[Netem] 2 netem qdiscs (delay and loss) in separate commands not working?

Christophe Dirac cdirac at hsr.ch
Mon May 19 01:54:00 PDT 2008


Hi,

I'm a bit confused and not sure if I'm doing something wrong or if this 
is a bug in recent netem versions:
I want to add 2 rules to my interface eth1, first ist delay of 100ms and 
second is a loss of 20%.
I'm doing this by executing 2 tc commands:
# tc qdisc add dev eth1 root handle 1:0 netem delay 100ms
# tc qdisc add dev eth1 parent 1:1 handle 10:0 netem loss 20%
the probelm is that the first qdisc (delay 100ms) is ignored, the loss 
works fine.
# tc qdisc ls dev eth1
gives me:
qdisc netem 1: root limit 1000 delay 100.0ms
qdisc netem 10: parent 1:1 limit 1000 loss 20%
it looks like the 2 rules are correctly set up.

Now if I set the 2 rules in one command:
# tc qdisc add dev eth1 root handle 1:0 netem delay 100ms loss 20%
everything works fine, delay and loss are working as expected.
# tc qdisc ls dev eth1
gives me:
qdisc netem 1: root limit 1000 delay 100.0ms loss 20%

OK, now I wanted to have a delay together with bandwith control by using a
token bucket filter (TBF).
I executed:
# tc qdisc add dev eth1 root handle 1:0 netem delay 100ms
# tc qdisc add dev eth1 parent 1:1 handle 10:0 tbf rate 512kbit buffer 
10000 limit 30000
and that worked as expected. Ping was delayed by 100ms and a test with 
iperf gave me
a bandwith of 512kbit/s.
# tc qdisc ls dev eth1
gives:
qdisc netem 1: root limit 1000 delay 100.0ms
qdisc tbf 10: parent 1:1 rate 512000bit burst 9999b lat 312.5ms

I tested this on 2.6.24 (Fedora 8) Kernel and on 2.6.25 (Fedora 9), both 
with the
same result. Normally my first example with the 2 netem qdiscs should 
work, right?
Or am I doing something completely wrong?

By the way, the exmaple is form this mailing list:
https://lists.linux-foundation.org/pipermail/netem/2005-July/000811.html
and it looks like it worked in older versions.

Thanks and kind regards,
Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3283 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.linux-foundation.org/pipermail/netem/attachments/20080519/c474daef/attachment.bin 


More information about the Netem mailing list