[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create shaper_bufferbloat.rst guide #571

Merged
merged 19 commits into from
Jun 21, 2024

Conversation

SeimusS
Copy link
Contributor
@SeimusS SeimusS commented Jun 9, 2024

Created a guide for FQ_CoDeL to combat Bufferbloat on OPNsense. There are several posts on forum and internet with wrong settings. This should provide proper configuration with optional tuning of FQ_C.

Created a guide for FQ_CoDeL to combat Bufferbloat on OPNsense. There are several posts on forum and internet with wrong settings. This should provide proper configuration with optional tuning of FQ_C.
Adjusted some wording and meaning
Had twice 2b > changed to 2a
Added sites for testing bufferbloat
Bufferbloat results after FQ_CoDel configuration and tuning
added shaper_bufferbloat to how-to page
@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 9, 2024

I tried to make the guide bit more informative as well provide additional information on the parameters. As it looks like a lot of users do something without knowing why. Or try to look what a parameter does but its hard to find.

P.S. This is my 1st official pull request ever, if there is something wrong let me know I will try to adjust it to my best knowledge.

Adjusted wording and hopefully last typo
* Adjusted some explanation for interval & target
* Added flows parameter into tuning and important parameters
* Added official FQ_C RFC
* Typos
@AdSchellevis AdSchellevis added the feature Adding new functionality label Jun 10, 2024
@AdSchellevis AdSchellevis self-assigned this Jun 10, 2024
@Monviech
Copy link
Member
Monviech commented Jun 10, 2024

I am using such a setup to fight bufferbloat on my asymmetric DSL. (250/40)

What helped me additionally was creating an additional Shaper rule, that matches "tcp (ACK packets only)" and targeting them with an own "Queue TCP ACK Upload" queue with the highest weight (100), which is part of the Upload Pipe that has CoDel enabled.

This seems to reduce latency of TCP handshakes when the Upload is heavily used.

I didn't measure anything though, I've just read at a few places that it would be a good choice to do.

As reference, here is my whole shaper config, I don't know how many forum posts I've read but I think it's pretty close to your docs, with more pipes and queues for better traffic shaping.

    <TrafficShaper version="1.0.3">
      <pipes>
        <pipe uuid="bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8">
          <number>10000</number>
          <enabled>1</enabled>
          <bandwidth>220</bandwidth>
          <bandwidthMetric>Mbit</bandwidthMetric>
          <queue/>
          <mask>none</mask>
          <buckets/>
          <scheduler>fq_codel</scheduler>
          <codel_enable>1</codel_enable>
          <codel_target>5</codel_target>
          <codel_interval>100</codel_interval>
          <codel_ecn_enable>1</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <fqcodel_quantum>1514</fqcodel_quantum>
          <fqcodel_limit>1000</fqcodel_limit>
          <fqcodel_flows>1024</fqcodel_flows>
          <origin>TrafficShaper</origin>
          <delay/>
          <description>Pipe 220 Mbits Download </description>
        </pipe>
        <pipe uuid="6bcf9e9c-81c2-4e59-9649-339b35b1194e">
          <number>10001</number>
          <enabled>1</enabled>
          <bandwidth>40</bandwidth>
          <bandwidthMetric>Mbit</bandwidthMetric>
          <queue/>
          <mask>none</mask>
          <buckets/>
          <scheduler>fq_codel</scheduler>
          <codel_enable>1</codel_enable>
          <codel_target>5</codel_target>
          <codel_interval>100</codel_interval>
          <codel_ecn_enable>1</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <fqcodel_quantum>1514</fqcodel_quantum>
          <fqcodel_limit>1000</fqcodel_limit>
          <fqcodel_flows>1024</fqcodel_flows>
          <origin>TrafficShaper</origin>
          <delay/>
          <description>Pipe 40 Mbits Upload</description>
        </pipe>
      </pipes>
      <queues>
        <queue uuid="d523ae29-1925-4ba6-89ed-b6e4a0f9e120">
          <number>10000</number>
          <enabled>1</enabled>
          <pipe>bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8</pipe>
          <weight>90</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue DNS Download</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="4c74bc97-7e86-4127-885b-fd8fcf14eece">
          <number>10001</number>
          <enabled>1</enabled>
          <pipe>bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8</pipe>
          <weight>100</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue TCP ACK Download</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="1a62264f-e634-44b1-9c6a-b37d338f1daa">
          <number>10002</number>
          <enabled>1</enabled>
          <pipe>bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8</pipe>
          <weight>1</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue Any Download</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="2640ab36-2318-46d7-94e0-687ab2e45a73">
          <number>10003</number>
          <enabled>1</enabled>
          <pipe>6bcf9e9c-81c2-4e59-9649-339b35b1194e</pipe>
          <weight>100</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue TCP ACK Upload</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="7e0c9a63-5ddc-425a-8e31-15c084a50984">
          <number>10004</number>
          <enabled>1</enabled>
          <pipe>6bcf9e9c-81c2-4e59-9649-339b35b1194e</pipe>
          <weight>90</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue DNS Upload</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="24410501-b253-4d14-82b5-c458250ee2ef">
          <number>10005</number>
          <enabled>1</enabled>
          <pipe>6bcf9e9c-81c2-4e59-9649-339b35b1194e</pipe>
          <weight>1</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue Any Upload</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="55294006-5142-4778-b830-642d3d4bb258">
          <number>10006</number>
          <enabled>1</enabled>
          <pipe>6bcf9e9c-81c2-4e59-9649-339b35b1194e</pipe>
          <weight>70</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue SSH Upload</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="e52619e0-e3cd-483a-b71f-ca975a4c8b9d">
          <number>10007</number>
          <enabled>1</enabled>
          <pipe>bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8</pipe>
          <weight>70</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue SSH Download</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="4198aac7-34bb-42a0-9899-85054fd2216d">
          <number>10008</number>
          <enabled>1</enabled>
          <pipe>6bcf9e9c-81c2-4e59-9649-339b35b1194e</pipe>
          <weight>20</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue TCP Upload</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="7b28af34-2ca5-4830-9815-6ed365cdc697">
          <number>10009</number>
          <enabled>1</enabled>
          <pipe>bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8</pipe>
          <weight>20</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue TCP Download</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="ae7e74aa-df43-49c0-b806-14e348b6beb9">
          <number>10010</number>
          <enabled>1</enabled>
          <pipe>bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8</pipe>
          <weight>10</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue UDP Download</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="b1d15e66-4fb7-45bb-80e7-924167c4106b">
          <number>10011</number>
          <enabled>1</enabled>
          <pipe>6bcf9e9c-81c2-4e59-9649-339b35b1194e</pipe>
          <weight>10</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue UDP Upload</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="98f3acf7-b46a-465e-a772-094fff00c27f">
          <number>10012</number>
          <enabled>1</enabled>
          <pipe>6bcf9e9c-81c2-4e59-9649-339b35b1194e</pipe>
          <weight>80</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue IPSEC Upload</description>
          <origin>TrafficShaper</origin>
        </queue>
        <queue uuid="801c81c2-49c4-493a-b164-a07203d2bb28">
          <number>10013</number>
          <enabled>1</enabled>
          <pipe>bbd488dd-f2e9-4bed-8f9b-8004fc53b0e8</pipe>
          <weight>80</weight>
          <mask>none</mask>
          <buckets/>
          <codel_enable>0</codel_enable>
          <codel_target/>
          <codel_interval/>
          <codel_ecn_enable>0</codel_ecn_enable>
          <pie_enable>0</pie_enable>
          <description>Queue IPSEC Download</description>
          <origin>TrafficShaper</origin>
        </queue>
      </queues>
      <rules>
        <rule uuid="f67871da-1811-41cc-883f-1d3d51b7e75c">
          <enabled>1</enabled>
          <sequence>1</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>tcp_ack</proto>
          <iplen>100</iplen>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>out</direction>
          <target>2640ab36-2318-46d7-94e0-687ab2e45a73</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="4d66e23a-156b-472c-b234-472953f79fc4">
          <enabled>1</enabled>
          <sequence>2</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>tcp_ack</proto>
          <iplen>100</iplen>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>in</direction>
          <target>4c74bc97-7e86-4127-885b-fd8fcf14eece</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="2cee51e3-4adf-471c-a945-7aadc5ccc000">
          <enabled>1</enabled>
          <sequence>3</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>udp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>53</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>out</direction>
          <target>7e0c9a63-5ddc-425a-8e31-15c084a50984</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="d4eb7fd5-20ec-4d4f-b8ba-a2de745335cb">
          <enabled>1</enabled>
          <sequence>4</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>udp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>53</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>in</direction>
          <target>d523ae29-1925-4ba6-89ed-b6e4a0f9e120</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="fbf3bc8f-8920-4152-afcf-a331a661d245">
          <enabled>1</enabled>
          <sequence>5</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>udp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>4500</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>out</direction>
          <target>98f3acf7-b46a-465e-a772-094fff00c27f</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="50282642-4e32-4a52-ac86-63ccc1037e31">
          <enabled>1</enabled>
          <sequence>6</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>udp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>4500</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>in</direction>
          <target>801c81c2-49c4-493a-b164-a07203d2bb28</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="be073f60-c462-416f-9b97-82ef8f8fb7f5">
          <enabled>1</enabled>
          <sequence>7</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>tcp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>22</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>out</direction>
          <target>55294006-5142-4778-b830-642d3d4bb258</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="a8566dbc-89d8-42ba-9c8c-f496421d28e2">
          <enabled>1</enabled>
          <sequence>8</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>tcp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>22</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>in</direction>
          <target>e52619e0-e3cd-483a-b71f-ca975a4c8b9d</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="916fc7ed-4070-4d9b-ab6d-d5001c92880c">
          <enabled>1</enabled>
          <sequence>9</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>tcp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>out</direction>
          <target>4198aac7-34bb-42a0-9899-85054fd2216d</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="f5ab93f3-52e4-4f37-956f-b00052c7ab40">
          <enabled>1</enabled>
          <sequence>10</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>tcp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>in</direction>
          <target>7b28af34-2ca5-4830-9815-6ed365cdc697</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="4d86c159-3d9a-47b5-90f3-8432b0a7d01f">
          <enabled>1</enabled>
          <sequence>11</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>udp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>out</direction>
          <target>b1d15e66-4fb7-45bb-80e7-924167c4106b</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="716e6712-864f-45c2-8c15-f807965dc7c1">
          <enabled>1</enabled>
          <sequence>12</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>udp</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>in</direction>
          <target>ae7e74aa-df43-49c0-b806-14e348b6beb9</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="b90df043-8cbc-4034-8150-2fe8d0287e55">
          <enabled>1</enabled>
          <sequence>13</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>ip</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>out</direction>
          <target>24410501-b253-4d14-82b5-c458250ee2ef</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
        <rule uuid="21b82287-3116-425c-86c7-9e9d8de23c07">
          <enabled>1</enabled>
          <sequence>14</sequence>
          <interface>opt20</interface>
          <interface2/>
          <proto>ip</proto>
          <iplen/>
          <source>any</source>
          <source_not>0</source_not>
          <src_port>any</src_port>
          <destination>any</destination>
          <destination_not>0</destination_not>
          <dst_port>any</dst_port>
          <dscp/>
          <direction>in</direction>
          <target>1a62264f-e634-44b1-9c6a-b37d338f1daa</target>
          <description/>
          <origin>TrafficShaper</origin>
        </rule>
      </rules>
    </TrafficShaper>

@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 10, 2024

I've read somewhere the same. However, I myself with the configuration I have, didn't yet seen/experienced latency on Upload during load, so its hard for me to test and write about it. However Download on my side is somewhat tricky (Due to my ISP's technological limitation)

I think the reason (in this specific case) why this Upload or Download latency may happen is due to the flows parameter, the default 1024 may be in some use-cases too low, which would cause some specific flows classified into same slots (sub-queues), this would cause for them as well a latency if that specific sub-queue is experience it.

Even if increase of flows parameters could improve it, ultimately I think creating a separate Queue for TCP ACK, which with CoDeL will create sub-queues for specific TCP ACK flows, is ultimately better way.

This is just my rough (positive imagination) estimate, but usually the no-knobs deployment for FQ_CoDeL works in 98% of the time if the BW parameter in the Shaper Pipe is set properly. The 2% are then the setups were it needs tuning additional to the out of the box setup of FQ_CoDeL.

I may however maybe try it on Download Pipe to see if there will be improvements. If so we could added it as one of the tuning points into the guide.

I like your Shaper config, very diligent. Thank you for the config.

@mimugmail
Copy link
Member

The problem is that there is no rule of thumb as it heavily depends on media type (LAN, Ethernet, DSL, Satelliten, Cable) and latency. E.g. for cable with variing upload speeds you may hit congestion earlier than your pipe kicks in

@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 10, 2024

You are absolutely right, that's the main problem actually. For Download as well Upload alike.

For the Shaper/Fq_CoDeL to work all the time properly, you need to hit "persistently" the throughput specified in the BW parameter within the Pipe. Which on these technologies is hardly possible sometimes (or most of the time, really depends).

Even thou FQ_CoDeL does have mechanisms such as target & interval (another one is limit but... not usable currently) that measure the delay for each queue and can take action upon it, the fact that you set BW 500 but can reach at a time only 200M will cause a back-pressure which will result in increased latency.

This specific I tested, and the results was even if this happens the latency is still lower with FQ_CoDel in such situation than without FQ_CoDeL at all. The margin in these situation was 50-120ms (with FQ_CoDel) vs 1200-2000ms (without FQ_CoDeL) during congestion time, worst case scenario.

As for the rule of thumb, there is none, but its recommended to target 85% of advertised ISP BW. Which in theory and most cases should include the worst case scenario throughput. However even this recommendation is recommended to take with grain of salt and needs to be tuned accordingly.

Thus doing few runs of Internet speed-tests, to possibly get average throughput and from it target 85% as the BW value in the Shaper is a good start. I would however extent this, to target 85% of the lowest possible throughput as your BW value, if somebody wants to always try prevention of bufferbloat.

The caveat is, the lowest possible that sometimes occurs maybe waaay to low thus you are loosing substantial amount of BW. Its a heavy tradeoff. For example if I have 500M and lowest throughput occurrence sometimes is 200M. I could set 85% of that 200M as the BW in Pipe. But I am cutting myself of 300M possible throughput that I am usually able to get just to prevent the occasional latency.

* Changed some working
* Typos
* More clarified the problem in regards of FQ_CoDeL implementation in BSD, as this is not directly related to limit parameter, but its related to the implementation
*ECN note add
@SeimusS SeimusS marked this pull request as draft June 11, 2024 15:23
@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 11, 2024

I did contact the original creators behind FQ_CoDeL and asked them to give potential review for explanation of FQ_CoDeL & its parameters. They gave me some feedback and tips.

I changed this PR to Draft. I will include their feedback into the How-To. As I want to have this as complete and perfect as possible so the wider audience is well informed, and has at least some grasp on what to configure as baseline and tune further if needed.

I am also retesting and checking further the configuration.

P.S. Also I found a mistake in the config example, the queue for object pipe shouldn't have any values (it has no configuration value), this is used for dynamic queue such as FiFo etc. when we are not specifying any Queue objects. Its not needed as we will create separate queue object binded to the specific Pipe.

Regards,
S.

@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 12, 2024

Few observations/notes from my side (OPNsense configuration):

A. CoDeL can be configured in Pipe

  • If configured in Pipe, standalone Queue object that binds to the Pipe cant be used. Otherwise CoDel will not be applied on the PiPes dynamic queue
  • Enabling the ECN option in Pipe will enable it as well for CoDeL
  • CoDeL is applied to the whole dynamic Queue

B. CoDeL can be configured in Queue

  • standalone Queue object bind to the Pipe
  • Pipe setting CoDel even if checked has no configuration value when standalone Queue objects are configured
  • Enabling the ECN option in Pipe does nothing
  • Enabling the ECN option in Queue will enable it as well for CoDeL

C. FQ_CoDel is configured in scheduler

  • Can be used with dynamic queues as well non dynamic Queues e.g., Create only Pipe with FQ_CoDeL or Pipe + Queue with FQ_CoDeL
  • In theory each Flow is in its own Queue, classified by hashing the 5-tuple
  • You can enable CoDeL in Queue, ipfw shows its configured (FQ_CodeL in scheduler CoDel in Queue) but doesn't bring any benefit
  • Weights in Queues looks like do not have any impact, FQ_CoDeL is not honoring/using it
  • If weighted Queues are needed combination of Codel AQM + (for example) WFQ Scheduler needs to be done
  • MASK setting in Queues (same for Pipes) doesn't have any impact, When removed BW equality behaves the same
  • Enabling the ECN option in Pipe will enable it as well for FQ_CoDeL in scheduler
  • Enabling the ECN option in Queue does nothing (if CoDeL is disabled)

SeimusS and others added 7 commits June 12, 2024 22:40
* Rewrote & adjusted partially some sections (interval & target, quantum)
* Did more testing on configuration using GUI as well ipfw on CLI
* Removed some obsolete configuration options (MASKs, Queue value)
* Explained/Specified better some configuration options
* Added sources (IPFW BSD 14.1 and others)
* Adjusted text formatting
* Corrected result for ping directly from CLI
docs: Richb edits on shaper_bufferbloat.rst
Many editorial changes
Committing an update that includes as well Rich Brown's editorial overhaul with more specific and precise explanation FQ_CoDel:

* Put all the background info for FQ_CoDel at the top

* I made all the lines short. I find it easier to edit, and it's easier to see the changes. (Not so much this time, but in the future. It avoids 200-character lines in a diff where phrases are added and deleted, and you're trying to figure out which words changed...)

* I moved the details of FQ_CoDel out of the tables to the top. Now the tables only contain the critical info about the particular setting (not the entire algorithm)

* In each of the "B" steps, I just said, "Do it like the 'A' step, but use these values." I think it decreases clutter and shows how the A & B steps are similar. It also avoids repetitive instructions that drift apart in subsequent edits. DRY - Don't Repeat Yourself.
* I dropped many of the details of FQ_CoDel machinery (new queues/old queues) since they don't change the settings people need to consider. (Of if they really want to get into it, they should work with the RFC)

*  Made capitalization of "FQ_CoDel" consistent with RFC 8290

* Added screenshots of the "big three" useful speed test websites

* Adjusted explanation in Options for OPNsense configuration
@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 19, 2024

Hello @AdSchellevis

I think I am finished here. I was lucky enough to reach towards FQ_CoDel creators & bufferbloat community. They were kind enough to review fully the docs adjust it and provide more proper details about FQ_CoDel.

Special thanks to @richb-hanover & @dtaht for giving me their time, advice and full review!

P.S. last thing that is needed is just to check for grammar and spelling errors.

Regards,
S.

@SeimusS SeimusS marked this pull request as ready for review June 19, 2024 17:31
I forgot to add the better explanation for FQ_C.
Now all should be in place
Run the text thru a grammar checker in VS Code
Fixing last grammar issues
@AdSchellevis
Copy link
Member

@SeimusS very nice writeup, thanks for contributing it. I'll merge and push it to the docs.

@AdSchellevis AdSchellevis merged commit 210951d into opnsense:master Jun 21, 2024
@richb-hanover
Copy link
Contributor

PS @SeimusS - you're famous(-ish)! https://randomneuronsfiring.com/opnsense-fights-bufferbloat/

Thanks again for letting me contribute.

@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 22, 2024

@richb-hanover hahaha bit unexpected yet lovely of you. Many thanks for mentioning OPNsense (& its official docs for FQ_C) on your blog!

I had fun too.

Regards,
S.

@SeimusS SeimusS deleted the SeimusS-patch-1 branch June 22, 2024 10:19
@SeimusS
Copy link
Contributor Author
SeimusS commented Jun 22, 2024

@AdSchellevis

One question I didn't put the reference for the doc "shaper_bufferbloat" into source/manual/shaping.rst its only in the source/manual/how-tos/shaper.rst.

Which makes it maybe a bit hidden when somebody looks at the Traffic Shaping manual as whole. Is it possible you will additionally put it there as well? Otherwise I can open another PR.

how-tos/shaper_bufferbloat

Regards,
S.

@AdSchellevis
Copy link
Member

@SeimusS I missed that as well, just added 39640f2 which should help.

@richb-hanover
Copy link
Contributor

@AdSchellevis @SeimusS Google Alerts for "bufferbloat" points me to this video:

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

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding new functionality
Development

Successfully merging this pull request may close these issues.

None yet

5 participants