GATE / CS ARCHIVE

SUBJECT COLLECTION

Computer Networks · Routing Algorithms

20 questions, newest first

GATE CSE has asked 20 questions on Routing Algorithms (Computer Networks) from 2003 to 2025, in 16 of the 46 papers; the most recent is in GATE CSE 2025 Set 2. In the last five years it carried 1.5 marks per 100-mark paper on average, against 0.9 since 2003. Since 2014 the questions have been 7 MCQ, 4 NAT and 3 MSQ. 1 group of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
2 marks · MCQ
Report issue

Applying longest-prefix IP routing

Routing Algorithms

Question 40, GATE 2025: Destination 145.36.109.70 arrives at a router with entries 145.36.0.0/16→E1; 145.36.128.0/17→E2; 145.36.64.0/18→E3; 145.36.255.0/24→E4; default→E5. Which outgoing interface is selected? A E3; B E1; C E2; D E5.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (3 steps)

Approach: First find all matching network prefixes, then choose the most specific (longest) one.
The first two destination octets are 145.36, so the /16 E1 entry matches. The /17 E2 entry additionally requires the high bit of the third octet to be 1, meaning a third octet from 128 through 255. The destination’s third octet is 109, so that entry does not match.
The /18 E3 prefix fixes the first two bits of the third octet to 01, covering 64 through 127. Since 109 lies in that range, it matches. The /24 E4 entry requires third octet 255, so it does not match.
Among E1’s /16, E3’s /18 and the default, /18 is longest. Thus forward to E3, option A. Routing is not a first-listed-match decision, and a longer prefix is relevant only if it actually matches.

Original paper, page 40 · Answer key

1 mark · MCQ
Report issue

Routing Algorithms

Question 17, GATE 2025: Match routing methods with their usual shortest-path algorithm: (i) distance-vector routing; (ii) link-state routing. Algorithms are (a) Bellman–Ford and (b) Dijkstra.
Options: A. i→a, ii→b; B. i→a, ii→a; C. i→b, ii→a; D. i→b, ii→b.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Distance-vector routing maintains estimates to destinations and exchanges these with neighbors. Router x updates its distance to y using
Dx(y)=min over neighbors v of [cost(x,v)+Dv(y)].
This is the Bellman–Ford recurrence, applied in a distributed fashion. Thus (i) matches (a).

A link-state router learns the network's connectivity and link costs through link-state advertisements. With this graph available locally, it computes a shortest-path tree rooted at itself, conventionally using Dijkstra's algorithm for nonnegative link costs. Thus (ii) matches (b). The important distinction is neighbor distance estimates versus an advertised topology map, not simply that both seek shortest routes. The two correct matches appear together only in A.

Original paper, page 15 · Answer key

2 marks · NAT
Report issue

Choose the longest matching IP prefix

Routing Algorithms

Question 58, GATE 2024: A router has routes 10.1.1.0/24→R1, 10.1.1.128/25→R2, 10.1.1.64/26→R3 and 10.1.1.192/26→R4. It sends 20 packets to each of 10.1.1.16, .72, .132, .191 and .205. How many packets use R2? The abbreviated destinations share prefix 10.1.1.
Tap to enlarge
Answer & solution

Official answer: 40

Step through it (7 steps)

Approach: A router uses the matching route with the greatest prefix length, not the first matching row or every matching route.
1. The /24 covers last-octet values 0–255. The /25 beginning at 128 covers 128–255. The /26 beginning at 64 covers 64–127, and the /26 beginning at 192 covers 192–255.
2. Destination .16 matches only the /24 and uses R1. Destination .72 matches the /24 and the 64/26; the longer /26 wins, so it uses R3.
3. Destinations .132 and .191 match the /24 and the 128/25, with no matching /26. Both therefore use R2.
4. Destination .205 also matches R2's /25, but it matches the more specific 192/26, so it uses R4 instead.
Exactly two hosts use R2, each with 20 packets: 2×20=40.
Answer: 40. Counting .205 for R2 would ignore longest-prefix selection.

Original paper, page 34 · Answer key

1 mark · MSQ
Report issue

Routing Algorithms

Question 25, GATE 2023: Select the incorrect OSPF statements: A it uses Bellman–Ford; B it uses Dijkstra's least-cost paths; C it is an inter-domain protocol; D it supports hierarchical routing.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, C

OSPF is a link-state intra-domain routing protocol that applies Dijkstra’s shortest-path algorithm. It also supports hierarchical areas with a backbone. Bellman-Ford is associated with distance-vector protocols, and inter-domain routing is not OSPF’s role. The incorrect statements are A, C.

Teaching detail. OSPF routers distribute link-state information within an autonomous system, build a topology view, and compute shortest paths using Dijkstra. Areas provide hierarchy, normally tied together by a backbone area. Inter-domain routing means routing between autonomous systems and is associated with BGP rather than OSPF. Notice that the question asks for incorrect statements: selecting the two true statements B,D would reverse the answer even if the protocol facts were understood correctly.

Original paper, page 23 · Answer key

2 marks · NAT
Report issue

Routing Algorithms

Question 65, GATE 2023: Routes are 200.150.0.0/16→1, 200.150.64.0/19→2, 200.150.68.0/24→3, 200.150.68.64/27→4, and default→0. Which interface receives destination 200.150.68.118 under longest-prefix matching?
Tap to enlarge
Answer & solution

Official answer: 3

Step through it (3 steps)

The destination matches 200.150.0.0/16 and 200.150.64.0/19, and it also matches 200.150.68.0/24. The /27 entry 200.150.68.64 covers last-octet values 64 through 95, so it does not match 118. The longest matching prefix is consequently the /24 entry, whose interface ID is 3.

Teaching detail. Check network matches rather than selecting the most specific row unconditionally. The /19 mask fixes the top three bits of the third octet and covers third-octet values 64 through 95, including 68. The /24 fixes the entire third octet to 68. The /27 additionally divides the last octet into groups of 32; its network 64 covers 64..95, whereas 118 lies in 96..127. The /27 is more specific but fails to match, leaving /24 as the longest matching row. The default is used only when no more specific route matches.

Original paper, page 69 · Answer key

2 marks · MSQ
Report issue

Routing Algorithms

Question 55, GATE 2022: Routing entries are 12.20.164.0 mask 255.255.252.0→R1; 12.20.170.0 mask 255.255.254.0→R2; 12.20.168.0 with /23→interface 0; 12.20.166.0 with /23→interface 1; default→R3. Which offered prefixes collectively aggregate the nondefault address set? A 12.20.164.0/20; B 12.20.164.0/22; C 12.20.164.0/21; D 12.20.168.0/22.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B,D

The nondefault entries cover third-octet ranges 164-167, 170-171, 168-169 and 166-167. Their union is exactly 164-171. It is covered by the two aligned prefixes 12.20.164.0/22 (164-167) and 12.20.168.0/22 (168-171), giving B, D. A /21 containing 164 begins at 160 and covers 160-167; a /20 containing it begins at 160 and covers 160-175. The offered /21 and /20 addresses are not canonical network starts and would include extra destinations when masked. This answer describes address-set aggregation, not replacing all forwarding entries with two routes while preserving their different next hops; the more-specific routes are still needed for those next-hop distinctions.

A /22 fixes the top six bits of the third octet, so its network begins on a multiple of four and covers four consecutive values. Ranges 164–167 and 168–171 straddle a /21 boundary and cannot be replaced by the offered /21 without changing the address set. Longest-prefix forwarding details remain distinct from this coverage calculation.

Original paper, page 37 · Answer key

2 marks · NAT
Report issue

Routing Algorithms

Question 57, GATE 2022: Unit-cost routers form P—Q—R. Distance-vector tables have converged when Q—R fails. P and Q send updates at random times at the same average rate. Find, to one decimal place, the intended probability of a P↔Q loop and count-to-infinity; explain the stochastic assumptions needed.
Tap to enlarge
Answer & solution

