Subject: Re: Skipping TCP / UDP / IP checksums on loopback traffic
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Jonathan Stone <jonathan@dsg.stanford.edu>
List: tech-net
Date: 10/25/2004 09:59:20
In message <mtu4qkin45x.fsf@contents-vnder-pressvre.mit.edu>,
"Nathan J. Williams" writes:

>But what is the virtue of doing the checksumming in this case at all?
>I see a slight complexity advantage in checksumming everywhere, but
>that's it.

See Jeffrey Hsu's comment about ``faithfully mirror[ing] the same
processing done for physical interfaces'.  Some of us who tweak the
network stack use lo0 as a measurement-proxy for the stack itself,
independent of the vagaries of any particular NIC or LAN.  In my own
little corner of the world, that's the primary purpose for lo0.

[The fact that lo0 may offer higher throughput and lower overhead
than, say, digital-loopback through a physical interface is ...
mere happenstance.]

We could go off on a tangent about sysctls to enable or disable
checkusmming on lo0, and how that leads to two incommensurate sets of
numbers [with checksum, without]; if you care to follow that?

>I'm curious. Having said that the benchmarks this change targets are
>deficient, what is it about your benchmarks for this case that is
>interesting?

What I find interesting are benchmarks that exercise all the normal
processing. Including checksums, header prediction, slow-start, and
any other portions of the stack that have been, or are subsequently
suggeested, as candidates for being elided.

If you *want* a high-speed, low-overhead local IPC transport, then use
PF_LOCAL. That's what it's for.

>Finally, I note that Jason's change included the ever-popular
>sysctl knob for turning the checksumming back on. Would this address
>your concern about your benchmarks? 

Personally, I'd sooner do checksums et. al over lo0, and not include a
sysctl to disable them. I've yet to see a real-world application where
lo0 throughput was a significant factor; but I'm willing to learn.
(large X11 server requests, monster bitmaps, used to be the canonical
example, but those use sysvshm or PF_LOCAL these days.)


>If not, I would like to advocate
>its removal, because from where I stand there's no reason for this
>behavior to be optional.

I see no compelling reason [aside from relative performance in bogus
benchmarks, which I think we agree a bogus reason] to elide the
checksum at all.