摘要 |
A communication protocol stack apparatus and method determine the aggregate maximum header and trailer lengths(H, T) and a payload size(P) for each layer of the protocol stack and pre-allocate for each layer one or more buffers of a length equal to the sum of "H", "T" and "P". The layer copies receiving data into the pre-allocated buffer at a position determined by "H", and copies its header and trailer immediately before and after the data in the buffer. The layer sets two references. The next lower layer copies its header and trailer into the buffer at the positions determined by the references and updates the references. The process is repeated until the lowest layer and data between the references is copied to a physical device for transmission.
|