Computer Networking for Beginners series — Part 1. This post is the starting point of a series on computer networking. It gives you the big picture of how networks work; each upcoming post in the series takes one part of that picture and explores it in depth.

Every time you load a web page, send an email, stream a video, or print to a wireless printer, data travels across a computer network — often several of them — in a fraction of a second. Most people never think about how that happens until something stops working: the Wi-Fi drops, a website won’t load, or a new printer can’t be found.

Understanding networking changes that. You’ll know what your router actually does, why your laptop has an address like 192.168.1.25, what DNS is and why “it’s always DNS,” and how to find out where a connection is failing. If you build or manage websites, it also explains what’s really happening when you point a domain at a server, connect over SSH, or troubleshoot a site that’s down.

This guide walks through the fundamentals of computer networking from the ground up: what a network is, the hardware that makes it work, how devices find each other, how data travels, the models networking professionals use to describe it all, and a set of simple commands you can use to explore your own network today.

What Is a Computer Network?

A computer network is two or more devices connected so they can share data and resources. The devices might be computers, phones, printers, smart TVs, security cameras, or servers. The connection might be a cable, a radio signal like Wi-Fi, or a mix of both.

Networks let devices share:

  • Information — web pages, emails, files, and messages.
  • Resources — printers, storage drives, and an internet connection.
  • Services — websites, databases, streaming, and backups.

The internet is simply the largest network of all: millions of smaller networks — homes, businesses, schools, data centers, and internet service providers — connected together and agreeing to follow the same rules for communicating.

Why Learn Networking?

Networking is one of the foundations of modern IT. Even a basic understanding helps you:

  • Troubleshoot connection problems at home or at work instead of just restarting things and hoping.
  • Set up and secure a home or small-office network properly.
  • Work with websites and servers — domains, DNS records, hosting, and remote access all rely on networking concepts.
  • Understand cybersecurity, since most attacks travel across a network.
  • Build an IT career. Networking knowledge is expected in help desk, system administration, cloud, and security roles, and it’s the core of certifications like CompTIA Network+ and Cisco’s CCNA. (See Benefits of IT Certifications.)

The Building Blocks of a Network

Every network, from a home Wi-Fi setup to the internet itself, is built from the same kinds of pieces.

End Devices

End devices (also called hosts) are where data starts and ends: laptops, desktops, phones, tablets, printers, smart TVs, and servers. Every end device connects to the network through a network interface — an Ethernet port, a Wi-Fi adapter, or both.

Network Devices

Network devices connect end devices and move data between them:

  • Switch — connects devices within a local network. When data arrives, a switch sends it only to the device it’s meant for. Offices use switches with dozens of ports; at home, a few switch ports are usually built into your router.
  • Router — connects different networks together and decides the best path for data to travel between them. Your home router connects your home network to your internet provider’s network.
  • Wireless access point (AP) — lets devices join the network over Wi-Fi. Home routers have one built in; larger buildings use several separate access points for coverage.
  • Modem — converts the signal from your internet provider (over cable, fiber, DSL, or cellular) into one your router can use. Many internet providers supply a combined modem and router.
  • Firewall — monitors traffic and blocks connections that don’t match its rules. Home routers include a basic firewall, operating systems have one built in, and businesses often use dedicated firewall devices.

The typical home “router” is really several devices in one box: a router, a switch, a wireless access point, a firewall, and often a modem.

Network Media

Media is whatever carries the signal between devices:

  • Copper Ethernet cable (like Cat 5e or Cat 6) carries electrical signals. It’s reliable, fast, and the standard for wired connections inside buildings.
  • Fiber optic cable carries pulses of light. It’s extremely fast over long distances, so it forms the backbone of the internet and is increasingly used for home internet connections.
  • Wireless (Wi-Fi, cellular, Bluetooth) uses radio waves. It’s convenient, but it’s slower and less consistent than a cable, especially through walls or at a distance.

Types of Networks

Networks are usually described by how much area they cover:

TypeNameCoversExample
PANPersonal Area NetworkA few meters around one personYour phone connected to wireless earbuds and a smartwatch
LANLocal Area NetworkA home, office, or buildingThe devices on your home router or an office’s switches
WLANWireless LANSame as a LAN, over Wi-FiYour home Wi-Fi network
MANMetropolitan Area NetworkA city or campusA city government connecting its buildings
WANWide Area NetworkLarge regions or the worldA company connecting offices in different states; the internet

Two more terms you’ll hear often:

  • A VPN (virtual private network) creates an encrypted connection across the internet, so a remote device can act as if it were on a private network. Tools like Tailscale make this easy to set up for your own devices.
  • An intranet is a private network, like a company’s internal website, that’s only reachable from inside the organization’s network.

