Community discussions

MikroTik App
 
User avatar
shadowskippie
Member Candidate
Member Candidate
Topic Author
Posts: 213
Joined: Tue Dec 21, 2010 6:20 pm

need help with prioritizing traffic

Fri Sep 02, 2011 9:45 am

Morning

I need some help as the title says.

In my little network at home a have a few people connect to the internet and i have a small issue with p2p.

now i'm not asking how to find and mark the p2p traffic, all i want to know is how do i make it a lower priority then the rest of the traffic so that i don't need to throttle the torrents but have it that other traffic that may exists at any given time be first inline with the internet
 
CCDKP
Member Candidate
Member Candidate
Posts: 170
Joined: Fri Jan 28, 2011 11:24 pm
Location: Midwest, United States

Re: need help with prioritizing traffic

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
 
User avatar
shadowskippie
Member Candidate
Member Candidate
Topic Author
Posts: 213
Joined: Tue Dec 21, 2010 6:20 pm

Re: need help with prioritizing traffic

Mon Sep 05, 2011 10:22 am

okay, see where you are going, torrent QoS is a pain in the arse. however i'm still gonna try and tackle little by little. nothing like a good challange :)


Coming back though to my local network, if i said i could control everything on my network, including what program they use and how they use it, would there be a chance still for me to prioritize the torrents. i want to do this because if there is no traffic flowing at the time the torrents can use the full connection but if something else needs it, that request will be serviced before the torrent one is.

if it still can't be done......semi reliably then i'l just get the users to throttle their own torrent clients
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: need help with prioritizing traffic

Mon Sep 05, 2011 2:52 pm

As CCDKP mentioned, capturing P2P traffic is difficult (almost impossible).
There are workarounds, like identifying traffic you know (HTTP for example) and treat every
other traffic as unknown, thus giving it lower priority. But still there is risk involved, since there
are some P2P client who will disguise them self as HTTP traffic, establishing connections in port 80.

For me, the better approach is what is proposed by the following article, it has worked for me:

http://wiki.mikrotik.com/wiki/Connection_Rate

Who is online

Users browsing this forum: avis99, gotsprings and 24 guests