Routing protocols interview questions, with answers
Routing is how packets find their way across networks that no single device fully sees. Interviews test the two families of routing protocols, their characteristic problems, and the role of BGP in holding the internet together, along with basics such as default routes and TTL.
The answers below cover routing tables, distance-vector and link-state routing, count to infinity, BGP, interior and exterior protocols, default routes and the TTL field. Then take the free Computer Networks diagnostic — ten questions across every networking topic in the bank — to see which of these you can explain but not yet apply.
The questions, with answers
1.What is routing, and what is in a routing table?
In short: Choosing the next hop for each packet; the table maps destination prefixes to a next hop, an outgoing interface and a metric.
Routing is the network layer's job of moving packets from source to destination across interconnected networks. Each router decides only the next hop, using its routing table, whose entries map a destination prefix to the next-hop router's address, the outgoing interface, and a metric or preference used to choose among alternatives. Entries come from directly connected networks, from routes configured by hand, and from routing protocols that exchange reachability information with other routers. The table is then compiled into a forwarding table that the router's hardware uses at line rate.
2.What is the difference between distance-vector and link-state routing?
In short: Distance-vector routers share their route tables with neighbours; link-state routers flood link information so each computes paths from the full map.
In distance-vector routing, each router knows only its distances to destinations and periodically sends that vector to its neighbours, which update their own using the Bellman-Ford rule; it is simple but converges slowly and can suffer routing loops. RIP is the classic example. In link-state routing, each router floods advertisements describing its own links to every router in the area, so all routers build the same map and each runs Dijkstra's algorithm to compute shortest paths. It converges faster and avoids count to infinity, at the cost of more memory and computation; OSPF and IS-IS work this way.
3.What is the count-to-infinity problem?
In short: After a failure, distance-vector routers can keep learning stale routes from each other, raising the distance step by step without end.
When a network becomes unreachable, a router's neighbour may still advertise a route to it that actually passed through the first router. The first router believes it, adds one hop, and advertises the result back, and the two keep increasing their distances by one each exchange, while packets loop between them. Distance-vector protocols limit the damage by capping the metric so that a route becomes unreachable at a fixed value, and reduce it with split horizon, which does not advertise a route back to the neighbour it was learned from, poison reverse and triggered updates.
4.What is BGP, and why is it called the protocol of the internet?
In short: The Border Gateway Protocol exchanges reachability between autonomous systems, choosing routes by policy, and glues the internet together.
The internet is made of tens of thousands of autonomous systems, networks run by ISPs, companies, universities and cloud providers, each under one administration. BGP is the exterior gateway protocol that exchanges routes between them. It is a path-vector protocol: each advertisement carries the list of autonomous systems the route passes through, which prevents loops and lets networks apply business policies, such as preferring a paying customer's link over a peer's. BGP runs over TCP port 179, and misconfigurations or hijacks can reroute large parts of the internet.
5.What is the difference between interior and exterior gateway protocols?
In short: Interior protocols (RIP, OSPF, IS-IS) route within one organisation's network; exterior protocols (BGP) route between organisations.
Interior gateway protocols run inside a single autonomous system, where one administrator controls every router, so they aim for the fastest convergence and the best technical path by metrics such as hop count or link cost; RIP, OSPF, IS-IS and EIGRP are examples. Exterior gateway protocols connect different autonomous systems, where trust is limited and routing must follow contracts and policies rather than shortest paths, and they must scale to the whole internet's routing table; BGP is the only one in use today. A large network typically runs an IGP internally and BGP at its edges.
6.What is a default route?
In short: The route 0.0.0.0/0, used when no more specific route matches, which usually points to the gateway toward the internet.
A default route matches every destination, written 0.0.0.0/0 in IPv4 or ::/0 in IPv6, and it is used only when no other route matches the destination. A host's default gateway is its default route: the router on its local network that handles everything outside it. Edge networks, such as a home or a branch office with one upstream link, need little more than a default route, while the core routers of the internet hold full BGP tables and carry no default route, a region known as the default-free zone.
7.What does the TTL field in an IP packet do?
In short: Each router decrements it by one and discards the packet at zero, so looping packets cannot circulate forever.
The time-to-live field, called hop limit in IPv6, is set by the sender, commonly to 64 or 128. Every router that forwards the packet decrements it by one, and a router that decrements it to zero discards the packet and usually sends an ICMP Time Exceeded message back to the source. This guarantees that a packet caught in a routing loop eventually disappears rather than consuming bandwidth indefinitely. traceroute exploits the mechanism: it sends packets with TTL 1, 2, 3 and so on, and each router that drops one reveals itself in the ICMP reply.
How the diagnostic asks it
One question from the Computer Networks bank, exactly as a sitting would show it. The bank has 4 on routing and 30 across Computer Networks.
After a link fails, which problem can make distance-vector routers slowly increase their distance to an unreachable network, and how does RIP limit it?
- 1Count to infinity; RIP treats 16 hops as unreachable, so the counting stops therecorrect
- 2Routing loops caused by flooding; RIP limits the flooding to 15 hops
- 3Split horizon; RIP disables split horizon after a failure
- 4Count to infinity; RIP recomputes all routes with Dijkstra's algorithm
In distance-vector routing, routers learn distances only from neighbours. When a network becomes unreachable, two routers can each believe the other still has a path and keep raising their estimates by one hop in turn, the count-to-infinity problem. RIP bounds it by defining 16 hops as infinity, so the network is declared unreachable after the count reaches 16; split horizon and poison reverse reduce the problem further, rather than cause it. RIP does not flood link states and does not use Dijkstra; those belong to link-state protocols such as OSPF.
Measure it
Reading answers tells you what’s true. A diagnostic tells you what you get wrong.
10 Computer Networks questions across its topics, easy to hard, about fifteen minutes. You get a readiness figure with the arithmetic shown, the topics you missed named, and a practice set sized for today. Free: 1 diagnostic a month and 15 problems a day. No card.