$\text{Host A}$ sends a $\text{UDP}$ datagram containing $8880\text{ bytes}$ of user data to $\text{host B}$ over an $\text{Ethernet LAN}.$ Ethernet frames may carry data up to $1500\text{ bytes (i.e. MTU = 1500 bytes)}.$ Size of $\text{UDP}$ header is $8\text{ bytes}$ and size of $\text{IP}$ header is $20\text{ bytes}.$ There is no option field in $\text{IP}$ header. How many total number of $\text{IP}$ fragments will be transmitted and what will be the contents of offset field in the last fragment?
Similar question: https://gateoverflow.in/204129/gate-cse-2018-question-54
Answer is C. Number of fragments $=\large\Big\lceil\frac{8888}{1480}\Big\rceil = 7$ Offset of last fragment $=\dfrac{(1500 - 20)\times 6} {8}=1110$ (scaling factor of $8$ is used in offset field). $\text{TCP or UDP header}$ will be added to the DataUnit received from Transport Layer to Network Layer. And fragmentation happens at Network Layer. So no need to add $\text{TCP or UDP}$ header into each fragment.
@dangling-else our main motive is to deliver a packet from A to B. routers use ip header(ip header is appended to each fragment) to securely deliver packet from source to the destination address. Then at the Destination host we reassemble the packets and forward to our target port/process.
Answer is : 7 fragments and last fragment offset is 1110
UDP data = 8880 bytes UDP header = 8 bytes IP Header = 20 bytes Total Size excluding IP Header = 8888 bytes. Number of fragments = ⌈ 8888 / 1480 ⌉ = 7 Offset of last segment = (1480 * 6) / 8 = 1110
@ Paras Nath excluding IP Header or Udp header ??????
64.3k questions
77.9k answers
244k comments
80.0k users