Sample Header Ad - 728x90

Why does netem delay not work when netem loss does

1 vote
0 answers
19 views
I am using tc to test the behaviour of a networked app under various network conditions. The setup is like this:
if [ -z "$(tc qdisc show dev ${MAIN_LINK} ingress)" ]
then
    sudo tc qdisc add dev ${MAIN_LINK} handle ffff: ingress
fi

sudo tc filter del dev ${MAIN_LINK} ingress
sudo tc filter add dev ${MAIN_LINK} parent ffff: protocol ip u32 match ip dport 20780 0xffff match ip protocol 17 0xff action mirred egress redirect dev ${BRIDGE}

sudo tc qdisc add dev ${MAIN_LINK} root handle 1: prio
sudo tc filter add dev ${MAIN_LINK} parent 1: protocol ip prio 1 u32 flowid 1:1 match ip dport 20780 0xffff match ip protocol 17 0xff
If I add packet loss, using a loop to ramp it up bit by bit like this then it works:
tc qdisc add dev "${MAIN_LINK}" parent 1:1 netem loss random ${LEVEL}%
    tc qdisc add dev "${BRIDGE}" root handle 1: netem loss random ${LEVEL}%
If I add packet delay, again ramping up bit by bit like this then it has no effect that I can see at all:
tc qdisc add dev "${MAIN_LINK}" parent 1:1 netem delay ${DELAY} ${JITTER} distribution normal
    tc qdisc add dev "${BRIDGE}" root netem delay ${DELAY} ${JITTER} distribution normal
Values of DELAY and JITTER went up to 1870 and 1530 (340 to 3400 ms delay) and there was no apparent effect at all. How do I get packet delay to work? Why does packet loss work but packet delay does not?
Asked by AlastairG (213 rep)
Jul 8, 2025, 09:25 AM