10.5k views
Two hosts are connected via a packet switch with $10^7$ bits per second links. Each link has a propagation delay of $20$ microseconds. The switch begins forwarding a packet $35$ microseconds after it receives the same. If $10000$ bits of data are to be transmitted between the two hosts using a packet size of $5000$ bits, the time elapsed between the transmission of the first bit of data and the reception of the last bit of the data in microseconds is ______.

edited | 10.5k views
0
Arjun sir, if u say that 2nd packet is start transmitting after 520 Msec  then 500 Msec required just to transmit its bits to network then further 20 Msec must be required to propogate its bits to switch .sir plz explain this because i didn't got ur point of neglecting Propoagation delay(Packet 2 just follow packet 1) because packet 2 is not present in n/w buffer before 1020 Msec then further 20 msec for pd . Correct me if I m wrong
0
Doubt :

Time elasped b/w 1st and last bit of data...
Since 1st bit reached at destination at 555microsec,

last bit reached at destination 1575 microsec.

So time elapsed b/w them should be 1575 - 555 = 1020s????
0
I understood
1st bit transmition start it is saying.

since 1st bit transition start at 0second

so time elasped b/w (Transition of first which is 0) and (Reching of last which is 1575) = 1575us
+1
both of the packets were sent simultaneously one after the other by the 1st host, so the packet delay was added only once. Both of them were stored at the buffer queue of the router.
+3
0
Transition time of last or second packet + time of first packet to reach the destination from  source = 500 +(500+20+35+500+20)=1575 microsec.
0
how can we say that "is this cut through switch or store and forward switch"????

if it is cut through switch then transmission time of switch will not be considered..

correct me if i am wrong.

No. of packets sent $=\dfrac{10000}{5000}= 2$.

Time for the first packet to reach switch $=\text{Transmission time + Propagation delay}$
$= \left(\dfrac{5000}{10^7}\right)\times {10^6}\mu s+20\mu s$

$= 520\mu s.$

$($Another $520\mu s$ is required for the same packet to reach the destination from the switch and in between there is a forwarding delay of $35\mu s.$ So, first packet is received at destination at $2\times 520+ 35=1075 \mu s. )$

After $520 \mu s,$ the switch can start receiving the second packet and at $520 + 500 = 1020 \mu s,$ second frame is completely received by the switch $($we don't need to add propagation time here as packet $2$ can just follow packet $1 )$.

So, at $1055\mu s$ from the start the switch starts sending the second packet and this will be received at destination after another $520 \mu s=1575 \mu s.$ Since we added transmission time, this ensures that the last bit of data is received at the sender.

EDIT:-

(Alternate solution)

We can think the same question in terms of last packet, argument here is: The moment last packet reaches to destination, all other packets are already reached.

Total time $=\text{Transmission time of all packets + Propagation time for first link}$
$\text{+ Switch Delay + Transmission time of last packet for Switch}$
$\text{+ propagation time for 2nd link}.$

$=\left (\dfrac{10^4}{10^7}sec=1ms=1000\mu s \right) 1000 + 20 + 35 + 500 + 20=1575\mu s.$

by Veteran (425k points)
edited by
0
It can simply use a different storage for receiving and sending and copy the packet as soon as it is arrived fully.
0

@arjun sir

I'm interrested in Packet 2 only

case 1  packet2 moving from sender
Like you said in the beginning
" (we don't need to add propagation time here as packet 2 can just follow packet 1) "
You took only 500us
case 2 : packet 2 moving from switch
But while the packet is moving fom switch you did add 20us for propagation delay .

Why it is so ?

0
in case 1, sender is having all packets ready. So, it just fires them back to back (unlike stop and wait).

In case 2, also you can consider like that. But then we have to calculate from receiver end - 1075+500 = 1575. I calculated from switch - 1055+520 = 1575.
0
@arjun sir , what is the logic in considring propogation delay in case 2 ? I didn't understand that , I have updated my answer pls check it sir
0
one of the best trickiest question i have encountered in the "computer network" so far
+2

Sir..2-3 clarifications are needed
At 520 whole first packet will be reached at switch. And at 1020 switch will get bits of 2nd packet?
I used to think tht transmission time is time taken to place the data on the link.
And propagation time is the time data take to travel through the link.
But u said that at 1020 time second frame will be reached at switch..

I think at 1020 second frame completes its transmission and it will take 20micro sec to propagate but that time will be overlapped with the time taken by first frame at switch and further transmission. (So no need to calculate that propagation time.)

0
Yes, what you were thinking was correct only. So, At 1000, second frame would be "transmitted" rt?
0
Yes it will start traveling from A to switch.
0
Very clever solution
U recognized that second packet was stored and forwarded and so u added there transmission delay
0
Are we assuming store and forward switch here? Otherwise why not start sending from switch towards destination as soon as the queuing 35 seconds finish while we're still receiving bits from source.
0
@Sachin, I think the alternate solution proposed by you have a flaw if u follow ur given formula:-

Just try this keep all data same except switch's transmission delay 700MicroSec.

And tell me the ans??
0
bro which formula ?

I may be incorrect, but tell me precisely where i am wrong.
Thnks :)
0

