What is the maximum RTP packet size for TCP/UDP transmission

I have a question, what is the maximum packet size RTP possible, when transmitting it over the TCP or UDP protocol, since the RFC 3550 standard does not say anything about it. In some stackoverflow responses, it was said that this is - 1458 bytes, but when transmitting a RTP packet over TCP or UDP, this size is not ~65535 (for example, for TCP, this value is = MAX_TCP_PACKET_SIZE - MIN_TCP_HEADER_SIZE = 65535 - 20 = 65515).

I need this one the answer is so that I know up to what size of the received packet I can get the potential packet RTP. It would also be great to know which ones + and - when sending the maximum packet size by TCP and UDP.

Author: bbdd, 2020-10-05

1 answers

65535 is the maximum packet size in ipv4 (there are just two bytes, no more bushing). Such packages go without problems, if it is localhost.

If we go to the local network, then the maximum size of the udp packet is actually the same, but only the packet will be fragmented (divided into pieces). This is determined by the size of the MTU and is usually in the range of 1450-1500. But each protocol eats a couple of bytes, for example, a vpn can take 8 bytes. Since for a UDP packet, the delivery is not if it can get lost, then for large packets (more MTU), the chances of getting lost are much higher - there are no requests for the lost chunk and the received chunks will simply be thrown away. If the chances of losing one piece are 0.9, then the chances of losing a package from three pieces are already 0.9^3 = 0.73. And so on.

As soon as we go online, everything becomes even sadder. Packages are packed and repacked, and there may be routers of different types on the way. and the maximum guaranteed package size, which will not be fragmented is 576 bytes (or 1280 bytes for IPv6).

Counting. The size of the ip header is from 20 to 60 bytes. udp header - 8 bytes. rtp, if correctly interpreted by the rfc, from 12 bytes (the minimum). Therefore, a minimum of 40 bytes per different headers. Therefore, 536 bytes, as for me, is the maximum packet size that is guaranteed to fit everywhere.

In practice, some systems use "fitting" - just send udp packets of different sizes and watching.

 1
Author: KoVadim, 2020-10-05 15:17:46