← Back to module
LFM
Networking 101

A network is a set of machines wired so they can pass data to each other. One thing trips people up: when does traffic go out to the internet, and when does it stay on your own network? Send some traffic and watch where it goes.

Try it · send traffic and watch where it goes
The internet
everything outside
Router
192.168.8.1 · gateway
Switch
local delivery
Your node
192.168.8.50
Laptop
192.168.8.20
Phone
192.168.8.30
Pick a path above. Each path lights up the devices the data actually passes through.

Every device on a network gets an IP address: a number that says where it is. An address has two parts, a network part shared by everything on the same network, and a host part unique to each device. The prefix (the /24) marks where one part ends and the other begins.

Try it · pick an address, then slide the prefix
■ network■ host■ split
prefix /24

People remember names; machines route by numbers. DNS is the lookup that turns a name into an IP address. Look one up and watch the lookup travel from server to server until it finds the address. The steps are how real resolution works; the addresses are examples.

Try it · look up a name
A normal name resolves to an address through that chain of servers. node.local never leaves your network. A known tracker is refused by your own resolver. Try all three.

One machine runs many services, so each listens on a numbered door called a port. A port is only reachable when two conditions are met: a service is listening on it, and the firewall lets the connection through. Toggle each and watch what an outsider can reach.

Try it · toggle the two gates on each port
Each port needs both gates open to be reachable. Flip them and watch the verdict.

This is what default-deny means: the firewall gate starts closed on every port, so a service is never exposed just because it is running. You open a port only for a service you need, and only to the devices you trust.

This reference is not needed to build the node. It covers the layer underneath: how the pieces are modeled, what a packet carries, how addresses are carved up, and how networks are shaped.

Two models describe the same journey. The 7-layer OSI model is the teaching reference; the 4-layer TCP/IP model is what the internet actually runs. They map onto each other.

OSI layerTCP/IPDoesExample
7 ApplicationApplicationThe app's own data and rulesHTTP, DNS, SSH
6 PresentationEncoding and encryptionTLS
5 SessionKeeps a conversation opensockets
4 TransportTransportSplits into segments, ports, reliabilityTCP, UDP
3 NetworkInternetAddresses and routes packetsIP, ICMP
2 Data LinkLinkFrames between adjacent devicesEthernet, MAC
1 PhysicalThe wire or radio itselfcabling, wifi

Your data does not travel alone. Each layer wraps it in a header, like nested envelopes. Click a segment to see what it carries.

Ethernet
IP
TCP
Your data
Click a segment above.

A prefix splits an address block into a network and the hosts inside it. Enter an address and prefix to see the real numbers.

/
Subnet mask
-
Network address
-
Broadcast
-
Usable hosts
-

Usable hosts = 2^(32 − prefix) − 2 (the network and broadcast addresses are reserved). A /24 gives 254; a /30 point-to-point link gives 2.

This section covers how the machines are wired together. Your build uses a star.

your build

Star

Every device connects to one central point, your switch and router. It is simple and the standard layout for a home or small network.

Mesh

Devices connect to many others, so traffic has more than one path. It is resilient, but requires more wiring and overhead.

Bus

All devices share one line. It is cheap and old; one break can take down the segment.

Ring

Each device links to two neighbors in a loop. Some backbone networks use it; traffic routes around any break.

References: MDN, How the internet works · Cisco, Switch vs Router · Cloudflare, What is DNS