Practically, the header size of any IP packet must not be less than 20 bytes (can be observed from the IPv4 datagram format).

The Gateway to Computer Science Excellence

+79 votes

Best answer

**Correct answer should be option D.**

As we know in packet switching- dividing message into packets decrease the

transmission time due to pipelined transmission.

but if there are many packets beyond some threshold then transmission time may

increase. So, we can do by option checking

**1.** packet size $=4 =\text{ packet data + header size}= 1+3$

So no. of packets will be $=\dfrac{\text{message}}{\text{packet data}}$

$=\dfrac{24\ B}{1\ B} = 24\text{ packets}$.

So, time to reach at receiver for $1^{st}$ packet will be,

$=3 \text{ (source + two intermediate node)}\times \text{transmission time}$

$TT=\dfrac{L}{BW}$... Here, $L$ will be changed according to option and $BW$ will remain same ..

So time to reach at receiver for $1^{st}$ packet will be $=\dfrac{3\times 4}{BW}=\dfrac{12}{BW}$

and for remaining $23$ packets will take time $=23\times TT=\dfrac{23\times 4}{BW}=\dfrac{92}{BW}$

TOTAL TIME $=\dfrac{104}{BW}$

**2. **packet size $= 6 = 3+3\text{ ( packet data + header size)}$ so no of packets will be $8$.

Time to reach at receiver for $1^{st}$ packet will be $=\dfrac{3\times 6}{BW}=\dfrac{18}{BW}$

and for remaining $7$ packet will take time $=\dfrac{7\times 6}{BW}=\dfrac{42}{BW}$

Total time $=\dfrac{60}{BW}$

**3.** packet size $= 7 = 4+3,$ so no of packets $=\dfrac{24}{4}=6\text{ packets}$

For $1^{st}$ packet time will be $=\dfrac{3\times 7}{BW}=\dfrac{21}{BW}$

For remaining $5$ packet will take time $=\dfrac{5\times 7}{BW}=\dfrac{35}{BW}$

Total time$=\dfrac{56}{BW}$.

**4.** packet size $=9=6+3,$ so no of packet will be $4.$

For $1^{st}$ packet time will be $=\dfrac{3\times 9}{BW}=\dfrac{27}{BW}$

For remaining $3$ packets will take time $=\dfrac{3\times 9}{BW}=\dfrac{27}{BW}$

TOTAL time $=\dfrac{54}{BW}$

So, optimal packet size will be $9\text{ byte}$ due to less total transmission time.

**Alternate method (thanks to sachin )**

In that case we can do it using minimisation of a variable.

Let, $24\text{ byte}$ data is divided into number of packets each have $x\text{ byte}$

of data.

Therefore, packet size $=x+3,$ and Number of packets $(k)=\dfrac{24}{x}$.

(it is ceil, if $24$ is not multiple of $x$ )

Total time =$3(x+3)+ (k-1)(x+3)$ (assumed $BW =1,$ just to avoid writing $"BW"$

again and again)

(ignoring propagation delay as it has nothing to do with packet size, if one wish

he/she can add that too but later he will realize it will anyway become zero while differentiating. )

$\Rightarrow$ Total time $=2x+3k+kx+6$ ( $k$ is equal to $\text{24}/{x}$ )

$\Rightarrow$ Total time $= 2x+\left(\dfrac{3\times 24}{x}\right)+\left(\dfrac{24*x}{ x}\right)+6$

$\Rightarrow$ Total time $=2x+\frac{72}{x}+30$

to minimise this time, differentiation should give $0.$

that gives, $2−\dfrac{72}{x^{2}} = 0$

$\Rightarrow x=6$.

including $3\text{ bytes}$ of header, packet size $=9\text{ Bytes}$.

**Option is D.**

0

why remaining 23 packets will take time = 23 *TT

why not 23*3*TT as there are (source + two intermediate node)

PLease Explain ??

why not 23*3*TT as there are (source + two intermediate node)

PLease Explain ??

+85

@ sonam vyas Good explanation. But what if there are no options and it is numerical answer type ? :D

In that case we can do it using minimisation of a variable.

Let 24 byte data is divided into number of packets each have $x$ byte of data.

Therefore packet size = x+3, and Number of packets (**k**) = $\frac{24}{x}$. (it is ceil, if 24 is not multiple of x)

total time = 3(x+3)+ (k-1)(x+3) (assumed BW =1, just to avoid writing "BW" again and again)

(ignoring propagation delay as it has nothing to do with packet size, if one wish he/she can add that too but later he will realize it will anyway become zero while differentiating. )

$\implies$ total time = $2x+3k+kx+6$ (k is equal to $\frac{24}{x}$)

$\implies$ total time = $2x+\left (3\times\frac{24}{x} \right )+\left (\frac{24}{x} \times x \right ) +6$

$\implies$ total time = $2x+ \frac{72}{x} +30$

to minimise this time, diffrentiation should be 0.

that gives, $2-\frac{72}{x^2}$ = 0 $\implies x=6$

including 3 bytes of header, packet size = 9 Bytes.

Option **D**.

+1

@sonam plz explain what do u mean by

" so time to reach at receiver for 1st packet will be = 3(source + two intermediate node)* transmission time"

" so time to reach at receiver for 1st packet will be = 3(source + two intermediate node)* transmission time"

+5

@srestha

she means since there are 2 intermediate nodes(excluding source) means u have to transmit every packet 3 times to reach destination...so for first packet it will take this much time means 3Tt..and for remaining packets only 1 Tt(simply pipelining)...

she means since there are 2 intermediate nodes(excluding source) means u have to transmit every packet 3 times to reach destination...so for first packet it will take this much time means 3Tt..and for remaining packets only 1 Tt(simply pipelining)...

+2

He he...thnks for compliment :)

And i am not "sir" Just an aspirant like u :)

I am also big fan of u :D :)

And i am not "sir" Just an aspirant like u :)

I am also big fan of u :D :)

+8

Ok, dont assume it.

U will get total time = $\frac{1}{\text{ BW }}\times [3(x+3)+ (k-1)(x+3)]$

and at the end after diffrentiation, u will get this- $\frac{1}{\text{ BW }}\times [2- \frac{72}{x^2}] = 0$. It wont effect anything.

By the way, u can solve same question focusing on last packet (instead of first packet)

(we know that the moment last packet reaches destination, all other packets are already reached.)

Let Number of packets (k) = $\frac{24}{x}$ (where $x$ is size of data in single packet.)

each packet size is = $x+3$

Total Bytes needs to transmitted from source = $24+3k$ ($k$ packets and each has 3 byte of header.)

Transmission time of all packets from source = $\frac{24+3k}{\text{ BW }}$ (u can take BW =1, to avoid writing it.)

Now see the time last packet takes, it got transmitted to two intermediate notes and it takes 3 propagation delay time. (of course last packet got transmitted from source also, but this time is already included in $\frac{24+3k}{\text{ BW }}$)

Time for last packet = $2 \times \text{transmission time }+3 \times \text{propagation time }$

=$2 \times \frac{x+3}{\text{ BW }}$ (ignoring propagation time)

Total time = $\frac{24+3k}{\text{ BW }} + 2 \times \frac{x+3}{\text{ BW }}$

after putting $k=\frac{24}{x}$ and differentiating wrt $x$, u will get same equation as previous which is $2-\frac{72}{x^2}=0$

U will get total time = $\frac{1}{\text{ BW }}\times [3(x+3)+ (k-1)(x+3)]$

and at the end after diffrentiation, u will get this- $\frac{1}{\text{ BW }}\times [2- \frac{72}{x^2}] = 0$. It wont effect anything.

By the way, u can solve same question focusing on last packet (instead of first packet)

(we know that the moment last packet reaches destination, all other packets are already reached.)

Let Number of packets (k) = $\frac{24}{x}$ (where $x$ is size of data in single packet.)

each packet size is = $x+3$

Total Bytes needs to transmitted from source = $24+3k$ ($k$ packets and each has 3 byte of header.)

Transmission time of all packets from source = $\frac{24+3k}{\text{ BW }}$ (u can take BW =1, to avoid writing it.)

Now see the time last packet takes, it got transmitted to two intermediate notes and it takes 3 propagation delay time. (of course last packet got transmitted from source also, but this time is already included in $\frac{24+3k}{\text{ BW }}$)

