The Linux network protocol, Linux protocol stack based on layered design idea, it is divided into four layers, from down to up are: physical layer, link layer, network layer, application layer.
The Linux protocol stack is actually derived from the BSD protocol stack, it upward and downward interface and protocol stack software hierarchical organization itself is very good. The Linux protocol stack based on layered design idea, it is divided into four layers, from down to up are: physical layer, link layer, network layer, application layer. Physical layer provides a variety of connecting the physical equipment, such as a variety of card, serial cards; link layer mainly refers to the physical layer provides access to a variety of interface card driver, such as a LAN Driver; the network layer of the role is responsible for network data packets are transmitted to the correct position, the most important of the network layer protocol is a protocol of IP network layer, in fact there are other protocols such as ICMP, ARP, RARP, but unlike IP, most people are familiar with the transmission layer; the main role is to provide end to end, said the white point is provided between the application program and the communication, transport layer protocol for TCP most famous UDP protocol and the end is; application layer, as the name implies, of course, is provided by the application, used to transmit data for the semantic interpretation of" interface " layer, such as HTTP, SMTP, FTP and so on, in fact, application layer is not people finally see the layers, the uppermost layer should be" explain", will be responsible for the data in a variety of surface forms ultimately presented to the eyes.
Linux core network architecture of Linux network architecture from up to down can be divided into three layers, respectively is: user space application layer. Kernel space network protocol stack. The physical hardware layer. One of the most important and core course is the kernel space protocol stack layer.
Linux network protocol stack structure of Linux throughout the network protocol stack is constructed with the Linux Kernel, the entire stack is strictly according to hierarchical thinking to design, the entire stack is divided into five layers, respectively:
1, the system call interface layer, the essence is a user space application program interface call library, to user space application provides the use of the web services interface.
2, protocol independent interface layer, SOCKET layer, this layer is designed to shield the underlying different protocol ( more precisely is mainly TCP and UDP, of course also includes RAW IP, SCTP ), so that with the system call interfaces between layers can be simple, uniform. In simple words, no matter what our application layer protocol, through to the system call interface to build a SOCKET, the SOCKET is actually a huge sock structure, it and below a layer of the network protocol layer connection, shielding the different network protocols are different, only data section dedicated to the application layer. ( through the system call interface to present ).
3, network protocol layer, no doubt, this is the core of the protocol stack. This layer is mainly to achieve a variety of network protocols, the main course is IP, ICMP, ARP, RARP, TCP, UDP etc.. This layer contains many design techniques and algorithms, very good.
In 4, and the specific device independent driver interface layer, this layer the main purpose is to unite the different interface card driver and protocol of the network interface layer, it will be a variety of different driver function unified abstract for several special moves, such as open, close, init, this layer can shield the underlying different driver.
In 5, the driver layer, this layer of purpose is very simple, is to set up and the hardware interface layer. As you can see, the Linux network protocol stack is a strictly hierarchical structure, in which each layer performs relatively independent function, the structure is very clear. One of the two" independent" layer design is very good, through the two" independent" layer, the protocol stack can be easily extended. In our own software design, can absorb the design method.