Hey, good evening,
I have noticed that Janus has a limit of 1500 bytes size for data messages in the webRTC data channels. Why was it set to 1500? Could it be changed to 2000 bytes for example?
Thank you very much!
There’s no such limit, SCTP takes care of larger messages. Or are you talking about RTP forwarders / datachannel support in the Streaming plugin? In that case, the problem is the gatewaying to plain UDP: if I RTP-forward a message to send it via plain UDP, I have to stay in the boundaries of the MTU (hence ~1500); same thing in the Streaming plugin, where messages to relay via data channels need to be received on plain UDP by the plugin.
Thanks a lot for the quick response!
Perhaps I do not understand something, but the UDP messages may be fragmented and using this IP fragmentation the MTU is not a limit. I tried to send using fragmentation a message with 1886 bytes and in the ondata event in the streaming plugin I got only 1500 bytes. I looked for the reason why I have only 1500 bytes and I have noticied these few lines in the source code of Janus (in the function of janus_dtls_srtp_incoming_msg):
It seems that the data buffer has a hard coded size of 1500.
UDP fragmentation is not guaranteed to work everywhere.
The code you linked to is the DTLS code, which has nothing to do with SCTP. If you use the EchoTest demo, and send a huge string via datachannels there, you’ll receive a huge string back, because even if DTLS fragments it (DTLS being the transport in this case), the large SCTP message will be intact.
I see,
I tried to use the streaming plugin and to send a long binary message (its length is about 1887 bytes) but the ondata callback recieves a data object with a 1500 bytes length. It misses the last 387 bytes. Is there a way to go over this limit?
Then please see my first reply: RTP forwarders and Streaming plugins interact with the plain UDP world and go outside of the boundaries of DTLS/SCTP, which is why I added the 1500 (MTU) limit. If you want to go around that, you’ll have to modify the size of the buffer of incoming data in the Streaming plugin itself.
Thanks a lot!
Regards