Total time = Transmission time of all packets +  Propagation time for first link + Switch Delay + Transmission time of last packet for Switch + propagation time for 2nd link.

//Consider all data same except below...and solve the given question and tell me ans.

Transmission time for Switch=700 Micro Sec..

0
Why i am supposed to take $700$ ?
I am not getting..sorry :(

If you strongly feel that i made some mistake, then feel free to edit :)
0

I think ur approach is working for some cases.(Means not working for all cases)

If i take all data same except Transmission time for Switch=700 Micro Sec

then according to ur approach ans will be:->>1775

But in real if u will analyze by time line diagram with pipelining then ans will be 1975.

(The flaw in ur approach is U r strictly considering only last packet u r not bothering about any packet else last...But the special case i provided here..Ur last packet will go into a wait state of 200MicroSec bcz 1st packet is still in transmitting stage .So unlike 1775 as per ur approach ans will be 1975.

Plz analyze and correct me!!!

+1
Bro, what r is u doing?

U are taking transmission time of switch differently for different packets?

frame me an EXACT question like they ask in GATE. And i will tell u that everything is cool.
+1

@Sachin Plz Solve this question using ur approach(an EXACT question like they ask in GATE):-

Two hosts are connected via a packet switch .The bandwidth of Source to packet switch is 107bps and Packet switch to Destination is $\frac{50}{7}$ Mbps . Each link has a propagation delay of 20 microseconds. The switch begins forwarding a packet 35 microseconds after it receives the same. If 10000 bits of data are to be transmitted between the two hosts using a packet size of 5000 bits, the time elapsed between the transmission of the first bit of data and the reception of the last bit of the data in microseconds is ______.

+1
The second solution is good.It will save from calculation mistake:)
0
Arjun sir can we do this problem with this approach

For sending 10000bits 1milisecond of time required...

So propogation time is 0.020miliseconds*2+0.035miliseconds

Adding all this value to 1.075miliseconds which 1075microseconds
0
Total time =Transmission time of all packets + Propagation time for first link=Transmission time of all packets + Propagation time for first link
+ Switch Delay + Transmission time of last packet for Switch+ Switch Delay + Transmission time of last packet for Switch
+ propagation time for 2nd link.,

what modifcation do I need in the formula if I get n packets and there are  n routers in between?

​​​​​$\text{number of packets send }=\frac{10000}{5000}=2$

$\text{Transmission Time }=\frac{5000}{10^{7}}=500$micro seconds

$\text{Propogation Time }=20$micro seconds

packet 1

At t=0
packet starts from source
At t=500

packet 1 is fully transmitted by source. Now it is availble in the link

At t=520
packet 1 is availbe at swich

At t=555
packet transmission starts from switch after waiting for 35μs

At t= 1055
packet 1 is fully transmitted by switch . Now it is availble in the link

At t=1075

packet 2

At t=500
packet starts from source

At t=1000
packet 2 is Now available in the Link. Fully transmitted from source .packet 2 Now, begins to propogate to Switch

At t=1020

packet 2 now reachs switch

At t= 1055

packet transmission starts from switch after waiting for 35μs

At t=1555

packet 2 is fully transmitted by switch . Now it is availble in the link

At t=1575

packet 2 Reaches destination

by Boss (21.3k points)
edited by
+4
yes, timing diagram makes it simple. You can just add what happens at sender, a packet is sent immediately after the first one - no waiting time and whole 500 ms is for sending the first packet (transmission time). That will make the explanation super simple :)
+4
+2
isse achha xplanation ho hi nii skta @pc bhai
0

" the time elapsed between the transmission of the first bit of data and the reception of the last bit of the data"

Here it is asking the total time from end to end right? But at time 1575 only the first bit of data will have reached the reciever right?

+1
Thanks. Its simplest Explanation.
+1

why packet 2 starts at t=500 ?

Is it because of it was already waiting in buffer?

0
very nicely explained! Thanks..
0

Hey, Please Anyone help me, why you start the second packet at=500 microsecond?, But Packet switching theory says that first packet completely reach to the switch then only second packet will start transferring.

So first packet reached to the switch at t=520 microsecond, So second packet start the transmission at t= 520 microsecond.

please correct me if I am wrong?  @Arjun Sir,

