next up previous
Next: Buffer management Up: Implementation Previous: Implementation

The Buffers

Both \ensuremath{PBuf} and \ensuremath{IBuf} are circular buffers of $N$ fixed size slots, with $N$ a configurable constant. \ensuremath{PBuf} slots are large enough to hold maximum-size packets, while the slots in the index buffers hold two 32 bit values: an index in \ensuremath{PBuf} and the packet's `classification result' (the value returned by the filter). A packet is considered `interesting' if the filter returns a non-zero result.

Applications read packets of a flow by indexing \ensuremath{PBuf} of filter $f$ with the values in \ensuremath{IBuf}. By default, network packets are stored in \ensuremath{PBuf} from the link layer up. As applications access the index buffers, classification results are immediately available, normally within the same cache line. Although the indices point only to the packets in which they are interested, applications are able to see packets received by all others in the same flow group (but not those received by other groups).


Herbert Bos 2004-10-06