Fair Queueing

XTF

Gawd
Joined
Oct 11, 2011
Messages
591
What (home) routers support fair queueing?
Suppose 100 kb/s upstream bandwidth is available, one user 'demands' 75 kb/s and another demands 50 kb/s. Both should get 50 kb/s. Basically, the available bandwidth should be shared in a fair and automatic way. Seems like common sense, but I haven't found a router yet that supports this.
 
What if the 75kb/s one is a voice call and the 50kb/s one is just some random file upload, should call quality suffer? Now you need to do QoS in addition to FQ. Do you know what happens when you enable just QoS on an old WRT linksys router with a 20Mbps internet connection? Not 20Mbps. Throw FQ on top of that and even todays high end consumer routers, which typically have around 400MHz CPUs tops, would run into serious memory and CPU utilization issues trying to do that kind of traffic shaping. Most consumers don't want it anyway so there's practically no gain for the increased cost for hardware. Companies know that if you really need something with that capability you'll pay for it.
 
What if the 75kb/s one is a voice call and the 50kb/s one is just some random file upload, should call quality suffer?
Yes :p
Now you need to do QoS in addition to FQ. Do you know what happens when you enable just QoS on an old WRT linksys router with a 20Mbps internet connection? Not 20Mbps. Throw FQ on top of that and even todays high end consumer routers, which typically have around 400MHz CPUs tops, would run into serious memory and CPU utilization issues trying to do that kind of traffic shaping. Most consumers don't want it anyway so there's practically no gain for the increased cost for hardware. Companies know that if you really need something with that capability you'll pay for it.
Got a reference for those CPU and memory issues you're mentioning?
 
Not off hand, the QoS thing was from reading on the DD-WRT forums from people having problems with older routers on newer internet connections and not being able to reach full speed unless QoS was disabled. But for both QoS and FQ the router has to do a lot more with each packet than just pass it down the line. QoS requires the router to first figure out if the packet is a known protocol and once it has packets sorted by type it has to chose which order they go in, who gets bumped to the front of the line, etc... FQ doesn't care so much about what kind of data is in the packet but how big it is and where it's coming from then has to sort and send based on that info.

With an MTU of 1500 and a 5Mbit uplink (not unreasonable these days) you're looking at least 400 packets per second it's having to inspect and prioritize, assuming each packet is max size, but chances are there will be lots of smaller ones so that number could increase significantly depending on the traffic. That's not including the traffic coming back on the downlink that the router also has to process and since TCP ensures accurate delivery for every packet out there's an ACK that comes back, so another 400+ packets to inspect to verify with any firewall rules and unNAT and send back to the source system, Like I said typical consumer routers only have a 400MHz CPU and 64MB RAM max, they're not really designed to have to do a lot of processing on each packet they see, the assumed usage is just auto-forward.
 
Let's assume 1000 packets per second. That's still 1 millisecond per packet (average), about 400000 cycles. Now you're claiming that this isn't enough to do any kind of fair queueing, without any kind of reference.

Of course old routers that aren't capable of doing this exist. But I don't think you can claim no home router can do it. Especially now that some home routers are used for 100 or even 500 mbit/s connections.
 
Those cycles aren't JUST doing FQ they have to do a lot of other stuff too. I'm sure there's some really expensive home routers that are still considered consumer grade that might have the juice to handle it but they're probably borderline as expensive as small buisness routers. No matter how you look at it tho FQ would require more CPU than no FQ, and there's practically zero demand for it because best effort for the most part works pretty dang good. If a company did want to add that functionality and maintain current performance specs, they'd have to increase the CPU and possibly RAM to cover the new load. If the CPU already in the router could just add FQ and still meet performance specs, they'd just put a weaker CPU in its place to do the same job without FQ and lower their costs,
 
I used m0n0wall on an old Dell Pentium 4 2.0GHz

At first we had to split up 20+ people on a 5mb/768kb, the internet was literally unusable if someone was uploading a file to DropSend or sending and email with an attachment. This was using a Linksys RV82, but it didn't have packet-shaping setup properly. I replaced it with m0n0wall and it was like we had a new connection. Sure, things were still a little slow but at least your connection didn't just 'die'.

Later we moved to a new office with 50mbs/5mbs cable and still use the same setup, just new IP addresses. Even when maxing out downloads the CPU never goes over 20-25%

For a home connection I would probably use an Atom PC or something that was smaller and used a lower power chip.
 
I use a Supermicro Atom D510 with 2GB Ram running pfsense. Pfsense does support FAIRQ. Along with several other QOS schemes.

I'm running HFSC and love it. Let my torrent download at full throttle but throttle them back to 2% if web traffic or game/VOIP traffic need to get through...
 
For a home connection I would probably use an Atom PC or something that was smaller and used a lower power chip.

The home connection is actually 25/25 :p
So a real PC is the best option? I'll have a look at pfSense.
pfSense (and co) are complete distro's, right? Is there also a solution I could install on top of Debian, such that the computer can also be used for other things? (I like Debian)
 
Last edited:
An atom box would be good, or a low power i3 barebones kit. You would really want your FW appliance to be a separate OS from anything else if only for the virtue of a smaller exposure to the public internet. If you want to share a box, it's becoming more common to virtualize the Router/FW under a baremetal Hypervisor like VMWare or XenServer for home use also. And you're on the right track for rock-solid QOS features, use PFSense.
 
Back
Top