• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Trafic shaping for Streaming to twitch as well as streaming Netflix/YouTube

Traffic Shaping
8
38
8.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    Harvy66
    last edited by Sep 26, 2017, 11:07 PM

    I can pin a string in C# and modify the structure such that it thinks the size of the string is anything I want and can change the value of the string. I can "officially" change the value and length of strings.

    Just because you can't doesn't mean you should. fq_Codel technically working is an undefined implementation detail.

    1 Reply Last reply Reply Quote 0
    • B
      bingo600
      last edited by Sep 27, 2017, 4:15 PM

      @Harvy66:

      Just because you can't doesn't mean you should. fq_Codel technically working is an undefined implementation detail.

      Would you care to elaborate on that please  ;)
      Are you saying that native FreeBSD queuing are undefined ?
      Or just not tested with pfSense ?

      I have installed the sudo package from the "BSD repos", because i saw a need for it.
      And still think it's ok to use the "right tool" for the job.

      But "fiddling under the hood" will of course VOID the warranty like everywhere else.

      /Bingo

      If you find my answer useful - Please give the post a 👍 - "thumbs up"

      pfSense+ 23.05.1 (ZFS)

      QOTOM-Q355G4 Quad Lan.
      CPU  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
      LAN  : 4 x Intel 211, Disk  : 240G SAMSUNG MZ7L3240HCHQ SSD

      1 Reply Last reply Reply Quote 0
      • H
        Harvy66
        last edited by Sep 29, 2017, 2:24 AM

        I'm just saying, if my car lets me drive off a bridge, it doesn't mean that's an officially supported use of the vehicle. You take full responsibility for undocumented "features".

        1 Reply Last reply Reply Quote 0
        • P
          PCbuilder1997
          last edited by Oct 1, 2017, 3:07 PM Oct 1, 2017, 2:59 PM

          Ok. I stated before that I am a noob.
          I also think that some are misunderstanding what I am meaning by streaming. Yes Netflix is a streaming service, but I am talking about streaming content from my computer to a website upstream ( to twitch.tv) as well as allowing streaming downstream (from netflix.com) at the same time. I am lost with the what you guys are calling dummynet and I do not fully understand what some of the names and acronyms stand for such as these:
          qInternet
          qACK
          qDefault
                            I understand what the words default and internet mean, i just do not know what their purposes are if that makes sense.

          If I understand this correctly, "q" stands for queue followed by what is in the queue for being shaped? What is qACK?
          I also have found that the higher the number in the priority list = the higher priority i.e. 7= highest priority, correct?

          I have the bandwidth percentages set kind of odd to me in the sense that it doesn't add up. If I have the bandwidth percentages adding up to 100% across all queues NOTHING works. So currently, most queues sit at about 5%-15% qGames is the highest at 30%.

          I really would like to figure this out and I am sorry that i cannot figure it out on my own. You guys have been very helpful so far. I just am having difficulty making sense of the language.
          Thank you in advance.

          pfsenseShaping3.png
          pfsenseShaping3.png_thumb

          1 Reply Last reply Reply Quote 0
          • P
            PCbuilder1997
            last edited by Oct 1, 2017, 3:16 PM

            @Harvy66:

            If it still doesn't work, use FairQ as your shaper, set your interface to 90% of your actual speed, have one queue on your interface, make sure it's the default and enable Codel on it.

            Where would I find FairQ in the wizard? I only get three options; HSFC CBQ and PRIQ

            1 Reply Last reply Reply Quote 0
            • B
              belt9
              last edited by Oct 1, 2017, 3:24 PM Oct 1, 2017, 3:18 PM

              Correct those are different queues within the ALTQ shaper.

              pfSense uses two basic types of traffic shaping, ALTQ & Dummynet (dummynet is under the "Limiters" tab).

              ALTQ is what your screenshot is of. It is very effective, but you need to know what you are doing and even then it takes time to enter all of your queues.

              Dummynet is very simple, you just make two limiters. One for Download, the other for Upload.
              Set a queue within each limiter, set your subnet mask (probably /24) - ask if oyu need help with any of the other settings, there aren't many).
              You would limit both of these streams to some value slightly less than the slowest your internet ever gets.
              This is the step that most people mess up with traffic shaping - because no one wants to do it.

              But, put simply - your internet bandwidth is a series of funnels. For simplicity we'll just say there are two funnels - you and your ISP (there are more). If your funnel is larger than your ISP's, then your ISP funnel will limit your traffic - probably not in the way that it best for you.
              If you want control over how your traffic is limited then you MUST make your funnel smaller than your ISP's - therefore you MUST limit your bandwidth to less than the slowest it EVER gets.
              What this means is - if you pay for a 50Mbps down / 10 Mbps up line, but during peak traffic you are actually only getting 40/8, then you would set your limiters to 38,000Kbps / 7,600Kbps. If you decided to just set it to something like 49,000Kbps/9,000Kbps, then the limiters would do nothing for you during peak hours (when it matters most).

              Once the dummynet limiters are created, you just apply them to your firewall rules in the advanced section of each rule and you are done.

              You can use dummynet in pre 2.4.x, but you can't use fq_codel. I recommend using 2.4.0 (the Release version comes out tomorrow). Because you can set your dummynet to use fq_codel with the CLI and shellcmd package.

              fq_codel is just a very good algorithm that is exceptional at fairly sharing your bandwidth and greatly reducing latency at the same time. So it will generally solve all of your problems without a whole bunch of config.

              If you don't want to go that way, I recommend you watch this video on traffic shaping. It will show you how it works so you know what you are doing. After watching that you'll at least know what questions to ask. After watching that you'll probably also see why I recommend you just use dummynet for a home network that is simply trying to upload and download video content without bufferbloat.

              https://www.youtube.com/watch?v=rF46PNid1Mo

              1 Reply Last reply Reply Quote 0
              • P
                PCbuilder1997
                last edited by Oct 1, 2017, 3:25 PM

                Thank you sir! Story of my life. Here i am doing the advanced S*** where the next tab over is the thing I need that will work and be ok. LOL
                Thanks man.
                I will try this and I will also putts around learning with AltQ.

                1 Reply Last reply Reply Quote 0
                • B
                  belt9
                  last edited by Oct 1, 2017, 3:47 PM

                  Anytime!

                  Please ask if you have any other questions.

                  1 Reply Last reply Reply Quote 0
                  • P
                    PCbuilder1997
                    last edited by Oct 2, 2017, 7:12 PM

                    @belt9:

                    Correct those are different queues within the ALTQ shaper.

                    pfSense uses two basic types of traffic shaping, ALTQ & Dummynet (dummynet is under the "Limiters" tab).

                    ALTQ is what your screenshot is of. It is very effective, but you need to know what you are doing and even then it takes time to enter all of your queues.

                    Dummynet is very simple, you just make two limiters. One for Download, the other for Upload.
                    Set a queue within each limiter, set your subnet mask (probably /24) - ask if oyu need help with any of the other settings, there aren't many).
                    You would limit both of these streams to some value slightly less than the slowest your internet ever gets.
                    This is the step that most people mess up with traffic shaping - because no one wants to do it.

                    But, put simply - your internet bandwidth is a series of funnels. For simplicity we'll just say there are two funnels - you and your ISP (there are more). If your funnel is larger than your ISP's, then your ISP funnel will limit your traffic - probably not in the way that it best for you.
                    If you want control over how your traffic is limited then you MUST make your funnel smaller than your ISP's - therefore you MUST limit your bandwidth to less than the slowest it EVER gets.
                    What this means is - if you pay for a 50Mbps down / 10 Mbps up line, but during peak traffic you are actually only getting 40/8, then you would set your limiters to 38,000Kbps / 7,600Kbps. If you decided to just set it to something like 49,000Kbps/9,000Kbps, then the limiters would do nothing for you during peak hours (when it matters most).

                    Once the dummynet limiters are created, you just apply them to your firewall rules in the advanced section of each rule and you are done.

                    You can use dummynet in pre 2.4.x, but you can't use fq_codel. I recommend using 2.4.0 (the Release version comes out tomorrow). Because you can set your dummynet to use fq_codel with the CLI and shellcmd package.

                    fq_codel is just a very good algorithm that is exceptional at fairly sharing your bandwidth and greatly reducing latency at the same time. So it will generally solve all of your problems without a whole bunch of config.

                    If you don't want to go that way, I recommend you watch this video on traffic shaping. It will show you how it works so you know what you are doing. After watching that you'll at least know what questions to ask. After watching that you'll probably also see why I recommend you just use dummynet for a home network that is simply trying to upload and download video content without bufferbloat.

                    https://www.youtube.com/watch?v=rF46PNid1Mo

                    Now by setting these things slower than my actual aren't I effectively bottlenecking my own internet? Also, the lingo for these limiters; for the destination tab - source is down while destination means up? (see attachment)

                    pfsenseShaping4.png
                    pfsenseShaping4.png_thumb

                    1 Reply Last reply Reply Quote 0
                    • B
                      belt9
                      last edited by Oct 2, 2017, 7:34 PM

                      Down is destination

                      Up is source

                      Yes, you have to be your own bottleneck otherwise an upstream router will be queueing your traffic

                      1 Reply Last reply Reply Quote 0
                      • P
                        PCbuilder1997
                        last edited by Oct 3, 2017, 3:28 PM

                        Kind of like this?
                        And what more options are there?

                        I get 90 up and 25 down.

                        pfsenseShapingLimiter1.png
                        pfsenseShapingLimiter1.png_thumb
                        pfsenseShapingLimiter2.png
                        pfsenseShapingLimiter2.png_thumb

                        1 Reply Last reply Reply Quote 0
                        • B
                          belt9
                          last edited by Oct 3, 2017, 3:53 PM

                          The opposite of that, downstream is destination, upstream is source

                          1 Reply Last reply Reply Quote 0
                          • P
                            PCbuilder1997
                            last edited by Oct 3, 2017, 4:14 PM

                            Lol
                            That IS how I had it saved, Don't know why i screenshot it that way. I was more so asking about the funnels.

                            1 Reply Last reply Reply Quote 0
                            • B
                              belt9
                              last edited by Oct 4, 2017, 12:00 AM

                              Funnels as in your bandwidth limits?

                              That depends very much on your personal connection.

                              Some people have WAN connections that are rock solid i.e., they pay for say 100/100 FiOS service, and actually get 100/100 or better 99%+ of the time. If that's you then you could safely set your bandwidth limits to 95%+ of your advertised bandwidth.

                              Most people's connection would be some cable or dsl connection - let's say 50/10. During non-peak hours when everyon's at work, they actually get 50/10 or slightly better. But when everyone comes home from work they get something more like 48/9. Then in the evenings when everyone is streaming netflix, etc. they get something like 38/6.5.
                              If this is you, then you would take the worst of those connections (38/6.5) and set your limits to maybe 95% of that, or 36,100Kbps/6,175Kbps. Then you have to live with cutting your internet connection down by 28%down/35%up all of the time just because your ISP sucks.
                              -This is what all the stuff in my signature is trying to avoid.

                              So, if you've accounted for that then you are good to go. But you have to measure your own network at different times, no one on here can accurately tell you exactly what to set it at.

                              1 Reply Last reply Reply Quote 0
                              • bestforminc2B
                                bestforminc2
                                last edited by bestforminc2 Feb 12, 2024, 10:32 AM Feb 12, 2024, 10:30 AM

                                ZeTwitch.com is a Twitch video/clip downloader that provides you with the easiest way to download Twitch clips and videos from twitch.tv.

                                http://zetwitch.com

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.