684 views
1 votes
1 votes

If a datagram of size 4000 bytes from transport layer arrives at network layer and it has to be forwarded through a link with maximum capacity of 800 bytes. Then calculate the number of fragments needed if the header size is 20 bytes. Also calculate the data size of the last fragment.

  1. 5 fragments ,100 bytes
  1. 5 fragments ,104 bytes
  1. 6 fragments ,100 bytes
  1. 6 fragments ,104 bytes

2 Answers

0 votes
0 votes

 

Byte Address 776 +(20 header) 776 +(20) 776 +(20) 776 +(20) 776 +(20) 100 +(20)
Fragment Offset 0 97 194 291 388 485
M-bit 1 1 1 1 1 0

 

 

IP-Payload= 3980bytes ; MTU= 780bytes

Fragment Offset: ByteAddress/8 ; 

Hence No. of fragments required to accomodate 4000bytes: 6

0 votes
0 votes
The number of fragments needed would be 6, and the data size of the last fragment would be 100 bytes. This is because, the total size of the datagram is 4000 bytes and header size is 20 bytes so, the total data size is 4000 - 20 = 3980 bytes. And the maximum capacity of the link is 800 bytes, so the number of fragments needed is 3980/800 = 4.975 = 6 (rounding up). The last fragment will have the remaining data, which is 3980 - (6-1)*800 = 100 bytes.

Related questions