Easy torrent shaper for home use
-
The idea may be obvious but it wasn't to me and after a lot of trial and error and even some thinking and reading I came up with a fairly simple and effective torrent shaping solution. If you're interested, read on. :)
Idea
For inbound traffic (LAN interface(s)) you want the default queue to be the high priority queue. This way, you only need to create a single, low priority rule for your incoming torrent port.For outbound traffic (WAN) you want the default queue to be the low priority queue. This way all those randomly initiated torrent connections will be low priority. Now just add some rules in the Floating rules table to make dns, http, icmp etc. a high priority.[1]
Implementation
I currently use two queues for incoming and three queues for outgoing traffic:Incoming Parent: HFSC (LAN interface)
Bandwidth: 6912Kbit/s (adjust all these to your downstream speed)
Upperlimit: - - 6912Kbit/s
Realtime: - - 6912Kbit/s
Shared: - - 6912Kbit/sIncoming "qDefault"
Options: Default
Bandwidth: 30%
Upperlimit: - - 95%
Realtime: 80% 2000 60%
Shared: - - 30%Incoming "qLow"
Options: RED, ECN
Bandwidth: 40%
Upperlimit: 80% 50 70%
Realtime: - - -
Shared: - - 40%Outgoing Parent: HFSC (WAN interface)
Bandwidth: 736Kbit/s (adjust to your upstream speed)Outgoing "qACK" [2]
Options: RED, ECN
Bandwidth: 5Kbit/s
Upperlimit: - - -
Realtime: 8Kb 20 5Kb
Shared: - - 5KbOutgoing "qHigh"
Options: RED, ECN
Bandwidth: 50%
Upperlimit: 95% 100 90%
Realtime: 75% 2000 60%
Shared: - - 50%Outgoing "qDefault"
Options: Default, RED, ECN
Bandwidth: 20%
Upperlimit: 70% 100 60%
Realtime: - - -
Shared: - - 20%Note: If you decide to use Explicit Congestion Notification (ECN) make sure to also enable it in your OS (Win, Linux, Mac…).
Result
All available bandwidth is saturated dynamically at all times. I can watch HD streams while sharing files via torrent, without using any bandwidth limits in my torrent application.Thanks for reading.
PS: I never had such a good internet experience before - I have only just used my modem. Thx pfSense team!- I chose high priority for these (outgoing): ICMP, 20-23, 53, 123, 80, 443, 465, 993, 1935, 43, 843
- Use pftop's queue-monitor to monitor the saturation of the"qACK" queue. My settings are optimized for DSL 6000 and may not work well for your setup. You don't want to see any drops here.
-
is there a chance for you to screenshot and/or describe how you made the LAN/WAN rules regarding your traffic shapers?
i'm looking for an easy way to configure this as well.
thanks a lot!
-
sure, see attachment (sorry for the mess, once a shot was pasted I couldn't move it anymore). note that I have tweaked the values - I have learned a bit more about the possibilities of m1,d and m2 since my initial post.
-
thanks a lot!
i'll try these settings today and report back on findings!
p.s i suppose in "LAN" instead of 100mbit/s i should use 1gbit/sec (which is my network) or it doesnt really matter?
edit: i've included everything, and i got noticable difference in internet experience!…but seems like qHigh on LAN is dropping packets like crazy...should it be like that?
edit2: does floating rules have "quick" enabled?
-
you would need to tweak the values for qHigh and probably qAck too…you don't want to see drops there, only in the qLow queues. and yeah, for Gbit LAN you would set it to 1000Mbit (you also want to assign local traffic into the qLink queue, I have only shown the browsing/torrent-relevant rules).
-
how is it possible to assign qLink queue to LAN->LAN traffic?…i was positive that LAN->LAN traffic is not filtered if its on the same LAN...
i know i'm probably asking too much, but your situation is too similar to what i want to accomplish, its daunting not to ask further questions!
-
You're probably right. I guess it depends on the setup. I am using a transparent firewall and everything is getting filtered (public AP on one side (OPT1) and my PC's on LAN). In my case I have to assign traffic into qLink to not queue it into the default queues.
-
i have the same setup, and so far no matter what queues i force packets into, i see them populating the "LAN" queue…:(((
can you please share a little info and some screenshot on how you made lan traffic go through "qlink" and the internet traffic to the other queues?
-
For some reason ports will NOT show in any rules I create. Not sure what to do to get them to work correctly.