All of lore.kernel.org
 help / color / mirror / Atom feed
* netem qdisc destroys traffic in other tc classes (HFSC classes)
@ 2020-03-26 21:15 kaskada
  0 siblings, 0 replies; only message in thread
From: kaskada @ 2020-03-26 21:15 UTC (permalink / raw)
  To: netfilter

Hello,

I guess you will not beleive me that this is possible issue, but you can use the simple script below to see.

I`m trying to use netem qdisc together with HFSC tc rules. For simplicity, I wrote this tiny script, so you all can replicate the issue,
in case you are interested to. The problem is that if I send data traffic to class (1:aaaa) with netem attached, it harms the traffic going through the default class (1:ffff).
If I change netem for fq_codel (or sfq, pfifo, ...), than traffic going through "netem class 1:aaaa" does not have any impact to traffic going in default class.

This is very scary behaviour which costed me a lot of time when debugging much more comlicated setup (some 50000 tc rules).
It looks like HFSC and netem are not compatible and can not be used together? I used netem with HTB recently and it was working well.

-->Netem will add delay to the traffic which is not going through "netem class".<--


If you try to run the script bellow and than start ping to some IP address (for example 8.8.8.8, 8.8.4.4, ...) or generate any traffic which would go through default class
and than try to download file from Mikrotik site, the downloading from Mikrotik would broke the other traffic. Delays to ICMP to 8.8.8.8 and 8.8.4.4 will than get very long... Downloading from Mikrotik will be bad too, but that is what it should be (because it goes through netem class).

For example you can download this file (which is one of bigger ones on Mikrotik site I found):
https://download.mikrotik.com/routeros/7.0beta5/chr-7.0beta5.vhdx



script (un/comment netem/fq_codel lines for BAD/OK behaviour)...:
-------
# root qdisc a class:
tc qdisc add dev eth1 root handle 1: hfsc default ffff
tc class add dev eth1 parent 1: classid 1:1 hfsc ls m2 100000kbit ul m2 100000kbit

# default qdisc a class - all traffic goes here, for simplicity:
tc class add dev eth1 parent 1:1 classid 1:ffff hfsc ls m2 50000kbit ul m2 50000kbit
tc qdisc add dev eth1 parent 1:ffff handle ffff:0 fq_codel

# except testing traffic going into class for testing netem qdisc
tc class add dev eth1 parent 1:1 classid 1:aaaa hfsc ls m2 10kbit ul m2 20000kbit
# netem qdisc - when used, it causes problems for all traffic in default class 1:ffff
tc qdisc add dev eth1 parent 1:aaaa handle aaaa:0 netem delay 500ms 15ms 25%
# fq_codel (for example, same with sfq, pfifo) - OK, no problems
#tc qdisc add dev eth1 parent 1:aaaa handle aaaa:0 fq_codel

# for this simple script if you download files from Mikrotik site, it will be put to "netem class 1:aaaa"
iptables -t mangle -A POSTROUTING -m physdev --physdev-in eth0 -s download.mikrotik.com -j CLASSIFY --set-class 1:aaaa


Thank you
Pep.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-26 21:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 21:15 netem qdisc destroys traffic in other tc classes (HFSC classes) kaskada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.