Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to throttle in an almost binary way my bittorrent traffic.

I have seen some posts on the subject on how to deal with nasty users - the answers are more targeted at how to make their life difficult than on the limitation itself. I read M0n0wall and pfSense articles mentioned in other posts but they do not address my specific need. I also searched on google and read on tc (with limited understanding)

So I must not be too clever but I still fail to understand in practical words how to achieve:

  • an untamed bittorrent traffic on certain ports (which I can set) when nobody is using other protocols (read HTTP) on the network

  • a squeeze of the availble bandwidth for bittorrent (down to almost zero) when there is other traffic.

I am specifically looking for a "squeeze" of the bandwidth, not hard limits. I can only estimate the upload/download on my link as it changes form reboot to reboot of the ADSL box.

I use a linux (debian) server which also acts as router / firewall / wifi access point -- so I guess that it is the ideal setup as all the traffic sources are plugged right on it. This is a home LAN where i control all the activities (namely - I do bittorrent in a headless way (with deluge) and other users (as well as myself) browse the web). Since the ADSL connection is poor I need to restrict p2p to have workable web access.

share|improve this question

migrated from May 24 '11 at 14:38

This question came from our site for system and network administrators.

Is this a home, or office setup? – Dan May 24 '11 at 13:16
further to @DanBig's question, though the answer is implied, is the LAN just for you, or are there other people (and approximately how many)? – Norky May 24 '11 at 14:27
Is it really necessary to limit the BitTorrent bandwidth or do you really want to just implement QoS? – Hello71 May 24 '11 at 14:56
Thanks for the comments - I updated the post to be more precise: the LAN is mine and the users are known and cooperative, in fact it is my activity I want to control. I am looking for QoS and not bandwidth limitation. – WoJ May 25 '11 at 9:58
This is much easier if you can control both sides of the limiting link... (Your router and the ISP router...). If you could do that, you could simply set it up to let through all non-bittorrent traffic and then bitorrent on whatever bandwidth is left... You are unlikely to get that level of control outside a corporate VPN though... With a consumer connection, you have the problem that the traffic you want to limit already affected your other traffic before you can do anything about it... – Gert van den Berg Jan 1 at 9:22

The simplest (but probably uneffective) way is to use 'connection limit' criteria. You may identify and restrict overactive p2p-users, which will create a lot of connections to peers.

Another approach is using some p2p detection algorithms as an iptables extension. There are: ipp2p and l7-filter (can be used apart or simultaneously), but usually they require more resources from system.

share|improve this answer
I will have a look at ipp2p - thanks. The drawback is that all these mechanisms are looking at "fighting" the p2p traffic while I have complete control over it (including the ports which will be used, etc.). So it is really a friendly QoS I am trying to achieve – WoJ May 25 '11 at 10:47

Do you want automatic throttling? That is, whenever there is non-BitTorrent traffic, it should be prioritised over BitTorrent. Or would throttling during certain hours, i.e. afternoons/mornings when there are likely to be people using other protocols, be acceptable? If the latter, many BitTorrent clients can be set to throttle aggregate bandwidth used, and do so at scheduled times, e.g. limit themselves to 20KB/s up and downstream during office hours, and run unlimited (i.e. normally) outside of those hours.

The different approaches are performed in different places - traffic prioritisation would happen on your gateway, while client throttling would happen on, well, a client machine (though of course in your case the Debian host could be both the BitTorrent client and the gateway...)

share|improve this answer
I am looking for automatic throttling. I know that I can set specific times for download/seed/nothing-or-limited on my client but I do not really have "office hours" and "no-activity hours" – WoJ May 25 '11 at 10:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .