The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+26 votes
5.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$
asked in Computer Networks by Veteran (363k points)
edited by | 5.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 ??

please someone clarify my doubt

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

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  

5 Answers

+46 votes
Best answer

$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.

answered by Boss (30.8k points)
edited by
+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.
Please, do reply me if I get it wrong.
0

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

plzz answer...

+2
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
+22 votes
payload =total length-header

             =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
answered by Boss (31.8k points)
+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.
Please, do reply me if I get it wrong.
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 ?

+17 votes

there is a similar problem has been given in "Forouzan book" 

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

answered by Loyal (8.2k points)
+6 votes
Since M=0; It is indication of last fragment.

Data length=Total Length-header length

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)
answered by Loyal (9.1k points)
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
+3 votes
ans c)
answered by Loyal (5.3k points)
0
m=0 , means no more fragments following,

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

so (c) is correct
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,599 questions
48,601 answers
155,673 comments
63,739 users