GATE 2010
82 questions
MCQ 821-mark 39 · 2-mark 43
Questions 56–60 of 82
Consider a network with 6 routers R1 to R6 connected with links having weights as shown in the following diagram
All the routers use the distance vector based routing algorithm to update their routing tables. Each router starts with its routing table initialized to contain an entry for each neighbour with the weight of the respective connecting link. After all the routing tables stabilize, how many links in the network will never be used for carrying any data?
All the routers use the distance vector based routing algorithm to update their routing tables. Each router starts with its routing table initialized to contain an entry for each neighbour with the weight of the respective connecting link. After all the routing tables stabilize, how many links in the network will never be used for carrying any data?
Answer: (C)
A link is never used if some other path between its end points is cheaper. Check every link:
- R1-R2 (6): R1-R3-R2 is shorter. Unused.
- R4-R6 (8): R4-R5-R6 is shorter. Unused.
- R1-R3 (3): other path R1-R2-R3 is . Used.
- R2-R3 (2): other path R2-R1-R3 is . Used.
- R2-R4 (7): other path R2-R3-R5-R4 is . Used.
- R3-R5 (9): other path R3-R2-R4-R5 is . Used.
- R4-R5 (1): cheapest possible. Used.
- R5-R6 (4): other path R5-R4-R6 is . Used.
So exactly 2 links are never used: R1-R2 and R4-R6.
Answer: (C)
- R1-R2 (6): R1-R3-R2 is shorter. Unused.
- R4-R6 (8): R4-R5-R6 is shorter. Unused.
- R1-R3 (3): other path R1-R2-R3 is . Used.
- R2-R3 (2): other path R2-R1-R3 is . Used.
- R2-R4 (7): other path R2-R3-R5-R4 is . Used.
- R3-R5 (9): other path R3-R2-R4-R5 is . Used.
- R4-R5 (1): cheapest possible. Used.
- R5-R6 (4): other path R5-R4-R6 is . Used.
So exactly 2 links are never used: R1-R2 and R4-R6.
Answer: (C)
Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use the same net mask N. Which of the values of N given below should not be used if A and B should belong to the same network?
Answer: (D)
Look at the last octets: 113 = 0111 0001 and 91 = 0101 1011. Only the first 2 bits match.
- Masks .0, .128 and .192 cover at most 2 bits same network.
- Mask .224 covers 3 bits: 011 and 010 different networks.
Answer: 255.255.255.224
- Masks .0, .128 and .192 cover at most 2 bits same network.
- Mask .224 covers 3 bits: 011 and 010 different networks.
Answer: 255.255.255.224
One of the header fields in an IP datagram is the Time to Live (TTL) field. Which of the following statements best explains the need for this field?
Answer: (D)
Every router lowers the TTL value by one. When TTL becomes 0, the router discards the packet. So if a packet gets stuck in a routing loop, it cannot go around forever.
Answer: It can be used to prevent packet looping
Answer: It can be used to prevent packet looping
Which one of the following is not a client server application?
Answer: (D)
Internet chat, web browsing and e-mail each use a client program and a server program. Ping is different. It only sends ICMP echo messages, and the OS network stack deals with them. No server application is involved.
Answer: Ping
Answer: Ping
The following program is to be tested for statement coverage:
T1 : a, b, c and d are all equal
T2 : a, b, c and d are all distinct
T3 : a=b and c !=d
T4 : a !=b and c=d
Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4?
begin
if (a ==b) {S1; exit;}
else if (c ==d) {S2;}
else {S3; exit;}
S4;
end The test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a, b, c and d. The exact values are not given. T1 : a, b, c and d are all equal
T2 : a, b, c and d are all distinct
T3 : a=b and c !=d
T4 : a !=b and c=d
Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4?
Answer: (D)
Check each statement:
- S1 runs when a = b (T1 or T3).
- S2 and S4 run when a b and c = d (T4).
- S3 runs when a b and c d (T2).
T1, T2, T4 cover all four.
Answer: T1, T2, T4
- S1 runs when a = b (T1 or T3).
- S2 and S4 run when a b and c = d (T4).
- S3 runs when a b and c d (T2).
T1, T2, T4 cover all four.
Answer: T1, T2, T4