IPv4-an-Fragmentation

Question 1

Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header and a 40-byte TCP header. The packet is forwarded to an IPv4 router that supports a Maximum Transmission Unit (MTU) of 600 bytes. Assume that the length of the IP header in all the outgoing fragments of this packet is 20 bytes. Assume that the fragmentation offset value stored in the first fragment is 0.

The fragmentation offset value stored in the third fragment is __________.

A
144
B
145
C
146
D
147
       Computer-Networks       IPv4-an-Fragmentation       Gate 2018
Question 1 Explanation: 
MTU = 600 bytes, IP header = 20 bytes
Therefore Payload = 600 - 20 = 580 bytes.
As we know fragment size should be multiple of 8 but 580 bytes is not a multiple of 8, therefore fragment size is 576 bytes.
Offset value of kth fragment = Fragment size *( kth fragment - 1) / scaling factor
Offset value of third fragment = 576 * (3-1) / 8 = 144
Question 2
Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 bytes). Size of UDP header is 8 bytes and size of IP heard is 20 bytes. There is no option field in IP header. How many total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?
A
6 and 925
B
6 and 7400
C
7 and 1110
D
7 and 8880
       Computer-Networks       IPv4-an-Fragmentation       GATE 2015 -(Set-2)
Question 2 Explanation: 
UDP data = 8880 bytes, UDP header = 8 bytes, IP Header = 20 bytes
Total Size excluding IP Header = 8888 bytes.
Number of fragments = ceil(8880+ UDP or TCP header /1500-IP header)
= ceil(8880+8 /1500-20)
= ceil(8888/1480)
= 7
Offset of last fragment = (MTU-IP header ) *( number of fragments -1) / scaling factor = 1110 (scaling factor of 8 is used in offset field).
=(1500-20)* (7-1)/8
=1110
There are 2 questions to complete.