> I would like to simulate packet loss of RTP packets on the network, and I 
> would like to use Live555 to do this.  In fact, there already is some code in 
> MultiFramedRTPSink (in the MultiFramedRTPSink::sendPacketIfNecessary() 
> function) which is contained in a "TEST_LOSS" macro, and is hardcoded to 
> simulate 10% loss:
> 
> #ifdef TEST_LOSS
>    if ((our_random()%10) != 0) // simulate 10% packet loss #####
> #endif
> 
> I would like to do some more sophisticated testing (e.g. change the packet 
> loss to 5% or 25%).  What is the "right" way to do this?

Normally I don't advise modifying the supplied code.  However, because you just 
want to simulate packet loss for testing (i.e., I presume you don't plan on 
building a product that loses packets :-), you might as well just modify the 
(#ifdef'd out) code that's already there.

E.g., if you want to simulate N% packet loss (where N is an integer in the 
range [0,100], then you could change the "if" condition above to
        if ((our_random()%100 >= N) // simulate N% packet loss

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to