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

    Need some help understanding how to traffic shape inbound

    Scheduled Pinned Locked Moved Traffic Shaping
    18 Posts 2 Posters 3.3k 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.
    • DerelictD
      Derelict LAYER 8 Netgate
      last edited by

      I'd put the game queue at, say, bandwidth and link share 60% and the torrents at like 5%.  If it's really important I'd also set a realtime value on the game queue at, say 10%.  Note also that if you want pings to reflect what's really going on you need to put them (icmp) in the game queue.

      Then test and see how it does.

      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
      • L
        lordkitsuna
        last edited by

        @Derelict:

        I'd put the game queue at, say, bandwidth and link share 60% and the torrents at like 5%.  If it's really important I'd also set a realtime value on the game queue at, say 10%.  Note also that if you want pings to reflect what's really going on you need to put them (icmp) in the game queue.

        Then test and see how it does.

        wouldnt this just mean that the torrents can only ever use 5%? or am i not understanding that correctly? I would like the torrents to be able to use all of the bandwidth when nothing is going on. is that what that does or is that limiting it to always be 5%?

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

          No.  It means that they get 5% of the backlogged queue, which is only an issue when there's congestion.

          There is no way to give something else priority without dropping bittorrent traffic.  That's the name of the game.

          Something has to get dropped to make room for the traffic you set as priority.

          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
          • L
            lordkitsuna
            last edited by

            @Derelict:

            No.  It means that they get 5% of the backlogged queue, which is only an issue when there's congestion.

            There is no way to give something else priority without dropping bittorrent traffic.  That's the name of the game.

            Something has to get dropped to make room for the traffic you set as priority.

            alright so like this?

            http://imgur.com/vSCvFdj

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

              No.  Upperlimit is a hard-set 5%.  That tells the shaper to drop traffic in excess of 5% of the parent queue.  Get rid of it unless that's what you want.

              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
              • L
                lordkitsuna
                last edited by

                @Derelict:

                No.  Upperlimit is a hard-set 5%.  That tells the shaper to drop traffic in excess of 5% of the parent queue.  Get rid of it unless that's what you want.

                ohh ok so bandwidth at 5% or blank? and then upper limit just turned off? Sorry that i am being so slow with this but thanks a lot for all the help. Also would you recommend Codel Active Queue? i dont fully get what it is but it makes it sound like a good thing from the wiki it brings me too.

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

                  Set bandwidth and link share (m2) to the same value.

                  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
                  • DerelictD
                    Derelict LAYER 8 Netgate
                    last edited by

                    I leave codel unchecked.

                    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
                    • DerelictD
                      Derelict LAYER 8 Netgate
                      last edited by

                      You might want to go to Diagnostice->Edit File, enter /tmp/rules.debug, then hit Load.  Look for the section that looks like this:

                      
                       altq on  em2 hfsc queue {  qLink,  qInternet  } 
                       queue qLink on em2 bandwidth 25% hfsc (  default  , linkshare 25%  )  
                       queue qInternet on em2 bandwidth 10Mb hfsc (  linkshare 10Mb  , upperlimit 10Mb  )  {  qDNS,  qACK,  qVPN,  qBulk,  qOpenWireless,  qLowPrio  } 
                       queue qDNS on em2 bandwidth 5% hfsc (  realtime 5% , linkshare 5%  )  
                       queue qACK on em2 bandwidth 10% hfsc (  linkshare 10%  )  
                       queue qVPN on em2 bandwidth 10% hfsc (  realtime 5% , linkshare 10%  )  
                       queue qBulk on em2 bandwidth 50% hfsc (  linkshare 50%  )  
                       queue qOpenWireless on em2 bandwidth 2Mb hfsc (  linkshare (2Mb, 5000, 1Mb)  , upperlimit (2Mb, 5000, 1Mb)  )  
                       queue qLowPrio on em2 bandwidth 5% hfsc (  linkshare 5%  )  
                      
                       altq on  em0_vlan223 hfsc queue {  qLink,  qInternet  } 
                       queue qLink on em0_vlan223 bandwidth 25% hfsc (  default  , linkshare 25%  )  
                       queue qInternet on em0_vlan223 bandwidth 100Mb hfsc (  linkshare 100Mb  , upperlimit 100Mb  )  {  qDNS,  qACK,  qVPN,  qBulk,  qLowPrio  } 
                       queue qDNS on em0_vlan223 bandwidth 5% hfsc (  realtime 5% , linkshare 5%  )  
                       queue qACK on em0_vlan223 bandwidth 10% hfsc (  linkshare 10%  )  
                       queue qVPN on em0_vlan223 bandwidth 10% hfsc (  realtime 5% , linkshare 10%  )  
                       queue qBulk on em0_vlan223 bandwidth 50% hfsc (  linkshare 50%  )  
                       queue qLowPrio on em0_vlan223 bandwidth 10% hfsc (  linkshare 10%  )  
                      
                       altq on  em0_vlan1004 hfsc queue {  qLink,  qInternet  } 
                       queue qLink on em0_vlan1004 bandwidth 20% hfsc (  default  , linkshare 20%  )  
                       queue qInternet on em0_vlan1004 bandwidth 10Mb hfsc (  linkshare 10Mb  , upperlimit (10Mb, 2000, 2Mb)  )  {  qOpenWireless  } 
                       queue qOpenWireless on em0_vlan1004 bandwidth 50% hfsc (  linkshare 50%  )  
                      
                      

                      And post it, along with the characteristics of your internet service (that example is for a 100/10 cable connection.)

                      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
                      • L
                        lordkitsuna
                        last edited by

                        @Derelict:

                        Set bandwidth and link share (m2) to the same value.

                        Thanks so much i now have it working and everything behaves as expected. My torrents can take up the speed when nothing is going on but as soon as i start playing games they get dialed back enough that my games ping remains unaffected.

                        1 Reply Last reply Reply Quote 0
                        • L
                          lordkitsuna
                          last edited by

                          Oh yeah sure here is that file.

                          set limit tables 3000
                          set optimization normal
                          set timeout { adaptive.start 0, adaptive.end 0 }
                          set limit states 100000
                          set limit src-nodes 100000
                          
                          #System aliases
                          
                          loopback = "{ lo0 }"
                          WAN = "{ bfe0 }"
                          LAN = "{ xl0 }"
                          IPV6TUN = "{ gif0 }"
                          
                          #SSH Lockout Table
                          table <sshlockout>persist
                          table <webconfiguratorlockout>persist
                          #Snort tables
                          table <snort2c>table <virusprot>table <bogons>persist file "/etc/bogons"
                          table <bogonsv6>persist file "/etc/bogonsv6"
                          table <negate_networks># User Aliases 
                          
                          # Gateways
                          GWIPV6TUN_TUNNELV6 = " route-to ( gif0 2001:470:a:45d::1 ) "
                          GWWAN_DHCP = " route-to ( bfe0  ) "
                          
                          set loginterface xl0
                          
                          set skip on pfsync0
                          
                          scrub on $WAN all    fragment reassemble
                          scrub on $LAN all    fragment reassemble
                          scrub on $IPV6TUN all    fragment reassemble
                          
                           altq on  bfe0 priq bandwidth 25Mb queue {  qACK,  qOthersDefault,  qP2P,  qGames,  qOthersHigh,  qOthersLow  } 
                           queue qACK on bfe0 priority 6 priq (  ecn  )  
                           queue qOthersDefault on bfe0 priority 3 priq (  ecn  )  
                           queue qP2P on bfe0 priority 1 priq (  ecn  , default  )  
                           queue qGames on bfe0 priority 5 priq (  ecn  )  
                           queue qOthersHigh on bfe0 priority 4 priq (  ecn  )  
                           queue qOthersLow on bfe0 priority 2 priq (  ecn  )  
                          
                           altq on  xl0 hfsc queue {  qInternet  } 
                           queue qInternet on xl0 bandwidth 25Mb hfsc (  ecn  , linkshare 25Mb  , upperlimit 25Mb  )  {  qACK,  qP2P,  qGames,  qOthersHigh,  qOthersLow  } 
                           queue qACK on xl0 bandwidth 19% hfsc (  ecn  , linkshare 19%  )  
                           queue qP2P on xl0 bandwidth 98% hfsc (  ecn  , default  , linkshare 5%  )  
                           queue qGames on xl0 bandwidth 98% hfsc (  ecn  ,  realtime 9% , linkshare 15%  )  
                           queue qOthersHigh on xl0 bandwidth 25% hfsc (  ecn  , linkshare 15%  )  
                           queue qOthersLow on xl0 bandwidth 4.75% hfsc (  ecn  , linkshare 4.75%  )  
                          
                          no nat proto carp
                          no rdr proto carp
                          nat-anchor "natearly/*"
                          nat-anchor "natrules/*"</negate_networks></bogonsv6></bogons></virusprot></snort2c></webconfiguratorlockout></sshlockout> 
                          

                          As i said my internet is a 25/25 Fiber to the house connection. I messed with the settings a bit, i tried seeing what would happen if i set p2p and games bandwidth to 98% and then set the backlog and such and it seems to be working. Either can take up most of the link if it wants but when they both want the link games wins.

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

                            @lordkitsuna:

                            @Derelict:

                            Set bandwidth and link share (m2) to the same value.

                            Thanks so much i now have it working and everything behaves as expected. My torrents can take up the speed when nothing is going on but as soon as i start playing games they get dialed back enough that my games ping remains unaffected.

                            Awesome.

                            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.