Skip to content
Lesson: How IP decides where to send a packet, and how NAT rewrites itSwitch
← How a network works

Lesson 2 of 6 · OSI Layer 3

How IP decides where to send a packet, and how NAT rewrites it

Before sending anything, a host asks one question: is the destination on my subnet? If not, the packet goes to the default gateway. Private addresses cannot be routed on the internet, so the router translates them with NAT.

From a private address to a public server

Follow one packet through the local-or-remote decision and the NAT translation.

LAPTOP192.168.1.10ROUTER + NAT192.168.1.1 / 198.51.100.7INTERNETmany hopsSERVER203.0.113.10
192.168.1.10/24 · dst 203.0.113.10 · not on my subnet

STEP 01 / 05

Compare the address with the subnet

The laptop applies its mask to the destination. 203.0.113.10 is not inside 192.168.1.0/24, so the laptop will not try to reach it directly. It will use its default gateway.

The decision

My network
192.168.1.0/24
Destination
203.0.113.10
Result
use gateway

Example addresses. 192.168.0.0/16 is private; 198.51.100.7 and 203.0.113.10 are documentation addresses.

Check your understanding

How IP decides where to send a packet, and how NAT rewrites it

All 1 sections · no timer

Unlimited retries

Questions from every section are combined into one assessment. Answer them all correctly to complete the article.

Your completion saves in this browser. Sign in to sync it to your account.