Question
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 header 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?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2015 answer key
Solution
Calculate the fragment sizes and Fragment Offset values according to IPv4 fragmentation standards.
- Total data to fragment:
UDP user data = 8880 bytes.
UDP header = 8 bytes.
Total IP payload = .
- Maximum payload per fragment:
MTU = 1500 bytes.
IP header = 20 bytes.
Maximum payload per fragment = .
Notice that 1480 is divisible by 8 ().
- Fragment generation:
- Fragment 1: 1480 bytes, Offset = , MF = 1
- Fragment 2: 1480 bytes, Offset = , MF = 1
- Fragment 3: 1480 bytes, Offset = , MF = 1
- Fragment 4: 1480 bytes, Offset = , MF = 1
- Fragment 5: 1480 bytes, Offset = , MF = 1
- Fragment 6: 1480 bytes, Offset = , MF = 1
Total data in first 6 fragments = .
- Fragment 7 (Last fragment):
- Payload size = .
- Offset = .
- MF = 0.
Total fragments = 7, and offset in the last fragment = 1110 (option C).
C
Forgetting the 8-byte UDP header or expressing the fragment offset in bytes (8880) rather than 8-byte blocks (1110).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 2
- Question
- 62 of 65, printed as CS Q.52
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.