Skip to content
Snippets Groups Projects
Commit 53297a6d authored by Eloi Bail's avatar Eloi Bail Committed by Guillaume Roguez
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -194,7 +194,8 @@ udp_socket_create(sockaddr_storage* addr, socklen_t* addr_len, int local_port) ...@@ -194,7 +194,8 @@ udp_socket_create(sockaddr_storage* addr, socklen_t* addr_len, int local_port)
return udp_fd; 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; static const size_t SRTP_BUFFER_SIZE = RTP_BUFFER_SIZE - 10;
SocketPair::SocketPair(const char *uri, int localPort) SocketPair::SocketPair(const char *uri, int localPort)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment