Many of us know the IP protocol, that is, the Internet Protocol address. But it is also a datagram protocol. These basic structures are not clear to many friends. Next we will introduce the basic structure of this datagram.
Internet Protocol IP)
Internet protocol is a datagram protocol, which is mainly responsible for addressing and routing data packets between hosts. However, the IP address is a connectionless protocol, which means that it does not establish a connection before data exchange, so the IP address is also unreliable, which means it cannot ensure correct transmission of data packets.
The IP always tries its best to send data packets, but IPv4 data packets may be lost, sent in wrong order, duplicated, or delayed. Therefore, a higher level protocol such as TCP or an application protocol is required) the transmitted data packets must be confirmed and the lost data packets must be restored as needed. The IP packet header structure is displayed.
;
Figure IP packet header information
The data headers of the Internet Protocol are described as follows.
Version: the IP version used for data transmission. The size is 4 bits.
Header Length: Specifies the header length.
Service type: it is used to set the priority or priority of data transmission. The value is 8 bits.
Total Length: indicates the total length of the datagram. The total length of the datagram = Header Length + data length. The size is 16 bits.
ID: used to identify all segments. The size is 16 bits.
Segmentation flag: determines whether a datagram can be segmented. It also indicates whether there are more segments after the current segment, with a size of 3 bits.
Segment offset: used by the target computer to find the position of a segment in the entire datagram, with 13 characters in size.
Survival time: the number of network segments allowed for data packets to pass before the vro discards the data packets. TTL is set by the sending host. When the vro forwards IPv4 data packets, the TTL is decreased by 1, this field is used to prevent endless loop propagation of data packets in IPv4 networks. The length is 8 bits.
Protocol: Specifies the upper-layer protocol used to create data in the data field. The size is 8 bits.
Checksum: Check the integrity of the transmitted data. The size is 16 bits.
Source Address: the source IP address. The field length is 32 bits.
Target address: the destination IP address. The field length is 32 bits.
Option: there are more than one required field. The length of the field depends on the selected IP Option.
Data: contains data transmitted over the network. Internet Protocol datagram also includes header information of the Upper-layer protocol.