Official answer: 0.5

Before failure, P believes R is two hops away via Q, and Q has a one-hop route. After detecting Q-R failure, Q can be misled if P advertises its stale route first: Q installs distance 3 via P while P still routes via Q, forming a loop. If Q announces unreachability first, P removes the route and avoids that loop. In the intended symmetric independent update-race model, either router is equally likely to send first, so the probability is 1/2=0.5. The stated equality of average update rates alone does not mathematically specify this race probability: identical/exchangeable timing distributions and no relevant delivery delay are additional assumptions. The example also assumes ordinary distance vector without split horizon or poisoned reverse; those safeguards change the result.

For independent exponential update clocks of rate λ, P(P sends first)=∫₀∞ λe−λte−λtdt=1/2. Equal mean intervals without identical residual-time distributions do not justify this integral. In the loop, Q installs 3 via P, then P learns 4 via Q, then Q learns 5, illustrating count-to-infinity.

Original paper, page 38 · Answer key

2 marks · MSQ
Report issue

Routing Algorithms

Question 45, GATE 2021: Distance-vector routing: R→X,Y,Z link costs 3,2,5. Advertised distances X,Y,Z→P are 7,6,5; to Q are 4,6,8. Update R. A P distance 10; B Q distance 7; C P next hop Y; D Q next hop Z.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: B; C

Bellman-Ford updates R-to-P with min(3+7, 2+6, 5+5)=8, reached through Y. For Q it uses min(3+4, 2+6, 5+8)=7, reached through X. Hence B, C, not A or D.

The update formula is D_R(v)=min_N(c(R,N)+D_N(v)). For P the three candidates are 10,8,10; for Q they are 7,8,13. Store both the minimum cost and its minimizing neighbor. Choosing the neighbor with the cheapest direct link alone would pick Y for both and be wrong for Q.

Original paper, page 82 · Answer key

1 mark · MCQ
Report issue

Routing Algorithms

Question 15, GATE 2020: Which IP-router claims are true? I Forwarding never modifies IP packets. II A router need not implement a routing protocol. III It should reassemble fragments when outgoing-link MTU exceeds incoming-packet size. Options: A I,II; B I only; C II,III; D II only.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Worked explanation

Distinguish the forwarding plane from the control plane. Forwarding uses an existing destination-prefix table; a human can configure static routes, so a dynamic routing protocol is not mandatory. Forwarding is not a bit-for-bit copy of the IP header: hop lifetime is decremented, and IPv4’s header checksum must reflect that. A larger next-link MTU merely permits larger packets; it does not make a transit router the reassembly destination. Fragments may follow different paths, another reason end-to-end reassembly belongs at the destination. Thus only II survives.

Derivation and answer

A router changes at least TTL/hop limit while forwarding and, in IPv4, adjusts the header checksum, so I is false. It can use a static forwarding/routing table without a dynamic routing protocol, so II is true. Ordinary IP fragment reassembly is performed at the destination, not by transit routers merely because the next MTU is larger, so III is false. Thus D.

Original paper, page 7 · Answer key

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Routing Algorithms

Question 9, GATE 2017: For IPv4 routing, assess I:RIP uses distance-vector routing; II:RIP packets use UDP; III:OSPF packets use TCP; IV:OSPF uses link-state routing. A:I,IV. B:I,II,III. C:I,II,IV. D:II,III,IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. RIP exchanges distance estimates with neighbors and uses a distance-vector approach, so I is true. Its routing messages are carried in UDP datagrams, making II true.

2. OSPF distributes link-state information and computes shortest paths from its link-state database, so IV is true. Its packets run directly over IP using protocol number 89, not through TCP, so III is false.

3. The true set is I,II,IV, option C. Routing algorithm type and transport encapsulation are separate properties; identifying OSPF as link-state does not imply that it uses TCP.

