Log In
23 votes
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
edited by
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?
So you have that last incompletely filled packet for that
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.
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 . :)
Datagram is data +IP header . so yes need to remove . otherwise explicitly given in question. Like in 2017 set 1 question they give.

I think in gate 2016 set 1

However you are correct as per concept .

Thanks :)

 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.

6 Answers

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

edited by
should we not do scaling here?

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

Need to be change !

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

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



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

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

Any link for this?

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 "

IP datagram = 1000B

Header = 20B

Data = 1000 - 20 = 980 B


The router has to forward the packets on a link whose MTU is 100B.

Therefore each packet at max can have 80B of data because of 80B + 20B(header) = 100B.

Now data in the packets should be a multiple of 8 consider the limitations of Offset field.


980 will be divided into 11 packets of 80B each, 1 packet of 76B and 1 packet of 24B, so finally,

880 + 76 + 24 = 980.

Answer = 13 fragments.
It is 980/80 upper ceiling..last packet would be left with 20B
38 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.

edited by
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
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
If payload is not multiple of 8 then what to do
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
5 votes


thanks :)

@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?
3 votes
13 fragments
1 vote

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.

0 votes

I think using the formula seal(data size/mtu data size) will give incorrect answer if mtu data size is not a multiple of 8. 

Eg: Suppose ip packet size=60B, ip header size= 10B and mtu=20B.

now, seal(50/10) = 5.. But actually data is sent as (8,10) each and will take 8B*6+2B*1=7 packets in total. Although this wouldn't be the case for for many questions.. or take seal(50/8)=7...



Related questions

69 votes
16 answers
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of $1$ $\text{megabyte}$ and the maximum output rate is $20$ $\text{megabytes}$ per $\text{second}$. Tokens arrive at a rate to sustain output at a ... machine needs to send $12$ $\text{megabytes}$ of data. The minimum time required to transmit the data is _____________ $\text{seconds}$.
asked Feb 12, 2016 in Computer Networks Sandeep Singh 15.8k views
42 votes
8 answers
A sender uses the Stop-and-Wait ARQ protocol for reliable transmission of frames. Frames are of size $1000$ bytes and the transmission rate at the sender is $80$ Kbps (1 Kbps = 1000 bits/second). Size of an acknowledgment is $100$ bytes and the transmission ... $100$ milliseconds. Assuming no frame is lost, the sender throughput is ________ bytes/ second.
asked Feb 12, 2016 in Computer Networks Sandeep Singh 10.2k views
41 votes
8 answers
Consider the weighted undirected graph with $4$ vertices, where the weight of edge $\{i,j\}$ is given by the entry $W_{ij}$ in the matrix $W$. W=$\begin{bmatrix} 0&2 &8 &5 \\ 2&0 &5 &8 \\ 8&5 &0 &x \\ 5& 8 &x &0 \end{bmatrix}$ The largest possible integer value of $x$, for which at least one shortest path between some pair of vertices will contain the edge with weight $x$ is ___________.
asked Feb 12, 2016 in DS Sandeep Singh 9.7k views
56 votes
15 answers
Let $G$ be a complete undirected graph on $4$ vertices, having $6$ edges with weights being $1, 2, 3, 4, 5,$ and $6$. The maximum possible weight that a minimum weight spanning tree of $G$ can have is __________
asked Feb 12, 2016 in Algorithms Sandeep Singh 14k views