Page 1 of 1

IP message header "fragment offset"

Posted: Tue Oct 17, 2006 7:24 am
by Neo
Hi,
I was trying to figure out how the "flags"+"fragment offset" field in a IP header works.
What does the "fragment offset" indicate? what kind of values does it usually have?
I tried googling but could'nt get enough of a description for the meaning of these fields.
Any help/links would be great.
TIA

Posted: Thu Oct 19, 2006 7:04 pm
by Midas
Many routers will fragment packet datagrams as they transmit them. A long datagram is more likely to be fragmented. Reconstruction of the original packet is aided by a number of fields:

The Number of Fragmented Blocks field tells how many fragments the datagram was split into. The first fragment must be 8 bytes long. Thereafter, the fragments can be of arbitrary length.

The Fragment Offset gives the offset, in multiples of 8 bytes, of the received packet from the beginning of the original transmitted packet. In conjunction with the Length field, this tells you which part of the original packet is covered by this packet.

The More Fragments field tells if there are any more fragments after this one (indicating the last fragment - although this may not be the last fragment received, due to latency in the network).

It should be noted that a packet can be marked as Do Not Fragment. This will generally slow its transmission, however.

EDIT: Added a fair bit, to give a more rounded answer. You might also want to take a look at RFC791, which is the Internet Protocol request for comment. Most of this was from memory, consulting to check I wasn't misinforming you. ;)