Network Topologies

A topology is the layout of how devices connect. The most common ones:

  • Star — every device connects to a central switch or router. If one cable fails, only that device is affected. This is how almost every home and office network is built today.
  • Mesh — devices connect to several others, so data has more than one path. The internet’s backbone works this way, and “mesh Wi-Fi” systems use the same idea to cover large homes.
  • Bus and ring — older layouts where devices share a single cable or form a loop. You’ll mostly see them in textbooks and certification exams.

How Data Travels: Packets

When you send a photo, load a web page, or stream a song, the data isn’t sent as one big piece. It’s broken into small chunks called packets. Each packet contains:

  • A piece of the actual data (the payload).
  • A header with information like where the packet came from, where it’s going, and its place in the sequence.

Packets travel independently — they can even take different routes across the internet — and the receiving device puts them back together in the right order. If a packet gets lost, it can be sent again without resending everything. This approach, called packet switching, is what makes networks efficient: many conversations can share the same cables at the same time, packet by packet.

Addresses: How Devices Find Each Other

For data to reach the right place, every device needs an address. Networks use two main kinds.

MAC Addresses

A MAC address (Media Access Control address) is a hardware identifier assigned to each network interface. It looks like this:

3C:22:FB:9A:41:7E

It’s written in hexadecimal (see What Are Binary and Hexadecimal Number Systems?). Switches use MAC addresses to deliver data to the right device within a local network. MAC addresses don’t travel beyond your local network, so a website you visit never sees yours.

IP Addresses

An IP address (Internet Protocol address) identifies a device on a network and makes it possible to reach it from other networks. Routers use IP addresses to move data between networks. There are two versions:

  • IPv4 — four numbers from 0 to 255, separated by dots: 192.168.1.25. There are only about 4.3 billion possible IPv4 addresses, which isn’t enough for every device in the world.
  • IPv6 — a much longer address written in hexadecimal: 2001:db8:85a3::8a2e:370:7334. IPv6 has enough addresses for practically every device that will ever exist, and it’s gradually being adopted alongside IPv4.

A helpful comparison: a MAC address is like a person’s name, which stays the same wherever they go; an IP address is like their mailing address, which depends on where they are right now.

Public and Private IP Addresses

Your devices at home don’t each get their own public internet address. Instead:

  • Each device gets a private IP address, from ranges reserved for local networks — most often 192.168.x.x, 10.x.x.x, or 172.16.x.x to 172.31.x.x. These addresses are reused in millions of homes and only work inside a local network.
  • Your router has one public IP address, assigned by your internet provider, that the rest of the internet sees.
  • The router uses NAT (Network Address Translation) to share that single public address among all your devices, keeping track of which reply belongs to which device.

To learn more, read What Is an IP Address? IPv4 vs IPv6, Public vs Private and What Is Internet Protocol (IP)?.

Subnets and the Default Gateway

Every device’s network settings include a few values that work together:

  • IP address — the device’s own address, like 192.168.1.25.
  • Subnet mask — like 255.255.255.0, which defines which addresses are part of the same local network (here, everything from 192.168.1.0 to 192.168.1.255). Dividing networks into smaller pieces like this is called subnetting — see What Is a Subnet?.
  • Default gateway — the router’s address, usually something like 192.168.1.1. When a device wants to reach an address outside its own subnet, it sends the data to the default gateway, and the router takes it from there.
  • DNS server — the server the device asks to look up domain names (more on that below).

Ports and Protocols

Protocols: The Rules of Communication

A protocol is an agreed set of rules for how devices communicate — like a shared language with its own grammar. Every networking task has protocols: HTTP and HTTPS for web pages, SMTP for sending email, DNS for looking up names, SSH for secure remote logins (see What Is SSH?), and many more. Because every device follows the same published protocols, a phone from one company can load a website from a server built by another.

Ports: Which Program Gets the Data

An IP address gets data to the right device, but a device runs many programs at once. A port number gets data to the right program on that device. If an IP address is a building’s street address, a port is the apartment number.

Common services use standard port numbers:

PortProtocolUsed for
22SSHSecure remote login
25 / 587SMTPSending email
53DNSLooking up domain names
80HTTPWeb pages (unencrypted)
443HTTPSWeb pages (encrypted)
3389RDPWindows Remote Desktop

See What Are the Well-Known Port Numbers? for a longer list.

TCP and UDP

