I have a program which sends data from one pc to another using UDP (size of data 150 bytes). That program is writen in delphi 7 (TldUDPClient and TldUDPServer components using to send and recive data). I need to test this program on 30% packet loss.
I use ipfw
for windows (downloaded from sourceforge) :
ipfw -f flush
ipfw add pipe 1 ip from any to any out
ipfw pipe 1 config plr 0.3
When I use ping I see that 30% of data loss.
When I launch my delphi program, after some time of working it returns an
error: socket error 10004
. The description of the error was: Interrupted function call.
A blocking operation was interrupted by a call to WSACancelBlockingCall
.
Is that problem of capability between my network component and packet loss emulation? Or will I see that in real situations too, when suffering packet loss? Which another firewall or another software i can use for emulation of packet loss?
Sounds more like a packet loss emulation issue. The
ipfw
tool seems to interrupt the connection - from this site - is it your version? - the source code does not implement this option - but it's 4 years old. With the ping command, you just know that you did not receive any answer within the expected time - there is no "connection" in the ARP protocol AFAIR.From the UDP standard, packet loss is painless: there is no acknowledge nor error message retrieved to the socket layer.
On a real network connection, UDP packets are lost silently.
And painfully... perhaps ;)