πŸ”Œ
CodingπŸŽ“ Ages 14-18Intermediate 11 min read

Computer Networks and Protocols

Computer networks and protocols explained: LANs vs the internet, how routers and switches move data, and key protocols like TCP/IP, HTTP, and DNS. With diagrams in words and a quiz.

Key takeaways

  • A network is two or more devices connected so they can exchange data
  • A protocol is an agreed set of rules that lets different devices understand each other
  • TCP/IP is the core protocol suite of the internet: IP delivers packets, TCP makes delivery reliable
  • Higher-level protocols like HTTP, DNS, and TLS run on top of TCP/IP to do specific jobs

What a network really is

A computer network is simply two or more devices connected so they can exchange data. That could be two phones sharing a photo over Bluetooth, the laptops in your school joined to one Wi-Fi point, or the billions of machines that make up the internet. The scale changes, but the core idea is the same: devices send each other messages.

The challenge is that the devices on a network are wildly different β€” phones, laptops, servers, printers, smart speakers β€” built by different companies, running different software. For them to communicate, they must all agree on the rules of how messages are formatted and sent. Those agreed rules are called protocols.

If you have read How the Internet Works, you have already met some of these ideas. This lesson goes one level deeper into the rules that make it all work.

Protocols: a shared language

A protocol is an agreed set of rules for communication. Think about a phone call between strangers: you both follow an unwritten protocol β€” one person says "hello," the other replies, you take turns, you say "goodbye" before hanging up. Without those rules, the call would be chaos.

Network protocols are the same idea, but written down precisely. A protocol defines things like: How is the message structured? Where does the address go? How does the receiver confirm it arrived? Because everyone follows the same protocol, a phone made in one country can talk to a server on another continent.

Local networks: LANs

A LAN (Local Area Network) is a network in one place, like a home, school, or office. Inside a LAN, two pieces of hardware do most of the work:

  • A switch connects devices in the same network and forwards data to the correct one using hardware addresses called MAC addresses. Every network device has a unique MAC address burned in when it is made.
  • A router connects your LAN to other networks β€” most importantly, to the internet. It forwards packets between networks using IP addresses.

In a typical home, your Wi-Fi box is actually a router and switch combined, plus a wireless access point.

Packet switching

Networks do not send a whole file as one giant lump. They chop it into small pieces called packets. Each packet carries a chunk of the data plus a header that says where it is going, where it came from, and where it fits in the sequence.

Packets travel independently and may even take different routes across the network. At the destination they are reassembled in the correct order. This approach, called packet switching, is what makes networks efficient and resilient: if one packet is lost or one path is busy, only that small piece needs to be re-sent or rerouted, not the whole file.

TCP/IP: the engine of the internet

The internet runs on a family of protocols usually called TCP/IP. Two of them do the heavy lifting:

IP (Internet Protocol) handles addressing and routing. Every device gets an IP address (for example 192.168.1.5 or a longer IPv6 address). IP stamps each packet with a destination address and lets routers pass it from network to network until it arrives. But IP makes no promises: packets can arrive out of order, be duplicated, or get lost.

TCP (Transmission Control Protocol) adds reliability on top of IP. TCP numbers every packet, checks each one for errors, asks for any lost packet to be re-sent, and puts everything back in the right order. When you load a web page or send a message, TCP is what guarantees the data arrives complete and correct.

Some apps use UDP instead of TCP. UDP skips the re-sending and ordering to be faster, which suits live video calls and games where a slightly dropped frame matters less than speed.

Layers: stacking protocols

Protocols are organised into layers, where each layer does one job and relies on the layer below it. A simplified view:

Application   β†’  HTTP, DNS, email   (what the app wants to do)
Transport     β†’  TCP or UDP          (reliable or fast delivery)
Internet      β†’  IP                  (addressing and routing)
Link          β†’  Wi-Fi, Ethernet     (the actual cable or radio)

The big advantage of layering is independence. You can switch from Ethernet cable to Wi-Fi at the bottom layer without changing anything about how a web page works at the top. Each layer trusts the one below to do its part.

Protocols you use every day

On top of TCP/IP sit many higher-level protocols, each for a specific task:

  • HTTP / HTTPS β€” fetches web pages. HTTPS is HTTP wrapped in encryption.
  • DNS β€” translates names like educaweb.org into IP addresses.
  • TLS β€” encrypts connections so others cannot read them (the padlock in your browser).
  • SMTP / IMAP β€” send and receive email.

When you open a website, several of these work together in under a second: DNS finds the address, TCP/IP carries the packets, TLS secures them, and HTTP delivers the page.

Try this activity

Map a real request. Pick a website you use. On paper, draw the journey of a single request and label every protocol it touches in order: which protocol finds the address (DNS), which carries and routes the packets (IP), which makes delivery reliable (TCP), which encrypts it (TLS), and which fetches the page (HTTP). Then write one sentence explaining what would go wrong if each protocol were missing.

To see how that secured data is actually scrambled, read Encryption and Keeping Data Safe.

Quick quiz

Test yourself and earn XP

What is a network protocol?

What is the main job of the IP protocol?

What does TCP add that IP alone does not provide?

Which protocol turns a website name like example.com into an IP address?

Why are protocols organised into layers?

FAQ

A network is any group of connected devices, such as the computers in your home sharing one router. The internet is a global network of networks β€” millions of separate networks linked together using the same protocols (mainly TCP/IP) so they can all talk to each other.

HTTPS is HTTP running inside an encrypted TLS connection. The web requests are the same, but TLS scrambles them so attackers between you and the server cannot read or change the data. That is why secure sites show a padlock.

A switch connects devices within one local network and forwards data using hardware (MAC) addresses. A router connects different networks together β€” for example your home network to the internet β€” and forwards packets using IP addresses.