Sunday, April 15, 2018

GATE-Computer Networks-Flow Control

Previous GATE questions with solutions on Computer Networks (Flow Control) - CS/IT

GATE -2015
1. Since it is a network that uses switch, every packet goes through two links, one from source to switch and other from switch to destination.
Since there are 10000 bits and packet size is 5000, two packets are sent. Transmission time for each packet is 5000 / 107 seconds
Two hosts are connected via a packet switch with 107 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 _________.
(a) 1075      (b) 1575        (c) 2220         (d) 2200

Ans: option (b)
It is given that there are 10,000 bits and since the packet size id 5000 it means we have 2 packets to send. 
Transmission time for one packet = 5000 / 107 seconds = 500μs
Transmission time is the time taken to transmit a packet from host to the outgoing link.

It is also given that the propagation delay of links is 20μs.  Propagation delay is the time taken by a bit to reach from sender to receiver (in this case from sender to switch it is 20μs and from switch to receiver it 20μs)

Time for the first packet (P1) to reach switch =Transmission time + Propagation delay
=500μs + 20μs = 520μs
Once P1 reaches the switch, the switch will take 35μs to process the packet and then it takes 500μs to transmit it to the link and then the packet will take 20μs to reach the receiver.
Therefore Time taken by P1 to reach from switch to receiver = 35μs + 500μs+ 20μs = 555μs
Therefore time taken by P1 to reach from sender to receiver = 520μs+555μs = 1075μs

But we need to note that after 520μs the switch starts receiving second packet (P2).
i.e. At 520μs+500μs = 1020μs P2 is completely received by switch.
Now Time taken by P2 to reach from switch to receiver = 35μs + 500μs+ 20μs = 555μs
It means that at  1575μs (1020μs+555μs) P2 reaches the destination.

2. Suppose that the stop-and-wait protocol is used on a link with a bit rate of 64 kilobits per second and 20 milliseconds propagation delay. Assume that the transmission time for the acknowledgement and the processing time at nodes are negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is_________________.
(a) 160      (b) 320      (c) 640      (d) 220      

Ans: option (b)
Since the link utilization should be atleast 50% it means that efficiency, η 50%
Since it is mentioned that it is a stop&wait protocol, the efficiency of the link can be calculated as below:
η =  1 /( 1 + 2a)
a = Tp/Tt (where Tp = Propagation delay & Tt = Transmission Time)
Lets see the length of the packet to achieve a link utilization of 50%
50/100 = 1 /( 1 + 2a)
1/2 = 1 /( 1 + 2a)
a = 1/2
Tp/Tt = 1/2
Tt = 40ms
Tt = transmission time = L/B (where L = length of packet and B = bandwidth)
L/B = 40
L =40 * B = 40 ms * 64 Kbps = 40*10-3 *64*103 = 2560 bits
Since we need to determine the frame size in bytes L = 2560/8 = 320 bytes.
Therefore, the minimum frame size in bytes to achieve a link utilization of at least 50% is 320bytes