Routing Questions with Answers

34 practice questions on Routing (Computer Networks) with answers and step-by-step solutions. Try 10 samples below, then practise all 34 free in the AptiNest app.

Sample questions

Question 1Easy

Which algorithm does OSPF use to compute routes?

  1. Path-vector selection
  2. Bellman-Ford
  3. Dijkstra's shortest path first
  4. Kruskal's minimum spanning tree

Answer: C. Dijkstra's shortest path first

Explanation

Each OSPF router builds the full topology map from LSAs and runs Dijkstra's SPF algorithm.

Step-by-step solution

  1. Every OSPF router builds an identical, complete link-state database from flooded LSAs.
  2. Each router then runs the same algorithm independently on that shared map.
  3. That algorithm is Dijkstra's shortest path first (SPF).

Why the other options are wrong

  • A. Path-vector route selection is BGP's mechanism, not OSPF's.
  • B. Bellman-Ford is the algorithm distance-vector protocols like RIP use, not link-state protocols like OSPF.
  • D. Kruskal's algorithm builds a minimum spanning tree, a different problem from finding shortest paths to every destination.

Tip: OSPF = link-state database + Dijkstra's SPF, run independently by every router.

Question 2Easy

Which device connects different networks and forwards packets based on IP addresses?

  1. Hub
  2. Repeater
  3. Router
  4. Layer-2 switch

Answer: C. Router

Explanation

Routers operate at the network layer. Hubs and repeaters are physical-layer devices; layer-2 switches forward by MAC address within a network.

Step-by-step solution

  1. A router operates at the network layer, reading IP addresses to make forwarding decisions.
  2. It uses those addresses to connect distinct networks together and forward packets between them.
  3. Hubs and repeaters work below addressing entirely, and layer-2 switches forward within one network using MAC addresses, not between networks.

Why the other options are wrong

  • A. A hub just repeats signals; it has no concept of IP addresses or separate networks at all.
  • B. A repeater, like a hub, just regenerates signals without reading any addresses.
  • D. A layer-2 switch forwards within one network using MAC addresses, not between networks using IP addresses.

Tip: Router = network layer, forwards between networks using IP addresses.

Question 3Easy

In RIP, what hop count means "unreachable"?

  1. 0
  2. 16
  3. 255
  4. 15

Answer: B. 16

Explanation

RIP allows paths up to 15 hops; a metric of 16 is treated as infinity.

Step-by-step solution

  1. RIP treats hop counts up to and including 15 as reachable.
  2. A hop count of 16 is specifically reserved to mean 'unreachable'.
  3. This caps how far 'count to infinity' can climb before the route is declared dead.

Why the other options are wrong

  • A. 0 would actually mean the destination is the router itself (0 hops away), not unreachable.
  • C. 255 is far beyond RIP's actual maximum hop count of 15.
  • D. 15 is RIP's maximum usable (reachable) hop count; one more than that, 16, is what signals unreachable.

Tip: RIP: 15 = farthest reachable hop count; 16 = treated as infinity/unreachable.

Question 4Easy

What is an autonomous system (AS)?

  1. A single router with redundant power supplies
  2. A group of switches that share one VLAN and one spanning tree instance
  3. A DNS zone
  4. A set of networks under one administrative routing policy

Answer: D. A set of networks under one administrative routing policy

Explanation

Each AS has its own number and interior routing; BGP connects autonomous systems.

Step-by-step solution

  1. An autonomous system is a set of networks managed under one administrative routing policy.
  2. Each AS runs its own interior routing (such as OSPF) independently inside its own boundary.
  3. BGP is what connects these independently administered autonomous systems together.

Why the other options are wrong

  • A. An autonomous system is a network-wide administrative concept, not a description of one single device's hardware redundancy.
  • B. VLANs and spanning tree are layer-2 switching concepts within one network, unrelated to the layer-3, multi-network scope of an AS.
  • C. A DNS zone is a naming administrative boundary, a completely different concept from a routing administrative boundary.

Tip: AS = one administrative routing domain, identified by a unique AS number, connected to others via BGP.

Question 5Medium

Using the same table (172.16.0.0/12, 172.16.64.0/18, 172.16.96.0/19, default 0.0.0.0/0), which entry is used for 172.16.130.9?

  1. 0.0.0.0/0
  2. 172.16.64.0/18
  3. 172.16.96.0/19
  4. 172.16.0.0/12

Answer: D. 172.16.0.0/12

Explanation

130 lies outside 64 to 127 in the third octet, so only the /12 and the default match; the longer one, 172.16.0.0/12, wins.

Step-by-step solution

  1. 172.16.130.9 does not fall within the /18 (64-127) or /19 (96-127) ranges, since 130 is outside both.
  2. Only the broad /12 route and the default route actually cover this destination.
  3. Between those two, the /12 is more specific, so it wins.

Why the other options are wrong

  • A. The default route is only a last resort, but a more specific route (the /12) matches here.
  • B. 130 falls outside the 64-127 range this /18 covers, so it does not match this destination at all.
  • C. 130 falls outside the 96-127 range this /19 covers, so it does not match this destination either.

Tip: Always double-check that a candidate route's range genuinely contains the destination address before assuming it is the longest match.

Question 6Medium

OSPF is an example of which type of routing protocol?

  1. Distance-vector
  2. Static routing
  3. Link-state
  4. Path-vector

