[Live-devel] Re: Packet Loss simulation

Ross Finlayson finlayson at live.com
Sat Jan 24 02:55:16 PST 2004


>I've tested packet loss on my client computer (using OpenRTSP client or 
>mplayer), using the way Ross explained, but if I insert packet loss in any 
>of the 33 last packets of the rtp transfer, all the packets after the lost 
>one are discarded...

I finally got around to looking into this.

Here's what's happening: Whenever a packet gets lost, the receiving code, 
by default, stores all subsequent arriving packets until a certain 
threshold period of time has elapsed, or until the missing packet actually 
arrives.  This is in case the 'lost' packet was not really lost, but 
instead merely reordered in the network.  I.e., it allows out-of-order 
packets to get delivered.

However, this has the side effect that if one of the final packets to 
arrive gets lost, the packets that arrive after this might not get delivered.

>Does someone have any idea where it could come from and how I could 
>"bypass" this problem...

You can bypass the problem by adding the following code to 
"liveMedia/MultiFramedRTPSource.cpp", immediately after the line
         if (!bPacket->fillInData(source->fRTPInterface)) break;
// Add this code:
         setThresholdTime(0);
         if (/* I choose to simulate packet loss*/) break;

The "setThresholdTime(0);" statement tells the receiving code not to wait 
for any lost packets to arrive (so that all subsequent packets will get 
delivered immediately).


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list