Routing · Lesson 1 of 7

What is a router?

0 / 4 checkpoints answered

Full screen ↗

A router connects network-layer domains and forwards IP packets between them. A Linux host can act as a router when forwarding is enabled and its interfaces, routes, neighbor discovery, and filtering policy are configured appropriately.

Routing and Forwarding

Routing builds or selects information about reachable prefixes. Forwarding applies that information to each packet: examine the destination, choose an eligible route and next hop, decrement the hop limit, and transmit through an outgoing interface.

These are separate control-plane and data-plane concerns. A route can exist while firewall policy blocks forwarding, or a forwarding interface can be up while no valid route exists.

CheckWhat does packet forwarding do?

Routing Tables and Defaults

A route associates a destination prefix with an outgoing interface, next hop, metric, source preference, or other attributes. Longest-prefix matching favors a more-specific eligible route. A default route, IPv4 /0 or IPv6 ::/0, is the least-specific match and is used only when no more-specific route wins.

If no eligible route exists, the router drops the packet and may generate an ICMP unreachable message. A default route is optional and need not point directly to the public Internet.

CheckWhen is a default route selected?

Local and Routed Traffic

Two hosts on the same on-link subnet normally exchange frames without sending the IP packet through a router. A router becomes involved when route selection chooses it as a next hop or when topology and policy deliberately force routed traversal.

A home “router” commonly combines an IP router, Ethernet switch, Wi-Fi access point, DHCP service, NAT, and firewall. Each function should be diagnosed separately.

CheckMust traffic between two on-link hosts pass through their default router?

Hops and Loop Prevention

A routed hop is a network-layer forwarding step. IPv4 TTL and IPv6 Hop Limit are decremented at each router, bounding loops. Hop count is not a complete distance or quality metric: links differ in bandwidth, latency, loss, policy, and congestion.

CheckWhat does a smaller hop count fail to guarantee?

Summary

You can now separate a router's route selection from its forwarding action.

  1. Define routers by forwarding between IP networks.
  2. Distinguish control-plane routing from data-plane forwarding.
  3. Treat the default route as the least-specific fallback.
  4. Recognize that hop count alone does not measure path quality.