1

I am trying to prioritize TCP traffic using ToS field in IP header. I am saturating the interface(ethernet) by sending 1GB data through iperf with ToS field set to 0x10 (Minimize-Delay). I then start another TCP client with default ToS (0).

Expectation : My TCP client should not send data till iperf completes sending its data.

Result: The data from my client is sent even tough iperf is sending packets with higher priority.

I also tried to create the same scenario by creating 2 separate clients and allocating 0x10 and 0x08 ToS to respective clients using iptables. I used : iptables -A PREROUTING -t mangle -p tcp --sport 5000 -j TOS --set-tos Minimize-Delay

I am still not able to prioritize one client over other.

I am using Ubuntu (14.04) with iptables version 1.4.21

Can someone kindly help me solve the issue?

Thanks Varun

Varun
  • 11
  • 1

1 Answers1

1

ToS field is an indication of how to prioritize or route the packet, you now have to specify a policy to explain what you want to do with these packets. Note that the ToS field will only be useful on your LAN, ISP usually ignore or reset ToS.

Since you are running linux, you should take a look on tc (traffic control). (here's a good start)

If you want a strict ToS based priority, you have to set the pfifo_fast scheduler (you probably have fq_codel by default).

tc qdisc add dev eth0 root pfifo_fast

Although, if you want more flexibility, you might want to try hfsc or htb as a classful algorithm, then fq_codel / pfifo / sfq as a leaf classless algorithm. You will still be able to match ToS with iptables or tc.

setenforce 1
  • 928
  • 5
  • 7