in Computer Networks edited by
32,903 views
106 votes
106 votes
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 ______.
in Computer Networks edited by
32.9k views

4 Comments

This timing diagram might help.

1
1

MOST IMPORTANT POINT 

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

Transmission of the first bit of data at t=0

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

0
0

Exact same question is in Peterson-davis book 5th edition pg 65, q 20

2
2

11 Answers

111 votes
111 votes
Best answer

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}\;\text{sec} = 1\;\text{ms} = 1000\mu s \right) 1000 + 20 + 35 + 500 + 20=1575\mu s.$

edited by
by

39 Comments

edited by

 Your explanation says...

After 520 μs, the switch can start receiving the second packet. I agree with this.

But, the statement, 

520 + 20 = 540 μs, second frame is completely received by the switch. I dont agree with this. After the switch starts receiving the frame, it will take 500 μs to receive the frame completely. So the switch should receive the second frame at 520 + 500 = 1020 μs. So, 1020μs + 35μs forwarding delay + 500μs transmission time + 20μs propagation delay = 1575 μs. Thus, I think Madeeasy solution is correct.

Important point: If the transmission of two frames by the first host needs 1000μs, how can the second frame be received completely by the switch in 540μs ?

1
1
500 in 520 is propagation delay. So, if packets are send in succession, we have propagation delay only for the first packet. Time from the reception of frame and till the completion of frame is transmission time.
0
0
500 in 520 in propagation delay? How is that possible? 500 is transmission time and 20 is propagation delay. Isn't it?
1
1
Yes. You are correct. Midway while solving mid way I took them other way around. 1575 is the correct answer.
0
0
This answer needs to be corrected in the key.
0
0
yes. Corrected :)
0
0
Arjun sir...forward delay and transmission delay, both are different ????
0
0
Yes of course. Forwarding delay is the time spent in the switch. This is in addition to the transmission delay.
2
2
I did  this mistake in gate exam.. :(
0
0
WHy have you not added propagation delay for the second packet ? I didnt get what you mean by the statement that the packet 2 will just follow packet 1 ?
0
0
The packets are not transmitted using stop-and-wait protocol- they go continuously as in a continuous pipeline fashion.
0
0
After source has transmitted packet1, At 500 mi sec.it will start transmitting second packet..so for last byte of  packet 2 to reach switch it will reach at 500+500(trans time) +20(prop delay)=1020 mi sec

then at switch 35 delay +500 (trans)  den switch to dest 20 prop delay

so 1020+35+500+20=1575 micro sec.

I think same thing will happen but yes it will be as good as continuous coz no delay at source after sending 1 packet he will immedietly start sending packet2.
1
1

As you said "we don't need to add propagation time here as packet 2 can just follow packet 1."

why should  we include propogation time at switch while sending 2nd packet?

0
0
edited by
@Arjun Sir if delay at switch also not given then there also we will not consider Tprop for second Packet?
0
0

@Arjun sir , in the last step , It should be Since we added PROPAGATION DELAY, this ensures that the last bit of data is received at the sender. 

0
0
@arjunsir: why 2nd packet is transmitted before receiving ack of 1st packet?why packets are sent continuously?nothing is mention in question like this
0
0
@Daddy propagation delay i the travelling time through medium, and after this the first bit reaches the receiver. Add transmission time and then the last bit also reaches the receiver.

@Upasana Since question doesn't say about reliability or protocol, we can assume best case. Anyway never consider stop-wait unless mentioned in question.
2
2

1st packet is placed on link 2 by switch at t = 1055(500+20+35+500) but 2nd packet is arrive at switch at t = 1020.HOW SWITCH CAN RECEIVE 2ND PACKET BEFORE RELEASING PACKET 1 COMPLETELY. 

1
1
It can simply use a different storage for receiving and sending and copy the packet as soon as it is arrived fully.
1
1

@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
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.
1
1
edited by
@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
0
one of the best trickiest question i have encountered in the "computer network" so far
1
1

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

4
4
Yes, what you were thinking was correct only. So, At 1000, second frame would be "transmitted" rt?
0
0
Yes it will start traveling from A to switch.
0
0
reshown by
Very clever solution
U recognized that second packet was stored and forwarded and so u added there transmission delay
0
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
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
0
bro which formula ?

I may be incorrect, but tell me precisely where i am wrong.
Thnks :)
0
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
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
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!!!

0
0
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.
2
2
edited by

@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
1
The second solution is good.It will save from calculation mistake:)
3
3
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
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?
0
0
edited by

 I think  if n packets are given then:-

Total time in this case =  Time to reach last packet + (n-1)*Transmission time for one packet.

0
0
403 votes
403 votes

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

$\text{Transmission Time }=\frac{5000}{10^{7}}=500 \mu s$

$\text{Propagation Time }=20 \mu s$

packet 1

At t=0
   packet starts from source 
At t=500
   
packet 1 is fully transmitted by source. Now it is available in the link

At t=520
     packet 1 is available at switch

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 available in the link
   
At t=1075
  
packet 1 reaches receiver.

  
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 propagate to Switch

At t=1020
 
packet 2 now reaches 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 available in the link

At t=1575
 
packet 2 Reaches destination
 

edited by
by

4 Comments

@pC bhai great

0
0
nice explanation but 377 upvotes are crazy! thanks for the explanation
0
0
$\color{DarkGreen}\text{Best Answer 🏆}$
0
0
9 votes
9 votes

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$

3 Comments

@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?
0
0
propogation time overlop with first transmission time think like pipeline
0
0
It work as pipelining in packet switching

Transmission time and processing time  of intermediate switch is not counted for all packet except first packet

Propagation delay also not counted
1
1
6 votes
6 votes

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
Answer:

Related questions