0
Clear explanation indeed...!!!
0
nice soution
+1
Just select this solution as best why arjun sir answer is selected as this answer get max upvote is GO is biased :D
+2
@Moin If maximum voted answer is always selected as best, most people will never get to IITs :P And GO is indeed biased. If you dont like, please leave the place.
0
sorry arjun sir I think i should not write previous comment as GO is best in terms of any type of prepration related to computer science. I always promote this.
0

we have propagation delay only for the first packet

I used this logic got answer 1535 micro sec. Exactly 40 less when I ignore the Tp of 20 micro sec from sender to switch and from switch to destination. I am not getting that statement that Tp need not be considered as it is following 1st packet.

0
absolutely brilliant solution. after struggling for half an hour saw your solution and got it with in half second. Thanks...
+1

Thank you sir !!!

The simplest super explanation i had ever seen.

0
Just to simplify it, what ever happens to packet1 happens to packet2 after 500microseconds..(since transmission of packet2 starts after transmission of packet 1 is completed) .Here packet1 reaches destination host at 1075 microsec (500+20+35+500+20)from the beginning. So packet 2 reaches the destination 500microsec after that which means it reaches destination at 1575microsec
0

Transmission of the first bit of data at t=0

Reception of the last bit of the data at t= 1575

The time elapsed between the transmission of the first bit of data and the reception of the last bit of the data = 1575 -0 = 1575

Transmission time for a packet $\frac{5000}{10^{7}}=500microsec$

Propagation time for a packet $20microsec$

Swithching delay $35microsec$

So, overall transmission time of 1st packet =$2\times 500+2\times 20+35=1075 microsec$...................i

Second packet needs only last transmission $500microsec$..................................................................ii

So, total transmission time $1075+500=1575 microsec$

by Veteran (117k points)
0
@srestha Awesome answer, but I have an question, why didn't you take the propagation delays and delay time at switch for 2nd packet? And only the 1*TT for 2nd packet?

packet switching  follows pipelining and the main hero is pipelining  in this question.

by Active (3.2k points)
+1

@bharti nice .........

Transmission time, Tt = ( 5000 / 10) *106 μs  = 500 μs
Tp= 20 μs, switch delay= 35 μs
Total time to reach destination (For packet1) = (500+20+35+500+20) = 1075 μs

Now, I am going to make it easy for you. Always think like this.
There is a train.
Packet2 -> Packet1->
(Transmission time is time for the train to go to track from the station, the propagation time is to cover the track.)

Just tell me in a train, if 1st Bagi reaches in time x, when will second bagi reach destination? Is it that hard? 2nd bagi (Packet2) is 500 μs apart from Packet1. Because Tt from sender was 500 μs.
So it will reach 500 μs after it. Very simple.

But there is something to think about in this question.
In the way, they stop the train, take a delay of 35 μs. We have included it for bagi1(Packet1).
So do we need to add it to bagi2 too? Will the two bagis get separated due to this?
No. Why?
Before checking, you think yourself.
.
.
.
.
Because see the time for bagi1 again.
500+20+35+500+20
At time 500, bagi2 started. at 520 bagi1 is at that stoppage.
At time 555 bagi1 left station, it should come to track from the railway station in 1055, For bagi2 transmission time is not over yet.
at time 1000, bagi2 is at the stoppage. For bagi1 55time left to leave the stoppage station.
During this bagi2 took 35 delay, Bagi 1 has 20more time to leave stoppage station. So Bagi2 is ready too. So after 20 bagi2 will just be connected to bagi1. So there will be no gap in between them. So bagi2 will reach just after 500 μs of bagi1.

So I prefer this way of doing.
By the way, it is not always going to happen that they will be connected always and you will just add Tt, that is the extra time for packet2.
They may get separated in the way. So you can calculate that separation between them, you add it at last.
Here bagi2 covered it's delay when bagi1 was still transmitting. So they did not get separated. If the delay would be more than 55μs then they would get separated and you would have to add that distance too.

Anyway answer is 1075 μs + 500 μs = 1575 μs

by Boss (12.2k points)
There are 10000/5000 = 2 packets.

Transmission time for 1 packet = 5000 bits / 10^7 bps = 500 micro sec.

Packet 1 reaches in 500 (transmission from source) + 20 ( propagation to switch) +35 ( switch delay) + 500 (transmission from switch) + 20 (propagation to receiver) = 1075 micro sec.

Since packet 2 starts 500 micro sec after packet 1, the last bit of it reaches in 1075 + 500 = 1575 micro sec.

Correct me if I am wrong.
by (11 points)
0
if 3 pkt instead of 2 pkt what will be the ans

Timing diagram , I hope now now u can visualises

by (339 points)