IP Routing Basics
IP Routing Basics
IP Routing Basics
Routing Devices: These are network devices, such as routers, that use
routing information to forward packets to the correct destination subnet.
IP Routing Table: Routers maintain a table (IP routing table) that stores all
the necessary routes and determines how packets are forwarded. It
includes information like the destination subnet, outbound interface, and
next-hop address.
Outbound Interface: The router’s interface through which the packet will
exit.
Next Hop: The address of the next device the packet should be
forwarded to.
5. IP Routing Basics 1
4. IP Routing Table and Route-Based Forwarding
IP Routing Table: It’s a collection of routing entries that the router uses to
forward packets. The table contains only the best or optimal routes, not all
possible routes.
5. Types of Routes
Direct Routes: Automatically generated by the router for subnets directly
connected to its interfaces. When an IP packet matches a direct route, the
router directly forwards the packet to the destination host using ARP entries
(Address Resolution Protocol) to resolve the MAC address.
Cost (Metric): When multiple routes from the same protocol exist, the
router uses the route with the lowest cost as the optimal one.
For example, a static route may have a preference value of 60, while an
OSPF route may have a preference of 10. If both routes exist for the same
destination, the router will prefer the OSPF route due to its higher
preference (lower value).
5. IP Routing Basics 2
When a router receives an IP packet, it uses the longest matching
mechanism.
This ensures that the router chooses the most specific route available for
forwarding.
When using a direct route, the router checks its ARP table to find the MAC
address corresponding to the destination IP address and forwards the
packet directly.
Not all direct routes are installed in the routing table; only those interfaces
that are physically and protocol-wise up are included.
Protocol: Indicates the protocol that discovered the route (e.g., OSPF, BGP).
Preference: The preference value for selecting among routes from different
protocols.
Cost (Metric): The cost associated with the route for selecting among
routes from the same protocol.
Next Hop: The IP address of the next device to which the packet should be
forwarded.
5. IP Routing Basics 3
any IP packets that don’t match any other routing entries.
Application Scenarios: Default routes are typically used at the egress (exit)
points of networks, such as the edge routers of an enterprise network. For
instance, an egress router in an enterprise might have a default route
pointing to the ISP, allowing the router to forward traffic destined for any
external network.
A. By Algorithm
Distance-Vector Routing Protocols: These use distance (hop count) and
direction (next hop) to determine the best route. Examples:
5. IP Routing Basics 4
B. By Application Scope
Interior Gateway Protocols (IGPs): Operate within a single AS. Examples
include RIP, OSPF, and IS-IS.
C. Floating Routes
Floating Routes: These are backup routes that only become active when
the primary route fails. They are configured with a higher preference value
(lower priority) than the primary route.
B. Route Summarization
5. IP Routing Basics 5
Overview: It is a technique where specific routes with the same prefix are
aggregated into a single summarized route. This reduces the number of
entries in the routing table and improves device resource utilization.
B. Black-Hole Routes
When summarizing routes, the router might use a Null0 interface as the
outbound interface. The Null0 interface is a logical interface that discards
packets, preventing them from being forwarded further. This is used to
prevent routing loops by acting as a "black hole" where packets are
dropped.
Ensure that the summary route covers only the intended specific routes
and does not include any unrelated routes.
By ensuring accurate summarization, you can optimize the routing table without
causing packet loss or misrouting.
5. IP Routing Basics 6