Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 serverfault.com May 24 '11 at 14:38

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

1  
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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.