Original paper, page 4 · Answer key

2 marks · MCQ
Report issue

Routing Algorithms

Question 36, GATE 2015: Routing entries:128.96.170.0/23→interface 0; 128.96.168.0/23→interface 1; 128.96.166.0/23→R2; 128.96.164.0/22→R3; default→R4. Destinations i128.96.171.92, ii 128.96.167.151, iii 128.96.163.151, iv 128.96.165.121. Labels ainterface 0, binterface 1, cR2, dR3, eR4. A i-a, ii-c, iii-e, iv-d; B i-a, ii-d, iii-b, iv-e; C i-b, ii-c, iii-d, iv-e; D i-b, ii-c, iii-e, iv-d.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Step through it (6 steps)

Longest-prefix matching sends 171.92 through 170.0/23 to interface 0; 167.151 matches 166.0/23 and 164.0/22, choosing the longer/23 to R2; 163.151 matches only default R4; 165.121 matches 164.0/22 to R3. Thus i-a, ii-c, iii-e, iv-d, A.

A /23 mask covers two adjacent third-octet values, so 170.0/23 covers 170–171 and 166.0/23 covers 166–167. A /22 mask starting 164 covers 164–167. Thus 171 uses interface 0; 167 matches both R2 and R3 but the longer/23 wins; 163 matches neither specific block and uses default R4; 165 matches only 164/22 and uses R3. Never stop at the first matching broad prefix without checking whether a more specific one exists.

Original paper, page 38 · Answer key

1 mark · MCQ
Report issue

Routing Algorithms

Question 23, GATE 2014: For a network with 500 nodes and 4000 links, evaluate these textbook routing statements. S1: Link-state has higher computational overhead than distance-vector. S2: Distance-vector with split horizon avoids persistent routing loops, unlike link-state. S3: After topology change, link-state converges faster than distance-vector. A: all true. B: all false. C: S1,S2 true and S3 false. D: S1,S3 true and S2 false.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Our answer: D under the standard protocol comparison

1. Method and setup. A link-state router builds a topology view and computes routes locally; distance-vector routers repeatedly exchange route estimates. Split horizon prevents advertising a route back along the interface from which it was learned, but this only directly addresses a two-router pattern, not every multirouter loop.

2. Work through the result and its assumptions. Link-state routing maintains topology and runs a shortest-path computation, conventionally costing more local computation but converging faster than iterative distance-vector updates. Split horizon does not eliminate all loops involving three or more routers, so S2 is false. The textbook comparison is S1/S3 true, D; actual convergence depends on timers, implementation and failure pattern, not the node/link counts alone.

Original paper, page 13 · Answer key

1 mark · MCQ
Report issue

Routing Algorithms

Question 23, GATE 2014: Which statement about RIP and OSPF is true? A RIP uses distance-vector routing; OSPF uses link-state routing. B OSPF uses distance-vector; RIP uses link-state. C both use link-state. D both use distance-vector.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

1. Set up the reasoning. Classify the information routers exchange: distance-vector protocols communicate distance estimates via neighbors, while link-state protocols advertise local links so routers can reconstruct a topology.

2. Derive the result. RIP exchanges distance vectors and uses hop counts. OSPF floods link-state information and computes shortest paths over topology. Thus A.

3. Check the interpretation. RIP's standard hop-count updates fit the first model. OSPF uses link-state advertisements and shortest-path computation, fitting the second. Both are interior gateway protocols, but that shared role does not imply a shared routing algorithm.

Original paper, page 34 · Answer key

2 marks · NAT
Report issue

Routing Algorithms

Question 26, GATE 2014: A CIDR router receives destination 131.23.151.76. Its prefix→interface table is 131.16.0.0/12→3; 131.28.0.0/14→5; 131.19.0.0/16→2; 131.22.0.0/15→1. Which output interface is selected?
Tap to enlarge
Answer & solution

Official answer: 1

Step through it (3 steps)

