Top Ad unit 728 × 90

08: Network Layer - IP header - Fragment Offset and TTL part 6

IP header

Fragment Offset :

The next field is Fragment Offset, which occupies 13 bits. These bits are used to locate fragments in their original IP datagrams. Furthermore, the ip fragments must be in multiples of 8 bytes. 2 to the power of 13 (2^13) gives 8192, which is the number of units that Fragment Offset can hold, and 8192 multiplied by 8 gives 65536, which is the total length of an IP datagram in bytes. Fragment offset looks like the following :

The above figure shows an IP datagram of 4000 bytes after it has been divided into three fragments, each one holds ID (Identification number), which must be the same for all the segments that are the results of a single IP datagram,  MF (More fragments) which means that the there are more fragments coming, and the Fragments Offset that indicates where is the location of a segment in the original IP datagram.

To make plain, consider this example, let us suppose that we have two computers, A and B. These two computers are in different networks, and connected by means of routers. Each of the networks has different MTU (Maximum Transmission Unit). Then, computer A wants to send a file of 5140 bytes to computer B, but computer B supports only 1500 bytes per fragment. So, they finally agreed upon 1500 bytes as MTU. Segmentation is mandatory in this case.  It will look as follows :

The above pictured figure reveals how an IP datagram becomes after fragmentation. I know you are now questioning how Fragment Offset has been calculated. Before starting the illustration, let me remind you that the size of IP header is 20 bytes, but it increases to 60 bytes when options are included. Any way, the size in this example is 20 bytes.

The first Fragment Offset is always set to 0. As you see, the length of this fragment is 1500 bytes including the original IP header. The size of the second fragment is 1500 too, but the Fragment Offset’s value is 185. It is figured as follows : we said that the ip fragments must be in multiples of 8 bytes right ! so, we take the first fragment and we subtract 20 bytes (of the header) from 1500 to have only data portion. We are left with 1480 bytes . Now we take 1480 and we divid it by 8, it gives 185, which is the Fragment Offset’s value.

Next, to calculate the third Fragment Offset, we work out 1500 (whose sequence number is 0-0) plus 1500 (whose sequence number is 0-1), and the result will be 3000, then we subtract 40 bytes of the first and second fragment, the sum will be 2960, divided by 8 gives 370, which is the Fragment Offset’ value of the third fragment.

Afterwards, the fourth and last Fragment Offset’ value is calculated by figuring 1500+1500+1500=4500 minus 60 of the third previous IP headers, the total will be 4440. We subtract this latter by 8 to result 555, which is the Fragment Offset’s value of the last fragment.

All in all, the calculation of the Fragment Offset’s number  is done as what precedes. Fragment Offset is there to make it easier when it comes to reassembly of fragments at the destination machine, each single fragment with a Fragment Offset’ value will be placed in its original location of the the original IP datagram.

TTL (Time-To-Live) :

This field occupies 8 bits in th IP header. Its chief purpose is keep a packet from causing loops or clogging up the network. To illustrate, when a transmitting machine sends a packet across the network up to the receiving machine, the router directly connected to the former machine  stamps on the packet a value, which if it reaches 0 while traveling through the network, the packet will be discarded. See the following figure.

As you see, the packet sent by the transmitting machine is set TTL value 6, which is gradually decreased at least by 1 as the packet  receives at each router until it is finally discarded when the value becomes 0. All that is done in order to prevent packets from endlessly circulating on the Internet or other network and causing congestion.  When the packet perishes, the receiving host sends an ICMP (Internet control message protocol) message back to the originating host.

TTL has another name when it is used with Ipv6, which is hop limit. Furthermore, The TTL is also useful  in indicating the range or scope for a certain packet to move around.  For instance, a specific TTL number can indicate the maximum range for a packet ; 0 is restricted to the same host ; 1 is restricted to the same subnet ; 32 is restricted to the same site ; 64 is restricted to the same region ; 128 is restricted to the same continent ; 255 is unrestricted.

This lesson is divided into four parts due to intensive content: first part, second part, third part (which is the current one), fourth part.
08: Network Layer - IP header - Fragment Offset and TTL part 6 Reviewed by BOUFTIRA on 10:16:00 AM Rating: 5

No comments:

All Rights Reserved by Computer Networks For All © 2015 - 2017

Contact Form


Email *

Message *

Powered by Blogger.