I’m trying to give priorities to some traffic out of a Linux machine.
For example, I want traffic to port 12345 to have high priority.
I choose DSCP class C6 for this.
I set the DSCP/TOS field of outgoing packets using iptables :
iptables -t mangle -A POSTROUTING -o eth0 -p tcp --dport 12345 -j DSCP --set-dscp 0x30
I send traffic and capture it with wireshark, and can verify that the DSCP field is set as expected.
Now I configure traffic control, using qdisc “prio”.
tc qdisc add dev eth0 root handle 1: prio
If I understand correctly, this will create 3 classes, the traffic attributed to class 1 will be send before the one attributed to class 2, and so on.
Traffic is classified according to the DSCP field.
And still, I can see no priorities on my traffic and if I check the activity linked to my classes :
tc -s class ls dev eth0
class prio 1:1 parent 1:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
class prio 1:2 parent 1:
Sent 99390509 bytes 82622 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
class prio 1:3 parent 1:
Sent 556732 bytes 4192 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
I can see only class 2 increases its packet number, I expected class 1 for my tagged traffic.
Does anybody see what I’m doing wrong here ?
edit : I try to reason using https://lartc.org/howto/
On this page in particular, the use of TOS field is decsribed : https://lartc.org/howto/lartc.qdisc.classless.html
I’m disturbed because, if I continue with example of CS6 class of service, CS6 is DSCP field 11000000, so according to lartc the TOS value is (bits 3 to 6) : 0000, which would send my CS6 traffic to band 1 (medium priority).
Same reasoning with AF33 class, DSCP field is 01111000, so TOS value would be 1100, then band 0, so high priority ? I’m lost here.
