Skip to contentSkip to conversation

Unexpected result with PFIFO or PRIO queue disciplines

DISCUSSION Miguel Ángel Bernabé 2 participants 2 messages Sep 11, 2014 – Sep 15, 2014

lore
Share & tools
lore
#0 lore raw

Using Ubuntu 12.10 (Linux version 3.5.0), i would like to do some basic QoS on an ethernet interface. This ethernet interface is the default route to the internet.

As i concern, the default Linux queue discipline configured for network devices is the pfifo_fast queue discipline that gives priority regarding TOS mark in the IP datagram header.

To test this queue discipline i am using ping with the option -Q to set the DSCP value of the packets.

$ ping -Q 184 www.google.com

I start with a round-trip time about 50ms but as soon i start to upload a file to Dropbox service via HTTP the ping time increases up from 50ms to 1500ms and it becomes very unstable. I have checked that TOS mark for Dropbox traffic is 0x0.

Then I am trying to accomplish the same task using PRIO queue discipline. To test this queue discipline i create the root PRIO queue discipline associated to the ethernet interface. Then i add a filter to send ICMP traffic to the most priority queue:

# tc qdisc add dev eth0 root handle 1: prio
# tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip 
protocol 1 0xff flowid 1:1

After configuring PRIO queue discipline i am failing with the same result, ping time increases much again as soon i upload a file to any hosting service.

I have checked tc statistics and i see that ICMP packets are already sent to the band 0 while dropbox traffic is queued in a less priority queue.

$ tc -s class show dev eth0
class prio 1:1 parent 1:
  Sent 7486 bytes 74 pkt (dropped 0, overlimits 0 requeues 0)
  backlog 0b 0p requeues 0
class prio 1:2 parent 1:
  Sent 863935 bytes 1956 pkt (dropped 0, overlimits 0 requeues 0)
  backlog 0b 0p requeues 0
class prio 1:3 parent 1:
  Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
  backlog 0b 0p requeues 0

My gateway is connected to the internet via ATM/DSL connection, upstream speed is 0.6Mbps and downstream speed is 10Mbps. If i configure the router as a bridge between LAN/ATM ports and I try to connect via PPPoE from LAN (so i configure the Qdisc for ppp0 interface) I get the same unexpected result, so the bottleneck is not in my router.

Are prio or pfifo_fast queue disciplines broken in the Linux kernel?.

#1 lore raw
Quoted 6 lines · Miguel Ángel Bernabé

My gateway is connected to the internet via ATM/DSL connection, upstream speed is 0.6Mbps and downstream speed is 10Mbps. If i configure the router as a bridge between LAN/ATM ports and I try to connect via PPPoE from LAN (so i configure the Qdisc for ppp0 interface) I get the same unexpected result, so the bottleneck is not in my router.

You need to use something like htb that rate limits and set the limit for your wan speed.

dsl/atm have overheads so ideally you need to know exactly how you are connecting (pppoa/pppoe/llc/vc mux/ipoa etc) to allow for these. Failing that you will need to set speed somewhat below the sync speed.

Quoted 2 lines

Are prio or pfifo_fast queue disciplines broken in the Linux kernel?.

Not broken, but without something rate limiting you need to be heavily maxing the eth and even then there may be buffering in driver/somewhere that can mess up some tests.