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

Introduction of network layer protocol, detailed explanation of IP packet format + ARP principle (focus 3, necessary knowledge of network rookies)

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

Share

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

one。 Let's first review which layer of the basic seven layers of our network is the network layer.

It is our third layer. This packet contains IP header, TC header and upper layer data.

two。 Functions of the network layer

The IP address in the network layer packet is equivalent to our logical address, the global address, and our computer will be assigned an address around the world.

three。 Detailed explanation of packet format

Version: we now have two versions of IPV4,IPV6, first of all, our IP address resources are limited, we are temporarily in the middle of these two, more than 6 billion people around the world.

Header length: it is the length of our header format and does not contain upper data

Priority and type of service: decide what data to send first. For example, if we send a QQ message to someone while we are downloading something, the computer will first send your QQ message. If you don't have this priority, you can only send the message after you have finished downloading.

Total length: packet header format length + data length, why do we have the header length and total length, so that the computer knows the length of the data and can slice and transmit the data.

Let's take a look at the second layer, which is the fragmented message. Each segment of data transmission, such as five gigabytes of a game, cannot be transmitted in one packet, which requires multiple data packets.

Identifier: a symbol for each segment of the packet

Flag: are there any other segments to follow?

Segment offset: data reorganization at destination

TTL: life cycle, the lifetime of each packet passing through a router will be reduced by 1, otherwise a packet will exist forever.

Protocol number: a protocol that describes upper-level data

Header checksum: check for packet integrity

Source address: your own IP address

Destination address: IP address of the other party

Optional: you can enter the time of the packet, which will be longer according to the actual situation.

data

IV. The principle of ARP protocol

How can our computer know each other's MAC address, through ARP to achieve, we provide to the data link layer encapsulation

Let's understand that in order to provide the source MAC and destination address for the data link layer encapsulation, I don't know what the data link layer is. Please see my previous blog.

The first step is that our PC1 host sends data to PC2 to see if its cache has the MAC address of PC2.

Second, if not, our PC1 will send an ARP request message through broadcast mode.

In the third step, all hosts can receive ARP request messages. As soon as PC2 sees my IP address, it will reply to unicast immediately, and other hosts will discard it.

In the fourth step, our PC1 will save the MAC address of the PC2 to the cache, which can be used immediately next time.

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