Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Learning experience of Network Protocol and hierarchical structure

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

(the following is pure fiction)

I. comparison between the division of the protocol stack and the human process of dealing with communication events

Foreword:

Reasonable people all know that "tools are the extension of human limbs", so "computer", the greatest invention of mankind in the 21 century, is also "tools". Compared with other cold "tools", he has

"unique thinking ability!" -- simple logical processing ability. Therefore, just as the brain can control the body, he can also control other "tools".

1. The division law of hierarchical structure

The book says: "the hierarchical structure has:

(1) people can easily discuss and learn the specification details of the protocol.

(2) the standard interface between layers facilitates engineering modularization.

(3) A better interconnection environment is created.

(4) reduce the complexity, make the program easier to modify, and the speed of product development is faster.

(5) each layer makes use of the adjacent lower-level services to make it easier to remember the functions of each layer.! "

Speak very well, the words all know, but many people do not know the meaning of the hierarchical structure after learning the network! (I am still confused after learning it twice), just like I know thousands of Chinese characters, but I can't write decent poems. I don't grasp the rules and study the connotation. Shallow is shallow, and it's useless to read more!

Think about what we do when we want to take something:

(1) instructions from the brain

(2) raise your arms

(3) arm extension

(4) grasp it with your hands

It is precisely because the function of the body is highly specific that human creativity is so amazing. Then the network layering is also for the purpose of more complete function and more concise implementation.

Take the four-tier structure in the actual network as an example (only consider the role of layering, not the specific details):

From this point of view, the principle of hierarchical structure is like the operation of our bodies. However, people are not simple, and computer networks are not simple, because they have many functions. Here, the different functions are highly specific again.

(1) our actual operation is different for different things that the hand may face (does the apple grasp with the hand or the prickly group with the hand? Similarly, the network interface layer has to face a variety of Lans, and its specific operation is also different (depending on the type of network card and driver type).

(2) for the arm, he can not only control the overall direction of the arm, but also the key point of force, and the key to holding multiple things depends on it. Similarly, the transport layer also has many functions, which are distinguished by "protocols".

For the implementation of different functions of the Internet layer, the transport layer and the application layer, use the "protocol" to control

After all, the "logic" of the computer is reflected in false or true, so multi-functions at the same level must be divided by signs (reflected in the op field of each layer header).

From the above, we can get a rough filter:

Layering makes the function of each layer more specific, and sub-protocol makes the function more perfect. (the genius and greatness of our predecessors)

Second, the "conjecture" of the design of three-way handshake and four-time wave.

The design of the TCP protocol header in the TCP/IP protocol cluster is particularly complex, but when you understand the role of each part, you are shocked to find that it simply simulates the details of human communication, of course, it is also achieved through huge conditional judgment.

The following is the format of the TCP section

16-bit port number (in TCP and UDP headers):

Suppose you say to your mother, "I'm hungry!" Your mother immediately came out: "1. You need to eat. 2. Implicitly know that you eat with your mouth", so the cooked food is delicious to swallow, not raw food for you.

This kind of agreement is agreed upon by people, but computers can't do it.

Similarly, there are all kinds of software that need network communication in the computer. In order to transmit the specific software requirements to each other's specific software, the concept of port is introduced. The port number indicates a certain process.

1. An analogy between three handshakes and four waves to communicate with people

Let's take a look at how we build communication:

(1) Xiaoming sent a request for an appointment to Xiaofang

(2) Xiaofang received and replied to agree

(3) Xiaoming said "go" after getting Xiaofang's consent, and Xiaofang knew that Xiaoming knew he had agreed.

At this point, they have established a communication; the same two hosts on the network (connected to Internet)

Establishing a connection using the TCP protocol is also required (initiating a connection-"peer reply -" reply to a reply)

These three steps. But the concrete realization is not as simple as human communication. After all, computers can only make judgments.

The following is a simulation of the three-way handshake:

SNY=1: indicates that this is a connection request or a message accepted by the connection. It is different from the communication with human beings, because the person can judge the content of the session according to the situation of the conversation, while the computer has to clearly indicate whether it is a connection request or not, because the actual data content fields in the connection request are not stored (that is, invalid contents have to be reissued after the connection is established).

J and k (in the 32-digit serial number): this content is equivalent to the specific content of the conversation, making it easier for the other person to give a corresponding answer, for example, you say to others, "We. Bar!" The other party is going to answer, although he knows that the result of the answer is still "yes or no", but he doesn't know the content at all, so he can't give a clear answer. This is also the point of this field design.

ACK=1: when ACK=1, the 32-bit acknowledgment sequence is valid. For example, when you talk to someone, you don't ask for advice, but they keep saying, "Yes!" Such a reply is meaningless. The utility of ACK is the same, but we know that "the reliability of transmission is based on reasonable requests and responses!" Therefore, the question and answer form is often used in the transmission process of the network, so most of the cases of ACK is 1. 5%.

Jacks 1 and Knights 1 (located at 32-bit confirmation serial number): make a definite reply to the accepted data, indicating that the message before J has been received. At the same time, Junior 1 also indicates the serial number of this piece of data he needs.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report