Afzal Badshah, PhD

Understanding Routing in Computer Networks: From Basics to Advanced Protocols

Think about how you use Google Maps or a delivery app every day. When you request directions, it doesn’t direct you blindly; it calculates the best route considering roads, traffic, and time. Similarly, in computer networks, packets need smart decisions on where to go and how to get there efficiently. Just like your map app reroutes when a road closes, routers dynamically reroute data to keep it moving smoothly. The complete tutorial on Computer Networks can be explored here.

“Routing is the process by which a packet of data is sent from its source network to its destination network, via one or more intermediate routers, selecting the optimum path among thousands of possible routes.”

Why do we need routing?

Imagine you send a parcel from your home to a friend’s house in different city. The parcel doesn’t fly directly, it goes via multiple delivery hubs, trucks, maybe even airplanes. In computer networks, when a data packet travels from one device to another across networks, it also goes through many “hops” (routers). Routing is how the network figures out which path the packet should take so it arrives safely and efficiently. In the OSI model, routing happens at Layer 3 (Network Layer). The router uses information (IP addresses, network topology) to forward packets.

Types of Routing

Routing is an important function in computer networking that involves directing data packets from one device to another across a network. You can imagine it like your daily journey from home to the university. You start from your house (the source) and reach the university (the destination) using certain roads (paths). Sometimes you choose a direct road, other times you may take different routes depending on traffic or road conditions. Similarly, routers choose paths for data to travel efficiently and reach the correct destination. It ensures that information reaches its destination efficiently and accurately. Routers are the key devices responsible for making routing decisions in a network.

Types of routing

Routing is divided into two main categories:

  1. Static Routing
  2. Dynamic Routing

Static Routing

Static routing is a routing method where network administrators manually configure the routing table on a router. Think of it like your parents bringing you to the university for the first time and showing you one specific route. You follow that exact path every day without exploring other roads or shortcuts. In this approach, the routing decisions are predetermined and do not change unless modified by the administrator. Static routing is straightforward and suitable for small networks with a relatively simple topology.

Static routing

How Static Routing Works
Network administrators manually enter routing information into the router’s configuration. This includes specifying the destination IP addresses and the corresponding next-hop routers. The router builds a static routing table based on this configured information. Since it does not adapt automatically, any network changes require manual updates.

“Static routing means you manually configure the path in the router.”

Advantages of Static Routing
Static routing is simple to configure and easy to understand. It has lower overhead on router resources since no dynamic routing protocol runs in the background.

Disadvantages of Static Routing
Static routing doesn’t adapt well to network topology changes and requires manual intervention whenever an update is needed.

Dynamic Routing

Imagine after a few weeks of classes, you’ve learned the city routes well. Now you start experimenting with alternate paths to reach the university faster, avoiding traffic or finding shortcuts. That’s similar to dynamic routing, where routers learn and share information to always find the best path.

Dynamic routing

Dynamic routing is a more adaptive approach to routing where routers communicate with each other using routing protocols to dynamically update and share routing information. This allows routers to automatically adjust to changes in the network, making it suitable for larger and more complex environments.

How Dynamic Routing Works
Routers running dynamic routing routing protocols share information about the network’s topology and maintain updated routing tables. When network changes occur, routers automatically exchange updates and recalculate the best paths.

“Dynamic routing means routers communicate with each other and decide paths automatically.”

Advantages of Dynamic Routing
Dynamic routing adapts automatically to network topology changes without manual intervention. It can find efficient paths based on real-time network conditions.

Disadvantages of Dynamic Routing
Dynamic routing protocols are more complex to configure and consume more router resources compared to static routing.

Understanding routing, static routing, and dynamic routing is fundamental to designing and maintaining efficient networks. The choice between them depends on network size, complexity, and adaptability needs.

Key concepts

Topology: This refers to how all the devices in a network are arranged and connected, like the layout of roads in a city that determine how vehicles move between areas.

Convergence: This is the time routers take to agree on the best possible routes after a change or failure occurs. It’s like traffic updates reaching all drivers so they can adjust their routes.

Metric: A value that helps routers decide which route is the best among available options, similar to choosing between routes based on distance, traffic, or travel time.

Autonomous System (AS): A group of networks under single administrative control.

Classification of Routing Protocols

Routing protocols are fundamental to network communication, and two prominent categories are Distance Vector and Link State protocols. Distance Vector protocols, exemplified by Routing Information Protocol (RIP), make routing decisions based on cumulative distances to destinations, conveyed through periodic updates. They employ algorithms like Bellman–Ford and rely on routing tables to determine the best paths. However, the convergence time can be slower due to periodic updates, and scalability may be challenging in large networks.

Distance Vector Protocol

A Distance Vector Protocol determines the best path to a destination by measuring the ‘distance’ to that destination, often expressed in terms of hop count. Routers using these protocols periodically share their routing tables with neighbours, maintaining a view of the network based on cumulative distances. Examples include RIP and IGRP.

Key Concepts

Link State Protocol

A Link State Protocol maintains information about the condition of network links. Unlike distance vector protocols, link state protocols keep a detailed database about the status of each link—bandwidth, delay, reliability—allowing routers to make informed decisions based on real‑time network conditions. Examples include OSPF and IS‑IS.

Key Concepts

Comparison

