Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Sep 2015 12:53:53 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        freebsd-net@FreeBSD.org
Subject:   Re: CoDel and ECN questions
Message-ID:  <201509061953.t86JrsrP077893@gw.catspoiler.org>
In-Reply-To: <201509020450.t824oTKP057556@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On  1 Sep, Don Lewis wrote:
> Bufferbloat on my DSL link to the outside world has been bugging me
> lately.  I was considering adding an OpenWrt box between my DSL modem
> and my FreeBSD firewall in order to get CoDel, when I discovered that
> CoDel had been quietly added to FreeBSD 11.  Unfortunately the
> documentation is severely lacking.  The ALTQ(4) man page mentions CoDel
> and points to pfctl(8) and pf.conf(5) for details, but pf.conf(5)
> discusses cbq, priq, hfsc, and red, but not codel.
> 
> I'm currently using ipfw and not pf, but it looks like ipfw can connect
> to altq, so I'm good there.

... in the outbound direction only.

> I need to limit bandwidth in both directions, but altq only controls
> outbound traffic on an interface, which makes sense.  If this box was
> just forwarding packets between two interfaces, I could also use altq on
> the inward-facing interface to limit download bandwidth to control the
> queue depth on the ISP side of my DSL link.   The problem is that some
> of the inbound traffic terminates on the firewall box itself, and in the
> future I may have more than one inside interface.  Dummynet is able to
> control bandwidth in both directions, but it only implements RED and
> gRED but not CoDel (or at least it's not documented).

In the simple case of a single host downloading via a slow connection,
altq doesn't help at all since it only deals with outgoing packets and
there isn't an outbound interface where it is helpful to limit the
bandwidth.

Looking at the source, it seems that there isn't a CoDel implementation
for dummynet.  It might be interesting to allow dummynet to use altq
queues. That would avoid having to reimplement CoDel for dummynet.

I do want to limit incoming bandwidth.  By setting the inbound bandwidth
limit slightly below my DSL download rate, and by using ECN and/or
dropping packets locally, I can get the remote TCP senders to slow down
and not bloat the buffers at the ISP end of my DSL pipe.  Ideally, my
ISP would fix he bufferbloat problem on their end, but I'm not holding
my breath ...

> The OpenWrt implementation can account for extra per-packet overhead in
> its bandwidth calculations.  That could be significant for me because of
> the additional PPPoE and ATM overhead, which is pretty large for small
> packets. Do we have anything similar?

Doesn't look like we have that.

> Can we combine ECN with CoDel?  Pf.conf(5) says that ECN implies RED.

Looks like the documentation is lagging.  Grepping the source turns up
ECN references in the CoDel source.

> I'm using 6rd and gif(4) for IPv6 connectivity.  Does gif copy the ECN
> bits when encapsulating and decapsulating packets?

The gif and stf man pages say this is an option.

BTW, it would be really nice if net/stf-6rd-kmod was imported.  The port
hasn't been updated to support FreeBSD 10.2, and there is no support at
all for 11.0-CURRENT.  Locally applying the patch to src means losing
freebsd-update support.  Importing this was discussed way back in 2010
and concerns were expressed about this being a waste of time since the
code would be obsolete before the useful end of life of FreeBSD 9.  Five
years later, at the rate that my ISP does technology upgrades, it looks
like I'll be needing 6rd through FreeBSD 10 EOL ...




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509061953.t86JrsrP077893>