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: 192.168.100.10/24192.168.100.10/24

    • MAC Address: aaaa.aaaa.aaaaaaaa.aaaa.aaaa

    • Default Gateway: 192.168.100.1192.168.100.1

  • Host B Connection Details (Destination):

    • IP Address: 192.168.200.20/24192.168.200.20/24

    • MAC Address: bbbb.bbbb.bbbbbbbb.bbbb.bbbb

  • Router 1 (R1) Interface Configuration:

    • G0/0 (Facing Host A): IP 192.168.100.1/24192.168.100.1/24, MAC f000.f000.f000f000.f000.f000

    • G1/1 (Facing Host B): IP 192.168.200.1/24192.168.200.1/24, MAC f111.f111.f111f111.f111.f111

  • Packet Segment 1 (Host A to Router R1):

    • Source IP: 192.168.100.10192.168.100.10

    • Destination IP: 192.168.200.20192.168.200.20

    • Source MAC: aaaa.aaaa.aaaaaaaa.aaaa.aaaa

    • Destination MAC: f000.f000.f000f000.f000.f000

  • Packet Segment 2 (Router R1 to Host B):

    • Source IP: 192.168.100.10192.168.100.10

    • Destination IP: 192.168.200.20192.168.200.20

    • Source MAC: f111.f111.f111f111.f111.f111 (Router's exit interface MAC)

    • Destination MAC: bbbb.bbbb.bbbbbbbb.bbbb.bbbb (Host B's MAC)

Routing Tables and Topology Configuration

  • Network Layout Example:

    • PC1 (192.168.10.10/24192.168.10.10/24) is connected to the NY Router via interface F0/1F0/1 (192.168.10.1/24192.168.10.1/24).

    • NY Router and LA Router are connected via a cross-link on network 192.168.20.0/24192.168.20.0/24.

    • NY Router interface G0/0G0/0: 192.168.20.1/24192.168.20.1/24

    • LA Router interface G0/0G0/0: 192.168.20.2/24192.168.20.2/24

    • PC2 (192.168.30.10/24192.168.30.10/24) is connected to the LA Router via interface G0/1G0/1 (192.168.30.1/24192.168.30.1/24).

  • NY Routing Table:

    • Destination: 192.168.10.0/24192.168.10.0/24 | Mask: 255.255.255.0255.255.255.0 | Exit Interface: F0/1F0/1

    • Destination: 192.168.20.0/24192.168.20.0/24 | Mask: 255.255.255.0255.255.255.0 | Exit Interface: F0/0F0/0

    • Destination: 192.168.30.0/24192.168.30.0/24 | Mask: 255.255.255.0255.255.255.0 | Exit Interface: F0/0F0/0

  • LA Routing Table:

    • Destination: 192.168.10.0/24192.168.10.0/24 | Mask: 255.255.255.0255.255.255.0 | Exit Interface: F0/0F0/0

    • Destination: 192.168.20.0/24192.168.20.0/24 | Mask: 255.255.255.0255.255.255.0 | Exit Interface: F0/0F0/0

    • Destination: 192.168.30.0/24192.168.30.0/24 | Mask: 255.255.255.0255.255.255.0 | Exit Interface: F0/1F0/1

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 1515 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 11.

    • 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., 192.168.20.0/26192.168.20.0/26).

  • 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: 00

      • Static route: 11

      • External BGP (eBGP): 2020

      • EIGRP: 9090

      • OSPF: 110110

      • RIP: 120120

      • Unknown: 255255

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 (10.0.0.110.0.0.1) and R2 (10.0.0.210.0.0.2) share a Virtual IP of 10.0.0.1010.0.0.10. 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.