udp - Simulate packet loss in C program language -
i have udp server/client code written in c , want simulate packet loss because packet loss on wireless network high , can not perform tests switched ethernet. example want have 20 % packet loss, how can in c ?
thx
i'm not sure want simulate network interuptions in application, test show simulation works. have simulate loss of packets outside of application.
you can add iptables rules doing :
# randomly dropping 20% of incoming packets: iptables -a input -m statistic --mode random --probability 0.2 -j drop # , dropping 20% of outgoing packets: iptables -a output -m statistic --mode random --probability 0.2 -j drop
http://code.nomad-labs.com/2010/03/11/simulating-dropped-packets-aka-crappy-internets-with-iptables/
Comments
Post a Comment