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

    A definitive, example-driven, HFSC Reference Thread

    Scheduled Pinned Locked Moved Traffic Shaping
    93 Posts 14 Posters 43.4k Views
    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.
    • KOMK
      KOM
      last edited by

      In my lab, I gave it an arbitrary bandwidth of 9Mb/s up/down.  Then I followed your directions exactly and pumped in all the specified percentages.  Did you mean to say that actual percentages should be used in the GUI, or were you meaning that we should pump in n% of the actual bandwidth number?  maybe I'll run through it again here at home.  Won't be back in the office until Monday.

      Edit: SO I just spun up the lab and tried it.  I set WAN and LAN bandwidth to 9Mb/s.  I created qLink next, set it to default, gave it bandwidth 20% and LS 20%.  Then I created qInternet and gave it UL 95% LS 95%.  As soon as I applied it, the same error appears.  See attached pics.

      WAN.png
      WAN.png_thumb
      qLink.png
      qLink.png_thumb
      qInternet.png
      qInternet.png_thumb

      1 Reply Last reply Reply Quote 0
      • S
        sideout
        last edited by

        Dont put the bandwidth vaule on LAN and WAN. Put the value on qInternet. Leave the WAN and LAN blank and you should not get the error.

        You want the qDNS to be under the qInterent. qLink and qInternet should be on the same level.

        1 Reply Last reply Reply Quote 0
        • KOMK
          KOM
          last edited by

          Thank you.  That wasn't clear to me.  No errors when I applied the shaper.

          Edit: Not so fast.  I went to Status - Queues and it failed to load the queues at all, and the error appeared in the statusbox again.

          1 Reply Last reply Reply Quote 0
          • S
            sideout
            last edited by

            I would blow it all away and redo it from scratch. I can try it in my lab later and see what I get.

            1 Reply Last reply Reply Quote 0
            • G
              georgeman
              last edited by

              @sideout:

              Dont put the bandwidth vaule on LAN and WAN. Put the value on qInternet. Leave the WAN and LAN blank and you should not get the error.

              You want the qDNS to be under the qInterent. qLink and qInternet should be on the same level.

              Yep, exactly. The idea is not to limit the interface itself but the queues, since you might have local devices lying on your WAN subnet

              If it ain't broke, you haven't tampered enough with it

              1 Reply Last reply Reply Quote 0
              • KOMK
                KOM
                last edited by

                I went back to my snapshot and tried again with the bandwidth value removed from WAN and LAN and added to both qInternet queues.  Same result with a slightly different error:

                (There were errors loading the rule(s): pfctl: linkshare sc exceeds parent sc root_em0 - The line in question reads (0): )

                1 Reply Last reply Reply Quote 0
                • S
                  sideout
                  last edited by

                  Are you staggering the queues though?

                  It should be like this:

                  LAN
                    qLink - 20%
                    qInternet - 95% of your real download vaule
                      qDNS - x%
                      qBulk - y%

                  x + y have to be less than value of qInternet

                  1 Reply Last reply Reply Quote 0
                  • G
                    georgeman
                    last edited by

                    I know what it's going on here. You should not type "95%" but the real amount, in Mbps or Kbps, that represents the 95% of your real speed

                    If it ain't broke, you haven't tampered enough with it

                    1 Reply Last reply Reply Quote 1
                    • KOMK
                      KOM
                      last edited by

                      Where, in the Bandwidth combobox or the service curve variable boxes?  Or both?

                      Edit:  Never mind.  It seems to not like using % at all.  I had to convert everything to Kb and Mb instead of %, and then finally my queues appeared in Status.

                      It should be like this:

                      LAN
                        qLink - 20%
                        qInternet - 95% of your real download vaule
                          qDNS - x%
                          qBulk - y%

                      I had the proper parent/child hierarchy but that wasn't my problem.

                      In your example, what is the relationship between qLink and qInternet as far as bandwidth is concerned?  They are both at the same level, but qLink has 20% and qInternet has 95% for a total of 115%.  I don't know how that is.

                      1 Reply Last reply Reply Quote 0
                      • S
                        sideout
                        last edited by

                        Since there is no value on LAN , the value on qLink does not matter as it is default and for local traffic.  The only thing that matters is the value on qInternet . That defines how much the child queues have.

                        It's kind of weird I know but it does work.

                        1 Reply Last reply Reply Quote 0
                        • KOMK
                          KOM
                          last edited by

                          Since there is no value on LAN , the value on qLink does not matter as it is default and for local traffic.

                          Can you leave it blank or must you provide some value, which is then subsequently ignored?

                          Set qDNS as having 30% realtime and 10% linkshare (and bandwidth).

                          Another question, sorry.  What is the bandwidth relationship above, and how does it figure into the parent/child calculations?  If I have parent qInternet at 10Mb and children qDNS at 1 Mb and qBulk at 9Mb, do I set qDNS's RT to 300Kb and LS to 100Kb as per 30%/10% above?  Is it supposed to add up to 1 Mb, the bandwidth total for the parent qInternet?

                          1 Reply Last reply Reply Quote 0
                          • S
                            sideout
                            last edited by

                            It needs a value. 20% is fine for a random value.  qDNS can be set at whatever you want. I just used 30% as an example.

                            1 Reply Last reply Reply Quote 0
                            • KOMK
                              KOM
                              last edited by

                              But what's qDNS's relationship between RT, LS and bandwidth?  LS and bandwidth are the same variable, so for my example, where qDNS bandwidth is 1Mb, I would set LS to 1 Mb and RT to 3 Mb (30%)?  If so, that extra 2Mb above what the bandwidth setting is, where does that come from?

                              1 Reply Last reply Reply Quote 0
                              • S
                                sideout
                                last edited by

                                I wouldn't set the RT to anything except for your priority queues.  RT say it gets X amount of bandwidth ALL the time so if you give qDNS 3MBIT then it gets 3Mbit all the time.  So that extra 2Mbit comes from whatever qInternet is set for , your case 9Mbit.

                                1 Reply Last reply Reply Quote 0
                                • KOMK
                                  KOM
                                  last edited by

                                  I would only ever use RT for VoIP traffic and ACK, typically.  OK, so it draws from the parent queue.  Sorry for asking endless questions but it's the only way to wrap my head around the whole thing and connect the dots between all the elements so that it makes sense.  I don't like following instructions without knowing what I'm doing and why,

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    sideout
                                    last edited by

                                    No worries. That is the best way to learn.

                                    1 Reply Last reply Reply Quote 0
                                    • DerelictD
                                      Derelict LAYER 8 Netgate
                                      last edited by

                                      Thanks sideout, georgeman.

                                      A couple things:

                                      georgeman:

                                      I know you specify this in the text, but in the floating match rules we still do not apply "quick" right?  This means that the qBulk rule has to come before the more specific qDNS rule.  One might be misled by the order in the text.

                                      sideout/all:

                                      The realtime queue you're discussing only applies when there's contention/congestion right?  If I specify 30% realtime for qDNS and there is no DNS traffic being placed in the queue, the other queues are not absentmindedly robbed of the 30% bandwidth, if I understand things.

                                      This has all been a really big help.  I appreciate it.  I am currently implementing the solution provided by georgeman on my bench.  More later.

                                      Chattanooga, Tennessee, USA
                                      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                      Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        sideout
                                        last edited by

                                        From my understanding - RT means that X% is taken automatically for that queue even if there is no traffic in the queue. At least that is the way it reads to me.    For what I use it for , qGaming that is a non issue as my use of HFSC is with traffic shaping at LAN parties so qGaming is my highest priority queue.  I use the following queues:

                                        LAN
                                        qInternet - bandwidth - 50MBit - I have 4 cable modems but putting in 200Mbit here would not be the correct thing to do as I cannot bond them to get 200Mbit
                                        qGaming - gaming traffic - RT 30% / bandwidth - 40% / LS - 40%
                                        qHTTPSTeam - bandwidth - 20% / LS 20%
                                        qWEBTraffic - bandwidth -  20% / LS 20%
                                        qACK - bandwidth - 20% / LS 20%

                                        qLink - bandwidth - 20% / LS - 20% - default queue

                                        WAN - 5MBIT - I have 4 WAN's so each are 5Mbit upload
                                        qLink - bandwidth - 10% / LS - 10% - Default queue
                                        qGaming - bandwidth 40% / RT - 20% / LS 40%
                                        qHTTPSteam - bandwidth - 20% / LS 20%
                                        qWEBTraffic - bandwidth - 20% / LS 20%
                                        qACK - bandwidth - 10% / LS 10%

                                        I use the floating rules to put DNS in the qGaming so it gets good response.  General web traffic goes into qWEBTraffic and then I use rules to put Steam traffic into qHTTPSteam.
                                        I use interface rules to direct gaming traffic out different wans via gateway groups. I allocate one modem / wan to like LoL gaming traffic , another to BF4 . I dedicate one modem to strictly web traffic and another modem is reserved for staff use and downloads as I have a limiter on for DHCP addresses to restrict all TCP connections to typically 25Mbit for everyone.

                                        This way I can get the best ping times and still give everyone bandwidth to do what they need without being too restrictive.

                                        1 Reply Last reply Reply Quote 0
                                        • KOMK
                                          KOM
                                          last edited by

                                          I'd like to see your ruleset if it isn't too much trouble.

                                          1 Reply Last reply Reply Quote 0
                                          • DerelictD
                                            Derelict LAYER 8 Netgate
                                            last edited by

                                            Okay.  This is all coming along nicely.

                                            I have created the following queues:
                                            WAN
                                              qLink default bw 20% ls 20%
                                              qInternet bw 15Mb ul 15Mb ls 15Mb
                                                qDNS bw 5% rt 5% ls 5%
                                                qACK bw 10% ls 10%
                                                qVPN bw 10% rt 5% ls 10%
                                                qBulk bw 50% ls 50%
                                                qOpenWireless bw 2Mb ul 2Mb ls 2Mb

                                            LAN
                                              qLink default bw 20% ls 20%
                                              qInternet bw 50Mb ul 50Mb ls 50Mb
                                                qDNS bw 5% rt 5% ls 5%
                                                qACK bw 10% ls 10%
                                                qVPN bw 10% rt 5% ls 10%
                                                qBulk bw 50% ls 50%

                                            OPENWIRELESS
                                              qLink default bw 20% ls 20%
                                              qInternet bw 10% ul 10Mb ls 10Mb
                                                qOpenWireless bw 50% ls 50%

                                            The screen shot details the floating rules.  All are !quick on WAN direction OUT.

                                            The only thing that's not going to the right queue are connections from OPENWIRELESS into the qOpenWireless on WAN.

                                            I have reset states.

                                            I have told my pass any any rule on OPENWIRELESS to queue to qOpenWireless.  That gets downloads into the right queue on the OPENWIRELESS interface but uploads are still going to qBulk.

                                            I am assuming this is because the floating rule on WAN OUT is happening post-NAT so the match on the source address is failing.  I just fixed this by, instead of my pass any any rule on OPENWIRELESS setting the queue to qOpenWireless, I instead mark the packet with "OW" and use that in a floating rule on WAN OUT to match on "OW" and place the traffic into qOpenWireless.  Seems to work.

                                            ![Screen Shot 2014-07-27 at 11.15.48 AM.png](/public/imported_attachments/1/Screen Shot 2014-07-27 at 11.15.48 AM.png)
                                            ![Screen Shot 2014-07-27 at 11.15.48 AM.png_thumb](/public/imported_attachments/1/Screen Shot 2014-07-27 at 11.15.48 AM.png_thumb)

                                            Chattanooga, Tennessee, USA
                                            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                            Do Not Chat For Help! NO_WAN_EGRESS(TM)

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