Step 1: Compare prefixes rather than numerical closeness. With the first octet fixed at 131, /12 covers second octets 16…31, so it matches 23. The /14 entry covers 28…31 and does not match; /16 requires exactly 19 and does not match. Step 2: The /15 entry fixes the top seven bits of the second octet, covering 22 and 23, so it matches. Step 3: CIDR chooses the longest matching prefix, /15 rather than /12. Its output interface is 1.

Original paper, page 58 · Answer key

2 marks · MCQ
Report issue

Distance-vector update after a reduced link cost

Routing Algorithms

Question 52, GATE 2011: A symmetric distance-vector network has edges N1-N2:1, N2-N3:6, N3-N4:2, N4-N5:4, N5-N2:3. Stabilized vectors in destination order N1,...,N5 are N1=(0,1,7,8,4), N2=(1,0,6,7,3), N3=(7,6,0,2,6), N4=(8,7,2,0,4), N5=(4,3,6,4,0). Each round all nodes first exchange current vectors, then update. Between rounds a link-cost change modifies only the directly incident entry at each endpoint. If N2-N3 decreases to 2, what is N3's vector after the next round?

(A) 3,2,0,2,5
(B) 3,2,0,2,6
(C) 7,2,0,2,5
(D) 7,2,0,2,6
Question 52, GATE 2011: A symmetric distance-vector network has edges N1-N2:1, N2-N3:6, N3-N4:2, N4-N5:4, N5-N2:3. Stabilized vectors in destination order N1,...,N5 are N1=(0,1,7,8,4), N2=(1,0,6,7,3), N3=(7,6,0,2,6), N4=(8,7,2,0,4), N5=(4,3,6,4,0). Each round all nodes first exchange current vectors, then update. Between rounds a link-cost change modifies only the directly incident entry at each endpoint. If N2-N3 decreases to 2, what is N3's vector after the next round?

(A) 3,2,0,2,5
(B) 3,2,0,2,6
(C) 7,2,0,2,5
(D) 7,2,0,2,6
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Before the next exchange, only the incident entries change: N2 sets its distance to N3 to 2, and N3 sets its distance to N2 to 2. In particular N2 still advertises distances 1 to N1 and 3 to N5; N4 advertises 8 to N1 and 4 to N5. N3 recomputes through neighbors N2 (link cost 2) and N4 (link cost 2): to N1, min(2+1, 2+8)=3; to N2, min(2+0, 2+7)=2; to itself, 0; to N4, min(2+7, 2+0)=2; to N5, min(2+3, 2+4)=5. Its vector becomes (3, 2, 0, 2, 5), option A.

The distance-vector recurrence is D3(j)=min over neighbors k of [cost(3,k)+Dk(j)], with D3(3)=0. The exchange occurs before recomputation, so N3 cannot use routes N2 or N4 will discover later in this same round. In particular, destination N5 improves via N2 from 6 to 2+3=5, while N1 improves to 2+1=3. Mixing updated and old advertisements would model an asynchronous cascade rather than the specified one-round calculation.

Original paper, page 15 · Answer key

2 marks · MCQ
Report issue

One synchronous round after a routing link failure

Routing Algorithms

Question 53, GATE 2011: Use the symmetric network edges N1-N2:1,N2-N3:6,N3-N4:2,N4-N5:4,N5-N2:3 and stabilized vectors N1=(0,1,7,8,4),N2=(1,0,6,7,3),N3=(7,6,0,2,6),N4=(8,7,2,0,4),N5=(4,3,6,4,0). Nodes exchange current vectors synchronously, then update; between rounds only incident entries change. First reduce N2-N3 to 2 and perform exactly one round as in the preceding question. Then N1-N2 fails; N2 immediately changes its N1 entry to infinity. After the NEXT round, what cost to N1 does N3 record?

