agoh the thing is- data must be in multiple of 8 only when a single packet has been fragmented into 2 or more parts by router(sender never fragments a packet or you can say at sender fragment offset of each packet is 0). so if router has to fragment a packet it must be divisible by 8 except the last packet.
If in this case instead of 100 MTU in question 90 MTU given then?
so each packet would have 20B header and 70B payload
but 70 is not multiple of 8 so so in one packet we can have 64B payload and 20B header so
the no. of fragments would be 980/64= 15.3125 so 16 fragments
is this correct?
Datagram contain data + ip header . so last fragment contain 20 byte.
Need to be change !
Denson- when a packet reaches to router it also contain header in it so you may consider 980 B payload + 20B header
Datagram$=1000B$ IP header$=20B$ Datagram$=$User data $+$ IP header User Data$=1000B-20B=980B$ Number of fragment$=\left \lceil \frac{1000B}{(100B-20B)} \right \rceil=\left \lceil \frac{1000B}{80B}\right \rceil =13$ the offset of the last fragment$=\frac{(100-20)\times 12}{8}=120$ (scaling factor of $8$ is used in offset field). Please correct me if I'm wrong$?$
now remaining 20B data could be sent in next fragment.
No,this line should be "remaining 40 B data to be send to next fragment "
MTU (M) is $80 + 20 \text{ bytes}$ Datagram size (DS) is $980 + 20$ No. of fragments are $\dfrac{\text{DS}}{\text{M}}=\dfrac{980}{80}=12.25$
So Answer is 13.
thanks :)
64.3k questions
77.9k answers
244k comments
80.0k users