chapter

    Routing Protocols and Packet Forwarding Practice Questions for Gate Cs

    Solve 207+ Routing Protocols and Packet Forwarding practice 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
    Level 1: Warm-up

    Consider the Bellman-Ford equation . If node has exactly 4 direct neighbors, what is the minimum number of terms that must be evaluated in the function to compute the least cost path to a destination ?

    Question 2
    Level 1: Warm-up

    In the Bellman-Ford equation , router evaluates paths to destination through its neighbors. If neighbor reports with , and neighbor reports with , what is the minimum computed cost ?

    Question 3
    Level 1: Warm-up

    Consider a network with source node and three other nodes , , . The link costs are: , , , , , . Using Dijkstra's algorithm starting from , what is the correct order in which nodes are added to the set (after )?

    Question 4
    Level 1: Warm-up

    Which of the following statements is TRUE regarding the comparison between Distance-Vector and Link-State routing protocols?

    Question 5
    Level 1: Warm-up

    In a Distance-Vector routing network, router has four direct neighbors . The direct link costs from to these neighbors are , , , and . The neighbors report their least costs to destination as , , , and . Using the Bellman-Ford equation, what is the new least cost computed by router ?

    Question 6
    Level 1: Warm-up

    In the step-by-step packet forwarding algorithm, which of the following statements is TRUE regarding the default route 0.0.0.0 / 0?

    Question 7
    Level 1: Warm-up

    A forwarding table entry is defined as 10.0.0.0/12. Which of the following destination IP addresses is IMPOSSIBLE to match this entry?

    Question 8
    Level 1: Warm-up

    A router's forwarding table contains the entry . If a packet arrives with destination IP , the router performs a bitwise AND between the IP and the subnet mask. What is the decimal value of the third octet of the resulting network prefix?

    Question 9
    Level 1: Warm-up

    Match the following routing concepts with their correct descriptions:

    List I (Concept)

    P: Split Horizon

    Q: Poison Reverse

    R: Count-to-Infinity

    S: Distance-Vector

    List II (Description)

    1: A router advertises a route back to the neighbor it learned it from, but with infinite cost.

    2: Bad news travels slowly, causing routers to incrementally increase their cost to a destination.

    3: A router does not advertise a route back to the neighbor from which it learned that route.

    4: Each router maintains a table of best known distances and periodically sends it to neighbors.

    Question 10
    Level 1: Warm-up

    The Distance-Vector routing algorithm fundamentally relies on a specific recursive equation to update its routing table based on neighbor information. What is the name of this equation?

    Free preview ends here

    Login to view the complete practice 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.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    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 Practice Questions for GATE CS

    Solve 207+ Routing Protocols and Packet Forwarding practice 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 (10 Problems)

    Question 1 · Computer Networks MCQ

    Consider the Bellman-Ford equation . If node has exactly 4 direct neighbors, what is the minimum number of terms that must be evaluated in the function to compute the least cost path to a destination ?

    1. A.

      4

    2. B.

      5

    3. C.

      3

    4. D.

      1

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: The Bellman-Ford equation evaluates the minimum cost over the set of all direct neighbors of node .

    Step 1: Identify the number of direct neighbors of node , which is explicitly given as 4.

    Step 2: The function iterates over the set of direct neighbors . It does not include node itself, as a node is not its own neighbor.

    Step 3: Therefore, exactly 4 terms must be evaluated, one for each of the 4 neighbors.

    Answer: A

    Question 2 · Computer Networks MCQ

    In the Bellman-Ford equation , router evaluates paths to destination through its neighbors. If neighbor reports with , and neighbor reports with , what is the minimum computed cost ?

    1. A.

      10

    2. B.

      11

    3. C.

      8

    4. D.

      5

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: The Bellman-Ford equation requires computing the sum of the local link cost and the neighbor's reported cost for each neighbor, then selecting the minimum.

    Step 1: Calculate the path cost via : .

    Step 2: Calculate the path cost via : .

    Step 3: Apply the function to the computed values: .

    Answer: A

    Question 3 · Computer Networks MCQ

    Consider a network with source node and three other nodes , , . The link costs are: , , , , , . Using Dijkstra's algorithm starting from , what is the correct order in which nodes are added to the set (after )?

    1. A.

      , ,

    2. B.

      , ,

    3. C.

      , ,

    4. D.

      , ,

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Dijkstra's algorithm always adds the node with minimum not yet in .

    Step 1: Initialize . Set , , .

    Step 2: Find minimum outside . is minimum. Add to . Now .

    Step 3: Update neighbors of :

    Step 4: Find minimum outside . Both and . Choose (or — tie-breaking). Add to . Now .

    Step 5: Update neighbors of :

    • (no change)

    Step 6: Add to . Now .

    Order: , ,

    Answer: , ,

    Question 4 · Computer Networks MCQ

    Which of the following statements is TRUE regarding the comparison between Distance-Vector and Link-State routing protocols?

    1. A.

      Distance-Vector routing requires every router to have complete knowledge of the network topology

    2. B.

      Link-State routing converges faster than Distance-Vector routing

    3. C.

      Distance-Vector routing is immune to the count-to-infinity problem

    4. D.

      Link-State routing uses the Bellman-Ford equation for path computation

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Compare the fundamental characteristics of DV and LS routing.

    Step 1: Analyze option A: "Distance-Vector requires complete topology knowledge"

    • FALSE. DV routers only know about their neighbors and learn iteratively. LS requires complete knowledge.

    Step 2: Analyze option B: "Link-State converges faster than Distance-Vector"

    • TRUE. LS has global knowledge and computes paths independently, leading to faster convergence. DV suffers from slow convergence due to count-to-infinity.

    Step 3: Analyze option C: "Distance-Vector is immune to count-to-infinity"

    • FALSE. Count-to-infinity is a fundamental problem in DV routing.

    Step 4: Analyze option D: "Link-State uses Bellman-Ford equation"

    • FALSE. LS uses Dijkstra's algorithm. DV uses Bellman-Ford.

    Answer: Link-State routing converges faster than Distance-Vector routing

    Question 5 · Computer Networks NAT

    In a Distance-Vector routing network, router has four direct neighbors . The direct link costs from to these neighbors are , , , and . The neighbors report their least costs to destination as , , , and . Using the Bellman-Ford equation, what is the new least cost computed by router ?

    Correct Answer:

    6.00

    Step-by-Step Solution

    Key idea: This is a direct application of the Bellman-Ford equation: .

    Step 1: Compute the cost via each neighbor:

    • Via :
    • Via :
    • Via :
    • Via :

    Step 2: Find the minimum:

    Answer: 6.00

    Note: The path via gives the least cost of 6, even though has a cheaper direct link (). The total cost matters, not just the first hop.

    Question 6 · Computer Networks MCQ

    In the step-by-step packet forwarding algorithm, which of the following statements is TRUE regarding the default route 0.0.0.0 / 0?

    1. A.

      It is evaluated first and always wins

    2. B.

      It is only used if no other entries match the destination IP

    3. C.

      It has a prefix length of 32, making it the most specific

    4. D.

      It overrides any matching specific prefix

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: The default route 0.0.0.0 / 0 has a prefix length of 0, making it the least specific match possible.

    Exam route: It only wins if no other entry matches, because any specific match will have .

    Learning route:

    1. The default route is defined as 0.0.0.0 / 0.
    2. Its prefix length is 0, which is the minimum possible value.
    3. The Longest Prefix Match rule dictates that the entry with the largest wins.
    4. Therefore, any specific match (where ) will override the default route. It is only used as a fallback when no specific entries match.

    Answer: It is only used if no other entries match the destination IP.

    Question 7 · Computer Networks MCQ

    A forwarding table entry is defined as 10.0.0.0/12. Which of the following destination IP addresses is IMPOSSIBLE to match this entry?

    1. A.

      10.0.0.1

    2. B.

      10.15.255.254

    3. C.

      10.16.0.0

    4. D.

      10.1.100.50

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a boundary case question, recognizable because it asks for an IMPOSSIBLE match, testing your understanding of subnet boundaries.

    Step 1: Analyze the entry 10.0.0.0/12. A /12 mask means the first 12 bits are fixed. The first 8 bits are the first octet (10). The remaining 4 bits come from the second octet.

    Step 2: Determine the valid range for the second octet. The prefix's second octet is 0 (binary 00000000). The first 4 bits must be 0000. This means the second octet can range from 00000000 (0) to 00001111 (15).

    Step 3: Evaluate each option:

    • 10.0.0.1: Second octet is 0. Valid.
    • 10.15.255.254: Second octet is 15. Valid.
    • 10.16.0.0: Second octet is 16 (binary 00010000). First 4 bits are 0001. Invalid.
    • 10.1.100.50: Second octet is 1. Valid.

    Step 4: Identify the impossible match. 10.16.0.0 falls outside the 0-15 range.

    Answer: Option C.

    Question 8 · Computer Networks MCQ

    A router's forwarding table contains the entry . If a packet arrives with destination IP , the router performs a bitwise AND between the IP and the subnet mask. What is the decimal value of the third octet of the resulting network prefix?

    1. A.

      15

    2. B.

      0

    3. C.

      240

    4. D.

      16

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: The network prefix is found by performing a bitwise AND between the destination IP and the subnet mask.

    Step 1: Determine the subnet mask for /20. A /20 mask means the first 20 bits are 1s. In dotted decimal, this is .

    Step 2: Identify the relevant octets. The third octet of the IP is 15. The third octet of the mask is 240.

    Step 3: Perform the bitwise AND on the third octet.

    • 15 in binary: $00001111$
    • 240 in binary: $11110000$
    • AND result: $00000000$, which is 0 in decimal.

    Answer: B

    Question 9 · Computer Networks MCQ

    Match the following routing concepts with their correct descriptions:

    List I (Concept)

    P: Split Horizon

    Q: Poison Reverse

    R: Count-to-Infinity

    S: Distance-Vector

    List II (Description)

    1: A router advertises a route back to the neighbor it learned it from, but with infinite cost.

    2: Bad news travels slowly, causing routers to incrementally increase their cost to a destination.

    3: A router does not advertise a route back to the neighbor from which it learned that route.

    4: Each router maintains a table of best known distances and periodically sends it to neighbors.

    1. A.

      P-3, Q-1, R-2, S-4

    2. B.

      P-1, Q-3, R-4, S-2

    3. C.

      P-3, Q-2, R-1, S-4

    4. D.

      P-4, Q-1, R-2, S-3

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: Distance-Vector routing uses specific techniques to mitigate the count-to-infinity problem caused by slow convergence.

    Step 1: Match S (Distance-Vector). It is defined by routers maintaining a table of distances and sending it to neighbors. This matches 4.

    Step 2: Match R (Count-to-Infinity). This is the problem where bad news travels slowly and costs increment to infinity. This matches 2.

    Step 3: Differentiate P (Split Horizon) and Q (Poison Reverse).

    • Split Horizon: Do not advertise the route back to the source. Matches 3.
    • Poison Reverse: Advertise it back, but with infinite cost. Matches 1.

    Step 4: Combine the matches: P-3, Q-1, R-2, S-4.

    Answer: A

    Question 10 · Computer Networks MCQ

    The Distance-Vector routing algorithm fundamentally relies on a specific recursive equation to update its routing table based on neighbor information. What is the name of this equation?

    1. A.

      Bellman-Ford equation

    2. B.

      Dijkstra's equation

    3. C.

      Floyd-Warshall equation

    4. D.

      Kruskal's equation

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: Distance-Vector routing is mathematically founded on the Bellman-Ford equation.

    Step 1: Identify the core mechanism of Distance-Vector routing, which is updating routing tables iteratively based on information received from directly connected neighbors.

    Step 2: Recall the mathematical foundation of this update rule. It is the Bellman-Ford equation, which calculates the least cost path recursively.

    Step 3: Evaluate the options. Dijkstra's is for Link-State routing, Floyd-Warshall is for centralized all-pairs shortest path, and Kruskal's is for minimum spanning trees.

    Answer: A

    More practice questions in this unit