Data is carried between programs by one of two main transport protocols:

  • TCP (Transmission Control Protocol) is reliable. It sets up a connection first (with a three-step “handshake”), numbers every packet, confirms that each one arrives, resends any that get lost, and puts them in the right order. Web pages, email, and file transfers use TCP, because every byte must arrive correctly.
  • UDP (User Datagram Protocol) is fast and lightweight. It just sends packets, without setting up a connection or checking that they arrive. Video calls, online games, live streaming, and DNS lookups use UDP, because speed matters more than perfection — a lost video frame is better than a frozen call.

Network Models: OSI and TCP/IP

Networking involves many layers of work happening at once — from electrical signals in a cable to the web page in your browser. Network models divide that work into layers, so each layer can focus on one job and rely on the layers below it.

The OSI Model

The OSI model (Open Systems Interconnection) has seven layers. It’s mostly used for teaching and troubleshooting — “is this a layer 1 problem or a layer 7 problem?”

LayerNameWhat it doesExamples
7ApplicationNetwork services for applicationsHTTP, DNS, SMTP, SSH
6PresentationFormatting, encryption, compressionTLS encryption, data formats
5SessionOpening, managing, and closing conversationsSession setup between apps
4TransportDelivery between programs, using portsTCP, UDP
3NetworkAddressing and routing between networksIP, routers
2Data LinkDelivery within a local networkMAC addresses, switches, Ethernet, Wi-Fi
1PhysicalBits as signalsCables, radio waves, fiber

A popular way to remember the layers from 1 to 7: Please Do Not Throw Sausage Pizza Away. For a full explanation of each layer, read Part 2 of this series: What Is the OSI Model?.

The TCP/IP Model

The TCP/IP model is the one the internet actually runs on. It groups the same ideas into four layers:

TCP/IP layerMatching OSI layersExamples
Application5, 6, 7HTTP, HTTPS, DNS, SMTP, SSH
Transport4TCP, UDP
Internet3IP
Network Access (Link)1, 2Ethernet, Wi-Fi

Encapsulation

When you send data, it travels down the layers on your device. Each layer wraps the data from the layer above with its own header, like putting a letter in an envelope, then that envelope in a box, then the box in a shipping crate:

  1. The application layer creates the data — for example, an HTTP request for a web page.
  2. The transport layer adds a TCP header with the port numbers.
  3. The internet layer adds an IP header with the source and destination IP addresses.
  4. The network access layer adds a header with MAC addresses and sends it out as signals.

At the other end, the receiving device unwraps the layers in reverse order until the original request reaches the web server program. This process is called encapsulation, and it’s why each layer can do its job without knowing the details of the others.

DNS: The Internet’s Phone Book

People remember names like example.com; computers route data using IP addresses. DNS (Domain Name System) translates between them.

When you type a domain name into your browser, your device asks a DNS resolver (usually provided by your router, your internet provider, or a public service like 1.1.1.1 or 8.8.8.8) for the IP address. If the resolver doesn’t already have the answer saved, it looks it up step by step:

  1. It asks a root server, which points it to the servers for the top-level domain, like .com.
  2. It asks a .com server, which points it to the domain’s authoritative name server — the server that holds that domain’s official records.
  3. It asks the authoritative server, which returns the IP address.

The resolver sends the answer back to your device, and both of them cache it for a while, so the next lookup is almost instant.

DNS stores several types of records. The ones you’ll use most when managing a website:

  • A — points a name to an IPv4 address.
  • AAAA — points a name to an IPv6 address.
  • CNAME — points a name to another name (for example, www to the main domain).
  • MX — tells the world which servers receive email for the domain.
  • TXT — holds text, often used to verify domain ownership and for email security settings.

Because almost everything depends on DNS, a DNS problem can make it look like “the internet is down” even when your connection is fine — which is why network administrators like to joke, “It’s always DNS.”

DHCP: How Devices Get Their Settings

You’ve probably never typed an IP address into your phone to join a Wi-Fi network. That’s because of DHCP (Dynamic Host Configuration Protocol). When a device joins a network, it asks for its settings, and a DHCP server — at home, your router — assigns it:

  • An IP address, borrowed for a period of time called a lease.
  • The subnet mask.
  • The default gateway.
  • The DNS servers to use.

The conversation has four steps, sometimes remembered as DORA: the device sends a Discover message, the server makes an Offer, the device sends a Request for that offer, and the server sends an Acknowledgment.

Devices that other devices need to find reliably — like printers, servers, and network storage — often get a static IP address (one that never changes) or a DHCP reservation, which tells the router to always give that device the same address.

Putting It All Together: What Happens When You Visit a Website?