Time for last packet = $2 \times \text{transmission time }+3 \times \text{propagation time }$

=$2 \times \frac{x+3}{\text{ BW }}$ (ignoring propagation time)

Total time = $\frac{24+3k}{\text{ BW }} + 2 \times \frac{x+3}{\text{ BW }}$

after putting $k=\frac{24}{x}$ and differentiating wrt $x$, u will get same equation as previous which is $2-\frac{72}{x^2}=0$

0

Thanks;You solved my BW=1 doubt..

But according to ur next approach to deal with this question i m not getting ur below quote:-

Transmission time of all packets from source =( 24+3k) /BW

I think you are not considering here pipelining . Bcoz u r giving all load of transmission to source only.

Plz correct me !

+2

Of course, i am considering pipeline here, just to get a shorthand calculation, I wrote directly.

U can do like this-

I want to calculate transmission time of all packets from the source.

Transmission time for one packet = $\frac{x+3}{BW}$.

there are such $k$(=$\frac{24}{x}$) packets, so toal transmission time from source = $k \times \frac{x+3}{BW}$ = $\frac{kx+3k}{BW} = \frac{24+3k}{BW}$

But it sould be preferable to write directly $\frac{24+3k}{BW}$, because i know that, this is total data that needs to transmissted from source.

U can do like this-

I want to calculate transmission time of all packets from the source.

Transmission time for one packet = $\frac{x+3}{BW}$.

there are such $k$(=$\frac{24}{x}$) packets, so toal transmission time from source = $k \times \frac{x+3}{BW}$ = $\frac{kx+3k}{BW} = \frac{24+3k}{BW}$

But it sould be preferable to write directly $\frac{24+3k}{BW}$, because i know that, this is total data that needs to transmissted from source.

+2

Thanks Understood.

Just need confirmation of below to points.

And suppose they will give propagation time in question:-

1.If they ask abt optimal packet size then ignore it.

2.if they ask total time from source to destination then include it.

is n't it?

Just need confirmation of below to points.

And suppose they will give propagation time in question:-

1.If they ask abt optimal packet size then ignore it.

2.if they ask total time from source to destination then include it.

is n't it?

+4

Yes u r right.

For 2nd statement, u can check this GATE question- https://gateoverflow.in/2153/gate2012_44

I commented there also.

For 2nd statement, u can check this GATE question- https://gateoverflow.in/2153/gate2012_44

I commented there also.

0

Can we establish a relation here that when the data size in a packet is less in comparison to control information(header size) then such packet size will be worst as it will increase transmission time in case of option a .

0

$=3 \text{ (source + two intermediate node)}\times \text{transmission time}$

you should modify this line to avoid confusion to

$=3 \times \text{transmission time}$ \\ why 3? (source + two intermediate node)

you should modify this line to avoid confusion to

$=3 \times \text{transmission time}$ \\ why 3? (source + two intermediate node)

+26 votes

**option D**

packet size $P = p+h$. where, $h$ is header size and

$p=\sqrt{\dfrac{hx}{k-1}}$ where, $x$ is message size and $k$ is no. of hopes.

so $p=\sqrt{\dfrac{3\times 24}{2}}=\sqrt{\dfrac{72}{2}}=\sqrt{36}= 6$

so Optimum packet size is $ 6 + 3 = 9.$

+1

EASY METHOD.

(k+(n-1))*(packet size)*transmission time

k is number of hops

n is number of packets.

transmission time is for one byte(unit)

so ,these method is derived from above calculation.you can expand and check by yourself

(k+(n-1))*(packet size)*transmission time

k is number of hops

n is number of packets.

transmission time is for one byte(unit)

so ,these method is derived from above calculation.you can expand and check by yourself

+1

0

@skrahul k- No of hopes here in the question is 2 so in the denominator it should have been 1 instead of 2

0

@Sachin Mittal 1 @Shaik Masthan @Rajesh Panwar

If Propagation time (given per hop ) would have been considered just for concept clearance, how much time it should be added

Accn to me, ( Tp * No of hops ) should be added only once (For first packet propagation delay)

So final total time for n packets and p hops

