Sockets Interface
The kernel structure consists of three layers: the socket layer, the protocol layer, and the device layer.
The socket layer supplies the interface between the subroutines and lower layers, the protocol layer contains the protocol modules used for communication, and the device layer contains the device drivers that control the network devices. Protocols and drivers are dynamically loadable. The Socket Label figure (Figure 1) illustrates the relationship between the layers.

Processes communicate using the client and server model. In this model, a server process, one end point of a two-way communication path, listens to a socket. The client process, the other end of the communication path, communicates to the server process over another socket. The client process can be on another machine. The kernel maintains internal connections and routes data from client to server.
Within the socket layer, the socket data structure is the focus of activity. The system-call interface subroutines manage the activities related to a subroutine, collecting the subroutine parameters and converting program data into the format expected by second-level subroutines.
Most of the socket facilities are implemented within second-level subroutines. These second-level subroutines directly manipulate socket data structures and manage the synchronization between asynchronous activities.