I would like all UDP traffic on my localhost to have 1% packet loss, 5 ms propagation delay. I thought I could use macOS' built-in dummynet for this.
I ran at the terminal
sudo dnctl pipe 1 config bw 10Mbit/s delay 5 plr 0.01
echo "dummynet out proto udp from any to any pipe 1" | sudo pfctl -f -
sudo pfctl -sa
and sudo dnctl list
show the expected outputs (the rule seems to have been added).
DUMMYNET RULES: dummynet out proto udp all pipe 1
00001: 10.000 Mbit/s 5 ms 50 sl.plr 0.010000 0 queues (1 buckets) droptail mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
Now I expect all udp traffic to be slowed.
I am developing a UDP app, testing it on localhost between a client program and a server program. The UDP traffic is clearly not having any dropped packets even though I would like to simulate 1% dropped packets.
User contributions licensed under CC BY-SA 3.0