Linux: HTB + PRIO qdisc: sometimes empty PRIO 1 queue

813 views Asked by At

I am facing a behaviour I can't explain myself at the moment.

Here is what I am trying to do: limit the sending rate through an interface (enp0s8) and apply a PRIO qdisc. Packets are sent to the appropriate band of the PRIO qdisc following their DSCP field.

To do this, I applied both a HTB (to shape trafic) and a PRIO qdisc.

For test purpose, I am sending trafic with iperf.

Here is the HTB and PRIO configurations:

#HTB qdisc
tc qdisc add dev enp0s8 root handle 1: htb default 1
tc class add dev enp0s8 parent 1: classid 1:1 htb rate 2000kbit ceil 
2000kbit burst 2000kbit

# PRIO qdisc
tc qdisc add dev enp0s8 parent 1:1 handle 2: prio bands 4
tc qdisc add dev enp0s8 parent 2:1 pfifo
tc qdisc add dev enp0s8 parent 2:2 pfifo
tc qdisc add dev enp0s8 parent 2:3 pfifo
tc qdisc add dev enp0s8 parent 2:4 pfifo

# PRIO filters
tc filter add dev enp0s8 parent 2:0 prio 1 protocol ip u32 match ip tos 0x28 0xff flowid 2:1
tc filter add dev enp0s8 parent 2:0 prio 2 protocol ip u32 match ip tos 0x38 0xff flowid 2:2
tc filter add dev enp0s8 parent 2:0 prio 3 protocol ip u32 match ip tos 0x48 0xff flowid 2:3
tc filter add dev enp0s8 parent 2:0 prio 4 protocol ip u32 match ip tos 0x58 0xff flowid 2:4

Here is my iperf script for test purpose:

killall iperf
iperf -c 192.168.56.1 -u -b 2.4m -l 1458B -S 0x58 -t 1024 & 
sleep 20
iperf -c 192.168.56.1 -u -b 2.4m -l 1458B -S 0x38 -t 1024 & 
sleep 20
iperf -c 192.168.56.1 -u -b 2.4m -l 1458B -S 0x28 -t 1024 & 

With this test, the following behaviour is expected:

  1. The traffic with lower priority (0x58) is sent and shaped to 2Mbps
  2. The traffic with more priority (0x38) is sent and shaped to 2Mbps. It is supposed to preempt bandwidth to the lower priority traffic.
  3. The traffic with higher priority os sent and shaped to 2Mbps. It is supposed to preempt bandwidth to all other flows.

It seems to work fine most of the time but from time to time, I see the traffic with second highest priority reappearing for a few seconds whereas I should not (see wireshark screenshot).

I checked the iperf flow which is steady.

Do you have an idea to explain this behaviour or a way to troubleshoot?

Thank you in advance. Alexandre

p.s

wireshark capture

0

There are 0 answers