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

    CoDel - How to use

    Scheduled Pinned Locked Moved Traffic Shaping
    206 Posts 30 Posters 123.5k 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.
    • S
      sideout
      last edited by

      I am going to put this in place for my configs I use at LAN parties. Going to test at home then apply to the routers used for the LAN's.

      I use the following queues for high traffic - qGames and qHTTPSteam so using CODEL on them should have the desired effect as they are commonly the most used queues.

      Next LAN isnt' until March but I might be able to squeeze some testing in at a smaller event in Feb.

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

        @Harvy66:

        fq_CoDel will be that much better once available.

        Have the developers indicated they plan on supporting fq CoDel in pfSense.  I have not seen any post that they are.  I probably should set up HFSC plus CoDel .  Today I just have CoDel applied to the lan and wan ports with no other traffic shaping. This way at least my traffic is dynamically reacting to congestion in the network.

        During prime time, I can see the slow down.  If I have a lot off file transfers happening, I can see the link speed up as it gets later in the night.  By about 10:30, my link is running a full speed and can pull a sustained 100/5 transfer either direction.

        Fq CoDel would be a great solution as it is adaptive.  I really hope it gets implemented.

        1 Reply Last reply Reply Quote 0
        • H
          Harvy66
          last edited by

          @switchman

          Yes, but no ETA

          https://forum.pfsense.org/index.php?topic=87931.msg485936#msg485936

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

            @Harvy66:

            @switchman

            Yes, but no ETA

            https://forum.pfsense.org/index.php?topic=87931.msg485936#msg485936

            I saw that, but I read that as "yea it would be nice", but not firm "yes we are going to to this", now we just need to pick the release.

            1 Reply Last reply Reply Quote 0
            • H
              Harvy66
              last edited by

              Time for a bounty!

              I wouldn't expect it before 2.2.3 at the earliest. Looks like a good backlog of bugs to stomp. It would be nice if it was added to Redmine as a feature request, just so it's official.

              1 Reply Last reply Reply Quote 0
              • T
                tuffcalc
                last edited by

                I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

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

                  @tuffcalc:

                  I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

                  Thats why the developers of CoDel say you should actually deploy FQ-CoDel.

                  1 Reply Last reply Reply Quote 0
                  • H
                    Harvy66
                    last edited by

                    @tuffcalc:

                    I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

                    Try settings your WAN rate to about 95% of your stable upload rate and see what happens.

                    1 Reply Last reply Reply Quote 0
                    • T
                      tuffcalc
                      last edited by

                      @Harvy66:

                      @tuffcalc:

                      I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

                      Try settings your WAN rate to about 95% of your stable upload rate and see what happens.

                      That fixed it…

                      1 Reply Last reply Reply Quote 0
                      • H
                        Harvy66
                        last edited by

                        @tuffcalc:

                        @Harvy66:

                        @tuffcalc:

                        I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

                        Try settings your WAN rate to about 95% of your stable upload rate and see what happens.

                        That fixed it…

                        Well, 200ms is a lot less than what I thought it would have been, so just enabling CoDel without setting bandwidth is probably doing something, just not as effective as in conjunction with settings your bandwidth.

                        Just wondering, what was your ping during saturation when you have your bandwidth set?

                        1 Reply Last reply Reply Quote 0
                        • T
                          tuffcalc
                          last edited by

                          @Harvy66:

                          @tuffcalc:

                          @Harvy66:

                          @tuffcalc:

                          I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

                          Try settings your WAN rate to about 95% of your stable upload rate and see what happens.

                          That fixed it…

                          Well, 200ms is a lot less than what I thought it would have been, so just enabling CoDel without setting bandwidth is probably doing something, just not as effective as in conjunction with settings your bandwidth.

                          Just wondering, what was your ping during saturation when you have your bandwidth set?

                          I've been all over the place and probably gave some false information (because I am new to this and didn't really understand what I was doing).  Anyway, let me try and clear up my findings:

                          1. No traffic shaping, all bandwidth available - ping 10ms
                          2. No traffic shaping, download saturated - ping 60ms
                          3. No traffic shaping, upload saturated - ping 500+ms

                          4. CODEL active with no bandwidth limit set - all pings same as scenarios 1,2 & 3.

                          5. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, all bandwidth available - ping 10ms
                          6. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, download saturated - ping 60ms
                          7. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, upload saturated - ping 50 to 80ms

                          So it does work, although during a saturated upload I notice my VoIP phone going a bit "robotic", but much improved over no traffic shaping (VoIP calls would be largely unusable).  Did not have that issue with PRIQ when prioritizing VoIP as first in line.  That being said, CODEL is much easier to setup and it looks like it doesn't completely starve other queues like PRIQ.  I'm sticking with CODEL.

                          Interested to see if FQ_CODEL will make my pings even lower.  Will test it as soon as it is available in pfsense.

                          1 Reply Last reply Reply Quote 0
                          • H
                            Harvy66
                            last edited by

                            @tuffcalc

                            Thanks for the info. I've done my fair share of "false" information with good intentions. It happens.

                            Yes, the whole PRIQ replacement is kind of interesting. The eventual fq_codel will actually do similar things of PRIQ, but better for general usage. Except in the case where you need certain traffic to always get priority, fq_codel will do what most people want, keep latency low without the hassle of floating rules.

                            1 Reply Last reply Reply Quote 0
                            • jimpJ
                              jimp Rebel Alliance Developer Netgate
                              last edited by

                              @tuffcalc:

                              @Harvy66:

                              @tuffcalc:

                              @Harvy66:

                              @tuffcalc:

                              I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

                              Try settings your WAN rate to about 95% of your stable upload rate and see what happens.

                              That fixed it…

                              Well, 200ms is a lot less than what I thought it would have been, so just enabling CoDel without setting bandwidth is probably doing something, just not as effective as in conjunction with settings your bandwidth.

                              Just wondering, what was your ping during saturation when you have your bandwidth set?

                              I've been all over the place and probably gave some false information (because I am new to this and didn't really understand what I was doing).  Anyway, let me try and clear up my findings:

                              1. No traffic shaping, all bandwidth available - ping 10ms
                              2. No traffic shaping, download saturated - ping 60ms
                              3. No traffic shaping, upload saturated - ping 500+ms

                              4. CODEL active with no bandwidth limit set - all pings same as scenarios 1,2 & 3.

                              5. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, all bandwidth available - ping 10ms
                              6. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, download saturated - ping 60ms
                              7. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, upload saturated - ping 50 to 80ms

                              So it does work, although during a saturated upload I notice my VoIP phone going a bit "robotic", but much improved over no traffic shaping (VoIP calls would be largely unusable).  Did not have that issue with PRIQ when prioritizing VoIP as first in line.  That being said, CODEL is much easier to setup and it looks like it doesn't completely starve other queues like PRIQ.  I'm sticking with CODEL.

                              Interested to see if FQ_CODEL will make my pings even lower.  Will test it as soon as it is available in pfsense.

                              Out of curiosity, which exact places do you have CoDel active for? As the shaper discipline for the interface, or using HFSC with "Codel Active Queue" on specific queues? And if the latter, which queues?

                              The more good/working examples we can get the better, I can put them up on the wiki for future reference.

                              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                              Need help fast? Netgate Global Support!

                              Do not Chat/PM for help!

                              1 Reply Last reply Reply Quote 0
                              • T
                                tuffcalc
                                last edited by

                                @jimp:

                                @tuffcalc:

                                @Harvy66:

                                @tuffcalc:

                                @Harvy66:

                                @tuffcalc:

                                I take back what I said about Codel.  When I saturate the upload fully for a long period of time my pings still shoot through the roof (200+ ms).

                                Try settings your WAN rate to about 95% of your stable upload rate and see what happens.

                                That fixed it…

                                Well, 200ms is a lot less than what I thought it would have been, so just enabling CoDel without setting bandwidth is probably doing something, just not as effective as in conjunction with settings your bandwidth.

                                Just wondering, what was your ping during saturation when you have your bandwidth set?

                                I've been all over the place and probably gave some false information (because I am new to this and didn't really understand what I was doing).  Anyway, let me try and clear up my findings:

                                1. No traffic shaping, all bandwidth available - ping 10ms
                                2. No traffic shaping, download saturated - ping 60ms
                                3. No traffic shaping, upload saturated - ping 500+ms

                                4. CODEL active with no bandwidth limit set - all pings same as scenarios 1,2 & 3.

                                5. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, all bandwidth available - ping 10ms
                                6. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, download saturated - ping 60ms
                                7. CODEL active (WAN side only) with bandwidth limit set at 98% of uplink speed, upload saturated - ping 50 to 80ms

                                So it does work, although during a saturated upload I notice my VoIP phone going a bit "robotic", but much improved over no traffic shaping (VoIP calls would be largely unusable).  Did not have that issue with PRIQ when prioritizing VoIP as first in line.  That being said, CODEL is much easier to setup and it looks like it doesn't completely starve other queues like PRIQ.  I'm sticking with CODEL.

                                Interested to see if FQ_CODEL will make my pings even lower.  Will test it as soon as it is available in pfsense.

                                Out of curiosity, which exact places do you have CoDel active for? As the shaper discipline for the interface, or using HFSC with "Codel Active Queue" on specific queues? And if the latter, which queues?

                                The more good/working examples we can get the better, I can put them up on the wiki for future reference.

                                It's active only for the shaper discipline for the WAN interface.

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

                                  It's active only for the shaper discipline for the WAN interface.

                                  OK.  Now I'm confused.  If codel has no knobs, what is actually doing the shaping based on the bandwidth 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
                                  • H
                                    Harvy66
                                    last edited by

                                    @Derelict:

                                    It's active only for the shaper discipline for the WAN interface.

                                    OK.  Now I'm confused.  If codel has no knobs, what is actually doing the shaping based on the bandwidth value?

                                    CoDel is not a traffic shaper, it does not do any rate limiting, that is the job of your rate limiter. All CoDel does is figure out which packets to dequeue next or which to drop.

                                    See my quotes from the makers of CoDel

                                    https://forum.pfsense.org/index.php?topic=88162.msg488220#msg488220

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

                                      Exactly.

                                      The question I have is why tuffcalc sees a difference in behavior when he sets a bandwidth value of 98% of his upload when his scheduler type is CODELQ?

                                      As I understand codel, it should make no difference, so what is actually doing the shaping?  Is it built into altq itself absent any HFSC, PRIQ, etc?

                                      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
                                      • H
                                        Harvy66
                                        last edited by

                                        Ahh.. I assumed PFSense/FreeBSD had a built in interface rate limiter that functioned separately of queue management like AQMs or shapers. To me, they are all orthogonal problems. The interface can be rate limited and not care about how queues are implemented, how many queues there are, or which queue to dequeue next. Traffic shapers can decide which queues to pull from and how fast to dequeue those queues, and AQMs can decide which packet to dequeue from a given queue.

                                        Interface->InterfaceRateLimiter->TrafficShaper(HFSC)->AQM(CoDel)

                                        Like a pipeline, with none needing to know anything about the others. Not to say this is how it is implemented, but it could be implemented this way as none of them have any overlap or unique dependencies on each other. Some traffic shapers may need to know how fast to expect the interface to dequeue from them.  HFSC might not actually be really "limiting", it might be just "scheduling", while the interface limiter might be doing the limiting. I'm not sure about implementation details, just looking at it from an abstract point of view and what could be done. I am ignoring the fact that HFSC does have the notion of an upper bound, but ignoring that, pretty much all other features of HFSC could be done without any rate limiting, only scheduling.

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

                                          This is what I get when I set scheduler type to CODELQ and a 900Mbit bandwidth:

                                          altq on  em0_vlan1003 codelq bandwidth 900Mb queue

                                          Absent any other requirements, that is probably sufficient to eliminate any buffer bloat one might have at their ISP (assuming bandwidth set to about 90-95% of reasonably-expected uplink.)

                                          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
                                          • C
                                            cmutwiwa
                                            last edited by

                                            This is a very informative thread, I've been searching this forum on general traffic shaping methods / tricks and I've bookmarked a couple of threads including this one…I'm yet do to my setup, I like doing the research first so I can have an idea of what I'm dealing with.

                                            I have a question tho'; from what I read CoDel is only meant to work (well) with high speed connections? 2.5mbit and above?. I'm currently using a very low ADSL connection 1770kbps down 550kbps up (thats what I get from speedtest although the ISP sells as 2mbit down 1mbit up), would CoDel work for me with this speeds?

                                            I'm looking to upgrade to 10mbit down 2.5mbit up soon but I kindly need to know if CoDel would work for me with my current speeds.

                                            Another question is; I'm I right to assume that CoDel can work side to side with PRIQ and the Limiter (I intend to use the Limiter to implement share bandwidth evenly on LAN as foxale08 has illustrated here; https://forum.pfsense.org/index.php?topic=63531.0 )

                                            Regards.

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