5.1.1 Ethernet Arbitration

if the user-level process isn't already waiting in a read( call with a large enough buffer, the system has to perform a copy. The kernel also still has to process the TCP checksum. while some of this work can be handled by a smart adapter, that just moves part of the protocol stack onto a co-processor, but does not eliminate. When the protocol stack must function with all types of network adapters, zerocopy becomes impossible because of details like byte alignment. The Ethernet header is 14 bytes, which always misaligns the IP header fields. Several research projects have developed methods for direct user-level-program access to the network because modifying the existing socket interface to use a zero-copy mechanism is very difficult. The most notable projects are the Virtual Interface Architecture (VIA) and U-Net, but neither is yet in widespread use.
5.4 Sockets
Sockets are the low-level interface between user-level programs and the operating system and hardware layers of a communication network. They provide a reasonably portable mechanism for two (or more) applications to communicate, and support a variety of addressing formats, semantics and underlying protocols. Sockets were introduced in the BSD 4.2 release of Unix, and are being formally codified by the POSIX 1003.1g Draft standard. Since its introduction, the sockets API has been widely adopted and is available on all modern Unix variants, including Linux. On Linux, the socket API is supported directly by the operating system. but research projects have proposed lower-level, so-called "zero-copy protocols" which would allow applications more direct access to the kernel. See Section 5.3.2 for more details.
The socket API is powerful but not particularly elegant. Many programmers avoid working with sockets directly, opting instead to hide the socket interface behind one or more additional layers of abstraction, e.g., remote procedure calls, or a library like MPI. Nevertheless, our survey of networking would not be complete without a brief introduction to sockets. Readers intending to program with sockets should consult both on-line, e.g., man socket, and printed documentation. The excellent book by Stevens1 has many examples and thoroughly covers the finer points of sockets programming.
The basic idea behind the socket abstraction is that network communication resembles file I/O sufficiently closely that the same system calls can be used for both.
1W. Richard Stevens, Unix Network Programming, 2nd ed., Volume 1: Networking APIs: Sockets and XTI, Prentice Hall, 1997

 



How to Build a Beowulf
How to Build a Beowulf: A Guide to the Implementation and Application of PC Clusters (Scientific and Engineering Computation)
ISBN: 026269218X
EAN: 2147483647
Year: 1999
Pages: 134

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