How to deliberately introduce a delay for incoming UDP packets
9,914
tc qdisc add dev eth1 root netem delay 250ms
hack allows to do it globally for the given interface. It includes UDP packets.
It delays outgoing packets only although. For incoming packets you can route packets though a virtual router (created by separate network namespace and veth
with netem
attached to veth side of link).
Related videos on Youtube
Author by
Vi.
Updated on September 17, 2022Comments
-
Vi. almost 2 years
I want each packet (that match iptables rule) to be delayed by some fixed time interval. How to to this?
Preudocode:
iptables -A INPUT -p udp <more conditions> -j DELAY --delay 50000 # delay UDP packets for 50 milliseconds
Update: @related Simulating a low-bandwidth, high-latency network connection on Linux
-
uxout almost 14 yearsWhy? Testing purposes?
-
Vi. almost 14 yearsYes, testing/debugging. Actually
tc qdisc add dev eth1 root netem delay 250ms
helped.
-