Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC Data Channel - max data size?

Tags:

webrtc

I'm using the WebRTC data channel to send JSON data. Seems to be working fine for small packets of data.

However, I'm trying to send a larger package (HTML of a webpage, base64 encoded, so maybe a few hundred KB), it never makes it to the other end.

Is there a max size?

like image 305
Andy Hin Avatar asked Feb 13 '16 14:02

Andy Hin


1 Answers

I think the spec doesn't say a word about max data size. In practice 16 KB is the maximum. Take a look at this blog post and especially the throughput / packet size diagram. This result has been achieved experimentally and is the one allowing for most compatibility between webrtc implementations.

I've managed to send packets as large as 256 KB (and even larger if memory serves me right) between two Firefox instances. This was about an year ago and since then the implementation may have changed an the max data size with it.

If you want to send packets larger than 16 K you have to fragment them first. The fragmentation has to be implemented as part of you application protocol.

like image 87
Svetlin Mladenov Avatar answered Sep 22 '22 05:09

Svetlin Mladenov