The IP field of the first understanding of the network layer protocol (1)

First understanding of network layer protocol (1)
IP field:
an IP data packet is composed of IP data packet header and data,
Insert picture description here
here is the representation of an IP data packet as shown in the figure below: the blue box is the header part, and the yellow part is The upper layer data part passed down from the upper layer here constitutes an IP data packet.

Insert picture description here
Here we specifically understand the header part of the IP data packet. Here, in order to better understand the various parts of the header, we use wireshark, a packet capture software, to capture packets to explain specifically.
As shown in the figure below: We use wireshark to grab a transport layer IP packet. When we open the IP packet of the network layer, we can see the composition of the IP packet under normal conditions. Under normal circumstances, for friends who are just starting to learn, they must have a numb scalp when they see so much English. We must not be afraid, so let's look at each part again.
We can look at the various parts of the IP segment according to the various parts
shown in the figure : 1. Version: the "Version 4" in the figure, which represents the version number of the IP, 4 bits
2. The length of the header: the "Header" in the figure The section of "length" indicates the length of the IP data packet header, 4 bits, the minimum length of the IP data packet header is 20 bytes, but its length is variable, and the specific length depends on the length of the optional field.
3. Priority and service type: the segment "DIfferentiated services field" in the figure, used to indicate the priority and service type of the data packet, 8 bits. By dividing a certain priority in the data packet, it is used to achieve the requirements of Qos (Quality of Service)
4. Total length: the "Total length" section in the figure, used to indicate the length of the entire IP data packet, 16 bits. The maximum length is 65535 bytes, including packet header and data.
5. Identifier: the "Identification" section in the figure, which represents the identifier of the IP data packet, 16 bits. When IP fragments the upper layer data, it will assign a set of numbers to all the fragments, and then put these numbers in the identifier field to ensure that the fragments will not be reorganized by mistake. The identifier field is used to identify a data packet so that the receiving node can reassemble the fragmented data packet.
6. Flags: the "Flags" in the figure, the flag field, 3 bits, the flag and the fragment are used to convey information. For example, when a data packet is sent from one Ethernet to another Ethernet, it indicates that the current packet cannot be fragmented or that after a packet is fragmented, it indicates whether the last fragment in a series of fragments has been sent.

Insert picture description here
7. Segment offset: the "fragment offset" in the figure, this field is used to indicate the segment offset, 13 bits. The information contained in the segment offset is how to reconnect the fragments in a fragment sequence.
8. TTL: "time to live" in the figure, this field is used to indicate the life cycle of the IP data packet, 8 bits. The information contained in this field is to prevent a data packet from being forwarded endlessly in the network.
The TTL value corresponds to the number of packets passing through the router. If a data packet does not pass through a router, the TTL will be reduced by 1. When the TTL value is 0, the data packet will be discarded.
9. Protocol number: the "Protocol" in the figure, the protocol field, 8 bits. This field is used to indicate which protocol is encapsulated in the IP packet, whether it is TCP or UDP. The protocol number of tcp is 6, and the protocol number of UDP is 17. Here we see that the TCP protocol number is 6.
10. Header checksum: the "Header checksum status" in the figure, this field is used to indicate the checksum, 16 bits. The checksum is a 16-bit error detection field. The destination host and each gateway in the network must recalculate the checksum of the packet header, just as the same-origin host does. If the data has not been changed, the two calculation results should be the same.
11. The source and destination addresses are the following two lines, so I won’t say that if they are all clear.
Summary: We will encounter many difficulties when learning computer-related. One of the most easy to encounter is not being able to understand. If the English level is average, it will be very difficult for us at the beginning. This is also the case for the author, but we cannot be afraid , You can use Youdao Dictionary and other tools to translate one by one. Be patient and learn together~!

Guess you like

Origin blog.csdn.net/weixin_44324367/article/details/109227827