Using Zero-Copy Buffer Functions

 < Day Day Up > 



Buffer copies within protocol stacks are commonly one of the largest performance drains. In a typical TCP/IP stack, a packet is copied from the physical device and then again, between the Sockets layer and the Application layer. Those two copies waste the computing capacity of the processor and should, therefore, be avoided (see Figure 7.5). Newer TCP/IP stacks provide a zero-copy option whereby the initial (potential) buffer copy targets a buffer in the application space. The application then simply passes the pointer of the buffer to the Application layer and no copy is performed.

click to expand
Figure 7.5: Illustrating buffer copies in a traditional TCP/IP stack.

Newer protocols such as RDMA (Remote Direct Memory Access) take this concept to the next level by not only providing buffers to the stack, but also providing a means to reserve them from the peer.



 < Day Day Up > 



BSD Sockets Programming from a Multi-Language Perspective
Network Programming for Microsoft Windows , Second Edition (Microsoft Programming Series)
ISBN: 1584502681
EAN: 2147483647
Year: 2003
Pages: 225
Authors: Jim Ohlund

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net