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

Encapsulation and unencapsulation

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Encapsulation and unencapsulation

Encapsulation: in the process of turning data into a bitstream, a specific protocol header action needs to be added to each layer of the reference model

Action: encapsulate from high layer to low layer, use a specific protocol at each layer, process the data, and add a specific protocol header in front of the data.

Encapsulation principles:

1: each layer adds a protocol header in front of the upper layer of data

2: the whole of the protocol header added is the PDU of this layer.

3: the PDU of each layer is the upper data for the next layer (the upper data of each layer is the PDU of the upper layer)

PDU (protocol data unit, that is, the data unit of each layer)

Application layer: APDU

Presentation layer: PPDU

Session layer: SPDU

Transport layer: segment (segment)

Network layer: packet (packet)

Data link layer: frame (frame)

Physical layer: bits (bit)

The encapsulation is sent by the sender, and the data can be sent only after it has been encapsulated.

* the host must know the destination IP address before encapsulating the packet, and the route to the destination network and the MAC address of the next hop before encapsulating the data frame.

Necessary parameters for encapsulation

Transport layer: source port number, destination port number

Network layer: source IP address destination IP address

Data link layer: source MAC address destination MAC address

De-encapsulation: the reverse process of encapsulation in which data is restored from a bit stream to data.

Action, unencapsulated in turn from the bottom to the upper layer, and the protocol header of that layer will be removed for each unencapsulated layer.

De-encapsulation principle:

1: must be unencapsulated from the bottom to the top

2: when unencapsulating, it can be unencapsulated only if the protocol header is reasonable (for example, you receive a package with your name and your home address on it, which is called reasonable for a long time).

3: once de-encapsulation stops, the data will be discarded

De-encapsulation is triggered by the receiver, and the data must be unencapsulated before it can be accepted.

The data link layer is divided into two sublayers:

LLC sublayer: logical link control sublayer-responsible for negotiating with the upper layer and using SAP to distinguish different upper layer protocols

MAC sublayer: media access control sublayer

The data link layer has FCS (frame check field) to check the integrity of the data.

The LLC sublayer provides a service access point (SAP) to identify upper layer protocols

1: each layer needs to communicate with the services of the lower layer

2: each layer needs to serve the upper layer, so you need to identify the protocols or applications used by the upper layer

Transport layer: use port numbers to identify upper applications

Network layer: use protocol numbers to identify upper applications

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

Servers

Wechat

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

12
Report