Designing Embedded Communications Software

Buffers are used for the interchange of data among modules in a communications system. Timers are used for keeping track of timeouts for messages to be sent, acknowledgements to be received, as well as for aging out of information in tables. A strategy for Buffer and Timer Management are essential for the communications software subsystem; this chapter covers these two topics in detail.
Buffers are used for data interchange among modules in a communications system. The data may be control or payload information and is required for system functioning. For example, when passing data from one process to another, a buffer may be allocated and filled in by the source process and then sent to the destination process. In fact, the buffer scheme in some operating systems evolved from inter-process communications (IPC) mechanisms.
The basic premise of buffer management in communications systems is to minimize data copying. The performance of a system is brought down dramatically if it spends a significant amount of CPU and memory bandwidth in copying data between buffers. The various techniques for buffer management build on this premise.
Buffer management is the provision of a uniform mechanism to allocate, manipulate and free buffers within the system. Allocation involves obtaining the buffer from the global buffer pool. Manipulation includes copying data to a buffer, copying data from a buffer, deleting data from anywhere in the buffer beginning, middle, or end, concatenating two buffers, duplicating buffers, and so on. Freeing buffers returns the buffers to...