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

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.