Subject: Re: Socket buffer accounting and TCP
To: Stefan Grefen <grefen@hprc.tandem.com>
From: Charles M. Hannum <mycroft@mit.edu>
List: tech-kern
Date: 09/03/1998 11:21:26
> If the mbufs have no room (or not much) than we're wasting headers
> and can start compressing to reclaim the header space if the amount of
> wasted headerspace is a certain percentage of buffered data. 
>
> If there is a mbuf with lots of space (eg. the new one fits in) then we can 
> compress immediatly.  

Obviously you're missing the point.  We don't want to do extra copies;
they're a waste of CPU time.

Consider, for example, a news server or mail server at an ISP, with
lots of clients connected via PPP (with small MTUs), all doing PMTU
discovery (which will cause lots of small segments to be received).
This is a very real case -- or at least will be more so when PMTU
discovery is more widely deployed.

In this case, almost all the packets are much smaller than the mbuf
size, so you're going to end up always copying the data an extra time.
This really screws your network layer performance.

This *can* be fixed, with largely the same mechanism one might use to
implement zero-copy socket buffering, but it's not trivial.