should be = **( Tp * p) + 1* p * Tt + (n-1) *Tt**

Is it correct??

+7 votes

suppose x=message size, h=header size, p=payload/packet date size ,assume bandwidth is b bps,no of hopes=k

total no of packets= x/p

--->> when message is packetized then these are send in a pipelined manner to reduce transmission time but thereis a threshold on packet size p hence it may not be more large or more small it must be optimum (??)

now we first derive transmission time ("ist packet takes transmissioon delay by all the intermediate nodes and source or transmission delay on all hopes and rest all packets take onle one hope transmission delay due to pipeline ")

transmission time =tt=

(p+h)*k / b +(x/p - 1)*(p+h)/b

=1/b( (p+h)*k + 1/p (x-p) (h+p))

// so resultantely we want to find minimum transmission delay at optimum packet size so differentiate tt w.r.t. p we get //

dtt/dp= 1/b(k*p^{2 }-p^{2}-xh)=0

so p^{2 }=(xh/k-1) or p=√(xh/k-1)

here h=3 x=24 k=3

p=√(24*3)/2 =6

so packet size =p+h=6+3=9 bytes

+6 votes

Dividing a message into packets may decrease the transmission time due to parallelism as shown in the following figure. But after a certain limit reducing the packet size may increase the transmission time also. Following figure shows the situation given in question. Let transmission time to transfer 1 byte for all nodes be t. The first packet will take time = (packet size)*3*t. After the first packet reaches the destination, remaining packets will take time equal to (packet size)*t due to parallelism.

If we use 4 bytes as packet size, there will be 24 packets Total Transmission time = Time taken by first packet + Time taken by remaining packets = 3*4*t + 23*4*t = 104t If we use 6 bytes as packet size, there will be 8 packets Total Transmission time = 3*6*t + 7*6*t = 60t If we use 7 bytes as packet size, there will be 6 packets Total Transmission time = 3*7*t + 5*7*t = 56t If we use 9 bytes as packet size, there will be 4 packets Total Transmission time = 3*9*t + 3*9*t = 54t

+2 votes

Very simple solution - https://www.aspirebuzz.com/content/packet-switching-network-packets-are-rout

Packet switched network message = 24 bytes

Header size = 3

Case 1: If packet size = 4

Then data = 4-3 =1 bytes only So require 24 packets

Case 2: Packet size 6 Data = 6-3 =3 Require 8 packets.

Case 3: Packet size = 7 Data = 7-3 =4 Require packets.

Case 4: Packet size=9 Data = 9-3 =6 Require Packets.

So min requirement is in case 4. Hence (d) is correct option

0 votes

Testing as per Option,Assume Transmission time =t

Option a)Optimum size= 4Bytes.i.e

Total packets required are **6 packets** each of size 4Bytes which makes Msg size=24B

1)for 1st packet: Time required= 3* transmission time=3t (assume tp=0)

2)1)for remaining 5 packets: Time required= 5* transmission time=5t {due to paralellism}

Total time =3t+5t=8t

Option b)Optimum size= 6Bytes.i.e

Total packets required are **4 packets** each of size 6Bytes which makes Msg size=24B

1)for 1st packet: Time required= 3* transmission time=3t (assume tp=0)

2)1)for remaining 3 packets: Time required= 3* transmission time=3t {due to paralellism}

Total time =3t+3t=6t

Option c)Optimum size= 7Bytes.i.e

Total packets required are **4 packets** each of size 7Bytes which will envelope msg into packet by keeping some free space .i.e Msg size=24B

1)for 1st packet: Time required= 3* transmission time=3t (assume tp=0)

2)1)for remaining 3 packets: Time required= 3* transmission time=3t {due to paralellism}

Total time =3t+3t=6t

Option d)Optimum size= 9Bytes.i.e

Total packets required are **3 packets** each of size 9Bytes which will envelope msg into packet by keeping some free spacei.e Msg size=24B

1)for 1st packet: Time required= 3* transmission time=3t (assume tp=0)

2)1)for remaining 2 packets: Time required= 2* transmission time=2t {due to paralellism}

Total time =3t+2t=5t

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,388 answers

198,576 comments

105,414 users