QoS (FQ-Codel, HFQ, SFQ & PFIFO) (EdgeRouter-X)

Soldato
Joined
11 Jun 2003
Posts
7,613
Location
The Shadows (london)
Hi all
can anyone explain these modes of QoS?
I don't really understand the differences.

I have really unreliable internet (2x 4g load-balanced connections) and I need to fix it so that in general devices get decent access and more importantly when I'm studying I get high priority.

if I set a rule for the router 192.168.1.0/24 and a rule for single address/es (eg 192.168.1.11) which take priority if the single address is in the same IP range?

hope that all makes sense.

thanks in advance!
 
Hi all
can anyone explain these modes of QoS?
I don't really understand the differences.


PFIFO = Packet limited FIFO (first in first out) essentially, the simplest type of queue you can have on a router and will be running by default. Basically, when a packet enters an interface, the router will service the packets in the order they arrive. If the queue has a max depth of 1000 packets and the queue is full due to congestion, every new packet will be dropped regardless of it's size/importance, this is called tail drop. Essentially - it can cause TCP sessions to really slow down, and hurt throughput, but it's the default mode on literally every router or switch.

HFQ = host fairness queue. The policy is normally applied to an entire subnet, say 192.168.100.0/24, the router will then divide the available bandwidth up between all the hosts on the subnet, to provide some fairness between hosts. The problem here is that in some cases, on some implementations - if you have 50Mbit of bandwidth and 2x hosts on the network, it'll always divide it in half so each hosts gets 25Mbit, whether the other host is using it or not, I don't think it'll burst between queues - but it might depend on the implementation.

SFQ = Stochastic fair queueing. A little more advanced and more useful. what happens here, is that when packets arrive on an interface, the router will measure the Source IP, Destination IP, and Source/Dest Port, (3 tuple) then create a hash for that flow of data. The flow will then be placed in it's own queue (your router might support up to 1024 queues, depending on how much memory it has). The router will then service each queue in a round-robin fashion. This mode offer a little more fairness, because the router is dividing the flows up into individual buckets and servicing them sequentially - it means big flows of 1500 byte packets (file download) might not hurt 64 byte packets as badly (gaming traffic) so it's a little kinder to traffic.

FQ-Codel (Flow-Queue codel) is a much new thing and more complex. It puts packets in queues similar to SFQ, in the sense it creates a bunch of queues (somewhere between 1024 and 65535, hashes the packets to the queues and so on) but it's the dequeue which is the advanced part. It's based on something called DRR (modified deficit round-robin) Essentially, when you have congestion - you have various different flows, in various different queues. The DRR algorithm has a value called a deficit value, or counter for each flow - this counter is normally the number of bytes that a flow can send when it's ready. It will only send the packet if the deficit value is larger than the packet in the queue. This basically means you'll avoid a situation where a single queue of traffic, hogs all the bandwidth and none of the other queues get served, so it's quite fair, it also requires hardly any configuration..

That said, many of these congestion management tools will only work well on a good connection - as they operate based on interface congestion, rather than a poor connection (like poor 4G connectivity or whatever) so with the scenario you've explained, you might not get great results with any of these, but FQ-Codel might work best.
 
As above, I don't think think any implementation of QoS is going to to help on a poor 4G connection.

Wouldn't it be better to remove the load balancing and run two individual WAN connections, one of which you can just use yourself?
 
Thank you so much for the in-depth explanation. I really appreciate it!

I do think about running two separate connections but often the speeds are as low as 2Mb and it makes it difficult to say stream and research on the same machine so i have 2 browsers open one with a VPN plugin so i get connections from both modems via one PC.

It's also a lot easier for the Mrs to get on with if its automatic and just works lol
 
Back
Top Bottom