Do you know the Linux network protocol stack?

Source: Internet
Author: User

What is the difference between the Linux network protocol stack and the network protocol in Windows? We also need to look at the specific content. Next, let's take a brief look at its concept, structure, and relevant explanations. Hope to help you.

Linux network protocol stack

The protocol stack of Linux is actually originated from the protocol stack of BSD. 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 transport layer protocol 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

The Linux network architecture can be divided into three layers:

The Application Layer of the 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 Kernel of Linux. 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. The purpose of this layer is to prevent different underlying protocols from being more accurate, mainly TCP and UDP, but also raw ip and SCTP ), 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. The data section is presented to the application layer 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 independent of a 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. For the driver layer, the purpose of this layer is very simple, that 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.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.