IP Routing explained

IP Routing is the process of forwarding data packets from one network to another using IP addresses. It determines the best path for data to travel across interconnected networks, ensuring information reaches its intended destination efficiently.


Key Concepts in IP Routing

  1. IP Address
    • Every device on a network has a unique IP address (e.g., 192.168.1.10).
  2. Subnet Mask
    • Divides the IP address into network and host portions, helping devices identify if a destination is within the same network.
  3. Default Gateway
    • Acts as the exit point for packets destined for other networks.
  4. Routing Table
    • A table maintained by routers that contains rules and paths to different networks.

How IP Routing Works

  1. Source Device: Sends data with a destination IP address.
  2. Subnet Check: The device checks if the destination IP is in its local network.
    • If yes: Sends data directly.
    • If no: Forwards data to the default gateway.
  3. Router’s Role:
    • The router examines the destination IP and consults its routing table.
    • The router forwards the packet to the next router (or directly to the destination if it knows the route).
  4. Final Delivery: This process continues until the packet reaches its destination.

Types of Routing

  1. Static Routing
    • Manually configured routes by network admins.
    • Suitable for small networks or stable paths.
  2. Dynamic Routing
    • Routers automatically discover and maintain routes using protocols like:
    • RIP (Routing Information Protocol)
    • OSPF (Open Shortest Path First)
    • BGP (Border Gateway Protocol) — Common for internet routing.
  3. Default Routing
    • Used when there’s no specific route in the table; data is sent via the default gateway.

Example of a Routing Table

Destination NetworkSubnet MaskGatewayInterface
192.168.1.0255.255.255.00.0.0.0LAN1
10.0.0.0255.0.0.0192.168.1.1WAN1
0.0.0.00.0.0.0192.168.1.1WAN1

Analogy

Think of IP routing as a postal system:

Steps Involved in IP Routing

IP routing is a multi-step process that ensures data packets are delivered to the correct destination. Here’s a step-by-step breakdown of how it works:


Step 1: Data Creation


Step 2: Subnet Check


Step 3: Packet Forwarding to Router


Step 4: Routing Table Lookup


Step 5: Packet Forwarding to Next Router


Step 6: Final Delivery


Example Scenario

Imagine your computer (192.168.1.10) wants to visit 8.8.8.8.

  1. Your PC checks if 8.8.8.8 is on the local network (it’s not).
  2. It sends the packet to the router (192.168.1.1).
  3. The router checks its routing table and forwards the packet to the next router.
  4. This continues until the packet reaches Google’s DNS server at 8.8.8.8.
  5. Google’s server responds with the requested data, following the reverse path.

Key Concepts During Routing

TTL (Time to Live): Prevents packets from looping indefinitely by decreasing at each hop.
MTU (Maximum Transmission Unit): Ensures packets are fragmented if they exceed size limits.
NAT (Network Address Translation): Translates private IPs (like 192.168.x.x) into public IPs for internet access.

renjithbs Avatar

Posted by

Leave a comment