9) IP Routing
Fundamentals of Routing
Routing is the technical process of selecting paths within a network along which to transmit network traffic.
This process is executed by specialized devices called routers.
Routers utilize routing tables and complex algorithms to determine the most efficient path for data packets to navigate from a source to a specific destination.
The Routing Process and Packet Delivery
During the routing process, specific packet headers change as the data moves across the network, particularly MAC addresses, while IP addresses typically remain constant.
Host A Connection Details (Source):
IP Address:
MAC Address:
Default Gateway:
Host B Connection Details (Destination):
IP Address:
MAC Address:
Router 1 (R1) Interface Configuration:
G0/0 (Facing Host A): IP , MAC
G1/1 (Facing Host B): IP , MAC
Packet Segment 1 (Host A to Router R1):
Source IP:
Destination IP:
Source MAC:
Destination MAC:
Packet Segment 2 (Router R1 to Host B):
Source IP:
Destination IP:
Source MAC: (Router's exit interface MAC)
Destination MAC: (Host B's MAC)
Routing Tables and Topology Configuration
Network Layout Example:
PC1 () is connected to the NY Router via interface ().
NY Router and LA Router are connected via a cross-link on network .
NY Router interface :
LA Router interface :
PC2 () is connected to the LA Router via interface ().
NY Routing Table:
Destination: | Mask: | Exit Interface:
Destination: | Mask: | Exit Interface:
Destination: | Mask: | Exit Interface:
LA Routing Table:
Destination: | Mask: | Exit Interface:
Destination: | Mask: | Exit Interface:
Destination: | Mask: | Exit Interface:
Static and Dynamic Routing
Static Routing:
Involves manual configuration of routers with specific predefined paths to reach network destinations.
Implementation: Simple in small environments.
Limitation: Lacks flexibility and scalability; it cannot automatically adjust to topology changes.
Dynamic Routing:
Automatically adjusts paths used to send data.
Mechanism: Routers use dynamic routing protocols to share information regarding network topology and traffic conditions.
Adaptability: Allows the network to respond to link failures or congestion dynamically to ensure efficiency.
Routing Protocol Classifications
Interior Gateway Protocols (IGP):
Used by a single organization to route traffic between its own LAN locations (e.g., routing from a NY branch to a LA branch within the same company).
Distance-vector: A hops-based protocol. Packets are forwarded via the path with the fewest number of hops.
Link-state: A bandwidth-based protocol. Packets are forwarded via the path with the highest available bandwidth.
Exterior Gateway Protocols (EGP):
Used to route traffic between different organizations or WAN links.
Example application: The Internet.
Border Gateway Protocol (BGP): The only contemporary EGP used to route internet traffic.
Autonomous System (AS): Consists of all network locations interconnected and managed by a single organization.
Core Interior Gateway Protocols
Routing Information Protocol (RIP):
Classification: One of the oldest distance-vector protocols.
Metric: Hop count, with a maximum limit of hops.
RIPv1: Classful protocol; does not include subnet information.
RIPv2: Classless protocol; supports subnetting (VLSM) and includes subnet mask information. Uses multicast updates and simple authentication.
Use Cases: Small to medium networks. Note: Limited scalability and slow convergence.
Open Shortest Path First (OSPF):
Classification: Link-state routing protocol.
Design: Hierarchical structure using "areas" to optimize traffic flow.
Efficiency: Updates are only sent when topology changes occur, reducing overhead.
Features: Supports VLSM and CIDR. Suitable for large, complex networks due to fast convergence, load balancing, and fault tolerance.
Enhanced Interior Gateway Routing Protocol (EIGRP):
Classification: Enhanced distance-vector protocol (combining aspects of distance-vector and link-state).
Metrics: Uses bandwidth, delay, load, and reliability to calculate paths.
Efficiency: Sends partial updates only when changes occur.
Features: Supports VLSM/CIDR; provides loop-free paths and quick convergence. Primarily used in medium to large networks, particularly those utilizing Cisco hardware.
Inter-Domain Routing: BGP
Border Gateway Protocol (BGP):
Function: Essential for routing between different domains on the internet.
Mechanism: Uses path attributes for route selection.
Communication: Utilizes TCP for reliable communication between BGP peers.
Features: Supports CIDR and utilizes complex policies for route selection and advertisement.
Scalability: Manages extremely large routing tables and is critical for ISPs and large enterprises with multiple internet connections.
Route Selection Logic
Metric:
A value assigned to routes to evaluate the cost of traversal. Protocols aim for the lowest metric.
Factors include hop count, bandwidth, delay, or reliability.
Prefix Length:
Specifies the number of bits in the network mask set to .
Used in CIDR (Classless Inter-Domain Routing) to define network boundaries.
Routers prefer the "longest match" (the most specific prefix) for routing decisions (e.g., ).
Administrative Distance (AD):
Used to rank the trustworthiness of route sources when multiple protocols provide a path to the same destination. Lower values are more preferred.
Standard Default Distance Values:
Connected interface:
Static route:
External BGP (eBGP):
EIGRP:
OSPF:
RIP:
Unknown:
High Availability and Virtualization
First-Hop Redundancy Protocols (FHRP):
Used to achieve high availability by providing redundant default gateways using multiple physical routers.
HSRP (Hot Standby Router Protocol): A Cisco proprietary redundancy protocol.
VRRP (Virtual Router Redundancy Protocol): An open standard redundancy protocol.
Virtual IP (VIP):
An IP address not tied to a specific physical interface on a device.
Example: R1 () and R2 () share a Virtual IP of . Hosts use the VIP as their default gateway. If one router fails, the VIP remains reachable via the redundant router.
Subinterface:
A virtual interface created by dividing a single physical interface into multiple logical interfaces.
Commonly used in "Router on a Stick" configurations to manage traffic for multiple VLANs over a single physical link.
Network Address Translation (NAT)
Function: Translates one IP address to another, often provided by a firewall or router.
Advantages:
Conserves public IP addresses.
Eliminates address overlap between different LANs.
Simplifies internet connectivity and avoids the need for renumbering networks when transitioning ISPs.
Disadvantages:
Translation causes processing delays in packet forwarding.
Loss of end-to-end IP traceability.
Incompatibility with certain network applications.
Types of NAT:
Static NAT (One-to-One): Translates one internal address to one specific external address. Used for internal hosts that must be accessible from the internet.
Dynamic NAT (Many-to-Many): Translates many internal addresses to an available pool of many external addresses. This is less common as it can still limit access based on the pool size.
Port Address Translation (PAT): Also known as overloading NAT or PNAT. Translates many internal addresses to a single public external address by tracking source port numbers. This is the most common method for providing internet access to LAN devices.