Here’s how everything in this guide works together when you type https://example.com into your browser and press Enter:

  1. Your device already has its settings. When it joined the network, DHCP gave it an IP address, a subnet mask, a default gateway, and a DNS server.
  2. DNS lookup. Your browser needs an IP address, so your device asks the DNS resolver for example.com’s address and gets one back.
  3. Is it local? Your device compares the website’s IP address with its own subnet. It’s not on your local network, so the data needs to go to the default gateway — your router.
  4. Connection. Your browser opens a TCP connection to the server’s IP address on port 443 (HTTPS), starting with the three-step handshake.
  5. Encryption. Your browser and the server set up an encrypted TLS connection, and the browser checks the site’s certificate to confirm it’s really talking to example.com.
  6. The request leaves your network. Your router uses NAT to replace your private IP address with your public one, and sends the packets to your internet provider.
  7. Routing across the internet. The packets hop from router to router across several networks, each one choosing the next step toward the destination.
  8. The server responds. The web server receives the HTTP request, and sends back the page — HTML, then CSS, JavaScript, and images, often using more connections and more DNS lookups.
  9. Back to you. The reply packets travel back the same way. Your router uses its NAT records to send them to your device, TCP reassembles them in order, and your browser displays the page.

All of this usually takes less than a second.

Your Home Network, Explained

With these concepts, a typical home network makes a lot more sense:

Internet ── Modem ── Router (with built-in switch, Wi-Fi, firewall, DHCP, NAT)
                       ├── Laptop     192.168.1.25  (Wi-Fi)
                       ├── Phone      192.168.1.31  (Wi-Fi)
                       ├── Desktop    192.168.1.40  (Ethernet)
                       └── Printer    192.168.1.50  (Ethernet, reserved address)
  • The modem connects to your internet provider.
  • The router has the public IP address on the internet side and acts as the default gateway (usually 192.168.1.1 or 192.168.0.1) on the home side.
  • Its DHCP server hands out private addresses like 192.168.1.25.
  • Its switch and Wi-Fi access point connect your devices.
  • Its NAT and firewall let your devices reach the internet while blocking unrequested connections coming in.

Explore Your Own Network: Essential Commands

You don’t need special tools to start exploring. These built-in commands work on Windows, macOS, and Linux, and they’re the first things IT professionals reach for when troubleshooting. Your results will be different from the examples below — that’s expected.

Find Your IP Address and Gateway

Windows (in Command Prompt or PowerShell):

ipconfig

Look for your active adapter’s IPv4 Address, Subnet Mask, and Default Gateway. Use ipconfig /all to see more, including your MAC address (shown as “Physical Address”) and DNS servers.

macOS:

ipconfig getifaddr en0          # your IP address on Wi-Fi (en0)
route -n get default            # shows your default gateway

Linux:

ip addr                         # your IP addresses
ip route                        # your default gateway ("default via ...")

Test a Connection with ping

ping sends small test packets to another device and measures how long the replies take:

ping -c 4 example.com           # on Windows: ping example.com
PING example.com (104.20.23.154): 56 data bytes
64 bytes from 104.20.23.154: icmp_seq=0 ttl=54 time=23.882 ms
64 bytes from 104.20.23.154: icmp_seq=1 ttl=54 time=21.680 ms
64 bytes from 104.20.23.154: icmp_seq=2 ttl=54 time=33.346 ms
64 bytes from 104.20.23.154: icmp_seq=3 ttl=54 time=21.114 ms

--- example.com ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 21.114/25.005/33.346/4.925 ms

Notice that ping looked up the IP address first — that’s DNS at work. Each line shows a reply and its round-trip time in milliseconds (ms): how long the packet took to get there and back. That delay is called latency. “Packet loss” tells you how many replies never came back.

Pinging your default gateway (for example, ping 192.168.1.1) is a quick way to check whether your device can reach your own router. Some servers deliberately ignore pings, so no reply doesn’t always mean a server is down.

See the Path with traceroute

traceroute (called tracert on Windows) shows each router your packets pass through on the way to a destination. Each step is called a hop:

traceroute example.com          # on Windows: tracert example.com
traceroute to example.com (104.20.23.154), 64 hops max, 40 byte packets
 1  router.home (192.168.1.1)  3.013 ms
 2  203.0.113.1 (203.0.113.1)  14.870 ms
 3  203.0.113.45 (203.0.113.45)  17.736 ms
 4  198.51.100.9 (198.51.100.9)  28.575 ms
 5  198.51.100.77 (198.51.100.77)  14.410 ms
...

The first hop is your own router. The next few are usually your internet provider’s routers, followed by the networks that lead to the destination. If a connection fails, the last hop that answers shows you roughly where the problem is.

