In an IPv4 datagram, the $M$ bit is $0$, the value of $HLEN$ is $10$, the value of total length is $400$ and the fragment offset value is $300$. The position of the datagram, the sequence numbers of the first and the last bytes of the payload, respectively are:
I have just one doubt..
Given , total length of the IP Datagram = 400B
payload of IP datagram = total length of the TCP right ?? = 400 - 40 = 360 B
Now , Paylaod size of TCP = 360 - (Header length of TCP )
then we continue with the process ??
but here they didn't give the Header length of TCP
so here we assume Header length of IP-datagram + Header length of TCP = 10B ??
please someone clarify my doubt
sushmita you analyze it in a wrong way
Now see the best answer...you understand properly
that's what i'm asked just above your comment......But i think in this question they take 20B of Ip header and 20B of tcp header because without it we didn't find the payload size of TCP
$M=0$ meaning no more fragments after this. Hence, its the last fragment.
IHL = internet header length = $10 \times 4 = 40B$ coz $4$ is the scaling factor for this field.
Total Length = $400B$
Payload size = Total length - Header length = $400 - 40 = 360B$
fragment offset = $300 \times 8 = 2400B$ = represents how many Bytes are before this. $8$ is the scaling factor here.
$\therefore$ the first byte # = $2400$
Last byte # = first byte # + total bytes in payload - 1 = $2400 + 360 - 1 = 2759$
Option C is correct.
@amar u are saying that 2400 represents how many Bytes are before this.. then how come it becomes the first byte..?
Here ..sequence numbers are considered for IP payload ..which contains TCP header..we should not consider sequence number for TCP header right ..as sequence numbers are given to data part only ??????
I think range of sequence number must cover 360 byte. For the last fragmented packet offset range would be [ 300 - 344 ]. So offset field contains number = 300. Only option C satisfies both the conditions of last fragment (MF = 0) and total 360 Byte (400-10*4 byte).i.e. possible sequence number can be [ 2400 - 2759 ] . That's why option C. I don't think initial sequence number assumption (as zero) is valid always. correct if wrong !
What if option C is given as = Last fragment,5000 and 5359. is it correct too ?
there is a similar problem has been given in "Forouzan book"
The reason is Header length is number of 32 bit words. So header length = 10 * 4 = 40
Aditi Dan Not useful....
Can someone help me understand examples on...