# GATE2016-1-53

6.2k 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________.

edited
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.
3
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 . :)
4
Datagram is data +IP header . so yes need to remove . otherwise explicitly given in question. Like in 2017 set 1 question they give.
1
@Prashant

I think in gate 2016 set 1

However you are correct as per concept .

Thanks :)
2

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.

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
0
should we not do scaling here?
12

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

Need to be change !

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

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

3

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

1

1

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 "

0
IP datagram = 1000B

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.

0
It is 980/80 upper ceiling..last packet would be left with 20B

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$

edited
1
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
2
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
1
If payload is not multiple of 8 then what to do
2
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 thanks :)

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

IP datagram of size 1000 bytes

MTU = 100B

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.

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

1
15.8k views
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}$.
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.
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 ___________.
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 __________