The details of the data from sending to receiving in Datacom Kingdom Adventures {encapsulation and decapsulation}

Series of Articles:
Adventures in the Datacom Kingdom (5)


Table of contents

foreword

1. The whole process of data encapsulation

1.1, the encapsulation form of the application layer

1.2, the encapsulation form of the transport layer

understand:

1.3, the encapsulation form of the network layer

understand:

1.4, the encapsulation form of the data link layer

understand:

1.5, physical layer

1.6, Summary

Second, network data transmission

Three, unpack

3.1, physical layer

3.2, data link layer

3.3, network layer

3.4, transport layer

3.5, application layer

3.6, Summary of Decapsulation

Summarize



foreword

With the continuous development of Huawei, the technology of data communication is becoming more and more important. Many people have started learning data communication. This article introduces the detailed packaging and network data transmission. It is our fifth stop through the Datacom Kingdom ( We use Huawei's ENSP software in this article).


1. The whole process of data encapsulation

1.1, the encapsulation form of the application layer

 Let's take the example of entering www.huawei.com on his own computer, and he has gone through those processes

We input www.huawei.com on the application of our browser . This is my most original data, and it is input in the browser at the application layer.

1.2, the encapsulation form of the transport layer

understand:

After the application layer is encapsulated, it reaches the transport layer. Because we use the http service, it uses the protocol of tcp, because in the transport layer

There are only two protocols, one is the TCP protocol and the other is the UDP protocol. The browser uses the HTTP service. The service is based on the TCP protocol and the port number is port 80, so we can only choose TCP here, in order to allow our transport layer to recognize , a TCP header must be added, otherwise the transport layer has no way to identify the data end. This is an adjustment made by the transport layer after receiving the data from the application layer.

1.3, the encapsulation form of the network layer

understand:

In the same way, when the data at the transport layer arrives at the network layer, the data segment must be changed into a format that can be recognized by the network, and the network layer will process it, otherwise the network layer will not process it, then what the network layer can recognize is the PDU, the data packet , so the transport layer must add an IP header to turn it into a data packet before the network layer can recognize it.

1.4, the encapsulation form of the data link layer

understand:

The same is true for the data link layer. The data link layer cannot process data packets of the network layer, but the data link layer can process data frames, so an Ethernet class 2 header is added to the data link layer for the data link layer, and An authenticity check of an FCS, so a data frame is formed

1.5, physical layer

The data frame of the data link layer becomes a 0101 bit stream that can be recognized by the physical layer, and finally it is transmitted to the other party through our network cable. This is encapsulation.

1.6, Summary

The data at the application layer must become identifiable by the transport layer, the data at the transport layer must become identifiable at the network layer, the data at the network layer must become identifiable at the data link layer, and the data at the data link layer must become physical The layer can recognize it, and finally pass it to the other party through the network cable. This is the encapsulation of data

Second, network data transmission

 The encapsulated data will be transmitted in the network, hop by hop,

For the processing of devices in this layer, it will only decapsulate in this layer

I'm a switch, I'll do it at the data link layer

I'm a router, I'll do it at the network layer

I am a terminal, I will process it at the application layer

After the receiving end receives it, it decapsulates it in the opposite direction

Three, unpack

3.1, physical layer

The so-called decapsulation is also the same, you pass it through a network cable

When the data transmitted by the bit stream reaches the physical layer, the data link layer cannot directly process the bit stream, because the bit stream is a concept of the physical layer, so you have to unravel the shell of your bit stream and turn it into a data link Layer data frame, after the physical layer processes the bit stream, it sends the data frame to the data link layer

3.2, data link layer

The data link layer will process the data frame. After the data link layer is processed, the frame header of the data frame and the authenticity check of the data frame will be removed to reveal the real data packet.

3.3, network layer

The network layer continues to process. After processing, the header and tail of the data packet are removed, and the protocol of the transport layer becomes a data segment.

3.4, transport layer

The transport layer continues to process, and after processing, the most original data is exposed.

3.5, application layer

After being processed by the transport layer, it is already the most original data, and the application layer can be used directly.

3.6, Summary of Decapsulation

Unpacking is equivalent to buying an item on Taobao, packing it in a carton, labeling it, and transporting it to the distribution center in your city by air or other cars, and you get the express delivery , First unpack the carton and then the label to get the most original data .


Summarize

Congratulations, you have passed the detailed explanation of encapsulation and network data transmission in this chapter, the fifth level of the Datacom Kingdom, and there are many more levels to come. There are still many treasures waiting for you to explore in the Datacom Kingdom, come on! Just to become a better version of myself.

Guess you like

Origin blog.csdn.net/weixin_73466540/article/details/131517211