Computer networks miscellaneous
- Consider socket API on a Linux machine that supports connected UDP sockets. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are CORRECT?
I. A connected UDP socket can be used to communicate with multiple peers simultaneously.
II. A process can successfully call connect function again for an already connected UDP socket.
-
View Hint View Answer Discuss in Forum
A process can successfully call connect function again for an already connected UDP socket for one of two reasons:
(1) To specify a new IP address and Port.
(2) To unconnect the socket.
A connected UDP socket have two function
(1) Bind () function used to create local address.
(2) Connect () function is specifying remote address. Where as, A unconnected UDP socket has only just a Bind () function. So, option (b) is correct.Correct Option: B
A process can successfully call connect function again for an already connected UDP socket for one of two reasons:
(1) To specify a new IP address and Port.
(2) To unconnect the socket.
A connected UDP socket have two function
(1) Bind () function used to create local address.
(2) Connect () function is specifying remote address. Where as, A unconnected UDP socket has only just a Bind () function. So, option (b) is correct.
- The values of parameters for the Stop-and-Wait ARQ protocol are as given below :
Bit rate of the transmission channel = 1 Mbps.
Propagation delay from sender to receiver = 0.75 ms.
Time to process a frame = 0.25 ms.
Number of bytes in the information frame = 1980.
Number of bytes in the acknowledge frame = 20.
Number of overhead bytes in the information frame = 20.
Assume that there are no transmission errors. Then, the transmission efficiency (expressed in percentage) of the Stop-and-Wait ARQ protocol for the above parameters is _______ (correct to 2 decimal places).
-
View Hint View Answer Discuss in Forum
Given data: B = 1 Mbps , Tprocess = 0.25 ms, TPt = 0.75 ms LIF = 1980 bytes , L(Overhead) = 20 bytes , LAF = 20 bytes
Efficiency (η) = ?
As we know that,Transmission time of data = Data size Bandwidth So , TX = L = ( LIf + LAf ) = ( 1980 + 20 ) bytes B B 1 × 106( bits / sec )
(∵ 1 byte = 8 bit)= 2000 × 8 (bits) 106( bits / sec )
TX = 16 m sec
Propagation time = 0.75 m sec.Transmission time of TACK = LAF = 20 × 8 bits B 106
∴ TACK = 0.16 m sec.
Then transmission efficiency of stop and wait ARQ.⇒ TX = 16 (TX + TACK + 2TPt + TProcess) (16 0.16 + 2 × 0.75 + 0.25) = 16 = 0.8933 = 89.33% 17.91
Hence answer is 89.33%Correct Option: B
Given data: B = 1 Mbps , Tprocess = 0.25 ms, TPt = 0.75 ms LIF = 1980 bytes , L(Overhead) = 20 bytes , LAF = 20 bytes
Efficiency (η) = ?
As we know that,Transmission time of data = Data size Bandwidth So , TX = L = ( LIf + LAf ) = ( 1980 + 20 ) bytes B B 1 × 106( bits / sec )
(∵ 1 byte = 8 bit)= 2000 × 8 (bits) 106( bits / sec )
TX = 16 m sec
Propagation time = 0.75 m sec.Transmission time of TACK = LAF = 20 × 8 bits B 106
∴ TACK = 0.16 m sec.
Then transmission efficiency of stop and wait ARQ.⇒ TX = 16 (TX + TACK + 2TPt + TProcess) (16 0.16 + 2 × 0.75 + 0.25) = 16 = 0.8933 = 89.33% 17.91
Hence answer is 89.33%
- Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK which is received by the client-side TCP. As per the TCP connection state diagram (RFC 793), in which state does the client-side TCP connection wait for the FIN from the server-side TCP?
-
View Hint View Answer Discuss in Forum
Correct Option: D
- The routing table of a router is shown below :
On which interface will the router forward packets addressed to destinations 128.75.43.16 and 192.12.17.10 respectively?
-
View Hint View Answer Discuss in Forum
To find the interface, we need to do AND of incoming IP address and Subnet mask. Compare the result of AND with the destination. Note that if there is a match between multiple Destinations, then we need to select the destination with longest length subnet mask. 128.75.43.16, matches with 128.75.43.0 and 128.75.43.0, the packet is forwarded to Eth1 as length of subnet mask in Eth2 is more. If a result is not matching with any of the given destinations then the packet is forwarded to the default interface (here Eth2). Therefore the packet's addressed to 192.12.17.10
Hence, option (a) is correct.Correct Option: A
To find the interface, we need to do AND of incoming IP address and Subnet mask. Compare the result of AND with the destination. Note that if there is a match between multiple Destinations, then we need to select the destination with longest length subnet mask. 128.75.43.16, matches with 128.75.43.0 and 128.75.43.0, the packet is forwarded to Eth1 as length of subnet mask in Eth2 is more. If a result is not matching with any of the given destinations then the packet is forwarded to the default interface (here Eth2). Therefore the packet's addressed to 192.12.17.10
Hence, option (a) is correct.
Direction: Consider a network with five nodes, N1 to N5, as shown below :
The network uses a distance vector routing protocol. Once the routes have stabilized, the distance vectors at different nodes are as following. Each distance vector is the distance of the best known path at that instance to nodes, N1 to N5, where the distance to itself is 0. Also, all links are symmetric and the cost is identical in both directions. In each round, all nodes exchange their distance vectors with their respective neighbours, Then all nodes update their distance vectors. In between two rounds, any change in cost of a link will cause the two incident nodes to change only that entry is their distance vectors.
- After the update in the previous question, the link N1 -N2 goes down. N2 will reflect this change immediately in its distance vector as cost ∞. After the next round of update, what will be the cost to N1 in the distance vector of N3?
-
View Hint View Answer Discuss in Forum
First, as soon as N1 -N2 goes down, N2 and N1 both update that entry in their tables as infinity. So N2 at this moment will be N2 (inf,0,2,_,_). I have left blank because that details are not important.
Now for N3 to get updated in the subsequent round it will get tables from N2 and N4 only. But first we need to find the N4 calculated in previous update. So in previous question N4 received updates from N3 and N5 which are N3 : (7, 6, 0, 2, 6),N5 : (4, 3, 6, 4, 0).
Now this is very important as why N4 did not get updated tables from N3.
So answer is that these tables were shared at the same moment and so in a particular round of update old values of all the tables are used and not the updated values.
N3 was updates after it passed its old table to its neighbors as why would N4 wait for N3 to get updated first!!! So N4 will update its table (in prev question) to N4 (8,7,2,0,4).
See here path to N1 exists via N5 and not via N3 bcoz when table was shared by N3 it contained path to N1 as 7 and N1 via N3 sums to 7 + 2 = 9. Now when N3 receives tables from N2(inf,0,_,_,_) and N4 (8,7,2,0,4). At first it will see its distance to N1 as "Inf" and NOT 3 because "inf" is the new distance with the same Next hop N2 (If next hop is same, new entry is updated even though it is larger than previous entry for the same next hop).
But at the same time it sees distance to N1 from N4 as 8 and so updates with the value (N3 - N4 + N4 - N1 ) = (2 + 8) = 10. So N3-N1 distance in N3 (10,_,0,_,_) is 10.Correct Option: C
First, as soon as N1 -N2 goes down, N2 and N1 both update that entry in their tables as infinity. So N2 at this moment will be N2 (inf,0,2,_,_). I have left blank because that details are not important.
Now for N3 to get updated in the subsequent round it will get tables from N2 and N4 only. But first we need to find the N4 calculated in previous update. So in previous question N4 received updates from N3 and N5 which are N3 : (7, 6, 0, 2, 6),N5 : (4, 3, 6, 4, 0).
Now this is very important as why N4 did not get updated tables from N3.
So answer is that these tables were shared at the same moment and so in a particular round of update old values of all the tables are used and not the updated values.
N3 was updates after it passed its old table to its neighbors as why would N4 wait for N3 to get updated first!!! So N4 will update its table (in prev question) to N4 (8,7,2,0,4).
See here path to N1 exists via N5 and not via N3 bcoz when table was shared by N3 it contained path to N1 as 7 and N1 via N3 sums to 7 + 2 = 9. Now when N3 receives tables from N2(inf,0,_,_,_) and N4 (8,7,2,0,4). At first it will see its distance to N1 as "Inf" and NOT 3 because "inf" is the new distance with the same Next hop N2 (If next hop is same, new entry is updated even though it is larger than previous entry for the same next hop).
But at the same time it sees distance to N1 from N4 as 8 and so updates with the value (N3 - N4 + N4 - N1 ) = (2 + 8) = 10. So N3-N1 distance in N3 (10,_,0,_,_) is 10.