Commit 53297a6d authored by Éloi Bail's avatar Éloi Bail Committed by Guillaume Roguez

daemon: decrease RTP payload max size

RTP packet maximum size must rely on maximum MTU size.
Networks such as ADSL include PPPoE header that reduce maximum
payload size.
Notice that packets higher than MTU would lead to fragmentation
by routers. With high bitrates in video, we want to avoid that.

This patch proposes to reduce the maximum UDP payload size allowed
to RTP to a value safe for PPPoE MTU.

This value has been computed as follow:

Ethernet MTU          = 1500 bytes
PPPoE headers        -= 8
IP headers           -= 24
UDP headers          -= 8
----------------------------------
Total for RTP payload = 1460 bytes

Issue: #80080
Change-Id: Ibc8d5943017f3cea3ac6e1f17f90a85f06755ebe
parent 60ba1a74
......@@ -194,7 +194,8 @@ udp_socket_create(sockaddr_storage* addr, socklen_t* addr_len, int local_port)
return udp_fd;
}
static const size_t RTP_BUFFER_SIZE = 1472;
// Maximal size allowed for a RTP packet, this value of 1460 bytes is PPoE safe.
static const size_t RTP_BUFFER_SIZE = 1460;
static const size_t SRTP_BUFFER_SIZE = RTP_BUFFER_SIZE - 10;
SocketPair::SocketPair(const char *uri, int localPort)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment