Router Basics

Layer 3 Forwarding and Routing Fundamentals

A Router is a Layer 3 device designed to connect different networks together. While switches use MAC addresses, routers use IP Addresses to make forwarding decisions.

Decision Making

Routers maintain a Routing Table (RIB) which acts as a map of the network, containing the best paths to all known destinations.

The Routing Table

Packet Forwarding Process

  1. De-encapsulation: Router strips the L2 header to see the L3 IP packet.
  2. Path Lookup: Router checks the Destination IP against its Routing Table.
  3. Longest Match: If multiple routes exist, the most specific subnet mask wins.
  4. Re-encapsulation: Packets are wrapped in a new L2 frame for the exit interface.
  5. Forwarding: The frame is sent out to the next hop.
Router# show ip route
C    192.168.1.0/24 is directly connected, Gi0/0
L    192.168.1.1/32 is directly connected, Gi0/0
S    0.0.0.0/0 [1/0] via 10.0.0.1
Key Takeaway

Switches connect devices within a single subnet; Routers bridge the gaps between subnets.

Go to Basic CLI Lab →