Article Title: understanding of linux network protocols. Linux is a technology channel of the IT lab in China. The protocol stack for Linux, including desktop applications, Linux system management, kernel research, embedded systems, and open source, is actually derived from the BSD Protocol Stack, its upstream and downstream interfaces and the software hierarchy of the protocol stack itself are very good. The protocol stack of Linux is divided into four layers based on the hierarchical design concept. The layers are from bottom to top: physical layer, link layer, network layer, and application layer. The physical layer mainly provides various connected physical devices, such as various NICs and serial cards. The link layer mainly refers to drivers of various interface cards that provide access to the physical layer, such as NIC drivers; the role of the network layer is to transmit network data packets to the correct location. The most important network layer protocol is the IP protocol. In fact, there are other network layer protocols such as ICMP, ARP, and RARP, most people are not familiar with IP addresses. The role of the transport layer is to provide end-to-end services. To put it bluntly, it is to provide communications between applications, the most famous Protocol on the transport layer is not the end of TCP and UDP; the application layer, as the name suggests, is of course provided by the application, the "man-machine interface" layer Used for semantic interpretation of transmitted data, such as HTTP, SMTP, FTP, etc. In fact, the application layer is not what people finally see, the top layer should be the "Interpretation layer", which is responsible for presenting data to people in various forms of table items. Linux network core architecture Linux network architecture can be divided into three layers from top to bottom: the application layer of user space. The network protocol stack layer of the kernel space. Physical hardware layer. Among them, the most important and core is the protocol stack layer of the kernel space. Linux network protocol stack structure the entire network protocol stack of Linux is built with the Linux Kernel. The entire stack is also designed in strict accordance with the concept of layering. The entire stack is divided into five layers: 1. The system call interface layer is essentially an interface call library for user space applications, providing interfaces for user space applications to use network services. 2. The protocol-independent interface layer is the SOCKET layer, which aims to shield different underlying protocols (more accurately, TCP and UDP, and of course raw ip addresses, SCTP, etc.), so that the interface with the System Call layer can be simple and unified. Simply put, no matter what protocol we use at the application layer, a SOCKET must be built through the system call interface. This SOCKET is actually a huge sock structure, it is associated with the network protocol layer at the following layer, shielding the differences between different network protocols. Only the data is presented to the application layer (presented through the system call interface ). 3. The network protocol implementation layer is undoubtedly the core of the entire protocol stack. This layer mainly implements various network protocols, including IP, ICMP, ARP, RARP, TCP, and UDP. This layer contains a lot of design techniques and algorithms, which are quite good. 4. The driver interface layer unrelated to the specific device. The purpose of this layer is to unify the drivers of different interface cards and the interfaces of the network protocol layer, it abstracts the functions of various drivers into several special actions, such as open, close, and init. This layer can shield different underlying drivers. 5. The purpose of the driver layer is very simple. It is to establish an interface layer with the hardware. As you can see, the Linux network protocol stack is a strictly hierarchical structure, with each layer performing relatively independent functions with a very clear structure. The two "irrelevant" layers are designed very well. With these two "irrelevant" layers, their protocol stacks can be easily expanded. This design method can be absorbed in our own software design.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service