LOGBOOK

HELP

1 / 6
Other keys: showSpace: good1-4: rate0: skip5: flag

Question

When a router receives a packet, what are the three possible outcomes based on the routing table lookup?

Answer

The router either: (1) forwards via a matching static route to the next-hop/exit interface, (2) forwards via the default static route if no specific match exists, or (3) drops the packet and sends ICMP (Internet Control Message Protocol) Destination Unreachable if no route matches at all.

Specific match, else default route, else drop + ICMP unreachable.

* The three routing-table lookup outcomes. *

The three forwarding decisions, step by step:

Outcome 1 — Specific route match found:

  • Destination IP (Internet Protocol) matches a static (or dynamic) route entry
  • Router identifies the next-hop IP address or exit interface from the route
  • Packet is encapsulated in a new Layer 2 frame and forwarded

Outcome 2 — No specific match, but default route exists:

  • No route specifically matches the destination IP
  • Router falls back to the default static route (0.0.0.0/0 or ::/0)
  • Packet is forwarded to the default gateway (typically the ISP (Internet Service Provider))
  • This is why the default route is called the "gateway of last resort"

Outcome 3 — No match at all, no default route:

  • No route matches AND no default route is configured
  • Packet is dropped
  • Router sends ICMP (Internet Control Message Protocol) Destination Unreachable (Type 3) back to the source
  • The source sees "Destination host unreachable" or "No route to host"

Note — the "packet for me" case: these three outcomes all concern transit traffic that the router has to forward. Before the routing-table lookup even happens, the router checks whether the destination IP is one of its own interface addresses (e.g. a ping to the router, an SSH/management session, or a routing-protocol update). If so, the packet is consumed locally — handed up the stack to the router itself — and never enters the forwarding path at all.

Tip: If users report "destination unreachable" errors, first check: does the router have a route to the destination? If not — is a default route configured? These two checks resolve most routing problems.

Go deeper:

or press any other key

Question

Walk through the complete packet forwarding process from PC1 to PC3 across three routers using static routes.

Answer

PC1 sends to its default gateway (R1) → R1 looks up destination in routing table, finds static route, forwards to R2 → R2 does the same, forwards to R3 → R3 has a directly connected route, ARPs (Address Resolution Protocol) for PC3's MAC (Media Access Control), and delivers the frame.

Each hop rewrites src/dst MAC; IP header unchanged end-to-end, TTL decrements.

* Hop-by-hop L2 re-encapsulation, IP (Internet Protocol) preserved. *

A packet traversing three networks through two routers; IP/TCP/HTTP preserved while link-layer frames are rebuilt per hop.

* End-to-end forwarding rebuilt hop-by-hop. — the Tango! project, CC BY-SA 3.0, via Wikimedia Commons. *

Step-by-step forwarding (PC1 → R1 → R2 → R3 → PC3):

Step 1 — PC1 to R1:

  • PC1 creates packet with destination IP = PC3's IP
  • PC1's default gateway is R1 → PC1 ARPs for R1's MAC
  • PC1 sends the frame: [Src MAC: PC1, Dst MAC: R1-G0/0]

Step 2 — R1 processing:

  • R1 receives frame on G0/0/0, strips Layer 2 header
  • R1 searches routing table for PC3's destination IP
  • Static route matches → next-hop is R2 (via S0/1/0)
  • R1 builds new frame: [Src MAC: R1-S0/1/0, Dst MAC: R2-S0/1/0]
  • Forwards out Serial0/1/0

Step 3 — R2 processing:

  • R2 receives on S0/1/0, strips L2, searches routing table
  • Static route matches → next-hop is R3 (via S0/1/1)
  • Builds new frame, forwards out S0/1/1

Step 4 — R3 to PC3:

  • R3 receives, searches routing table
  • Destination matches a directly connected network (G0/0/0)
  • R3 checks ARP table for PC3's MAC address
  • If no ARP entry → sends ARP Request on G0/0/0
  • PC3 responds with ARP Reply
  • R3 encapsulates: [Src MAC: R3-G0/0, Dst MAC: PC3]
  • PC3 receives and processes the packet

Key observation: The IP header (source = PC1, destination = PC3) stayed the same at every hop. Only the Layer 2 frame was rebuilt at each router.

Go deeper:

or press any other key