Sign in with
Sign up | Sign in
Your question

Best way to implement QoS

Last response: in Networking
Share
December 25, 2012 3:06:43 PM

Hi guys, I've been having a lot of problems recently concerning lag in online games. My ping, which may be anywhere for 20 to 50 on a good day, will spike to around 200 or so sporadically. I've pinpointed the problem to be other users on the connection taking up bandwidth, typically from watching HD videos on youtube.

I've attempted to set up QoS on my router: a Thomson TG 585 v7. I used this guide to place my machine on a high priority queue and all other devices on a low priority queue. This hasn't worked unfortunately. I'm wondering if it's possible to make it work or if I need to get a different router.

I was recommended the Asus N55-U router but it's price tag led me to wonder if there was something else that could be done.

I've seen netlimiter suggested to others but I have my doubts as to whether it will affect mobile devices (iphones, ipads etc) as these are the main culprits.

Whilst QoS would seem to be the best way to solve this, if there is an alternative (besides a separate line for gaming) I'd love to hear it.

More about : implement qos

December 27, 2012 10:39:08 PM

The high/medium/low stuff as you have found has very limited usefulness. It ASSUMES that traffic outbound determines the amount of inbound traffic. This is not true for many types of traffic.

Some routers including the ASUS you mention have a added QoS feature that lets you hard limit rates by group. This method works a little better still leaves a lot to be desired. To solve your problem you would put your machine in a class that has no limits. All other traffic you would either leave default or put it in a class. On each of the classes other than yours you would place a download limit rate. For example say you have a 5m internet and your game needs 1m. You would limit the other traffic to 4m leaving 1m for your gaming. 2 problems with this approach. You first will always have a 4m limit even if the other 1m is not being used it will be wasted. Second its hard to say if you really get 5m from the ISP when you and all your neighbors are using it. You may have to limit the other traffic much lower say to 2m just be sure your game gets enough.

There is no real solution for this problem other than to have the ISP do the QoS which they will only do for some business grade accounts..if they offer the service at all.
Related resources
December 28, 2012 12:01:14 AM

Quote:
This method works a little better still leaves a lot to be desired.


Not sure what you mean here. As I see it the QoS either works or it doesn't.

Quote:
You first will always have a 4m limit even if the other 1m is not being used it will be wasted.


Really? I was told that if I made gaming highest priority that the other low priority stuff would still run at line speed were I not gaming. Unless I misunderstood and you're not suggesting I apply QoS through any kind of prioritization scheme, rather some other method.

Quote:
Second its hard to say if you really get 5m from the ISP when you and all your neighbors are using it.


Afaik this is contention right? I don't imagine I'll have any issues here as I'm with a fairly niche ISP.

Quote:
There is no real solution for this problem other than to have the ISP do the QoS which they will only do for some business grade accounts..if they offer the service at all.


Yeah, there's no point even asking my ISP for this. They won't even enable fastpath on my connection.

So if I understand correctly, I can't do anything more with my current router and the Asus may or may not solve the issue. I have to say, I have my doubts. I can't be the only person in the world who has to share an internet connection and also understand the implications on latency. If QoS like the one on the Asus doesn't work, why would they bother implementing it? If you're someone who knows what QoS actually is, you probably won't be fooled by one that doesn't work. At least that's my line of thought.
December 28, 2012 9:19:12 AM

QoS only really works when you have complete control in a network. I use it all the time to make sure voice and video conferencing work in corporate network. We also use it to favor things like outlook traffic over internet surfing.

The only thing QoS is decide whose data to throw away. It does not actually have any method to make some traffic run faster it just throws away less of priority traffic than non priority.

You don't need QoS if you have enough capacity and don't have to decide which data to throw away since you are not throwing away any.

So if we look at a consumer internet connection. Say with 10m down and 1m up.

Case 1 you are running bit torrent and sending lots of data..ie trying to send more than 1m. Now lets say you have another 100k of web surfing and game data being send. So you are at 1.1m. The router must drop about 10% of the traffic. It will drop 10% of all of everyone's traffic equally...well equally random. So now you lose 10% of your web and game traffic. In this case since you control the router you can tell it to not drop your web and game traffic and drop even more of the other traffic. This is where QoS on a consumer router actually works.

Case 2 You are downloading more than maximum allowed by the ISP. So now lets say you have 11m of download traffic. It won't fit into the connection so the ISP router needs to drop 10% of the traffic. They don't care about you in any way so they just drop 10% of all the traffic no matter what type it is.

What can you do in case 2. The traffic is already gone by the time it gets to your router you can't magically recreate it. So ANY vendor that says they can fix this problem with QoS is giving you a bunch a crap.

So why do people THINK it works.

What inbound QoS does on a router is DROP EVEN MORE TRAFFIC. Sounds crazy that even though the ISP dropped the 10% I now drop say another 10%. But in this case I drop this extra 10% from things I want to not use the link. So my priority traffic now loses 10% and my non priority traffic loses 20%.

What happens when you lose traffic (only with TCP) you ask the other end to retransmit it. When the other end gets lots of these requests to retransmit it will if it follows the rules wait a tiny bit to send the packet...in effect slowing down but only for a very short period of time.