FeatureDistance Vector ProtocolLink State Protocol
DefinitionUses cumulative distance (e.g., hop count) to determine best pathUses real‑time link status to calculate best path
Example ProtocolRIP, IGRPOSPF, IS‑IS
Algorithm UsedBellman–FordDijkstra’s SPF
Routing InformationPeriodic updates with neighboursLSAs shared across network
Data StructureRouting TableLink State Database (LSDB)
Update MechanismPeriodic full updatesTriggered updates on change
Loop PreventionSplit Horizon, Poison ReverseBuilt‑in loop‑free path calculation
Convergence TimeSlowerFaster
ScalabilityLimited to small networksHighly scalable for large networks
Resource UsageLow CPU/memoryHigher CPU/memory
Neighbour DiscoveryImplicit via periodic updatesExplicit via Hello Protocol
Decision CriteriaBased on distance metricsBased on real‑time link metrics
Configuration ComplexitySimpleComplex
Ideal Use CaseSmall networksLarge enterprise/campus networks

Different Routing Protocols

RIP — Routing Information Protocol

Think of a small town with a few intersections. Each junction only knows how many turns it takes to reach other places and shares that number with its neighbours. RIP works similarly in small networks.

“RIP is a distance‑vector routing protocol that chooses paths based on hop count and shares routes periodically with neighbouring routers.”

How it works (simple): Routers send their entire routing table to neighbours at regular intervals. Each hop adds 1 to the hop count. Anything beyond 15 hops is considered unreachable. Basic loop‑prevention uses techniques like split horizon and poison reverse.

Best for: Small, simple networks where ease of configuration matters more than speed of convergence.

Limitations: Slow convergence; hop‑count cap (15); periodic updates consume bandwidth on larger topologies.

Tiny config sketch:

router rip
 version 2
 network 192.168.0.0
 no auto-summary

OSPF — Open Shortest Path First

Now picture a big city map: every junction has the same full map and recalculates the shortest path instantly when a road changes. That’s the OSPF spirit.

“OSPF is a link‑state routing protocol where each router builds a complete topology (LSDB) and runs Dijkstra’s SPF to compute the best paths.”

How it works (simple): Neighbours form adjacencies, exchange LSAs to build a Link State Database, then each runs SPF locally. Areas (with a backbone Area 0) make large designs scalable and reduce churn.

Best for: Medium‑to‑large enterprises/campuses needing fast convergence and hierarchical design.

Notes: Fast, loop‑free by design, supports VLSM/summarisation; more configuration complexity than RIP.

Tiny config sketch:

router ospf 1
 network 10.0.10.0 0.0.0.255 area 0
 network 10.0.20.0 0.0.0.255 area 1

EIGRP — Enhanced Interior Gateway Routing Protocol

Imagine couriers who consider multiple factors road speed, delays, and reliabilit etc, then pick the best path and keep a backup ready. That’s EIGRP.

“EIGRP is a hybrid routing protocol using the DUAL algorithm and composite metrics (bandwidth, delay, reliability, load) for fast, loop‑free convergence.”

How it works (simple): Forms neighbour relationships, computes a feasible distance to destinations, and keeps a feasible successor (backup) when available. Sends partial, triggered updates—efficient on links.

Best for: Cisco‑centric networks wanting very fast convergence with minimal overhead.

Notes: Vendor‑tilted history; easier operations once designed; supports unequal‑cost load balancing.

Tiny config sketch:

router eigrp 100
 network 10.0.0.0
 no auto-summary

BGP — Border Gateway Protocol

Think international shipping: routes are chosen not just by distance but by policies, agreements, and costs. That’s how the Internet scales.

“BGP is a path‑vector protocol used between autonomous systems; it selects routes based on attributes and policy rather than only shortest path metrics.”

How it works (simple): Peers (neighbours) exchange prefixes with attributes such as AS‑PATH, LOCAL_PREF, MED, and communities. Decisions follow a well‑defined attribute order. Convergence is slower by design but massively scalable and policy‑driven.

Best for: ISP and inter‑organisation connectivity; multi‑homed enterprises; Internet edge routing.

Notes: Requires careful filtering, stability controls, and route‑policy planning.

Tiny config sketch:

router bgp 65000
 neighbor 203.0.113.1 remote-as 65001
 network 198.51.100.0 mask 255.255.255.0

Comparative Analysis and Design Guidelines

ProtocolAlgorithm TypeMetricConvergenceScaleUse Case
RIPDistance‑VectorHop countSlowSmallBranch networks
OSPFLink‑StateCostFastMedium‑LargeCampus/Enterprise
EIGRPHybridBandwidth, DelayVery FastMediumCisco‑based enterprise
BGPPath‑VectorPolicy/AS‑PathSlowInternetISP, Inter‑AS

Self Assessment

  1. What is routing, and how does it ensure that data packets reach their destination efficiently?
  2. Explain the difference between static and dynamic routing using the home-to-university example.
  3. Describe how static routing works and list its major advantages and disadvantages.
  4. Define dynamic routing and explain how routers adapt to network changes.
  5. Compare Distance Vector and Link State protocols in terms of convergence time, scalability, and data structure.
  6. Explain the working principle of RIP and its limitations in large networks.
  7. Discuss how OSPF builds and maintains its network topology and why it’s preferred in large enterprises.
  8. Describe how EIGRP achieves fast convergence and the role of the DUAL algorithm.
  9. Explain how BGP makes routing decisions across autonomous systems and why policy-based routing is important.
  10. In which type of scenario would you recommend RIP, OSPF, EIGRP, and BGP, respectively, and why?
Exit mobile version