Interior vs Exterior Gateway Protocols
IGPs (Interior Gateway Protocols) route within a single autonomous system (AS) — a network under one administrative control (a company, campus, or ISP's internal network). IGPs include RIP, OSPF, EIGRP, and IS-IS. EGPs (Exterior Gateway Protocols) route between autonomous systems — BGP is the only widely used EGP and is the routing protocol of the internet.
An autonomous system is identified by an AS Number (ASN), a unique number assigned by IANA/RIRs. Private ASNs (64512–65534) are used internally; public ASNs are globally unique. BGP peers (neighbors) exchange routing information between ASes, enabling internet-wide reachability.
Distance-Vector Routing Protocols
Distance-vector protocols share routing tables (lists of networks and distances) with directly connected neighbors. Each router only knows routes from its neighbors' perspective — they do not have a full network map. The 'Bellman-Ford' algorithm calculates paths.
RIP (Routing Information Protocol): version 1 (classful, no VLSM) and version 2 (classless, VLSM, MD5 auth). Metric: hop count, max 15. Update interval: 30 seconds. Slow convergence — can take minutes after a topology change. Maximum 15 hops limits RIP to very small networks. RIPng supports IPv6.
EIGRP (Enhanced IGRP): Cisco's advanced distance-vector protocol (now open standard). Composite metric using bandwidth and delay (plus optionally load and reliability). Uses DUAL (Diffusing Update Algorithm) for loop-free, fast convergence — backup paths are pre-computed (feasible successors). Supports VLSM, classless, unequal-cost load balancing. No hop count limit.
Link-State Routing Protocols
Link-state protocols flood the entire network with topology information (LSAs — Link State Advertisements). Each router builds an identical map of the entire network, then runs Dijkstra's Shortest Path First (SPF) algorithm independently to compute best paths. Fast convergence, supports large networks.
OSPF (Open Shortest Path First): the dominant enterprise IGP. Metric: cost (reference bandwidth / interface bandwidth). Organizes network into areas — Area 0 is the backbone; all other areas must connect to Area 0. DR/BDR election on broadcast networks reduces LSA flooding. OSPFv3 adds IPv6 support. Authentication supported (MD5 or SHA).
IS-IS (Intermediate System to Intermediate System): another link-state IGP, preferred by ISPs for its scalability and stability. Uses levels instead of areas. Less common in enterprise environments but important to recognize.
BGP: The Internet Routing Protocol
BGP (Border Gateway Protocol) is a path-vector EGP that exchanges routing information between autonomous systems. Uses TCP port 179. BGP neighbors are manually configured (not auto-discovered). Path selection uses multiple attributes: AS path length (shortest preferred), local preference, MED, origin, and more.
eBGP (external BGP): between different ASes (across the internet). iBGP (internal BGP): within the same AS for distributing external routes. BGP carries the full internet routing table (900,000+ routes) and is the reason the internet works as a globally connected network.