So the "magic" is all dependent on a error recovery method built into TCP. It does not work when you are running bit torrent because if one session slows down other just take over. It does not work with UDP since there is no concept of retransmission. And it does not work with TCP implementations that quickly recover from errors rather than slowing down.

So you only option really is to drop even more traffic and hope your good traffic has enough room.

Even in the commercial environment people think QoS is some magic thing when all it is is deciding whose stuff to throw away.
December 28, 2012 11:47:26 PM

"The regular spikes show the YouTube video playing fetching data in batches, which results in spiky latency for other users on this 6.5 Mbps connection." - http://www.thinkbroadband.com/hardware/reviews/78-asus-...

So you're saying this wouldn't happen on say, a 100MB connection? I thought HD video would use as much bandwidth as there was available and anything else would essentially get queued on the router, hence the spikes on that diagram. If not, what kind of connection would I need to ensure I always have enough spare bandwidth for priority traffic?

Your example also leads me to believe that I can use a software solution (such as netlimiter) to place a hard cap on a low priority machine such that it won't exceed the ISPs download limit. Not that I can install that on an iPad (at least not to my knowledge) but I could perhaps corral people onto a desktop.
December 29, 2012 12:45:30 AM

How bandwidth is used really depends on the application there is no hard and fast rule. Technically video streams at a constant fixed rate because the output device can only display it so fast. Because of anticipated delays or loss application like youtube try to keep a buffer ahead so there are no perceived delays. So they quickly transmit a buffer and when the buffer is full they wait until it hits a predetermined point and then send again until the buffer is full. But things that stream live video can not send it faster than it is created so they send a a fixed rate no matter what.

This just happens to be how that one site works you cannot predict much by it.

How much bandwidth itcan actually use at some point is actually limited by the TCP window size and the latency. This is a complex topic but many time you will be limited by the latency before hit the bandwidth limit on a large circuit.

There is no circuit you can buy that will solve this. Unless you negotiate with the ISP they have no concept of priority traffic. They will send all they can until the line is full and drop the rest. It all comes down to the how the applications work. Badly behaved things like bit torrent will max anything you can find. If you try to slow one connection down 10 other ones will take its place.

The examples in the link actual confuse the subject. Traffic ALWAYS transmits at full line speed. The line is either 100% used of 100% idle. This gets into the concept of burst rates and buffers which is very complex. Even though it looks like is is running at a constant slower rate what is does not show is all the packet loss and retransmissions that are occurring. Because it is a long term average it just appears that way. You are actually transmitting more total data because of the error recovery. You need to watch this with a packet sniffer like wireshark to really understand what is going on. Again it just happens to work that way for youtube because that is how the application responds to packet loss.

ASUS is one of the routers that does have the ability to limit the traffic. You can use software on the end device to do similar function. They are using the download limiters as well as the unload ones. Just be careful UPLOAD traffic has no relationship to DOWNLOAD traffic. It just happens to work on certain application.
If I have a application I send a single message 100 bytes long that say send me file xxx using UDP on port yyy. Since I may not send another message until I get the whole file and the file could be 100g. How can you fix this only 100 bytes are sent no matter how much traffic I get. When we feed live video on our corporate network using multicast it work exactly like this so this is not just a fake example. The only reason it does not kill us is the video feed speed is limited by agreement with the people who run the application. There is a hard limit in the router just in case but this is also on the transmitter side.

The only way you can get it to work is to put limits in on everyone else that cause so many errors if they try to exceed some cap and you set that cap low enough to leave spare bandwidth. This method works for most applications but you pretty much hard reserve bandwidth for you priority application even when it is i not actually using it.

December 29, 2012 1:46:41 AM

Quote:
They are using the download limiters as well as the unload ones. Just be careful UPLOAD traffic has no relationship to DOWNLOAD traffic. It just happens to work on certain application.


It ought to work for me though right? The people watching youtube shouldn't be uploading much compared to me so there's no real issue with upload traffic not corresponding to download traffic. So long as the router can enforce a download limit on the other devices I should have no problems.

On a side note: what can cause packetloss besides a poor wireless signal?
December 29, 2012 9:23:49 AM

Yes the download limiter will work for youtube just be sure to set it to a little lower than what you actually want it to run. The packets you discard to enforce the limit still exist even if they are not counted in the limit.

Packet loss assuming no strange errors with some fiber in the network is almost always due to capacity issues. Could be actual circuit or equipment limitations but in most cases it is a QoS setting similar to what you are proposing artificially limiting the traffic. There are all kinds of strange agreement between ISP regarding how much traffic can pass between them. You could also get loss if the server on the far end was too busy but as a network guy I say that is not packet loss since the server actual got the packet and chose not to process it.
December 31, 2012 8:17:35 PM

As for routers then, do you have any recommendations? I'd like not to be locked into a single option.
December 31, 2012 11:04:08 PM

Best router is any you can load dd-wrt on. Gives the maximum flexibility.
I have a asus n66u that I mostly use...actually I use commercial cisco gear and only play with the consumer ones. This router out of the box has the bandwidth limit QoS but so do some of the other cheaper ASUS models. It has a huge number of features in the default software but I use dd-wrt mostly because I wanted to play with openvpn support and this router has the largest amount of memory.

I know a number of the linksys ones also have the bandwidth limit feature but I can't tell you exactly which ones do or don't without digging though the manuals.
!