We have an implementation in which we use QUIC via a connection group, server are client are on Swift using the Network framework.
Our use case is, the server should send data buffers to the client as fast and as much as possible, now the pace to call the send method from the server should be carefully done, because if we send too much data of course the client is not gonna be able to receive it.
The question would be, is there a way to query the congestion window so we know on the server side, how much data we should be able to send at some point? Asking because we are not getting all the data we are sending from the server on our client side...
We are using these settings:
let options = NWProtocolQUIC.Options(alpn: ["h3"])
options.direction = .bidirectional
//
options.idleTimeout = 86_400_000
options.maxUDPPayloadSize = Int.max
options.initialMaxData = Int.max
options.initialMaxStreamDataBidirectionalLocal = Int.max
options.initialMaxStreamDataBidirectionalRemote = Int.max
options.initialMaxStreamDataUnidirectional = Int.max
options.initialMaxStreamsBidirectional = 400
options.initialMaxStreamsUnidirectional = 400
Questions:
1.- Can we get a little more detail in above options, specifically on their impact to the actual connection?
2.- IsinitialMaxData the actual congestion window value
3.- Are we missing something or making incorrect assumptions?
Thanks in advance.
QUIC
RSS for tagCreate network connections to send and receive data using the QUIC protocol.
Posts under QUIC tag
23 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hello. Wanted to ask about the right way, or the intended way to leverage NWConnectionGroup for a QUIC based streaming solution.
The use case is, we are making a request from the client in order to play a movie, and we want to send as much video frames as possible (and as fast as possible) from the streaming server, which also uses the Network framework.
Our understanding is, NWConnectionGroup will open a QUIC tunnel between both parties so we can multiplex different streams to the client and we are already doing that.
We see a throughput of approx. 20-35MB/s (client device is an iPad and server is an M2 macbook pro running a server app) and we would like to understand if we can improve these results way more.
For example:
1.- Is it a good practice to create a second tunnel (NWConnectionGroup), or is not needed here?. We tried that, but the second one is also coming with id 0 on the metadata object, just as the first group we instantiated, not sure why this is the case.
2.- We are using a pool of several NWConnection (initialized with the group object) already instantiated, that way we send a video buffer in chunks as a stream on each connection. We use one connection for a buffer and when we need to send another buffer we use a different NWConnection pulled from the pool.
We maybe just want a confirmation/validation of what we are doing, or to see if we are missing something on our implementation...
Thanks in advance.
My team are now testing http/3 support in our app and backend. It looks strange to me how the behaviour is different between iOS 15.7.3 and 16.x (now 16.6).
It is a default URLSession config and just a regular URLRequest, with no assumesHTTP3Capable flag set. I observe the protocol in use with both collecting URLSessionTaskMetrics and the Network instrument.
On 15.7.3 the 1st request is done using h2, the network subsystem caches the Alt-Svc header (per host I suppose). Several seconds pass and then when I issue the same 2nd request a new connection is established and the protocol is upgraded to h3. This is all fine and as described in the documentation or wwdc videos.
However, when I take the same steps with a device running e.g. iOS 16.5.1 I see that the protocol is never upgraded to h3. Neither a longer timeout nor an app relaunch make any difference.
Interestingly, on my Ventura desktop the same url is also handled differently: h3 by Chrome but always h2 by Safari. In the mobile Safari on iOS 16, I'm also always shown HTTP/2 on e.g. the cloudflare status page for QUIC.
What can be the reason for such behaviour on iOS 16 and Apple platforms in general?
PS. I've tried running the app with CFNETWORK_DIAGNOSTICS but found no useful log messages to clarify problems with QUIC. Is there still a way to better diagnose such a problem?