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

      I love that new speed test. Should I have not been seeding 30Mb/s while running this test? lololol

      1 Reply Last reply Reply Quote 0
      • N
        Nonsense
        last edited by

        Nullify wrote:

        "Just make sure that your pfSense router is the slowest part of your upload and download traffic."

        So, in order to do that, should I use the traffic shaping wizard (where CoDel is not an option) to set my bandwidth (and leave all other settings on default, since I don't need to prioritize traffic), or should I use the CODELQ option under "By Interface?"

        Someone really should write the book, pfSense for Dummies.

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

          You shouldn't even need to use the wizard. Just click on  your WAN interface, set your bandwidth, and set it to codel.

          Another thing you could try is to set your interface to fairq, create a child queue, set as the default, then configure that queue to be codel.

          1 Reply Last reply Reply Quote 0
          • N
            Nullity
            last edited by

            First run some download/upload tests to get a baseline. Subtract about 5-10%, and use thagt as your bandwidth for your manually setup WAN and LAN queues using CODELQ.

            Run down/upload test to confirm that you are seeing queues registering some packets.

            I was a pfSense/networking noob a few months ago. This forum, the official book, the official wiki, and the interweb in general has about a decade of pfSense knowledge just waiting to be read. :)

            Please correct any obvious misinformation in my posts.
            -Not a professional; an arrogant ignoramous.

            1 Reply Last reply Reply Quote 0
            • N
              Nonsense
              last edited by

              Thanks all, but as my upload speed seems to vary quite a bit, no changes I make to traffic shaping seem to have much of an effect.  I'll likely have to wait for a faster internet connection before I am able to put these tools to good use–I might have to wait quite a long time, given my ISP's disinterest in improving its service.

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

                Set your upload speed 80% of your "normal" max speed. It will help more than not doing anything.

                1 Reply Last reply Reply Quote 0
                • superweaselS
                  superweasel
                  last edited by

                  @Nonsense:

                  Nullify wrote:

                  "Just make sure that your pfSense router is the slowest part of your upload and download traffic."

                  So, in order to do that, should I use the traffic shaping wizard (where CoDel is not an option) to set my bandwidth (and leave all other settings on default, since I don't need to prioritize traffic), or should I use the CODELQ option under "By Interface?"

                  Someone really should write the book, pfSense for Dummies.

                  +1 for pfSense for Dummies.

                  Sometimes you just want a clear and concise example and not to spend hours, days or even weeks combing the forum for that needle in a haystack answer.

                  pfSense rig: pfSense SG-4860/120GB SSD
                  WAN: CenturyLink Gigabit Fiber

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

                    Just wait 2-3 days. The same questions get asked over and over.

                    1 Reply Last reply Reply Quote 0
                    • N
                      Nonsense
                      last edited by

                      O.K., I set my WAN to use CODELQ with an upload speed of 800 kb/s.  I, however, still get a "D" in relation to buffer bloat on the DSL Reports speed test. :P  Do I need to reboot pfSense for the traffic shaping to take effect (it does not say so)?

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

                        Can you show us your config? I assume you have something simple. Maybe just a screenshot of your WAN interface under Traffic Shaping would be good.

                        I assume you have slightly more than 800Kb/s of upload bandwidth?

                        1 Reply Last reply Reply Quote 0
                        • N
                          Nonsense
                          last edited by

                          As per your request:

                          WAN.png
                          WAN.png_thumb

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

                            You need to check "Enable/Disable Discipline and its children".

                            1 Reply Last reply Reply Quote 0
                            • N
                              Nonsense
                              last edited by

                              Yes, of course, my oversight, thanks.  Now I get a "C" in relation to buffer bloat on the DSL Reports speed test.  It appears that download has the most effect on the score.

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

                                Do the same thing for your LAN interface, except your LAN bandwidth will be whatever your download speed is.

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

                                  I was wondering if it could be possible for someone to create two new versions of codel in PFSense, one for low bandwidth connections and one for high bandwidth.

                                  Codel has two parameters. something like a target latency and an interval, which for normal codel is something like 5ms and 100ms. They recommend 0.5ms and 50ms for 40Gb NICs. We may want a less aggressive one for low bandwidth connections, like 1Mb, so maybe 30ms and 150ms. I have no idea what number, just something less aggressive than 5ms on a 1Mb link trying to push a 1500byte packet.

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

                                    In theory, the only thing that needs to get changes are those two numbers.

                                    1 Reply Last reply Reply Quote 0
                                    • N
                                      Nonsense
                                      last edited by

                                      "Do the same thing for your LAN interface, except your LAN bandwidth will be whatever your download speed is."

                                      Done, thanks, now my score is a "B."

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

                                        You could try switching to fairq instead of codel and see how your milage goes.

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

                                          looks like 20ms target may be better for cable modems with a 150 interval, because of how buffering and scheduling works with DOCSIS. The modem needs to see a certain amount of backlog in the buffer in order to schedule more time, so a small target latency can artificially reduce buffering too much for DOCSIS. This may or may not be an issue for the router but the modem. But it does bring up possibilities where different target latencies for codel would be nice.

                                          1 Reply Last reply Reply Quote 0
                                          • N
                                            Nullity
                                            last edited by

                                            @Harvy66:

                                            I was wondering if it could be possible for someone to create two new versions of codel in PFSense, one for low bandwidth connections and one for high bandwidth.

                                            Codel has two parameters. something like a target latency and an interval, which for normal codel is something like 5ms and 100ms. They recommend 0.5ms and 50ms for 40Gb NICs. We may want a less aggressive one for low bandwidth connections, like 1Mb, so maybe 30ms and 150ms. I have no idea what number, just something less aggressive than 5ms on a 1Mb link trying to push a 1500byte packet.

                                            If I read the source code properly, pfSense's CoDel implementation supports both "target" ("qlimit" in pfSense) and "interval" but not the GUI. I have no idea what the standard practice is for manually editing the pfSense pf.conf/rules.debug. Here is the pfSense source: https://github.com/doktornotor/pfsense-tools/blob/master/patches/RELENG_10_0/altq_codel.diff#L126
                                            (Is there no better way to show pfSense source-code than this repo?)

                                            I will test a 20ms target and see if it changes anything. I thought the problems with CoDel and <768Kbit  connections was caused by more than an undersized target value… cannot hurt to try and see though! :)

                                            Please correct any obvious misinformation in my posts.
                                            -Not a professional; an arrogant ignoramous.

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