Routing is the process of selecting paths through a network along which to send data. Routers are the specialized devices that perform this function, making decisions based on routing tables and routing protocols.

How Routers Work

When a router receives a packet, it examines the destination IP address and consults its routing table to determine the best next hop. The router then forwards the packet toward its destination through the appropriate interface.

Routing Tables

A routing table contains entries that describe how to reach various network destinations. Each entry includes the destination network, subnet mask, next hop IP address, outgoing interface, and metric.

Direct vs Indirect Delivery

In direct delivery, the source and destination are on the same network, so the packet can be sent without a router. In indirect delivery, the packet must go through one or more routers to reach its destination.

Default Routes

A default route (0.0.0.0/0) is used when no specific route matches the destination. It serves as a catch-all path to reach networks not explicitly defined in the routing table.

Static vs Dynamic Routing

Static routes are manually configured by administrators, while dynamic routes are automatically learned through routing protocols that adapt to network changes.