Buffer Pool
Note: the buffer management strategy is unlikely to remain fixed. The current implementation uses a pool of several sized buffers, but we are interested in an m_buf-like strategy in the future. Obviously this has implications throughout the entire stack.
The buffer pool is how applications manage the larger buffers needed for sending and receiving IP packets. There are currently three sizes of buffers: 70, 256, and 1280 bytes. The number of each size is fixed at compile time in IPDispatchC. The BufferPool interface is very simple.
interface BufferPool {
command ip_msg_t *get(buffer_size_t sz);
command void put(ip_msg_t *buf);
}
Although there is only one buffer pool for all applications, different stack components may implement the interface on top of the bare one provided by BufferPoolC. For instance, applications sending UDP packets should use the BufferPool interface provided by UDPC, as it adds the necessary size for the IP and UDP headers.
