I am using a web server in localhost:8080
and I'm trying to use dummynet (ipfw) to simulate latency and low bandwidth to that server but somehow I cannot get it to work.
When I use the command
sudo ipfw add pipe 1 all from any to any
sudo ipfw pipe 1 config bw 400Kbit/s delay 100ms
and then ping the localhost
ping localhost
I get these results:
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=686.512 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=848.309 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=409.890 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=410.988 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=424.014 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=411.002 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=409.175 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=417.517 ms
My problems are:
Why is the ping round trip time (~400ms) is about 4 times larger than my specified delay (100ms)
The bandwidth limiting does not seem to work also. When I try to download a 6Mb test file from the address
http://localhost:8080/Testfile
in Chrome, I get the file instantly, not in my desired rate