Missing buffers on client side

Hi,

We are working with a small QUIC POC, in which the macbook pro is the server and the vision pro the client (we use it to test QUIC's functionality). We have below logic to send small buffers (128k) using only one stream because we want the data to arrive in order and reliably as QUIC guarantees:

private func createDummyData() {
        dummyData.append(Data(bytes: &frameNumber, count: MemoryLayout<UInt64>.size))
        frameNumber += 1
    }

 private func sendDataToClient() {
        createDummyData()
        let start = Date()
        
        Thread.sleep(forTimeInterval: 0.015)
        outgoingConnection?.sendBuffer(dummyData) { [weak self] in
            let interval = Date().timeIntervalSince(start)
            print("--> frame #: \(String(describing: self?.frameNumber)), send took: \(interval) seconds")
            
            
            self?.dummyData.removeLast(8)
            self?.sendDataToClient()
        }
    }

As you can see we are waiting for the completion handler to call the next send operation. We needed to add a delay (0.015) because even when the data is arriving in order, we are not receiving a considerable amount of buffer on the client side.

If we remove the delay, this is the way we are receiving our data. By the way, we are including a frame number (1,2,3,4....) on each buffer so we know which one arrived at the client :

Connected to QUIC bi-di tunnel id: 0...
Timestamp: 00:42:40.413, Buffer received...
Frame number: 0, received...

Timestamp: 00:42:40.414, Buffer received...
Frame number: 1, received...

Timestamp: 00:42:40.416, Buffer received...
Frame number: 29, received...

Timestamp: 00:42:40.416, Buffer received...
Frame number: 30, received...

Timestamp: 00:42:40.418, Buffer received...
Frame number: 43, received...

Timestamp: 00:42:40.418, Buffer received...
Frame number: 52, received...

Timestamp: 00:42:40.422, Buffer received...
Frame number: 65, received...

Timestamp: 00:42:40.424, Buffer received...
Frame number: 80, received...

Timestamp: 00:42:40.426, Buffer received...
Frame number: 90, received...

As you can see, we have received frames number 0 and 1 but after that we received # 29 and then jumps from 30 to 43 and 52 and 65. Again, if we introduce the delay this is not the case, is not fixing it but at least there are not that many losses.

We thought QUIC had an internal sending queue in which every frame is waiting to be sent and it will be delivered reliably.

Kindly let us know what are we missing.

Missing buffers on client side
 
 
Q