[4.5 Internet computer network of the network layer]

Mapping follows:

IP (Internet Protocol) Internet Protocol

IP: How to define the segment encapsulated upper-layer protocols (such as UDP, TCP, etc.), defines the Internet address (IP address) and how to forward IP datagrams and other content, is the core of the Internet network layer protocol. IP contains two versions, IPv4 and IPv6, and more generally use IPv4.

IP datagram

As shown below: IP datagram header and the data from the two parts, the header portion in turn comprising a fixed portion and a variable two, the fixed part also contains the version, header length, service, etc. to distinguish many parts. Then one by one we know about.

 

(1) Version number field occupies 4 bits is given IP version number. Routers determine which version of IP datagrams by parsing according to the field.

(2) The first four bits of the length field gives the datagram header length IP, comprising a variable length options field of 4 bytes. 4 may represent the maximum value is 1111 (15), 15 * 4 bytes = 60 bytes, and therefore of the IP datagram header length of a maximum of 60 bytes . Header length (excluding the Options field) a minimum of 20 bytes.

(3) the differentiated services field in 8 bits to indicate which type of services desired to obtain.

(4) 16-bit Total Length field accounted for, the total number of bytes given IP datagram includes a header portion and a data portion. 16 may be represented by a maximum value of 65535, the minimum header length is 20, and therefore a total length of up to 65515 = 65535-20.

(5) accounts for 16-bit identification field, for identifying an IP datagram (not uniquely identified). IP uniquely identifies a common IP datagram in accordance with the identification field and a source IP address and destination IP address and protocol fields.

(6) flag field is three bits, structured as follows:

DF: Do not Fragment flag. DF = 0 fragmentation is allowed. DF = 1 fragment is prohibited.

MF: More Frag flag. MF = 0 is not the final one or fragment. MF = 1 non-last piece.

(7) accounts for 13 chip offset field indicates an IP datagram fragmentation and encapsulation member relative offset IP datagram (encapsulated data slice starts the whole original datagram which byte), the chip offset field in units of 8 bytes (that is, the length of each fragment must be 8-byte (64-bit) integer multiple).

(8) time to live field 8 bits, represents the number of data segments in the IP router network may pass (or hop count).

(9) an upper layer protocol field of 8 bits indicating that the IP datagram is encapsulated segment of which the upper layer protocol. IP is the use of the field in the IP multiplexing and demultiplexing.

(10) accounted header checksum field 16, to achieve error detection using the checksum of the IP datagram header.

(11) representing the source IP address field 32, the IP address of the source host is sent an IP datagram.

(12) accounts for the destination IP address field 32, the IP address must be sent IP datagram service destination host.

(13) a variable length options field, in the range of 0 to 40 bytes, depending on the option content. (From this we can determine the first minister of a minimum of 20, that is, income 60-40)

(14) a data field, a data field to store the transport layer segments the encapsulated IP datagrams delivered to the upper layer protocol data corresponding destination host will they carry.

IP datagram fragment

MTU (Maximum transmission Unit) Maximum Transfer Unit: maximum amount of data can be a data link layer protocol carried by the link MTU is called.

(Note: IP datagram total length of less than 1500 bytes since although the network layer payload data as the data link layer protocol frame, but it is limited by the total length of the data link layer MTU.)

❤ questions? So if the total length of the datagram exceeds the limit of the MTU, the router how to deal with the datagram it?

The answer is: router IP datagram fragment (DF = 0) or discarded (DF = 1).

Next, details on how to be fragmented?

Maximum fragment may be encapsulated data length (in bytes) is:

The total number of IP fragmentation is required:

Each IP fragment offset field value of a sheet:

Each slice IP total length field is:

Each IP MF fragmentation field is:

 

Published 64 original articles · won praise 15 · views 10000 +

Guess you like

Origin blog.csdn.net/YaraRen/article/details/104889514