+25 votes
5.9k views

An $IP$ router with a $\text{Maximum Transmission Unit (MTU)}$ of $1500$ bytes has received an $IP$ packet of size $4404\text{ bytes}$ with an $IP$ header of length $20\text{ bytes}$. The values of the relevant fields in the header of the third $IP$ fragment generated by the router for this packet are:

1. $\text{MF bit}$: $0,$ Datagram Length:$1444;$ Offset$: 370$
2. $\text{MF bit}$: $1,$ Datagram Length$: 1424;$ Offset$: 185$
3. $\text{MF bit}$: $1,$ Datagram Length$: 1500;$ Offset$: 370$
4. $\text{MF bit}$: $0,$ Datagram Length$: 1424;$ Offset$: 2960$

edited | 5.9k views
0
HOW TO FIND THE OFFSET VALUE?, CAN ANYONE EXPLAIN PLEASE!!!!
0

"Total length of the datagram" field is of 16 bits and "Fragmentation Offset" field is of 13 bits.

2^16-1 cannot be represented using 13 bits therefore 2^16/2^13=8, 8 is the scaling factor and that's why offset is divided by 8.

1st Fragment's Offset :0

2nd Fragment's offset = Previous Fragment's Offset +(Data bytes of prev fragment/8) and so on.

## 8 Answers

+37 votes
Best answer
IP packet length is given $4404$ which includes ip header of length $20$
So, data is $4384$.

Now, router divide this data in $3$ parts
$1480\quad 1480\quad 1424$

After adding ip header in last packet size is: $1444$ and since its the last packet therefore $MF =0$

And offset is $\dfrac{2960}{8}=370$

Correct Answer: $A$
by (269 points)
edited
0
I am getting Datagram length=1424,or we add header length always at the last fragment?
+1
why the offset is not 3000/8? offset is the relative positon of fragment in a datagram, then why r we nt considering the headers?
+8
@https://gateoverflow.in/user/reena+kandari
datagram =header + data=20+1424=1444
+11

The format of data that can be recognized by IP is called an IP datagram. It consists of two components, namely, the header and data, which need to be transmitted.

So when datagram length is asked...Header length is also added.

0
first offset: 0 ---184
second offset :185---370
third oofset :371----549
where i am wrong ??
0
First offset : 0 - 184

Second offset : 185 - 369 (including both extremes)
0
Can you please explain to me how to calculate fragment here?
0
MTU always contain 20 B of header.rt?
As it is not mentioned ,I am asking.
+1

srestha i hope you mean IP header and its minimum length is 20 bytes and max is 24 bytes

0

Mk Utkarsh max ip header length = 24 bytes? how can you plz explain ...

0

@Mk Utkarsh Minimum length of an IP header is 20 Bytes and maximum length of an IP header is 60 Bytes.

0

ok thanks fo correction

+15 votes Thanks :)

by (459 points)
+7 votes
Ip packet size excluding the header=1404-20=4384

MTU of router/Network/Gateway=1500

No. Of fragments=ceil(4384/1500)=~3

These three fragments will be multiple of 8 but max but less 1500 like

1480,1480 and 1424

Offset of last fragments is:1480+1480=2960/8=370
by Loyal (9.7k points)
+4 votes
ans a)
by Loyal (5.2k points)
+1

I m getting: MF bit: 0, Datagram Length: 1424; Offset: 370

when we say " IP packet of size 4404", is including header or without including?? If it is without including header than Datagram lenght would be 1444... but if it is including header than it would  come 1424.. As per my understading when we say packet size, we mean size of whole packet, not just part of packet (which datagram lenth in it)... anyway I'll go with option (A) because offset can't be 2960 as in case of (D)...

+1
"an IP packet of size 4404 bytes with an IP header of length 20 bytes". I would also have gone with 1424 but for offset.
+2
@Arjun Sir and @Vicky:

from Peterson Davie:

"The IP datagram, like most packets, consists of a header followed by a number of bytes of data."

So won't datagram length be 20 + 1424 = 1444 bytes?
0
How?
0
@Srestha,A lil bit of discretion of urs involved here too:-

Since the MTU size is 1500-20(Header)=1480

No for first IP Fragment 1480 +20(Header)

For second fragment 1480 +20(Header)

For third fragment 1424+20(Header)

Also,why for the offset division is done by 8?Could you please tell?

Is this the way bifurcation done?
0
Total length of the datagram field is of 16 bits and Fragmentation Offset field is of 13 bits.

2^16-1 cannot be represented using 13 bits therefore 2^16/2^13=8, 8 is the scaling factor and that's why offset is divided by 8
+4 votes
Number of packet fragments = ⌈ (total size of packet)/(MTU) ⌉
= ⌈ 4404/1500 ⌉
= ⌈ 2.936 ⌉
= 3

So Datagram with data 4404 byte fragmented into 3 fragments. 

The first frame carries bytes 0 to 1479 (because MTU is 1500 bytes and HLEN is 20 byte so the total bytes in fragments is maximum 1500-20=1480).

the offset for this datagram is 0/8 = 0.

The second fragment carries byte 1480 to 2959.

The offset for this datagram is 1480/8 = 185.

finally the third fragment carries byte 2960 to 4404.

the offset is 370.and for all fragments except last one the M bit is 1.

so in the third bit M is 0.

by Loyal (9.3k points)
edited
0

while calculating offset, we always divide it by 8..??

0

while calculating offset, we always divide it by 8..??

+3 votes

Number of fragments =ceil(4404-20/1500-2)=3(approx) Take integer

First Fragments.

 1480 20

Offset  of first fragments  :: 0 and MF =1

Second Fragments:

 1480 20

Offset  of IInd fragments  :: 185 and MF =1

Third Fragments::

 1424 20

Offset  of IIIrd fragments  :: 370 and MF =1

And datagram length is nothing but total length=1424+20=1444 Byte

Therefore option A will be right.

by Loyal (9.7k points)
0
ceil(4404-20/1500-2) why -2 here ?
0

Offset  of IIIrd fragments  :: 370 and MF =1

change MF to 0

+1
MF should be 0
+1 vote

Since we have to add ip header and then ultimately remove it , it is better to not take it in consideration while solving such questions and taking MTU by excluding IP header

Data : 4404 B

F1 : 1480 offset : 0 MF:1

F2 : 2960 offset : 185 MF:1

F3 : 1444 offset : 370 MF: 0

Fragmentation is done on data not on header

by Active (1.9k points)
0 votes

Number of packet fragments = ⌈ (total size of packet)/(MTU) ⌉
So Datagram with data 4404 byte fragmented into 3 fragments. by (263 points)
Answer:

+25 votes
5 answers
3
+22 votes
7 answers
4
+18 votes
6 answers
5
+1 vote
0 answers
6
+20 votes
5 answers
7