6.1k views

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:

1. Last fragment, $2400$ and $2789$
2. First fragment, $2400$ and $2759$
3. Last fragment, $2400$ and $2759$
4. Middle fragment, $300$ and $689$
edited | 6.1k views
+1
Hi @Arjun Sir there is no sequence number field in IPV4 . It should be changed to fragment offset  , that too before diving by 8
0
ALWAYS 4 WILL BE THE SCALING FACTOR IN THE HLEN FIELD?
+1

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 ??

0
why are we talking about sequence number in ipv4??

The no of data bytes of ipv4 packet a head of any fragment divided by 8 is the fragmentation offset. But why are we taking them as sequence no?
+1

sushmita  you analyze it in a wrong way

Now see the best answer...you understand properly

0
HLEN=10 it means ip header is 40 bytes. How are u dividing it into 20 bytes TCP and 20 bytes ip header?
0

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.

edited
+1
You have assumed that sequence number has started from 0 for 1st Byte of first fragment but as for as I know sequence number is allotted randomly. So, we can only be sure that difference between sequence number for first Byte and last Byte must be 359. We can't surely tell that it must start with 2400.
0

@amar u are saying that 2400 represents how many Bytes are before this.. then how come it becomes the first byte..?

+3
2400 is the first byte of the last packet.
0
@Nitesh Tripathi what you mention is the case at Transport layer.
0
BUT sequence number is given to every byte of the data which doesn't include header bytes of tcp too??
0
Offset given is 300 which means (300*8=2400)2400 bytes are ahead of that packet, and in one packet we can store 360 bytes after removing header of 40 bytes as total length is 400 bytes but 2400 is not multiple of 360 so how can we divide packets?
0
why 8 is scaling factor here??
0
1Byte = 8Bits
0

@sushmita

@tusharp

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 ??????

0
For those who are getting confused between HLEN and size of header here is the answer. These are two different things. HLEN is feild in ip header.To find the size of header using hlen multiply it by 4 which is scaling factor.

=400-40

=360

M bit is 0 so it is last fragment

offset is 300

so packet's first bit  300*8=2400

last bit =2400+359=2759

so ans is c
+3
You have assumed that sequence number has started from 0 for 1st Byte of first fragment but as for as I know sequence number is allotted randomly. So, we can only be sure that difference between sequence number for first Byte and last Byte must be 359. We can't surely tell that it must start with 2400.
0
@arjun sir @pooja could you please tell me why payload is taking initial bits instead of header. Header should take first 40 bytes here then the payload. Are we assuming according to the options given?
0

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"

http://erdos.csie.ncnu.edu.tw/~ccyang/TCPIP/TCPIPSlide.html

Since M=0; It is indication of last fragment.

Data length=400-10*4=360

Fragments offset=300

Number of data byte ahead from this fragments is=300*8=2400

Last byte of last frame is=2400+360=2760

Last byte=2759(Because we starting our counting from 0---5---59)
0
I think it is silly doubt but it should be clear.

Can you please tell me why we are not taking header length equal to 10 since it is given in the question ?
+1

@Shubhanshu

The reason is Header length is number of 32 bit words. So header length = 10 * 4 = 40

+1
I think 10 means number of 4 bytes i.e 32-bit rows in the header is equal to 10

hence we are getting 10 * 4 = 40byte?
0
yes,correct
ans c)
0
m=0 , means no more fragments following,

hlen=10 : so header length =10*4 bytes

so (c) is correct
0
Can anyone please tell me how this 4 is coming? Still didn't get it :(
0

Given Fragment offset = 300, M = 0 So Last Fragment

For Fragment offset scaling factor is 8 so Total 300*8= 2400B ahead of Last fragment which are ranging from (0 to 2399)

So Last Fragment seq no starts from 2400

Now Given Total length = 400B In this Header size = 10*4=40B (Scaling factor of IP Header = 4)

Data = Total length - header length = 400-40 =360B

So Sequence number of last byte = 2759

Option C

1
2