The Network Protocol Stack

team bbl


To understand the need for network tuning, it helps to have a picture of how the operating system takes data from the application and sends it to a remote host, and does the reversehow it receives data from a remote host on the network and delivers it to a local application.

The parts of the operating system that handle networking operations are fairly modular in nature, with different layers handling clearly separated functions, implemented by various protocols. A collection of layers from the application interface down to the device interface is referred to as the protocol stack. The TCP/IP protocol family is the most widely used protocol suite. Together with the socket layer and the device driver, it makes up the typical network protocol stack.

The socket abstraction layer is the common kernel interface to the application. To open a communication channel with remote (or local) hosts, the application creates a socket, which contains, among other infrastructure, buffers used to hold the data that is read and written by the application.

The transport layer makes available two different protocols: TCP (transport control protocol) and UDP (user datagram protocol), which provide reliable, connection-oriented and unreliable, connectionless types of traffic, respectively. In the case of TCP sockets, the TCP protocol takes the data written to the socket by the application and ensures that the data is bundled into segments, sent reliably to the other end, retransmitting data that is lost, and maintaining control over the flow of data to minimize congestion on the network.

The transport layer then hands the segmented data to the IP layer, which implements typical network layer functions such as routing the data packets to the end point successfully. IP hands off the data packet to the network device driver, which ensures that the data is transferred to the hardware. Each layer encapsulates the data with its own headers containing protocol-specific information.

In the reverse direction, when a frame is received over the network, the network card generates an interrupt to the kernel, which then invokes an interrupt handler to transfer the packet from the card to kernel memory and schedules the packet to be processed by the network stack. The incoming packet is queued for delivery to the network layers in a device-specific queue. IP delivers a data packet for the application to the TCP layer, which places it in the correct socket read buffer if the packet is successfully validated at each stage.

    team bbl



    Performance Tuning for Linux Servers
    Performance Tuning for Linux Servers
    ISBN: 0137136285
    EAN: 2147483647
    Year: 2006
    Pages: 254

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