How networks fit together

LANs, WANs, and the Internet

Separate a local network from routed networks and understand how the Internet joins independent networks.

8 minute lesson

~~~

A local area network, or LAN, connects nearby devices through one organization’s links. A home Ethernet and Wi-Fi network is a common example. Everything behind your home router — laptop, phone, printer, TV — sits on one LAN.

A router joins IP networks. Traffic for a device on the same local network stays local. Traffic for another network is sent to a router, which chooses the next hop.

You can see this boundary on your own machine:

ip route
default via 192.168.1.1 dev wlan0
192.168.1.0/24 dev wlan0 scope link

The second line is your LAN: addresses in 192.168.1.0/24 are reachable directly, on the local link. The first line says everything else goes to the router at 192.168.1.1. That single default line is the edge of your local network. On macOS, netstat -rn shows the same two facts.

Where the WAN starts

A wide area network, or WAN, connects networks across a larger area. Your Internet provider operates a WAN that joins thousands of homes and offices to its own infrastructure.

But the Internet is not one company’s WAN. It is a network of networks using shared Internet protocols. Your provider hands packets to other providers, who hand them to data centers, until they reach the destination network.

Watch a packet leave your LAN and cross those networks:

traceroute -n 1.1.1.1
 1  192.168.1.1     2.1 ms
 2  100.64.12.1     8.4 ms
 3  62.101.93.45   12.9 ms
 ...

Hop 1 is your router — the last device on your LAN. Hop 2 is already inside your provider’s network. Every later hop belongs to some network you don’t control. On macOS the command is the same; on some Linux systems install it or use tracepath.

Same packet, different scopes

These labels describe scope and ownership, not a different packet format. The same IP packet can cross your LAN, your provider, and several other networks before reaching a server. Nothing about the packet changes because it moved from a “local” to a “wide” network.

This matters when you diagnose problems. A failure at hop 1 is your problem: cable, Wi-Fi, router. A failure at hop 2 or beyond belongs to your provider or someone further away, and no amount of local configuration will fix it.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →