Current location - Loan Platform Complete Network - Big data management - How many shorter datagram slices should it be divided into? What are the data field lengths, slice offset fields and MF flags for each datagram slice?
How many shorter datagram slices should it be divided into? What are the data field lengths, slice offset fields and MF flags for each datagram slice?

First of all, ip datagram header 20 is still 1460, the maximum is 500, plus in addition to the last slice, the other slice length must be an integer multiple of 8, so divided into 3 slices of length were 496, 496, 468, the offset were 0/8, 496\8, 496?2/8. MF were 1, 1, 0.

Example:

Example:

3 slices;

The first datagram was the first one, and it is the first datagram that has the data fields and MF flags, which are the values for each of them. p>3 slices;

First slice: data field length 1480, slice offset is 0, and MF is 1;

Second slice: data field length 1480, slice offset is 185, and MF is 1;

Third slice: data field length 1020, slice offset is 370, and MF is 0.

Extended information:

First Length: 4 bits, the maximum decimal value that can be represented is 15. Note that this field represents numbers in 32-bit words (1 32-bit word is 4 bytes long), so when the IP first length is 1111, the first length is 60 bytes. When the initial length of an IP packet is not an integer multiple of 4 bytes, it must be padded using the final padding field.

Thus the data portion always starts at an integer multiple of 4 bytes, which is more convenient when implementing the IP protocol. The disadvantage of limiting the length of the first part to 60 bytes is that sometimes it may not be enough. However, this is done in the hope that the user will minimize the overhead. The most commonly used initial length is 20 bytes (i.e., initial length 0101), when no options are used.

Source of reference; Baidu Encyclopedia - Datagram