[Live-devel] Client issue with large IP packets during interrop tests

DAVID SAHUC sahucd at sbcglobal.net
Mon Apr 12 10:38:50 PDT 2010


Hi,

We've had some issues 
while testing Live555 client (e.g. openRTSP, even on April 9th release) 
with our RTSP server while serving larger IP packets (containing MPEG-2 
TS but that might impact other modes).
Above a certain IP packet size, openRTSP doesn't 
receive correctly (data loss). I've had a hard time to trace where this 
error was coming from and I found the following line in 
MultiFramedRTPSource.cpp :

#define MAX_PACKET_SIZE 10000

The maximum IP datagram size is 65535 bytes; IP
datagrams are fragmented by the IP layer (RFC 791).
This can be easily fixed replacing this code with (at least on Linux, not 
tried on other OSes tho there shall be an equivalent):

#include 
<netinet/ip.h>
#define MAX_PACKET_SIZE IP_MAXPACKET

It also seems Live555 server(s) 
"only" serves 1316 bytes packets in MPEG-2 TS 188 mode. It looks like 
you're trying to fit as many TS packets as you can in 1500 bytes but MTU of 1500 bytes
only applies to Ethernet frames (plus it exists now "Jumbo frames" that 
can reach 9000 bytes). Fragmentation being managed at IP layer, you 
could serve bigger packets (up to max IP datagram size, i.e. 65KB).
Note that sending "only" 7 TS packets in an IP packet is totally fine, 
but adds more overhead (IP headers, etc.) over time. Sending bigger 
packets is recommended, while it needs benchmarking to find the optimal 
packet size for performance (a bit bellow 16KB in our tests for our 
environment); this can be different depending on O.S. & HW.

Maybe you will want to introduce, as we do, an "IP packet size" as a parameter 
for your server(s) (at least in MPEG-2 TS mode).

Hope this helps.

David.


More information about the live-devel mailing list