Routing Protocols and Packet Forwarding Pyqs for Gate Cs
Solve 8+ Routing Protocols and Packet Forwarding previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.
Try a question
Answer it here to see how it works. Nothing is recorded until you sign in.
Question 1
2025 Slot Set2 PYQ
Level 3: Exam Standard
Consider the routing protocols given in List I and the names given in List II:
List I List II (i) Distance vector routing (a) Bellman-Ford (ii) Link state routing (b) Dijkstra
For matching of items in List I with those in List II, which ONE of the following options is CORRECT?
Question 2
2025 Slot Set1 PYQ
Level 3: Exam Standard
A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
Question 3
2024 Slot Set1 PYQ
Level 3: Exam Standard
Consider the entries shown below in the forwarding table of an IP router. Each entry consists of an IP prefix and the corresponding next hop router for packets whose destination IP address matches the prefix. The notation “/N” in a prefix indicates a subnet mask with the most significant N bits set to 1.
This router forwards 20 packets each to 5 hosts. The IP addresses of the hosts are 10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191, and 10.1.1.205 . The number of packets forwarded via the next hop router R2 is _________
Question 4
2023 PYQ
Level 3: Exam Standard
The forwarding table of a router is shown below.
A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID __________.
Question 5
2023 PYQ
Level 3: Exam Standard
Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?
Question 6
2022 PYQ
Level 3: Exam Standard
Consider a network with three routers P, Q, R shown in the figure below. All the links have cost of unity.
The routers exchange distance vector routing information and have converged on the routing tables, after which the link Q−R fails. Assume that P and Q send out routing updates at random times, each at the same average rate. The probability of a routing loop formation (rounded off to one decimal place) between P and Q, leading to count-to-infinity problem, is___________.
Question 7
2022 PYQ
Level 3: Exam Standard
Consider routing table of an organization’s router shown below:
Subnet Number
Subnet Mask
Next Hop
12.20.164.0
255.255.252.0
R1
12.20.170.0
255.255.254.0
R2
12.20.168.0
255.255.254.0
Interface 0
12.20.166.0
255.255.254.0
Interface 1
default
R3
Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?
Question 8
2021 Slot Set2 PYQ
Level 3: Exam Standard
Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is as shown below.
The objective is to find the shortest-cost path from the router R to routers P and Q. Assume that R does not initially know the shortest routes to P and Q. Assume that R has three neighbouring routers denoted as X, Y, and Z. During one iteration, R measures its distance to its neighbours X, Y, and Z as 3, 2, and 5, respectively. Router R gets routing vectors from its neighbours that indicate that the distance to router P from routers X, Y, and Z are 7, 6, and 5, respectively. The routing vector also indicates that the distance to router Q from routers X, Y, and Z are 4, 6, and 8, respectively. Which of the following statement(s) is/are correct with respect to the new routing table of R, after updation during this iteration?
Free preview ends here
Login to view the complete previous-year questions and solutions
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Routing Protocols and Packet Forwarding PYQs for GATE CS
Solve 8+ Routing Protocols and Packet Forwarding previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.
Chapter Roadmap: Routing Protocols and Packet Forwarding
Chapter Journey
1. Longest-Prefix Matching Current
Focus: Per-packet decisions using forwarding tables. Weightage: High frequency of direct numerical questions.
2. Distance-Vector & Link-State
Focus: Dynamic table building (Bellman-Ford vs Dijkstra). Weightage: Algorithm steps and cost calculations.
What You Will Master:Trace any IP packet, resolve ties using longest prefix match, and simulate routing convergence.
Longest-Prefix Matching: The Router's Compass
The Router's Compass
The Core Problem
Routers cannot maintain a specific entry for every single IP address out of millions.
The Solution
Use Forwarding Tables with IP prefixes and the Longest Prefix Match rule.
What You Will Learn:
Table Structure: Prefixes, masks, and next hops.
Matching Algorithm: Bitwise AND operations.
Tie-Breaking: Why the longest prefix wins.
Routing Protocols and Packet Forwarding: Solved Questions with Step-by-Step Explanations (8 Problems)
Question 1 · Computer Networks · 2025_Set2MCQ
Consider the routing protocols given in List I and the names given in List II:
List I List II (i) Distance vector routing (a) Bellman-Ford (ii) Link state routing (b) Dijkstra
For matching of items in List I with those in List II, which ONE of the following options is CORRECT?
A.
(i) – (a) and (ii) – (b)
B.
(i) – (a) and (ii) – (a)
C.
(i) – (b) and (ii) – (a)
D.
(i) – (b) and (ii) – (b)
Correct Answer:
A
Step-by-Step Solution
Insight: This is a direct recall matching question about the core algorithms behind major routing protocol families.
Exam route: Map Distance-Vector to Bellman-Ford and Link-State to Dijkstra based on standard networking definitions.
Learning route:
Step 1: Analyze List I.
(i) Distance vector routing: A decentralized algorithm where routers share their entire routing table with neighbors. It relies on the Bellman-Ford equation to iteratively update costs.
(ii) Link state routing: A global algorithm where every router builds a complete map of the network topology and independently computes the shortest path. It relies on Dijkstra's algorithm.
Step 2: Match with List II.
(i) matches (a) Bellman-Ford.
(ii) matches (b) Dijkstra.
Step 3: Select the corresponding option.
Option A states "(i) – (a) and (ii) – (b)", which is the correct mapping.
Verification: RIP is a classic Distance-Vector protocol using Bellman-Ford. OSPF is a classic Link-State protocol using Dijkstra. This confirms the mapping.
Question 2 · Computer Networks · 2025_Set1MCQ
A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
A.
E3
B.
E1
C.
E2
D.
E5
Correct Answer:
A
Step-by-Step Solution
Insight: This is a direct longest-prefix match forwarding question, recognizable by the destination IP and a routing table with overlapping prefixes.
Exam route: Perform a bitwise AND between the destination IP and each subnet mask. Collect all matches and pick the one with the largest prefix length (largest N).
Learning route:
Step 1: Extract the destination IP: 145.36.109.70.
Entry 2: 145.36.128.0 /17. Third octet is 128 (10000000 in binary). Destination third octet is 109 (01101101). Bitwise AND with 10000000 gives 00000000 (0), which does not equal 128. No match.
Entry 3: 145.36.64.0 /18. Third octet is 64 (01000000). Mask for /18 covers first 2 bits of third octet (11000000 = 192). 109 AND 192 = 01101101 AND 11000000 = 01000000 = 64. This equals the prefix 64. Match. Length = 18.
Entry 4: 145.36.255.0 /24. Third octet 109 does not equal 255. No match.
Entry 5: Default. Matches everything, but length = 0.
Step 3: Resolve ties. We have matches for /16, /18, and Default (/0). The longest prefix is /18.
Step 4: The /18 match corresponds to Interface E3.
Verification: 145.36.109.70 falls in the range 145.36.64.0 to 145.36.127.255, which is exactly the 145.36.64.0/18 subnet.
Question 3 · Computer Networks · 2024_Set1NAT
Consider the entries shown below in the forwarding table of an IP router. Each entry consists of an IP prefix and the corresponding next hop router for packets whose destination IP address matches the prefix. The notation “/N” in a prefix indicates a subnet mask with the most significant N bits set to 1.
This router forwards 20 packets each to 5 hosts. The IP addresses of the hosts are 10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191, and 10.1.1.205 . The number of packets forwarded via the next hop router R2 is _________
Correct Answer:
40
Step-by-Step Solution
Insight: This is a longest-prefix match counting question, recognizable by a forwarding table and a list of destination IPs with packet counts.
Exam route: For each host IP, find the longest matching prefix in the table, identify its next hop, and sum the packets for the requested next hop (R2).
Learning route:
Step 1: Analyze the forwarding table.
10.1.1.0/24 → R1 (Range: 10.1.1.0 to 10.1.1.255)
10.1.1.128/25 → R2 (Range: 10.1.1.128 to 10.1.1.255)
10.1.1.64/26 → R3 (Range: 10.1.1.64 to 10.1.1.127)
10.1.1.192/26 → R4 (Range: 10.1.1.192 to 10.1.1.255)
Step 2: Evaluate each host IP against the table to find the longest match.
Host 1: 10.1.1.16. Matches /24 (R1). Does not match /25, /26, or /26. Longest match: /24 → R1.
Host 2: 10.1.1.72. Matches /24 (R1) and /26 (R3, since 72 is between 64 and 127). Longest match: /26 → R3.
Host 3: 10.1.1.132. Matches /24 (R1) and /25 (R2, since 132 is between 128 and 255). Does not match /26 (192). Longest match: /25 → R2.
Host 4: 10.1.1.191. Matches /24 (R1) and /25 (R2, since 191 is between 128 and 255). Does not match /26 (192). Longest match: /25 → R2.
Host 5: 10.1.1.205. Matches /24 (R1), /25 (R2), and /26 (R4, since 205 is between 192 and 255). Longest match: /26 → R4.
Step 3: Count packets for R2.
Hosts forwarding to R2 are Host 3 (10.1.1.132) and Host 4 (10.1.1.191).
Each host receives 20 packets.
Total packets via R2 = 2 hosts × 20 packets/host = 40.
Verification: 132 and 191 both fall in the 128-255 range of the /25 prefix, and neither falls in the 192-255 range of the /26 prefix. Thus, /25 is the longest match for both, correctly routing them to R2.
Question 4 · Computer Networks · 2023NAT
The forwarding table of a router is shown below.
A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID __________.
Correct Answer:
3.00
Step-by-Step Solution
Insight: This is a direct longest-prefix match forwarding question, recognizable by a destination IP and a routing table with overlapping prefixes.
Exam route: Convert each subnet mask to its prefix length, test the destination IP against each prefix, collect all matches, and pick the one with the largest prefix length.
Learning route:
Step 1: Convert subnet masks to prefix lengths.
255.255.0.0 = /16
255.255.224.0 = /19
255.255.255.0 = /24
255.255.255.224 = /27
Step 2: Test destination IP 200.150.68.118 against each prefix.
/16 (200.150.0.0): Matches the first 16 bits. (Match)
/19 (200.150.64.0): Third octet is 68 (01000100 in binary). Mask is 224 (11100000). 68 AND 224 = 64. Matches the prefix 64. (Match)
/24 (200.150.68.0): Third octet 68 matches 68 exactly. (Match)
/27 (200.150.68.64): Fourth octet is 118 (01110110). Mask is 224 (11100000). 118 AND 224 = 96. This does not equal the prefix 64. (No match)
Step 3: Resolve ties. The matching prefixes are /16, /19, and /24. The longest prefix is /24.
Step 4: The /24 entry points to Interface 3.
Verification: The IP 200.150.68.118 falls in the range 200.150.68.0 to 200.150.68.255, which is exactly the /24 subnet. It does not fall in the /27 subnet (64 to 95).
Question 5 · Computer Networks · 2023MSQ
Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?
A.
OSPF implements Bellman-Ford algorithm to find shortest paths.
Insight: This is a conceptual verification question about OSPF characteristics, recognizable by the request to identify "INCORRECT" statements about a specific routing protocol.
Exam route: Evaluate each statement against the standard definition of OSPF (Open Shortest Path First) as an intra-domain, link-state protocol using Dijkstra's algorithm.
OSPF is a Link-State protocol. Link-State protocols use Dijkstra's shortest path algorithm, not Bellman-Ford. Bellman-Ford is used by Distance-Vector protocols like RIP.
This is the defining characteristic of Link-State routing. OSPF builds a complete topology map and runs Dijkstra's algorithm.
Therefore, Statement B is CORRECT.
Step 3: Analyze Statement C: "OSPF is used as an inter-domain routing protocol."
OSPF is an Interior Gateway Protocol (IGP), designed for routing within a single autonomous system (intra-domain). Border Gateway Protocol (BGP) is used for inter-domain routing.
OSPF supports hierarchical routing through the use of "areas" (e.g., backbone area 0 and regular areas), which reduces routing table size and LSA flooding.
Therefore, Statement D is CORRECT.
Step 5: Select the INCORRECT statements.
Statements A and C are incorrect.
Verification: OSPF = Link-State = Dijkstra = Intra-domain (IGP) = Hierarchical (Areas). This confirms A and C are the false statements.
Question 6 · Computer Networks · 2022NAT
Consider a network with three routers P, Q, R shown in the figure below. All the links have cost of unity.
The routers exchange distance vector routing information and have converged on the routing tables, after which the link Q−R fails. Assume that P and Q send out routing updates at random times, each at the same average rate. The probability of a routing loop formation (rounded off to one decimal place) between P and Q, leading to count-to-infinity problem, is___________.
Correct Answer:
0.50
Step-by-Step Solution
Insight: This is a count-to-infinity probability question in distance-vector routing, triggered by a link failure and asynchronous update timing.
Exam route: Identify the two possible update orderings after a link failure. A routing loop forms if and only if the unaffected router sends its update before the router that detected the failure.
Learning route:
Step 1: Understand the initial converged state. P knows R is at distance 2 (via Q). Q knows R is at distance 1.
Step 2: Link Q-R fails. Q detects this and updates its distance to R to infinity.
Step 3: Analyze the two possible update orderings.
Case 1: Q sends its update to P before P sends its update to Q. Q tells P "distance to R is infinity". P receives this, realizes its route via Q is dead, and updates its distance to R to infinity. No loop forms.
Case 2: P sends its update to Q before Q sends its update to P. P tells Q "distance to R is 2". Q receives this and thinks, "I can reach R via P with cost 1+2=3". Q updates its distance to R to 3. Then Q tells P "distance to R is 3", and P updates to 1+3=4. A routing loop forms, leading to count-to-infinity.
Step 4: Calculate probability. Since P and Q send updates at random times at the same average rate, the probability of Case 2 (P sends before Q) is exactly 1/2=0.5.
Verification: The count-to-infinity problem in a 2-node loop strictly depends on the "bad news" (infinity) being overwritten by stale "good news" (distance 2) due to timing. This happens with 50% probability when rates are equal.
Question 7 · Computer Networks · 2022MSQ
Consider routing table of an organization’s router shown below:
Subnet Number
Subnet Mask
Next Hop
12.20.164.0
255.255.252.0
R1
12.20.170.0
255.255.254.0
R2
12.20.168.0
255.255.254.0
Interface 0
12.20.166.0
255.255.254.0
Interface 1
default
R3
Which of the following prefixes in CIDR notation can be collectively used to correctly aggregate all of the subnets in the routing table?
A.
12.20.164.0/20
B.
12.20.164.0/22
C.
12.20.164.0/21
D.
12.20.168.0/22
Correct Answer:
["B","D"]
Step-by-Step Solution
Insight: This is a route aggregation (supernetting) question, recognizable because it asks to "collectively aggregate" multiple subnets.
Exam route: Convert each subnet to its IP range, then find the minimal set of valid CIDR blocks from the options that cover all these ranges without gaps.
Learning route:
Step 1: Analyze the given subnets.
12.20.164.0 / 255.255.252.0 is a /22. Range: 12.20.164.0 to 12.20.167.255.
12.20.170.0 / 255.255.254.0 is a /23. Range: 12.20.170.0 to 12.20.171.255.
12.20.168.0 / 255.255.254.0 is a /23. Range: 12.20.168.0 to 12.20.169.255.
12.20.166.0 / 255.255.254.0 is a /23. Range: 12.20.166.0 to 12.20.167.255.
Step 2: Check the options for valid CIDR blocks that cover these ranges.
Option A (12.20.164.0/20): Invalid network address. A /20 block must start at a multiple of 16 in the third octet (e.g., 160.0), not 164.0.
Option B (12.20.164.0/22): Valid /22 block. Range: 12.20.164.0 to 12.20.167.255. This perfectly covers the first and fourth subnets.
Option C (12.20.164.0/21): Invalid network address. A /21 block must start at a multiple of 8 (e.g., 160.0 or 168.0), not 164.0.
Option D (12.20.168.0/22): Valid /22 block. Range: 12.20.168.0 to 12.20.171.255. This perfectly covers the second and third subnets (168-169 and 170-171).
Step 3: Combine the valid options.
Using Option B and Option D collectively covers all four subnets (164-167 and 168-171).
Verification: 12.20.164.0/22 covers 164, 165, 166, 167. 12.20.168.0/22 covers 168, 169, 170, 171. Together they cover 164 through 171, which matches all given subnets.
Question 8 · Computer Networks · 2021_Set2MSQ
Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is as shown below.
The objective is to find the shortest-cost path from the router R to routers P and Q. Assume that R does not initially know the shortest routes to P and Q. Assume that R has three neighbouring routers denoted as X, Y, and Z. During one iteration, R measures its distance to its neighbours X, Y, and Z as 3, 2, and 5, respectively. Router R gets routing vectors from its neighbours that indicate that the distance to router P from routers X, Y, and Z are 7, 6, and 5, respectively. The routing vector also indicates that the distance to router Q from routers X, Y, and Z are 4, 6, and 8, respectively. Which of the following statement(s) is/are correct with respect to the new routing table of R, after updation during this iteration?
A.
The distance from R to P will be stored as 10.
B.
The distance from R to Q will be stored as 7.
C.
The next hop router for a packet from R to P is Y.
D.
The next hop router for a packet from R to Q is Z.
Correct Answer:
["B","C"]
Step-by-Step Solution
Insight: This is a distance-vector routing update question, recognizable by the given neighbor distances and their reported distances to destinations.
Exam route: Apply the Bellman-Ford equation DR(Dest)=minv(c(R,v)+Dv(Dest)) for each destination to find the minimum cost and the corresponding next hop.
Learning route:
Step 1: Identify given costs from R to neighbors: c(R,X)=3, c(R,Y)=2, c(R,Z)=5.
Step 2: Calculate cost to P via each neighbor using the Bellman-Ford equation.
Via X: c(R,X)+DX(P)=3+7=10
Via Y: c(R,Y)+DY(P)=2+6=8
Via Z: c(R,Z)+DZ(P)=5+5=10
Minimum cost to P is 8, achieved via next hop Y.
Step 3: Calculate cost to Q via each neighbor.
Via X: c(R,X)+DX(Q)=3+4=7
Via Y: c(R,Y)+DY(Q)=2+6=8
Via Z: c(R,Z)+DZ(Q)=5+8=13
Minimum cost to Q is 7, achieved via next hop X.
Step 4: Evaluate options.
Option A: Distance to P is 10. (False, it is 8)
Option B: Distance to Q is 7. (True)
Option C: Next hop to P is Y. (True)
Option D: Next hop to Q is Z. (False, it is X)
Verification: The Bellman-Ford equation guarantees that the minimum of the sum of local link cost and neighbor's reported cost yields the correct shortest path in distance-vector routing.