Roommate lagging internet connection by watching videos from Chinese website. Can QoS fix issue

internetlaglatencyqosvideo

My roommate is an international student from China and likes to watch Chinese TV shows online using a website based in that region (we're on the U.S. East Coast). But it causes our network's latency to shoot up ridiculously high, hitting about 400ms when pinging 4.2.2.2 and ranging from 100 to 1000+ (normal is anywhere from 20-40ms). Unfortunately, she wants to play dumb about the problem, so I have to find a way to fix this issue that doesn't require her compliance.

My current router (Netgear N150 WPN824N) does not support QoS or any popular custom firmware that has it (AFAIK). So I was considering buying either a more expensive router with built-in QoS or a cheaper router that supports Tomato, dd-wrt or something else. But I'm not exactly sure what the issue is or whether QoS would help it (i.e., things one would ideally like to know before spending money). The most likely culprit website, tv.sohu.com, is not in English and has mostly region restricted video content. So all I can really test is latency to the site itself (which is about 350ms from where I live). I don't know if it's a bandwidth issue, or if the site uses some kind of weird custom protocol, or whatever else is potentially a factor here. I'm not a networking person, so outside of high bandwidth consumption, I'm really in the dark as to what kind of factors could potentially affect network performance in this way.

I do know that I have a mediocre internet connection to begin with, though. When I try to download a game from Steam I can peak out at about 2.5 megabytes/s, and this will cause a high amount of lag. But 2.5 mbps is a lot of bandwidth, and I can't imagine that website consuming that much.

Best Answer

Roommate lagging internet connection by watching videos from Chinese website. Can QoS fix issue?

I didn't read your whole story, but based on the question you asked, the answer is generally not really. QoS may, in some ideal circumstances, partially address the problem if you're using certain high priority services (like Voice over IP) and the packets are properly tagged and your upstream provider respects QoS. But it won't help you if the priority of your packets and your roommate's packets is the same.

What you want is some kind of Active Queue Management.

What happens when your roommate watches video? Well, a huge amount of data is received by your shared router/modem. In order to prevent losing this data, which is coming in as fast as the modem can receive, it creates a larger and larger internal buffer within the modem that queues up all the packet data.

It has to do this because it's receiving the IP packets out of order and from multiple places (your downloads, roommate's downloads, etc) and it has to reassemble the pieces together to form whole TCP packets. So it creates this enormous buffer to avoid losing any packets; otherwise, with a small buffer, some packets would have to be dropped, which might result in the data needing to be re-sent.

Unfortunately, once the buffer surpasses a certain size, the benefits of having the buffer are outweighed by its drawbacks. The major drawback of a "bloated" buffer is that there is enormous latency involved with the receipt of a packet.

Latency means that the application sending or receiving the data has to wait an extremely long time to confirm that it is properly sent or received. Since data in TCP sockets is "acked" by the other side as a way of confirming "OK, I got it!", the other end might assume after a certain amount of latency that the packet was lost, and attempt a re-send anyway. So, the goal of the large buffer was to prevent re-sends, but in its quest of doing so, it causes re-sends!!! Each re-send is just more bandwidth consumed/wasted, and more latency.

Active Queue Management, conceptually, is some kind of solution that attempts to intelligently limit how big the buffers can grow. By keeping the buffers as small as possible, while just large enough to prevent most data from being lost due to waiting for out of order packets, you can prevent buffer bloat.

What researchers have been trying to do for years (and which we've only been partly successful at as recently as May 2012) is to design an algorithm that implements proper Active Queue Management (AQM) without any manual user configuration or adjustment (because that would be time consuming and annoying). Just a sort of "magic bullet" that properly balances queue sizes to minimize packet loss and minimize latency at the same time.

So far, the only thing we've found that is enormously successful on home routers is Controlled Delay (CoDel) Active Queue Management, which is a recent addition to the Linux kernel.

CoDel is very useful because it controls the delay (latency) of packets. How it does this is a bit too technical for this question.

Some links on CoDel so you can read up on it:

CoDel on bufferbloat.net

CeroWRT

Jim Gettys' articles on codel

Edit: QoS is only half of the solution. Port based QoS (e.g. giving your packets a higher priority) will only take you so far; it won't reduce buffer bloat at all, and your latency will still be high. But your packet loss may drop slightly.

CoDel combined with QoS, a la CeroWRT on your router, is really the best approach.

Related Question