AQM/ECN in FreeBSD

After read­ing Jim Get­tys inves­ti­ga­tions about the prob­lems cur­rent buffer sizes of net­work equip­ment pro­voke (which may even have impli­ca­tions in the net neu­tral­i­ty debate), I had a look at which active queue man­age­ment (AQM) algo­rithms with or with­out explic­it con­ges­tion noti­fi­ca­tion (ECN) FreeB­SD supports.

It looks like there is not much imple­ment­ed (if the best solu­tion would be imple­ment­ed, it would not mat­ter how much there is, but unfor­tu­nate­ly there is no best solu­tion). Oth­er sys­tems offer more. RED is imple­ment­ed, but even the inventor/researcher of RED thinks the algo­rithm needs some improve­ments (he is in the process of prepar­ing a paper about this, as Jim Get­tys reveals). Blue/SFBlue is not imple­ment­ed (a more turnkey-solution than the cur­rent RED imple­men­ta­tion). PID con­troller (which may or may not be some­thing some­one wants to use in this case… no idea about its pros/cons in this regard, but it is ref­er­enced in the AQM arti­cle on Wikipedia) is also not implemented.

Regard­ing ECN for FreeB­SD you can find more or less no real doc­u­men­ta­tion in the net (at least with a sim­ple “ECN FreeB­SD” search). It is imple­ment­ed for the RED algo­rithm, but as the RED algo­rithm needs some tuning/setup, this is not a turnkey solu­tion. There is a ECN relat­ed sysctl, but I do not have the impres­sion that this is a turnkey-solution which mag­i­cal­ly gen­er­ates ECN mes­sages with­out using dum­mynet for AQM.

From my cur­rent under­stand­ing (but I think I do not know a lot about this top­ic) it looks like AQM is a fea­ture most peo­ple would like to have acti­vat­ed by default (with an appro­pri­ate algo­rithm which does not need tun­ing to pro­duce a good enough result). If this is cor­rect, it is a shame that FreeB­SD does not acti­vate AQM with an algo­rithm which is not bad for most cas­es by default (with the option to change the algo­rithm and to dis­able com­plete­ly). If my under­stand­ing is not cor­rect, I would like to get a hit with the clue bat please.

6 thoughts on “AQM/ECN in FreeBSD”

  1. Altq has imple­men­ta­tion of these AQM.
    But the issue is still the same it does not play well with multiqueue.

  2. You are con­fus­ing router ECN with host ECN. Host ECN is what I imple­ment­ed and it works fine. Router ECN is avail­able with RED on ALTQ.

    1. So the sysctl is host ECN, and the altq part is router ECN? If yes, what pre­vents us from enabling host ECN by default (what are the draw­backs), either by switch­ing the sysctl or via a rc.conf set­ting? I am aware that no rc.conf sup­port exists yet, but IMO this would be easy to write.

      What is the dif­fer­ence between host ECN and router ECN? For me (with just the Wikipedia-knowledge about ECN) it looks like in both cas­es a sys­tem should look if any buffer involved passed a spe­cif­ic fill-level and then send a ECN mes­sage. I can under­stand that dif­fer­ent AQM algo­rithms may want to mod­i­fy the ECN trig­ger level/behavior, so it is maybe a lit­tle bit more com­pli­cat­ed, but from a big pic­ture view I assume this is what is hap­pen­ing and I do not see a dif­fer­ence between host and router behavior.

      Can someome please shed some light on it. An URL would be sufficient.

  3. The router only marks the ECN packets
    The hosts set­up ECN between them­selves and they are respon­si­ble for throt­tling the tcp win­dow down when they see marked packets.
    No one turns ECN by default because mid­dle­box­es don’t under­stand the new option and will reject ECN packets.

  4. Con­nec­tions take longer to estab­lish because the mid­dle box­es will drop ECN SYN pack­ets. On FreeB­SD we stop using ECN after the third SYN retrans­mis­sion, but if we are load­ing a web­page with 100 images it will take a lot longer.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.