How to improve the webrtc data channel throughput?change sctp default send/receive windows size?

499 views
Skip to first unread message

Dongsheng li

unread,
Aug 27, 2018, 5:35:05 AM8/27/18
to discuss-webrtc
Deer friends,

I tried to use native webrtc data channel to build a p2p file transfer application. I tested the two peers(one android phone and one laptop) within the same local network, the transfer performance is not as good as expected, maybe only about 1.5MB/s. I think it's sucked compared with traditional ftp way.
Is there some way to boost the performance?  Increase the default sctp buffer size may be an option according to google search.  But how to do it within native webrtc code base?
Any help is appreciated!

Regard,
Sunrise

Lennart Grahl

unread,
Aug 27, 2018, 3:57:47 PM8/27/18
to discuss-webrtc
I made a throughput test a while ago with different window sizes than the one all browsers use at the moment. We have delayed this for Firefox since the results are a bit weird for larger window sizes than 1 MiB.

Thanks for reminding me though. We should push onwards to get at least 1 MiB into all browsers (well, libwebrtc and Firefox... and remind the Microsoft team again that data channels are mandatory) for improved throughput.

Dan DuFeu

unread,
Sep 18, 2018, 5:29:16 PM9/18/18
to discuss-webrtc
By changing window sizes, do you refer to setting sctp_sendspace() or is there another setting?

Thanks

Lennart Grahl

unread,
Sep 18, 2018, 5:32:31 PM9/18/18
to discuss-webrtc

Dan DuFeu

unread,
Sep 18, 2018, 5:54:34 PM9/18/18
to discuss-webrtc
Thanks! Based on this it is the same as setting the sendspace globally before creation of the connections. I also plan on testing different values.

Yes, it would be nice to have a nicely exposed parameter for this. :)

Lennart Grahl

unread,
Sep 19, 2018, 3:15:49 AM9/19/18
to discuss-webrtc
Not only the send space but also the receive space.

Exposing this is probably not a good idea. It's the job of the OS to choose sane values for kernel sockets and so it should be the job of the browser to choose sane values for userspace sockets depending on their environment.
Reply all
Reply to author
Forward
0 new messages