Bittorrent, Tomato and QoS: medium ok?

Discussion in 'Tomato Firmware' started by jeffjs, Sep 7, 2006.

  1. jeffjs

    jeffjs Network Guru Member

    What's the suggested setting in QoS for Bittorrent traffic? I want it to get through quickly, but not bog down the network. Currently set to Medium, but haven't tested yet.

    Just wondering how everyone is configuring this option.
  2. Disman_ca

    Disman_ca Super Moderator Staff Member Member

    I haven't used the QoS options yet but medium might be ok to start off with. Don't forget you need to set some higher priority services like www (which is the default) to ensure it throttles the torrent traffic. Try it at medium and see how it goes and fine tune from there. I would suggest also adding in a pop3 service with a priority of high to ensure you can surf and check email while torrents chug away.
  3. bigl2

    bigl2 Network Guru Member

    I use Low cass. But it depends on which class is given for "normal" services like WWW, DNS etc. It should be lower than all of them - that's all.
  4. NateHoy

    NateHoy Network Guru Member

    The "Default" in Thibor is between medium and low. That is the same default Tofu used on his HyperWRT flavor.

    So, if you set all of your P2P to LOW, then the rest of your traffic would run at a priority above that (medium/low) and P2P should only use "leftover" upstream bandwidth.

    However, I haven't tried out the new zesty Tomato flavor, so I'm basing my assumption on Tofu adopting the same defaults. I'd set P2P to LOW, get your upstream bandwidth tuned correctly, and try it out. If that doesn't work, you may need to set all your other services to something higher.

    Keep in mind that LOW means 100% of bandwidth (less QoS overhead) if nothing else is going on. So using "medium" for something that really should be your lowest priority is harmless, but it means you have lost one level of refinement that you would otherwise have.

    I use the following basic school of thought:

    - VoIP devices, gaming ports = HIGHEST
    - DNS = HIGHEST (low bandwidth, frequent requests, good thing to keep high)
    - HTTP/HTTPS = HIGH (interactive application that I'm generally waiting on)
    - SMTP/POP3/FTP = MEDIUM (batch applications)
    - P2P, etc = LOW (give them whatever is left over, but never allow them to interfere with other traffic)

    In an otherwise-idled Internet connection, P2P will run every bit as fast at LOWEST as it does at HIGHEST. QoS will only slow down P2P packets if something "more important" needs to get through. So the actual SETTING is arbitrary. The relative priority is what is important.

    "LOW", "MEDIUM", "HIGH", and "HIGHEST" are not passed along to your ISP. Your ISP, if they have QoS, is using their own criteria, which you cannot control and probably cannot even see, to do QoS. They only have meaning until the router passes the packets along to your modem, at which point they are not passed along with the data. At that point, all bets are off (which is why it is VITAL to tune your upstream bandwidth so your router knows how much bandwidth your modem can accept).
  5. Reiper

    Reiper LI Guru Member

    There is actually a drop down menu in Tomato's Qos to select the default classification. The default "default classification" is Low but this can be changed!

    Natheoy, you should give it a try, that zesty tomato flavor is GOOD! :)
  6. bigl2

    bigl2 Network Guru Member

  7. jeffjs

    jeffjs Network Guru Member

    Thanks for all of the feedback. I came to about the same conclusion - I am using settings similar to above.

    Evrything is working great. Also, I removed uTorrent and I am now using BitComet - this is a lot better traversing NAT w/UPnP, and it seems to not bog down my PC at all.

    Thanks again.
  8. NateHoy

    NateHoy Network Guru Member

    I finally took the plunge this morning. As our good friend Napoleon would say "SWEEEEEEET!!!!"

    I cannot believe how good the QoS realtime display graphs are. INSTANT feedback on how well my QoS settings are taking effect, with an easy drill-down graphical view of current QoS packets. This is some amazing stuff.

    So far, the IPP2P filter does not appear to be effective, at least not according to the feedback. I have BitTorrent (Azureus) running on port 49156. When I put a QoS filter of 49150-49160 to "Lowest", all my BitTorrent traffic goes to "Lowest". But when I turn on IPP2P (as seen below) and try to filter it that way, they all go to "Medium" (default).

    IPP2P: All IPP2P filters Lowest P2P Filter

    Not a huge deal, I can work with Port number and it's probably more efficient anyway.

    About the only thing I cannot find (he said, feeling stupid) is a function to clear NVRAM and restore factory settings. ???
  9. Reiper

    Reiper LI Guru Member

    It's on the configuration page, the last drop down menu to restore defaults... Going from memory here... :)
  10. LAGMonkey

    LAGMonkey Network Guru Member

    I have had the same problems with the IPP2P and some of the L7 filters. and im currently thinking about compliing tomato with updated definations. However my main problem is that i dont know a lot about linux. (infact its next to nothing) and also i dont have tofu's permision.

    Try setting the IPP2P setting to just catch BitTorrents and on Any port. It seems to have a better effect that just "All IPP2P"
  11. dvaskelis

    dvaskelis Network Guru Member

    QoS for BitTorrent traffic via a port number is only partially effective. While it will flag some of your traffic, I'm afraid in the end, it doesn't work that effectively for BitTorrent. By port alone, you won't flag all BitTorrent traffic because there are so many ports that are used by the other connections. You can flag a large range, like 1024-65535, but that will likely also flag other unintended traffic too.

    Are you perhaps encrypting your BitTorrent traffic to avoid traffic shaping with your ISP? (i.e. enabling crypto in Azureus or enabling encryption in µTorrent) If so, your BitTorrent traffic it will be "invisible" to ipp2p and l7, and therefore not be caught by those filters. You have to make sure protocol encryption is disabled in your BitTorrent client if you want to use ipp2p or l7.
  12. dvaskelis

    dvaskelis Network Guru Member

    That is the best bet in general, and even then, some BitTorrent traffic will still not get flagged. That's because, typically, both Azureus and µTorrent will accept encrypted connections even if you have set your BitTorrent client to have encryption turned off. And, there's no one-way protocol encryption, so such connections are encrypted in both directions!

    Both ipp2p and l7 will totally miss these connections, and they'll likely have default priority in QoS unless they match another non-ipp2p/l7 rule.
  13. LAGMonkey

    LAGMonkey Network Guru Member

    Many thanks for clearning that up. I always (prob nievly) thought that encryption was one way for some reason. Hence i always kept it turned off. But if its going the other way too then i suppose there isnt anything i can do about it.
  14. redcow

    redcow LI Guru Member

    using utorrent you can set an outgoing port in the advance settings, so you can filter using only the in and outgoing port without ipp2p and l7, works great for me and it doesn't matter if the traffic is encrypted or not.
  15. dvaskelis

    dvaskelis Network Guru Member

    While you can set a port, it's not going to be the only port BitTorrent traffic uses for transferring data. The port in the client is the incoming "listening" port, while outgoing connections will use a random local port just like every other TCP/IP application. See the µTorrent FAQ for more details. Also, you also don't control the ports that other connected BitTorrent clients are using for their incoming connections.

    The whole point of encrypting BitTorrent traffic is to try and make it invisible to filters like ipp2p and l7. It's a little bit of a cat-and-mouse game, for example, ipp2p 0.8.1_rc1 added the ability to detect BitComet header encryption at the time, although reportedly it now doesn't work with newer versions of BitComet. So, it's possible ipp2p and l7 may catch some of the encrypted BitTorrent traffic, but I'll bet that if you have the latest Azureus or µTorrent on both sides of a conversation, ipp2p and l7 will both miss those packets when encryption is used. Typically BitTorrent encryption is implemented so that is uses the lowest-level supported by both sides of a particular connection, and the point of BitTorrent is that you'll be connected using one Torrent with many clients at the same time, potentially all with totally different encryption settings.

    There's a good entry at Wikipedia on BitTorrent Protocol Encription (PE).
  16. NateHoy

    NateHoy Network Guru Member

    No, I'm not encrypting. My ISP does not traffic shape (yet). However, I do see your point on the "other" ports being used. I'm not too worried about the Torrent ports, but a good number of data connections appear to be made on ports other than the one I specified.

    I did a quick config to leave the primary port I have configured in Azureus at Lowest, and I've added BitTorrent-only IPP2P based on a recommendation someone made in this thread, also at Lowest. I started seeing SOME of my BitTorrent connections on the "odd" ports going down to Lowest after a minute or so, but not all of them by a long shot.

    Then I switched over to BitTorrent-only IPP2P (deleted the hardcoded ports), and about 10-15% of my BitTorrent packets went to Lowest, the rest went to Medium.

    So, it would seem that IPP2P is only partly effective, when it is used to identify BitTorrent specifically. The combination of specific port AND IPP2P-BitTorrent catches MOST of the BitTorrent-related connections, but not all. But the combination of the two is certainly more effective than either one standing alone.


    However, most importantly for my network, MAC address priority seems perfect. When I pick up my Vonage line, the pie chart shows bandwidth being handed over to "Highest", which only Vonage and DNS can get to.

    So, worst case, I can always take my BitTorrent machine and set its priority down below the rest of the LAN, with overrides to the standard protocols. But, so far, that hasn't been necessary. The little BitTorrent traffic that "leaks" into Medium hasn't been a real problem. The majority of it has been jammed down to "Lowest" with no problems.

    What I like the most about Tomato is the graphs and charts. It takes the mystery out of what is going on in QoS, and makes the results of my experimentation VERY clear and easy to intepret. NICE STUFF!
  17. redcow

    redcow LI Guru Member

    you are right, i mixed something up, sry
  18. fareal

    fareal LI Guru Member

    I agree. And also the ajax and javascript and the way its used when configuring the router, saving settings, restarting services, etc. Thanks, tofu.
  19. dvaskelis

    dvaskelis Network Guru Member

    Even though you are not initiating encrypted connections, the stuff that's being missed is likely encrypted BitTorrent traffic on odd ports, because your client isn't configured to turn away encrypted connection requests.

    One broad port range that's less restrictive you might try is both 6880-6999 and 49152-65534. The first is a slightly wide "old" BitTorrent port range, and the second is the current "recommended" BitTorrent port range.
  20. NateHoy

    NateHoy Network Guru Member

    Probably. I've also noticed that the number of them have dropped off a LOT, and that older ones are still in the list, though some of them have dropped off. So I'm wondering exactly where the data for the charts is coming from, and how current it might be. Even so, with a combination of P2P and my set ports, I have only three connections that didn't get placed properly and went to Medium. That's pretty darned good.

    Good idea. I added the 6881-6999 to the list, and that would have caught two of the three "misses". We'll see how that works out.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice