Why RTP max packet size is 1200 in WebRTC?

1457 views
Skip to first unread message

cyberwoodman

unread,
Dec 5, 2017, 3:32:00 AM12/5/17
to discuss-webrtc
HI all.

Buy studying WebRTC sources I was wondering why developers chose RTP max packet size as 1200 bytes.

As I correctly understood right now this constant is definded in media/engine/constants.cc|16| const int kVideoMtu = 1200;

Thanks.

Lorenzo Miniero

unread,
Dec 5, 2017, 4:49:47 AM12/5/17
to discuss-webrtc
Not a Chrome or libwebrtc developer, but I can give you a general answer. While the MTU is typically large enough (slightly lower than 1500) you can't assume it will be the same everywhere on the media path. If the packet you send is larger than the MTU of a network node, the packet will simply be dropped. Considering the overhead you can have with WebRTC on packets (SRTP, extensions, etc.), you want a smaller RTP packet to start from, to be sure the packet will always get through.

L.

Istvan Fenesi

unread,
Dec 5, 2017, 4:52:10 AM12/5/17
to discuss-webrtc

Iñaki Baz Castillo

unread,
Dec 5, 2017, 5:05:05 AM12/5/17
to discuss...@googlegroups.com
You can say "thanks" to all those "sys admins" that block ICMP for
"security reasons".



--
Iñaki Baz Castillo
<i...@aliax.net>

Niels Moller

unread,
Dec 5, 2017, 5:17:19 AM12/5/17
to discuss...@googlegroups.com
I think that's vaguely related. It would be reasonable for webrtc to
try to do path MTU discovery, which under IPv4 would mean setting the
"don't fragment" bit on sent packets, and respond to incoming ICMP.
(Which would then be broken if ICMP is gratuitously blocked, just like
TCP path MTU discovery breaks down in that case).

But we don't do anything like that, as far as I'm aware. Which means
that the IPv4 network is expected to fragment any packets that are too
large for some link on the path. Which has the drawback that if one of
the fragments is lost, other fragments will consume network resources
but still be useless if they make it to the receiver.

So the smaller max packet size is to avoid packet fragmentation.

cyberwoodman

unread,
Dec 5, 2017, 5:54:25 AM12/5/17
to discuss-webrtc
Yep, thanks, it's my post :)

cyberwoodman

unread,
Dec 5, 2017, 6:03:33 AM12/5/17
to discuss-webrtc
Thanks. Do you know who discovered such constant?

Harald Alvestrand

unread,
Dec 5, 2017, 6:29:46 AM12/5/17
to WebRTC-discuss
On Tue, Dec 5, 2017 at 12:03 PM, cyberwoodman <taras.k...@gmail.com> wrote:
Thanks. Do you know who discovered such constant?

Part of Internet folklore for the past 20 years.

Piece of history: The IPv4 minimum payload size was 576 bytes. Any link layer smaller than this had to do fragmentation/reassembly on the link.
(I've heard of people ignoring this and setting the MTU of their modem to 128 bytes. IP still worked.)

When IPv6 came along, the Internet had pretty much stabilized on the Ethernet frame size - 1500 bytes. A calculation of a standard IPv6 header + a layer or two of encapsulation led to the conclusion that it was safe to guarantee a payload size of 1280 bytes in all cases. (This isn't strictly true - the IPv6 header allows unlilmited "continuation" headers - what used to be called header extensions in IPv4. But packets with "continuation headers" are handled badly by most routers, so in practice they're not used for normal user traffic.)

Anyway, 1200 bytes is 1280 bytes minus the RTP headers minus some bytes for RTP header extensions minus a few "let's play it safe" bytes. It'll usually work.

 

--

---
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-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/80d628b7-fdca-4127-8faa-8f471fa20670%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

cyberwoodman

unread,
Dec 5, 2017, 9:39:51 AM12/5/17
to discuss-webrtc
Thanks. I think your first sentence completely explains my question!
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

cyberwoodman

unread,
Dec 7, 2017, 6:30:18 AM12/7/17
to discuss-webrtc
Here is a good explanation why packet should be lesser or equal than 1280 bytes for IPv6 networks.
https://www.arbornetworks.com/blog/asert/ipv6-fragmentation/
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Horaci Macias

unread,
Feb 1, 2018, 2:42:22 AM2/1/18
to discuss-webrtc
is this max RTP packet size value configurable or "tweakable" by any means? I'm trying to eliminate fragmentation on a network with MTU < 1200.

thanks,

Harald Alvestrand

unread,
Feb 1, 2018, 2:55:28 AM2/1/18
to WebRTC-discuss
I didn't know that anyone were running networks with MTU < 1200 any more ... at the very least, you'll never get IPv6 on those networks, since that requires an ~1400 byte subnetwork-layer MTU. I'm curious - care to share what kind of network it is?

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/e4d9bdf9-8e25-43bf-94c6-62c8ebd798cc%40googlegroups.com.

Horaci Macias

unread,
Feb 5, 2018, 7:35:21 AM2/5/18
to discuss-webrtc
Hi Harald,

The network I'm using uses MPLS links and some protocol tuneling that reduces the size available for application layers.
I'm still troubleshooting this as we speak to see if there is any other alternative, but still I'd like to know if this 1200 value in chrome is configurable by any means, at least to try things out.
My end goal is eliminate IP fragmentation completely on this environment which seems to be causing some glitches.

thanks,

H

Iñaki Baz Castillo

unread,
Feb 5, 2018, 7:37:19 AM2/5/18
to discuss...@googlegroups.com
On 5 February 2018 at 13:35, Horaci Macias <horaci...@gmail.com> wrote:
> Hi Harald,
>
> I'm still troubleshooting this as we speak to see if there is any other
> alternative, but still I'd like to know if this 1200 value in chrome is
> configurable by any means, at least to try things out.

AFAIK the 1200 is hardcoded.

Harald Alvestrand

unread,
Feb 5, 2018, 8:14:47 AM2/5/18
to WebRTC-discuss

--

---
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-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CALiegfkhUz_JDW5chDOSnZkKXW0zQENvmT3P4BB1bX6g8WYoKw%40mail.gmail.com.

Horaci Macias

unread,
Feb 10, 2018, 1:57:05 AM2/10/18
to discuss-webrtc
OK. Thanks!
Reply all
Reply to author
Forward
0 new messages