Look Up a Domain with nslookup

nslookup asks a DNS server for a domain’s IP address. It works the same way on Windows, macOS, and Linux:

nslookup example.com
Server:		192.168.1.1
Address:	192.168.1.1#53

Non-authoritative answer:
Name:	example.com
Address: 104.20.23.154
Name:	example.com
Address: 172.66.147.243

The first lines show which DNS server answered — here, the home router, using port 53. “Non-authoritative” means the answer came from a resolver’s cache rather than directly from the domain’s own name server. A domain can have more than one address, which lets a large website spread visitors across several servers.

Network Security Basics

A network that lets your devices talk to each other can also let others try. A few basic steps make a big difference:

  • Change your router’s default admin password, and keep its firmware updated.
  • Use WPA3 (or at least WPA2) Wi-Fi security with a strong password. Never leave Wi-Fi open.
  • Keep the firewall on — both on your router and on each computer.
  • Use a guest network for visitors and smart-home gadgets, so they’re kept separate from your main devices.
  • Turn off features you don’t use, especially remote administration and UPnP on the router.
  • Use encrypted connections: HTTPS for websites, SSH instead of Telnet for remote logins, and a VPN on untrusted public Wi-Fi.
  • Protect your accounts with two-factor authentication, and keep your devices updated to guard against malware.

A Simple Troubleshooting Checklist

When “the internet isn’t working,” work from the bottom of the network layers up:

  1. Physical: Is the cable plugged in? Is Wi-Fi turned on and connected to the right network? Are the lights on the modem and router normal?
  2. IP settings: Does your device have an IP address? An address starting with 169.254 means it couldn’t reach a DHCP server.
  3. Local network: Can you ping your default gateway? If not, the problem is between your device and your router.
  4. Internet: Can you ping a public IP address, like 1.1.1.1? If yes, your internet connection works.
  5. DNS: If you can reach 1.1.1.1 but websites won’t load by name, try nslookup example.com. If it fails, the problem is DNS.
  6. The website itself: If everything else works, the problem may be with the site or service you’re trying to reach.

And yes — restarting the modem and router really does fix a surprising number of problems. Now you know why: it renews the connection to your provider, clears the caches, and gives every device a fresh DHCP lease.

Networking Terms to Know

  • Bandwidth — the maximum amount of data a connection can carry per second, measured in megabits or gigabits per second (Mbps, Gbps).
  • Throughput — how much data actually gets through, which is usually less than the bandwidth.
  • Latency — the delay for data to travel from one point to another, measured in milliseconds.
  • Jitter — variation in latency; high jitter makes video calls choppy.
  • Packet loss — the percentage of packets that never arrive.
  • ISP — Internet Service Provider, the company that connects you to the internet.
  • Ethernet — the standard for wired local networks.
  • Gateway — a device that connects one network to another; usually your router.
  • NIC — Network Interface Card, the hardware that connects a device to a network.
  • Server / client — a server provides a service (like a website); a client uses it (like your browser).

What’s Next in This Series

This guide gave you the big picture of how networks work. Each post in the Computer Networking for Beginners series takes one of these topics and explores it in depth, with more hands-on examples. The series continues with Part 2: What Is the OSI Model?, a layer-by-layer look at the seven network layers, including how to see them in a real packet with Wireshark.

Until then, try the commands from this guide on your own network. Find your IP address and default gateway, ping your router, trace the route to your favorite website, and look up a few domain names. Seeing your own network in action is the best way to make these concepts stick.

Conclusion

A computer network is a set of connected devices that follow shared rules to exchange data. End devices connect through switches, routers, and access points over cables, fiber, and radio waves. Data travels in packets, using MAC addresses inside a local network and IP addresses between networks, with ports directing it to the right program and TCP or UDP carrying it there. DHCP gives every device its settings automatically, DNS turns names into addresses, and models like OSI and TCP/IP describe how all those layers fit together.

You don’t need to memorize everything at once. Start with the big picture — devices, addresses, packets, and protocols — and the details will fall into place as you explore each topic in this series.

Next in the Computer Networking for Beginners series: What Is the OSI Model? The Seven Network Layers

Computer Networking for Beginners series: Part 1: A Complete Guide to How Networks Work · Part 2: What Is the OSI Model? · Part 3: Networking Devices Explained · Part 4: CDNs, VPNs, QoS, and TTL · Part 5: Cloud Networking Explained · Part 6: Internet Protocol Explained · Part 7: Well-Known Port Numbers · Part 8: Protocols for Troubleshooting, Tunneling, and Security