Answer: C. Link-state

Explanation

OSPF routers flood link-state advertisements so each builds a complete topology map and runs Dijkstra's shortest-path algorithm.

Step-by-step solution

  1. OSPF routers flood information about their own links to every other router in the area.
  2. Every router ends up with an identical, complete map of the topology.
  3. Each router then runs Dijkstra's algorithm independently on that map to compute shortest paths.

Why the other options are wrong

  • A. Distance-vector protocols like RIP only know distances reported by neighbours, not the full topology OSPF builds.
  • B. Static routing is not a dynamic protocol category at all; routes are configured by hand.
  • D. Path-vector protocols like BGP track the sequence of autonomous systems a route passes through, a different mechanism from OSPF's topology database.

Tip: Link-state = full topology map + Dijkstra; distance-vector = just neighbours' distances + Bellman-Ford.

Question 7Medium

How does BGP prevent routing loops between autonomous systems?

  1. A router rejects routes whose AS_PATH already contains its own AS number
  2. It applies split horizon on every link between neighbouring autonomous systems
  3. It limits every path to 15 AS hops, like RIP
  4. It floods LSAs with sequence numbers

Answer: A. A router rejects routes whose AS_PATH already contains its own AS number

Explanation

Seeing its own AS in the path means the advertisement has looped back.

Step-by-step solution

  1. Every BGP route advertisement carries the complete AS_PATH, the full list of autonomous systems it has passed through.
  2. A router checks any incoming advertisement's AS_PATH for its own AS number.
  3. If its own AS number already appears, the advertisement has looped back, so the router rejects it.

Why the other options are wrong

  • B. Split horizon is a distance-vector technique used within protocols like RIP, not how BGP prevents loops between autonomous systems.
  • C. BGP has no fixed 15-hop limit like RIP; its loop prevention works differently, via the AS_PATH check.
  • D. Flooding LSAs with sequence numbers is link-state routing's technique (like OSPF), not BGP's.

Tip: BGP loop prevention: reject any route whose AS_PATH already contains your own AS number.

Question 8Medium

Why is OSPF divided into areas around a backbone area 0?

  1. To encrypt traffic between departments that belong to different areas
  2. To limit LSA flooding and SPF computation to smaller regions
  3. To allow RIP and OSPF to run together on the same routers without conflicts
  4. Because OSPF supports only 16 routers in total

Answer: B. To limit LSA flooding and SPF computation to smaller regions

Explanation

Areas keep link-state databases small; inter-area routes are summarised through area 0.

Step-by-step solution

  1. Without areas, every single OSPF router in a huge network would need to store and recompute routes over the entire topology on every change.
  2. Splitting into areas around a backbone (area 0) keeps each router's link-state database limited to its own area.
  3. Inter-area routes are instead summarised through area 0, keeping both flooding and SPF computation manageable.

Why the other options are wrong

  • A. OSPF areas have nothing to do with encrypting traffic; that is a security function, not a routing scalability one.
  • C. Running RIP and OSPF together is a separate topic (route redistribution), unrelated to why OSPF uses areas.
  • D. OSPF has no fixed 16-router limit; areas exist purely for scalability, not because of such a cap.

Tip: OSPF areas: smaller link-state databases, faster SPF runs, inter-area routes summarised through area 0.

Question 9Hard

Which BGP variant runs between routers inside the same autonomous system?

  1. OSPF
  2. iBGP
  3. IGRP
  4. eBGP

Answer: B. iBGP

Explanation

eBGP peers sit in different autonomous systems; iBGP distributes externally learned routes among routers of the same AS.

Step-by-step solution

  1. BGP has two variants depending on where the peers sit.
  2. eBGP runs between routers in different autonomous systems.
  3. iBGP runs between routers inside the same autonomous system, distributing externally learned routes internally.

Why the other options are wrong

  • A. OSPF is a completely separate interior routing protocol, not a variant of BGP.
  • C. IGRP is an old, unrelated Cisco distance-vector protocol, not a BGP variant.
  • D. eBGP specifically runs between routers in different autonomous systems, the opposite of what is being asked here.

Tip: eBGP = between different autonomous systems. iBGP = within the same autonomous system.

Question 10Hard

What does the TTL (Time To Live) field in an IPv4 header prevent?

  1. Packets being sent to the wrong MAC address
  2. Packets circulating forever in a routing loop
  3. Out-of-order delivery
  4. Packets larger than the MTU

Answer: B. Packets circulating forever in a routing loop

Explanation

Each router decrements TTL by one and discards the packet when it reaches zero, typically sending an ICMP Time Exceeded message (which traceroute relies on).

Step-by-step solution

  1. Every router that forwards an IPv4 packet decrements its TTL field by 1.
  2. If TTL reaches 0, the packet is dropped instead of being forwarded again.
  3. This guarantees that even a packet trapped in a routing loop eventually gets discarded rather than circulating forever.

Why the other options are wrong

  • A. MAC address issues are a data link layer concern, unrelated to TTL.
  • C. Ordering is handled by the transport layer, using TCP sequence numbers, not by TTL.
  • D. MTU and fragmentation are handled by separate mechanisms (the DF bit, Path MTU Discovery), not TTL.

Tip: TTL = a built-in 'give up after N hops' safety net against routing loops.

Practise all 34 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Computer Networks topics · All topics