You use a network every minute of the day. This page explains what is actually happening. It covers what a network is, how a message gets chopped into packets, the two kinds of address every device has, what switches and routers do, and how a web page reaches your screen. You don't need to buy anything. Every step has a command to run on the laptop you're reading this on, so you can see each idea for yourself. By the end, the words in every other guide in this section will mean something.
A network is two or more devices that can send each other messages. That's the whole definition. Two laptops joined by one cable are a network. So are your phone, TV and printer sharing the Wi-Fi at home. The Internet is a network too, just a very large one.
Networks come in sizes, and you'll see three words for them everywhere:
Those shared rules are called protocols. A protocol is an agreement about how to talk, just as English grammar is an agreement that lets two strangers understand each other. You'll meet a handful by name on this page: IP, TCP, DNS, DHCP. Each one solves one problem, and they stack together to deliver a web page.
The box your Internet provider gave you is almost certainly four devices in one case: a modem (talks to the provider's line), a router (joins your home network to the Internet), a switch (the Ethernet ports on the back) and a Wi-Fi access point. Step 04 pulls them apart. For now, just know that one box is doing several jobs.
When you load a photo, it doesn't travel as one big lump. Your device chops it into small pieces called packets, usually about 1,500 bytes each. A single photo can be a thousand of them. Each packet is sent separately, and the receiving device puts them back together in the right order.
Every packet is built like a letter in an envelope:
Why go to the trouble? There are two reasons, and both matter for everything that follows:
pingping sends one tiny packet to an address and times how long the reply takes. It's the simplest network test there is, and it works the same on every operating system. Open PowerShell (Windows: right-click Start → Terminal) or Terminal (Mac or Linux) and type:
ping 1.1.1.1
Each line is one packet that went out and came back. time=14ms is the round trip: 14 thousandths of a second to reach a server and return. Lost = 0 means none went missing. (Mac and Linux keep pinging until you press Ctrl+C.) 1.1.1.1 is a public server run by Cloudflare that always answers, which is why guides use it.
A friend asks why the Internet doesn't just send a whole file in one go. Explain packets using the post office.
Imagine mailing a 1,000-page book through a post office that only takes postcards. You number each page, write the address on every one, and drop them in. They travel mixed in with everyone else's mail, so the post office never gets blocked by one giant parcel, and your friend puts the pages back in order using the numbers. If page 412 gets lost, they ask for page 412 again, not the whole book. Packets are those postcards. The header is the address and page number, and the payload is the writing on the back.
This is the idea that confuses beginners most, so it gets its own step. Every network connection has two different addresses, and they do different jobs.
| MAC address | IP address | |
|---|---|---|
| Looks like | 3C-22-FB-8A-11-C4 | 192.168.1.23 |
| Set by | the factory, built into the network hardware | the network you join (usually handed out automatically) |
| Changes when you move? | No. Same at home, at work, in a café. | Yes. A new network gives you a new one. |
| Used for | the next hop, on this cable or Wi-Fi | the whole trip, end to end, across networks |
| Everyday analogy | your name | your street address |
An IP address is four numbers from 0 to 255 separated by dots. Think of it as a street and a house number. In 192.168.1.23, the first three numbers (192.168.1) are the street, meaning the network, and the last one (23) is the house, meaning your device. Devices on the same street can talk directly. Reaching another street needs a router, which is Step 04.
The subnet mask says where the street part ends. 255.255.255.0 means “the first three numbers are the street.” It is also written /24, and it's by far the most common mask on home and small office networks.
The default gateway is the address of your router, the house at the end of the street that knows the way to everywhere else.
ipconfig /all
ifconfig en0 | grep -E "ether|inet " route -n get default | grep gateway
ip addr ip route | grep default
Write down four things: your IP address, subnet mask, default gateway and MAC address. Your numbers will be different from the example; 192.168.0.x, 192.168.1.x and 10.0.0.x are all common. You'll use them again in Steps 07 and 08.
DHCP Enabled: Yes means your laptop asked the network for an address when it joined, and your router handed one out along with the mask, gateway and DNS server. That protocol is DHCP, and it's why you can join any Wi-Fi without configuring anything. The Cisco 1921 First Network guide has you build a DHCP server yourself.
You take your laptop from home to a coffee shop. Which of its two addresses changes, which stays the same, and why does a device need both?
The MAC address stays the same, because it's built into the Wi-Fi hardware, like your name. The IP address changes, because it describes where you are, like a street address, and you've moved to a different street. You need both because they answer different questions. The IP address gets a packet across the world to the right street and house. The MAC address is how the last device on your street hands it to the right machine. The postal system uses the address to get a letter to your building, and then someone reads the name to put it in your hands.
Networking equipment looks alike (grey or black boxes covered in ports), but each kind does one specific job. The easiest place to see all of them is the box your Internet provider gave you, opened up:
A switch connects devices. A router connects networks. Almost every networking question starts with which of the two you're dealing with.
An office has run out of Ethernet ports. Someone suggests buying a router; someone else says a switch. Who's right, and how would you explain the difference?
The switch. The office needs more sockets on the same network, and a switch is a power strip for network cables: plug it into a free port and you get eight or twenty-four more, all on the same street as everything else. A router is for joining two different streets, such as the office and the Internet. The office already has one of those. Adding a second router would create a new, separate street, and the new devices couldn't easily see the printer on the old one.
Delivering a web page means solving several separate problems: getting a signal onto the wire, finding the right network, reaching the right program, and agreeing on what the message means. Networking splits them into layers, and each layer solves one problem and relies on the layer below. That's why you can change from Wi-Fi to Ethernet without your browser noticing. Only the bottom layer changed.
| Layer | Problem it solves | Address it uses | Examples | Box that works here |
|---|---|---|---|---|
| Application | What does the message mean? | a name, like bozcode.com | HTTP/HTTPS (web), DNS, SSH, email | — |
| Transport | Which program on the device? Did every piece arrive? | a port number, like 443 | TCP, UDP | firewall |
| Internet | Which network, and which device on it, anywhere in the world? | IP address | IP, ICMP (ping) | router |
| Link | How to reach the next device on this cable or Wi-Fi? | MAC address | Ethernet, Wi-Fi | switch, access point |
This four-layer version is the TCP/IP model, which is how the Internet is actually built. You'll also hear about the OSI model, which splits the same job into seven layers. Its numbers are the ones people say out loud: a switch is a Layer 2 device, a router is Layer 3, and TCP and UDP are Layer 4. OSI Layers 1 and 2 are the Link row above (1 is the physical cable or radio signal), 3 is Internet, 4 is Transport, and 5–7 are all folded into Application.
An IP address gets a packet to the right device. But a computer runs many network programs at once, such as a browser, an email client and a chat app. The port number says which one the packet is for, like an apartment number after the street address. Some ports are standard, so everyone knows where to knock:
| Port | Protocol | Used for |
|---|---|---|
443 | HTTPS | secure web pages (almost all of them now) |
80 | HTTP | unencrypted web pages |
53 | DNS | looking up names (Step 06) |
22 | SSH | secure remote command line, used to manage routers and servers |
67 / 68 | DHCP | handing out IP addresses |
3389 | RDP | Windows Remote Desktop |
The transport layer comes in two main kinds. TCP numbers every piece, confirms each arrived, and resends anything lost. Web pages, email and file downloads use it because every byte must arrive. UDP just sends and doesn't check. Video calls, games and DNS use it, because a late packet is useless and it's better to move on than wait for it to be resent.
Packets need IP addresses, but people remember names. DNS (the Domain Name System) is the Internet's phone book: you ask it for a name and it answers with the address. Every time you type a website, your device asks a DNS server first, before it sends a single packet to the site. Try it:
nslookup bozcode.com
The first two lines are who you asked. That's the DNS server from your ipconfig /all in Step 03, usually your own router, which forwards the question to your provider's DNS servers. The last lines are the answer. Non-authoritative just means the answer came from a server that had it saved, not from the server that owns the name, which is normal and fast.
A very common fault: websites won't load, but ping 1.1.1.1 works fine. The network is up; only name lookups are failing. Now you can tell the two apart in ten seconds. If pinging a number works and nslookup of a name doesn't, the problem is DNS.
Everything so far comes together here. When you type bozcode.com and press Enter, this happens in well under a second:
bozcode.com and gets back an IP address (Step 06).443, agree an encryption key (the padlock in your browser), and then the browser asks for the page. The page comes back as packets over the same path in reverse, and the router passes each one back to your laptop.arp -a
This is your laptop's list of neighbours on the same street: each IP address and the MAC address it matched. Your default gateway will be in the list, because your laptop talks to it constantly. (Linux: ip neigh.)
tracert -d bozcode.com
Each line is one router that handled your packet, with three timings to reach it. Hop 1 is always your default gateway, the address you wrote down in Step 03. Hop 2 is usually your provider. The timings grow as the packet travels further. A line of * means that router didn't answer this test, which many don't. The packet still went through. -d (or -n) skips looking up a name for every hop, which makes it much faster.
Here's a puzzle. Your laptop's IP address from Step 03 is something like 192.168.1.23. So is your neighbour's. So are millions of other laptops. How can they all have the same address?
Because those are private addresses. Three ranges are reserved for use inside homes and offices and are never used on the public Internet:
| Private range | Typically seen |
|---|---|
10.0.0.0 – 10.255.255.255 | companies, some home routers |
172.16.0.0 – 172.31.255.255 | companies, virtual machines |
192.168.0.0 – 192.168.255.255 | almost every home network |
Anyone can use them, and they only need to be unique within one network. To reach the Internet, your router does NAT (Network Address Translation): on the way out, it replaces your private return address with its one public address, the address your provider gave it. It keeps a note of which conversation belongs to which device, and swaps the address back when replies arrive. Every device in your house shares that one public address.
You already have your private address from ipconfig. Now open the site's IP Lookup page, which shows the address this web server saw your request come from:
The two are different, and that difference is NAT. Every phone and laptop in your house would show the same public address on that page.
Some providers, especially mobile and satellite ones, put their own NAT in front of yours and share one public address between many customers. You saw a hint of that in the example traceroute: 100.64.0.1 at hop 2 is from a range reserved for exactly this. It's normal, and it's why some games and home servers struggle on those connections.
Your laptop says its address is 192.168.1.23, but a website says your address is 203.0.113.57. A friend thinks one of them is wrong. Explain why both are right.
Think of an office building with one street address and a mail room. Inside, everyone has a desk number: that's 192.168.1.23, and only people in the building use it. When you send a letter out, the mail room puts the building's street address on it as the return address: that's 203.0.113.57, the only one the outside world ever sees. When the reply comes back, the mail room remembers it was yours and walks it to your desk. The website only ever sees the building's address. Your laptop only knows its desk number. Both are true; they're just used on different sides of the mail room, and the mail room is your router doing NAT.
Every term from this page, for when you meet it again in another guide.
| Term | In one line |
|---|---|
| Network | Two or more devices that can send each other messages. |
| LAN / WAN | A network in one place / a network that joins places. |
| Protocol | An agreed set of rules for talking, like IP, TCP, DNS or DHCP. |
| Packet | A small piece of a message, with a header (addresses) and a payload (data). |
| MAC address | The hardware address built into a network interface. Used for the next hop. |
| IP address | The logical address a network gives a device. Used end to end. |
| Subnet mask | Says which part of an IP address is the network (255.255.255.0 = /24). |
| Default gateway | The router a device sends anything that isn't on its own network. |
| DHCP | Hands out IP addresses, masks, gateways and DNS servers automatically. |
| ARP | Finds the MAC address that belongs to an IP address on the same network. |
| Switch | Connects devices on one network, using MAC addresses. “Layer 2.” |
| Router | Connects different networks, using IP addresses. “Layer 3.” |
| Port | A number that picks the program on a device (443 = HTTPS, 22 = SSH). |
| TCP / UDP | Checked, resent delivery / fast, unchecked delivery. |
| DNS | Turns names into IP addresses. |
| NAT | Lets many private addresses share one public address. |
ping / tracert | Is it reachable? / Which routers are on the way? |
ping 1.1.1.1 works, and you know what time= and Lost meantracert and in arp -aYou now know what a network is made of and how a packet crosses the Internet. The next step is to stop just watching the network and start building one. That means a real router you configure yourself, where you set every address, mask, gateway, DHCP pool and NAT rule from this page by hand.
Hands-on with a used Cisco router that costs less than a textbook. Part 1 starts with the console cable; by Part 3 your laptop reaches the Internet through a router you set up yourself.
The commands you'll type on Cisco routers and switches, grouped by what they do.