After read­ing Jim Gettys in­vest­ig­a­tions about the prob­lems cur­rent buf­fer sizes of net­work equip­ment pro­voke (which may even have im­plic­a­tions in the net neut­ral­ity de­bate), I had a look at which act­ive queue man­age­ment (AQM) al­gorithms with or without ex­pli­cit con­ges­tion no­ti­fic­a­tion (ECN) FreeBSD sup­ports.

It looks like there is not much im­ple­men­ted (if the best solu­tion would be im­ple­men­ted, it would not mat­ter how much there is, but un­for­tu­nately there is no best solu­tion). Oth­er sys­tems of­fer more. RED is im­ple­men­ted, but even the inventor/​researcher of RED thinks the al­gorithm needs some im­prove­ments (he is in the pro­cess of pre­par­ing a pa­per about this, as Jim Gettys re­veals). Blue/​SFBlue is not im­ple­men­ted (a more turnkey-​solution than the cur­rent RED im­ple­ment­a­tion). PID con­trol­ler (which may or may not be some­thing someone wants to use in this case… no idea about its pros/​cons in this re­gard, but it is ref­er­enced in the AQM art­icle on Wiki­pe­dia) is also not im­ple­men­ted.

Re­gard­ing ECN for FreeBSD you can find more or less no real doc­u­ment­a­tion in the net (at least with a simple “ECN FreeBSD” search). It is im­ple­men­ted for the RED al­gorithm, but as the RED al­gorithm needs some tuning/​setup, this is not a turn­key solu­tion. There is a ECN re­lated sy­sctl, but I do not have the im­pres­sion that this is a turnkey-​solution which ma­gic­ally gen­er­ates ECN mes­sages without us­ing dummynet for AQM.

From my cur­rent un­der­stand­ing (but I think I do not know a lot about this top­ic) it looks like AQM is a fea­ture most people would like to have ac­tiv­ated by de­fault (with an ap­pro­pri­ate al­gorithm which does not need tun­ing to pro­duce a good enough res­ult). If this is cor­rect, it is a shame that FreeBSD does not ac­tiv­ate AQM with an al­gorithm which is not bad for most cases by de­fault (with the op­tion to change the al­gorithm and to dis­able com­pletely). If my un­der­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 im­ple­ment­a­tion of these AQM.
    But the is­sue is still the same it does not play well with mul­tiqueue.

  2. You are con­fus­ing router ECN with host ECN. Host ECN is what I im­ple­men­ted and it works fine. Router ECN is avail­able with RED on ALTQ.

    1. So the sy­sctl is host ECN, and the altq part is router ECN? If yes, what pre­vents us from en­abling host ECN by de­fault (what are the draw­backs), either by switch­ing the sy­sctl or via a rc.conf set­ting? I am aware that no rc.conf sup­port ex­ists 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 cases a sys­tem should look if any buf­fer in­volved passed a spe­cif­ic fill-​level and then send a ECN mes­sage. I can un­der­stand that dif­fer­ent AQM al­gorithms may want to modi­fy the ECN trig­ger level/​behavior, so it is maybe a little bit more com­plic­ated, but from a big pic­ture view I as­sume this is what is hap­pen­ing and I do not see a dif­fer­ence between host and router be­ha­vi­or.

      Can someo­me please shed some light on it. An URL would be suf­fi­cient.

  3. The router only marks the ECN pack­ets
    The hosts setup ECN between them­selves and they are re­spons­ible for throt­tling the tcp win­dow down when they see marked pack­ets.
    No one turns ECN by de­fault be­cause middle­boxes don’t un­der­stand the new op­tion and will re­ject ECN pack­ets.

  4. Con­nec­tions take longer to es­tab­lish be­cause the middle boxes will drop ECN SYN pack­ets. On FreeBSD we stop us­ing ECN after the third SYN re­trans­mis­sion, but if we are load­ing a webpage with 100 im­ages it will take a lot longer.

Leave a Reply

Your email address will not be published. Required fields are marked *