Study guides · Introductory

Read an IP forwarding table and choose a next hop

Use destination prefixes, next hops, and a default route to follow the decision that sends a packet toward its destination.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. Distinguish the destination from the next hop
  2. Work through longest-prefix matching
  3. Limit loops without assuming reachability
  4. Use the table in an investigation
  5. Ask Logeia about this articleCheck your understanding

Distinguish the destination from the next hop

An IP packet carries its final destination address. The sending host, however, may not share a link with that destination. It consults a forwarding table to choose an outgoing interface and, when required, a next-hop router. The next hop is the next stop, not necessarily the machine running the destination application.

A directly connected route may deliver to a neighbor on the local link. A route to a remote network may instead deliver to a gateway. Keep the decision about an IP destination separate from the link-layer work needed to send a frame to an adjacent device. Both are needed for a packet to move.

Work through longest-prefix matching

In ordinary destination-based IPv4 forwarding, a matching route with a longer prefix is more specific. Both 10.0.0.0/8 and 10.2.0.0/16 match destination 10.2.3.4, but the /16 narrows the destination range further. Selection is not simply a matter of taking the first line displayed by a command.

Suppose the table contains 10.2.3.0/24, 10.2.0.0/16, and 0.0.0.0/0. Destination 10.2.3.9 matches the /24 most specifically; 10.2.8.9 matches the /16. Another destination can use the default /0 when no more specific route applies. Choices among equally specific candidates depend on additional rules and configuration.

Limit loops without assuming reachability

A configuration error can circulate packets between routers. IPv4 TTL decreases as a packet is forwarded, and a packet that exhausts that value is discarded. This bounds repeated forwarding. Despite its historical name, treating TTL as a precise stopwatch in seconds is not a sound way to explain modern forwarding behavior.

Finding an outbound route does not establish a working round trip. The return path may be missing, a filter may block traffic, or the destination may be unavailable. State exactly which direction and traffic you tested rather than labeling the whole network healthy from one observation.

Use the table in an investigation

Choose a specific destination and identify the selected route, outgoing interface, and next hop. Then check whether that neighbor is reachable and whether the expected source address is used. If a VPN changes access to only some destinations, look for a newly installed specific route that takes precedence over an earlier one.

This explanation covers basic destination forwarding. Policy routing, multiple paths, namespaces, and address translation can require more context than one table provides. Missing traceroute replies are also inconclusive: a device may forward traffic without returning the diagnostic response you expected. Use multiple observations before assigning a cause.

Reading and practice are recorded separately in this browser, for each language.

Learn this in order

Understand the systems behind the web · STEP 9

Choose a learning path