What is the maximum size of webRTC data channel messages?

I am experimenting with webRTC, and it seems that there is an arbitrary limit on the number of bytes that can be sent in each message. This guy , an example of which I used, chose a limit of 100 (plus a few) bytes. In my tests, it is close to 200 bytes. However, from reading TCP and UDP these protocols support packets of about 65 kb in size and even when using MTU for different types of networks, there should still be much more free space than ~ 200 bytes.

The only source I found that mentions the hard limit is this WebRTC data link protocol draft , but it only talks about TBD.

So my questions are:

  • if there is any source that defines the limitation of the current message size in any browser?
  • if I can assume that the limit is always the same, and if not, how can my application be informed about the limit?
+6
source share
2 answers

The sharefest project has found a way to limit the speed - you can change the outgoing sentence to change the bandwidth setting (for http://www.ietf.org/rfc/rfc2327.txt )

Details here: https://github.com/Peer5/ShareFest/blob/master/public/js/peerConnectionImplChrome.js#L201

From my own experience, you are still limited to ~ 800 bytes per message.

+5
source

I tested the jpegs transfer to chrome 57 over the data feed, and messages up to 64k seem to be reliable now.

The webRTC data channel has a reliability mechanism; it uses SCTP via DTLS (via UDP). SCTP allows you to set reliability and order of behavior, but by default WebRTC uses ordered + reliable - this means that you get the same semantics with TCP - except that message boundaries are preserved - at least theoretically.

In practice, Chrome can deliver partial messages to javascript if they run out of free space, so it’s better to check that you have a complete message before processing it.

0
source

All Articles