Books indexNetwork Foundations: from mental models to data measurement

Lesson

Lesson 19: Gateways, routing and NAT

Lesson 19 of 24 · Module 5: Resolution, routing and services

Learning goal

After this lesson, you can apply longest-prefix matching, select a next hop and keep NAT separate from the routing decision.

Why this concept matters

A default route is not always chosen. The host selects the most specific matching route and then frames traffic for the next hop.

Routing decision

Select the most specific route, then build a frame for the next hop.

NAT is separate from routing and is not a security substitute.

Make the route decision before translation

  1. Collect matching routes.
  2. Choose the longest prefix.
  3. Identify interface and next hop.
  4. Apply NAT or policy separately if present.

From local prefix to next hop

A host compares the destination with local prefixes and then applies longest-prefix matching. The default route is used only when no more-specific route matches.

Most specific precedes default

Choose the most-specific route first and treat translation as a separate function.

NAT is separate

Routing chooses a path; translation changes addresses under policy and does not replace routing. The page records no production measurement or learner execution.

Diagnostic exercise

Takeaway and the next lesson

Routing chooses a path; translation changes addresses under policy and does not replace routing.

Quick review

  1. What does 0.0.0.0/0 mean?
  2. Which rule selects among matching routes?
  3. Is NAT encryption?
Show the explained answers
  1. A default route matching every destination.
  2. Longest-prefix match, then tie-breaking rules.
  3. No.

References and evidence limits