(A) 3
(B) 9
(C) 10
(D) Infinity
Question 53, GATE 2011: Use the symmetric network edges N1-N2:1,N2-N3:6,N3-N4:2,N4-N5:4,N5-N2:3 and stabilized vectors N1=(0,1,7,8,4),N2=(1,0,6,7,3),N3=(7,6,0,2,6),N4=(8,7,2,0,4),N5=(4,3,6,4,0). Nodes exchange current vectors synchronously, then update; between rounds only incident entries change. First reduce N2-N3 to 2 and perform exactly one round as in the preceding question. Then N1-N2 fails; N2 immediately changes its N1 entry to infinity. After the NEXT round, what cost to N1 does N3 record?

(A) 3
(B) 9
(C) 10
(D) Infinity
Question 53, GATE 2011: Use the symmetric network edges N1-N2:1,N2-N3:6,N3-N4:2,N4-N5:4,N5-N2:3 and stabilized vectors N1=(0,1,7,8,4),N2=(1,0,6,7,3),N3=(7,6,0,2,6),N4=(8,7,2,0,4),N5=(4,3,6,4,0). Nodes exchange current vectors synchronously, then update; between rounds only incident entries change. First reduce N2-N3 to 2 and perform exactly one round as in the preceding question. Then N1-N2 fails; N2 immediately changes its N1 entry to infinity. After the NEXT round, what cost to N1 does N3 record?

(A) 3
(B) 9
(C) 10
(D) Infinity
Tap to enlarge
Your answer
Answer & solution

Official answer: C

This is the round immediately after the update in printed question 52, not a converged routing table. In that previous round N4 retained distance 8 to N1: via N3 it saw the old advertised distance 7, giving 2+7=9, while via N5 it obtained 4+4=8. When link N1–N2 fails, N2 immediately changes its N1 entry to infinity. In the next exchange N3 therefore sees N2 advertise infinity and N4 advertise 8 to N1. Its new distance to N1 is min(2+infinity, 2+8)=10, option C. Ordinary distance-vector updating uses neighbors’ current advertisements; it does not retain its obsolete distance 3 as an independent route.

The crucial neighbor advertisement is N4's, so reconstruct it from the previous round: to N1, via N3 costs 2+7=9 using the old N3 vector, while via N5 costs 4+4=8; thus N4 advertises 8. Following failure, N3 hears no usable N1 route from N2 but still hears N4's stale value. Its update to 10 illustrates distance-vector count-to-infinity behavior: a finite advertised route can temporarily survive even though N1 is physically disconnected.

Original paper, page 15 · Answer key

2 marks · MCQ
Report issue

Unused links after distance-vector convergence

Routing Algorithms

Question 54, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. After routing tables stabilize, how many links are never used to carry data?
Options: (A) 4; (B) 3; (C) 2; (D) 1.
Question 54, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. After routing tables stabilize, how many links are never used to carry data?
Options: (A) 4; (B) 3; (C) 2; (D) 1.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

With positive link weights, an edge is unusable by any shortest path exactly when another path between its endpoints is strictly shorter. Link R1–R2 has weight 6 but R1–R3–R2 costs 3+2=5, so it is unused. Link R4–R6 has weight 8 but R4–R5–R6 costs 1+4=5, so it is also unused. Every remaining edge is itself a shortest path between its endpoints: R1–R3=3, R2–R3=2, R2–R4=7, R3–R5=9 and R4–R5=1, R5–R6=4. In particular the alternative to R3–R5 through R2,R4 costs 2+7+1=10, greater than 9. Thus exactly two links will never be selected, C. This assumes stabilized shortest-path routing, with data available for any source/destination pair.

To prove that an edge is never needed, replace it in any purported shortest route by the cheaper endpoint-to-endpoint route; the result is a shorter walk and, with positive weights, can be reduced to a path. Conversely, an edge strictly shortest between its own endpoints is needed for that endpoint pair. This avoids enumerating every source–destination routing table.

Original paper, page 14

2 marks · MCQ
Report issue

Unused links after weight changes

Routing Algorithms

