RTT (ms) | Throughput on Chromium (MB/s) | Throughput on Firefox (MB/s) |
---|---|---|
0 | 7 | 10 |
10 | 3 | 8 |
20 | 1.5 | 4 |
var dcOpts = {
Adding Michael for advice.It looks like Chrome keeps resetting the send window but FireFox does fine.Michael,what do you think could cause this?
Certainly. I repeated the experiment both with reliable and unreliable datachannels on both Chromium and Firefox, again with 50ms RTT. See attached images for results. Y-axis displays bytes/tick. It doesn't look like there are any differences between reliable/unreliable datachannels at the moment.
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thank you very much Michael for the information on how to log SCTP packets in Firefox.Until now I have been testing with an Uint8Array that is filled with 32 KB of random data once, and then sent over the datachannel in a setTimeout() loop of 0 ms, with a check of the datachannel send buffer size before sending so we don't overfill it.The reason why I've been using 32KB message sizes is that lower message sizes resulted in considerably slower throughput, now I noticed why: JavaScript execution can't keep up with the available bandwidth and the dc buffer is empty every time we call dc.send(). To fix that I put a while loop inside of the setTimeout() loop: the while loop calls dc.send() until the buffer is full.With this fix I'm able to measure slightly better throughput performance with 2 KB message sizes than with 32 KB. With 50ms RTT, Firefox gets up to 1.91 MB/s - measured on the receiving side of the benchmarking application, so that doesn't account for any overhead. The 'iotop' tool says the total bandwidth usage towards the receiving machine is about 2.14 MB/s. So when accounting for all the overhead we are now getting pretty close to the 128K window size: 1024 * 1024 * 2.14 * 0.05 = 112K. 2K seems to be at least very close to the optimal message size, I also tested some other nearby values but 2K gave the best throughput and it also held up in tests with no simulated latency.Results for different RTT values with 2KB message size, total usage measured with iotop:0ms 10.1 MB/s (11.2 MB/s total)10ms 8.84 MB/s (9.88 MB/s total)20ms 4.67 MB/s (5.22 MB/s total)40ms 2.37 MB/s (2.65 MB/s total)80ms 1.20 MB/s (1.35 MB/s total)160ms 0.60 MB/s (0.67 MB/s total)320ms 0.30 MB/s (0.34 MB/s total)You're right, looks very much like throughput is halved when RTT is doubled, which makes sense if the window size is indeed hardcoded.The results give us these window sizes (using the values for total bandwidth usage):10ms 104K20ms 109K40ms 111K80ms 113K160ms 112K320ms 114KFairly close to 128K.I'm not allowed to attach pcapng files, so below is a link to a ~3 second SCTP capture of a Firefox to Firefox throughput benchmark with 2KB message size and 40ms RTT.
I can capture Firefox to Chromium (+ vice versa) or Chromium to Chromium tomorrow if needed.
Thanks for your help. I'm researching WebRTC datachannels for my bachelor's thesis.
This is where Chrome initialize the SCTP stack:I don't see any code to change the configuration of flow control or CC.
The window referred here is the recieved window, since the link's throughput >> actual throughput and there's no additional traffic, right?So the begged question is, why is the receiver window 128k and not more? - If there was link throughput problems the congestion control would take care of that. So why not better utilize a link which is free just 'far away'?
diff -r 7f5a8526b55a netwerk/sctp/datachannel/DataChannel.cpp--- a/netwerk/sctp/datachannel/DataChannel.cpp Tue May 13 12:41:43 2014 +0200+++ b/netwerk/sctp/datachannel/DataChannel.cpp Thu Jul 10 15:51:31 2014 +0300@@ -372,6 +372,19 @@ return false; }
+ int rcvbuf_size = 131072; //default+ int sndbuf_size = 131072; //default+ if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_RCVBUF,+ (const void *)&rcvbuf_size, sizeof(rcvbuf_size)) < 0) {+ LOG(("Couldn't change receive buffer size on SCTP socket"));+ goto error_cleanup;+ }+ if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_SNDBUF,+ (const void *)&sndbuf_size, sizeof(sndbuf_size)) < 0) {+ LOG(("Couldn't change send buffer size on SCTP socket"));+ goto error_cleanup;+ }+ // Make non-blocking for bind/connect. SCTP over UDP defaults to non-blocking // in associations for normal IO if (usrsctp_set_non_blocking(mMasterSocket, 1) < 0) {
It seems we have to adjust both the sender and receiver SCTP window sizes.
Also, is there an easy way of automatically adjusting the sender/receiver window sizes by setting some socket option on the SCTP socket that I'm overlooking? Or is this supposed to be handled by the application (browser in this case)?
Best regards,Rasmus
Thank you for the answers Michael.I'm still wondering whether there is a problem in the congestion control algorithm. Now that I've been testing with larger send/receive windows (1M), the browser tries to ramp up data transmission rates gradually, but with high enough latencies (100ms, 500ms were tested) it always seems to reach a point where the transmission rate drops quickly and then starts climbing again, in a sawtooth-like wave:
Does congestion control apply the same way in unordered, unreliable SCTP? - Isn't it suppose to be more UDP like and keep the bit-rate the application demands?
Basically the only difference is that in reliable there are retransmits in case of packet loss, and in ordered the SCTP takes care of 'poping' the messages out of its buffer to the application in an order?
Would you expect any throughput changes between reliable/not ordered/not?
On Monday, July 14, 2014 3:03:28 PM UTC+2, Shachar wrote:Basically the only difference is that in reliable there are retransmits in case of packet loss, and in ordered the SCTP takes care of 'poping' the messages out of its buffer to the application in an order?If you neglect the bandwidth for the retransmissions, I wouldn't expect a difference in throughput.Would you expect any throughput changes between reliable/not ordered/not?No. It is more about latency...
On Monday, July 14, 2014 5:15:00 PM UTC+3, Michael Tüxen wrote:
On Monday, July 14, 2014 3:03:28 PM UTC+2, Shachar wrote:Basically the only difference is that in reliable there are retransmits in case of packet loss, and in ordered the SCTP takes care of 'poping' the messages out of its buffer to the application in an order?If you neglect the bandwidth for the retransmissions, I wouldn't expect a difference in throughput.Would you expect any throughput changes between reliable/not ordered/not?No. It is more about latency...But didn't we just see that latency directly affects throughput?
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/0synE_0zeCQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.