Network Implementation · Topic 1 of 8
Routing Technologies
Explain how routers choose paths with static and default routes, dynamic OSPF, EIGRP and BGP, administrative distance, metric and prefix length.
- 5 min
- The longest prefix match is checked first, then administrative distance, then metric.
- Lower administrative distance is more trusted. Connected is 0 and static is 1.
- OSPF is link state and uses cost. EIGRP uses a composite metric. RIP uses hop count.
What it is
Routing is the process a router uses to forward a packet toward its destination network. The router keeps a routing table, and each entry says which next hop or interface reaches a given prefix.
Routes come from three sources: directly connected networks, static routes an administrator types in, and dynamic routing protocols that learn routes from other routers. The exam asks which source to use and how the router picks one route when several match.
How it works
Static routing and the default route
A static route is fixed by hand. It is simple, uses no bandwidth for updates and is predictable, but it does not adapt when a link fails.
A default route matches any destination that no other route covers. It is written 0.0.0.0/0 in Internet Protocol version 4 (IPv4) and ::/0 in IPv6, and it usually points to the router that faces the internet.
Cisco IOS style (Internetwork Operating System): ip route 10.2.0.0 255.255.0.0 192.168.1.2
Default route: ip route 0.0.0.0 0.0.0.0 192.168.1.1
Dynamic routing protocols
Dynamic protocols let routers share routes and recover from failures on their own. They are grouped by where they run and how they work.
| Protocol | Type | Scope | Metric |
|---|---|---|---|
| Open Shortest Path First (OSPF) | Link state | Interior, inside one organization | Cost, based on link bandwidth |
| Enhanced Interior Gateway Routing Protocol (EIGRP) | Advanced distance vector | Interior | Composite metric using bandwidth and delay |
| Border Gateway Protocol (BGP) | Path vector | Exterior, between autonomous systems | Path attributes and policy |
| Routing Information Protocol (RIP) | Distance vector | Interior | Hop count |
An autonomous system (AS) is a group of networks under one administration. Interior gateway protocols (IGPs) run inside an AS, and BGP is the exterior gateway protocol that joins the internet together.
OSPF routers flood link state information so that each router builds a full map of its area and calculates the shortest path. Large OSPF networks are divided into areas that connect to a backbone area, area 0.
EIGRP was developed by Cisco and learns neighbors, then shares routes with fast convergence. BGP is used by internet service providers and by large organizations with several internet connections.
How a router selects a route
When more than one route could carry a packet, the router applies three rules in order.
- Prefix length: the most specific match (longest prefix) wins. A /24 route beats a /16 route for the same destination.
- Administrative distance (AD): when the same prefix is learned from different sources, the source with the lower AD is trusted more.
- Metric: when the same protocol offers several paths, the lowest metric wins.
| Route source | Typical administrative distance |
|---|---|
| Directly connected | 0 |
| Static | 1 |
| External BGP | 20 |
| EIGRP (internal) | 90 |
| OSPF | 110 |
| RIP | 120 |
Lower AD is better. A static route can be given a high AD so that it acts only as a floating backup when the dynamic route disappears.
Convergence and loops
Convergence is the time routers need to agree on the new topology after a change. Faster convergence means shorter outages.
The Time to Live (TTL) value in the Internet Protocol (IP) header drops by one at each router. If it reaches zero, the packet is discarded, which prevents packets from circling forever in a routing loop.
What to remember for the exam
- The longest prefix match is checked first, then administrative distance, then metric.
- Lower administrative distance is more trusted. Connected is 0 and static is 1.
- OSPF is link state and uses cost. EIGRP uses a composite metric. RIP uses hop count.
- BGP is the exterior protocol between autonomous systems. OSPF and EIGRP run inside one.
- A default route is 0.0.0.0/0 for IPv4 and ::/0 for IPv6.
- Static routes are simple but do not adapt to failures.
- OSPF uses areas, with area 0 as the backbone.
- TTL decreases by one per router and prevents endless loops.
When a question has two routes to the same destination, check the prefix length before anything else. A more specific route wins even if its metric or AD looks worse.
Common mistakes
Comparing metrics across protocols. Metrics from OSPF and EIGRP cannot be compared. Administrative distance decides between protocols.
Thinking a higher AD wins. The lower number is preferred.
Using BGP inside a small local network. BGP is for connecting autonomous systems and for large policy driven designs.
Forgetting the return route. A packet may reach the server, but the reply fails if the server side has no route back.
Assuming a default route fixes everything. It sends unknown traffic to one next hop, which hides problems and can create loops.
A static route does not disappear when the remote network fails unless it is tied to a tracked interface or reachability check, so traffic can be sent to a dead path.
Check yourself
Answer these three.
Which wins, a /24 route with a metric of 50 or a /16 route with a metric of 5?
The /24 route, because the longest prefix match is applied first.
Which protocol is used between internet service providers?
Border Gateway Protocol (BGP), the exterior gateway protocol.
What does a lower administrative distance mean?
The route source is more trusted, so its route is preferred.
Topic 1 of 8 in Network Implementation
Test yourself on Network Implementation
The full CompTIA Network+ N10-009 question bank has 910 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by CompTIA. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.