Question 55, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. First determine the links never used after stabilization. Change every such link’s weight to 2 and rerun distance-vector routing until stable. How many links are now unused?
Options: (A) 0; (B) 1; (C) 2; (D) 3.
Question 55, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. First determine the links never used after stabilization. Change every such link’s weight to 2 and rerun distance-vector routing until stable. How many links are now unused?
Options: (A) 0; (B) 1; (C) 2; (D) 3.
Question 55, GATE 2010: An undirected router network has exactly these links and weights: R1–R2:6, R1–R3:3, R2–R3:2, R2–R4:7, R3–R5:9, R4–R5:1, R4–R6:8, R5–R6:4. Routers use distance-vector routing, starting with neighbor entries equal to direct-link weights. First determine the links never used after stabilization. Change every such link’s weight to 2 and rerun distance-vector routing until stable. How many links are now unused?
Options: (A) 0; (B) 1; (C) 2; (D) 3.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Change precisely the two previously unused links R1–R2 and R4–R6 to weight 2. Now R5–R6 has direct weight 4 but R5–R4–R6 costs 1+2=3, so it becomes unused. All other links remain shortest between their endpoints: the changed links have weight 2; R1–R3=3 beats R1–R2–R3=4; R2–R3=2; R2–R4=7 beats R2–R3–R5–R4=12; R3–R5=9 beats R3–R2–R4–R5=10; and R4–R5=1. Hence one link remains unused, B. Recompute routes after the weight changes rather than retaining the previous unused set.

Changing edge weights requires recomputing shortest paths globally. The former R4–R6 bypass is now the cheap direct edge of weight two; together with R4–R5 of weight one it undercuts R5–R6. The changed R1–R2 edge does not undercut R1–R3, since 2+2=4>3. These comparisons explain why the unused set changes rather than merely shrinking.

Original paper, page 14

2 marks · MCQ
Report issue

Longest-prefix routing and host route

Routing Algorithms

Question 55, GATE 2004: Router entries (destination,mask,interface) are (128.75.43.0,255.255.255.0,Eth0), (128.75.43.0,255.255.255.128,Eth1), (192.12.17.5,255.255.255.255,Eth3), and default→Eth2. Which interfaces forward destinations 128.75.43.16 and 192.12.17.10 respectively?
Options:
(A) Eth1,Eth2
(B) Eth0,Eth2
(C) Eth0,Eth3
(D) Eth1,Eth3
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (4 steps)

Step 1: 128.75.43.16 matches both 128.75.43.0/24 and 128.75.43.0/25; the longer /25 prefix selects Eth1.192.12.17.10 does not equal the only 192.12.17.* explicit route, the /32 host route 192.12.17.5 via Eth3, so it uses default Eth2. Matching the first three octets does not make a /32 host route a subnet route.

Step 2: Teaching check: The /25 mask covers last-octet values 0–127, including 16, and outranks /24. The /32 entry matches exactly 192.12.17.5, not all addresses beginning 192.12.17. Any other unmatched destination, including .10, uses default.

Original paper, page 8

1 mark · MCQ
Report issue

IP source-routing capability

Routing Algorithms

Question 27, GATE 2003: Which assertion about Internet Protocol is false? A. A computer can have several IP addresses; B. Packets from the same source to the same destination can take different routes; C. A packet is discarded if it cannot reach its destination within a bounded number of hops; D. A source cannot set an outgoing packet’s route, which is determined only by router routing tables.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. A and B are compatible with multiple interfaces and datagram routing. For C, IPv4 routers decrement TTL and discard expired packets. To refute D it suffices to cite the historical source-route options; their rarity or filtering in current networks does not make the categorical protocol statement true.

2. Historical IPv 4 includes loose/strict source-route options that allow a sender to influence/specify a route. Therefore the categorical assertion that only router tables can determine the route is false, D. Multiple addresses and differing packet routes are possible, while TTL limits forwarding hops. Source routing is commonly filtered or disabled operationally, which does not erase the protocol capability considered by this historical question.

Original paper, page 3