The Gateway to Computer Science Excellence
+20 votes
4.8k views
An IP datagram of size $1000$ $\text{bytes }$arrives at a router. The router has to forward this packet on a link whose MTU (maximum transmission unit) is $100$ $\text{bytes }$. Assume that the size of the IP header is $20$ $\text{bytes }.$

The number of fragments that the IP datagram will be divided into for transmission is________.
in Computer Networks by Loyal (7.2k points)
edited by | 4.8k views
0
If datagram length includes header length, then data=980 B. However, 980 is not a multiple of 8, while data length should be a multiple of 8. So, is it that there are 2 incoming IP datagrams, and now they are to be divided?
0
So you have that last incompletely filled packet for that
–2
Answer comes out to be different if considering the fact that 980B of data length is not a multiple of 8.

Assuming header length is included in IP datagram size.

- IP datagram of size 1000B

- So data = 980 B. Nearest multiple of 8 = 976.

- So 2 incoming IP packets -> Packet1 [20 header, 976 data] and Packet2 [20 header, 24 data].

These packets will be fragmented by router as MTU of next network is 100B.

ie. In next network, IP datagram has 80 B data. (mutliple of 8).

Router processes Packet1 into ceil(976/80)= 13 packets.

Router processes Packet2 into ceil(24/80)= 1 packet (ie. not fragmented).

=> Net packets reaching 2nd network = 13+1 =14.
+2
Could anyone plz clarify whether we need to take 20 bytes of header or not while calculating the data size .

i.e. Should i take 1000- 20 or should i take 1000

However in both cases answer will be 13 only . :)
+3
Datagram is data +IP header . so yes need to remove . otherwise explicitly given in question. Like in 2017 set 1 question they give.
0
@Prashant

I think in gate 2016 set 1

However you are correct as per concept .

Thanks :)
0

 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.

5 Answers

+52 votes
Best answer
IP Datagram size $=1000B$
MTU $=100B$
IP header size $=20B$
So, each packet will have $20B$ header + $80B$ payload.
Therefore,$80 \times 12 = 960$
now remaining $20B$ data could be sent in next fragment.
So, total $12 + 1 = 13$ fragments.
by Loyal (9.4k points)
edited by
0
should we not do scaling here?
+12

Datagram contain  data + ip header . so last fragment contain 20 byte.

Need to be change !

+1
Shouldn't the datagram size 1000 B also include 20 B header??? Why is that not considered in the solution??
0

- when a packet reaches to router it also contain header in it so you may consider 980 B payload + 20B header

+1

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

0
Is datagram contain IP header or datagram doesnot contain any header?

Any link for this?
0

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 "

+36 votes

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.

by Junior (533 points)
edited by
0
why ans is not 14

ip datagram=980+20 and MTU= 20+80  , so we have to select multiple of 8 which is less than 80.

which is 72 then partitioning 980 then total 13 parts will be there like 20+72 and 14th part will be 20+48.then total 14 fragments will be ther???????? plz correct me if i am wrong
+1
the last fragment need not be a multiple of 8 we count only the palyload to be a multiple of 8 hence out of the 980 bytes payload we divide it according to the mtu of the target which is 80(data) +20(header)  (mtu consists of the header part of the network layer also ) hence we split it as 80*12+ 20 bytes hence total 13 fragments
0
If payload is not multiple of 8 then what to do
+1
when payload is not a multiple of 8 see that the beginning fragments should be a multiple of eight the last fragment need not be a multiple of 8 as it has no fragments behind it.. on the whole the entire payload need not be a mutiple of 8
+4 votes

       

thanks :)

by (459 points)
+1
@Harit, If datagram length includes header length, then data=980 B. However, 980 is not a multiple of 8, while data length should be a multiple of 8. So, is it that there are 2 incoming IP datagrams, and now they are to be divided?
+2 votes
13 fragments
by (163 points)
0 votes

IP datagram of size 1000 bytes

MTU = 100B

Header size = 20B

Since MTU is 100B we cant transmit entire 1000B at a time so we need to perform fragmentation here.

Data in one fragment = Total size - header size = 100-20 = 80B

Total fragments = 1000/80 = 12.5                           

So we need 13 fragments.

by Junior (935 points)
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
50,651 questions
56,214 answers
194,175 comments
95,433 users