Fri Sep 02, 2011 5:13 pm
Torrents pose 2 major problems when it comes to QoS. First, it is VERY hard to mark the encrypted UDP streams, since they are specifically designed to avoid detection and tracking. Your best bet there is to mark everything that isn't torrent traffic and just increase it's priority.
Secondly, the heavy use of UDP makes it almost impossible to reliably throttled download speeds. Throttling upload is always effective, because you can control the rate at which packets move from a large bandwidth connection (your LAN), to a low bandwidth pipe (your ISP connection). TCP or UDP, you can always insure packets always leave the router at a rate the internet connection can handle. In doing so, you are able to choose which packets go first and which packets can wait/be dropped. Throttling download is a bit more difficult.
Since your router is at the receiving end of the slower internet connection, you have no way of directly controlling the order or quantity of packets which are entering your internet connection. The only method for manipulating the data is to convince the remote peers to slow down the rate they are sending. In TCP, this is handled by congestion avoidance algorithms and manipulation of the TCP window size. If too many packets are sent down a congested link, some of them are dropped. When the sender realizes there has been some packet loss, they slow down the rate at which data is sent. This is a key principle QoS exploits. By regularly delaying or dropping packets, TCP connections can be held at a rate slower than your internet connection to allow room for other data to go first.
The UDP data connections used by bittorrent clients lacks this protocol-level functionality. While it is true the bittorrent clients should be responsible for regulating the data rate when congestion is detected, in practice this doesn't always work well. Average torrent transfers involve connections with hundreds of different peers using many different clients, which typically means they will continue to bombard your internet connection until it is saturated at the ISP's router. The only real way to prevent this is to set an appropriate download limit in your bittorrent client, so the client knows when to stop requesting data and can tell other bittorrent clients to not sent it so much data.
With all that, it still doesn't mean that putting some QoS rules in the router won't help some. I just wanted you to know some of the theory behind what you were looking to do and why you may not always see the results you were expecting from certain QoS setups, particularly those controlling download rates. I would suggest getting comfortable with QoS without the torrent traffic present first, then moving on to trying to tackle the p2p problem. It is an issue that troubles even experienced ISP, so don't be too discouraged by it. Good Luck.
TL;DR, QoS is awesome, but throttling UDP downloads from bittorrent is painful at best.
--CC_DKP