← All lessons
DNS, HTTP and other protocols · Lesson 1 of 8

Before you start

This course covers the services you use every day on the internet: names, web pages, email and remote logins. It follows How networks work, and this lesson gathers everything it needs from there.

Devices on a network are hosts. Data travels in small pieces called packets, and routers pass each packet from network to network towards where it's going. Every host has an IP address that says where to deliver packets: IPv4 ones look like 203.0.113.7, and the newer, longer IPv6 ones like 2001:db8::7. A port, a number from 0 to 65,535, picks which program on the host gets the data, like a flat number in a building.

Two protocols (sets of rules both ends follow) carry most data. TCP sets up a connection, numbers everything, resends what's lost and puts it back in order. UDP just sends each message once, with no connection, which is quicker for small questions. A round trip is one message there and its reply back.

Networking is split into layers, from the bottom: the physical link (cable or Wi-Fi), IP addresses and routing, TCP or UDP between two programs, and at the top the application, what the message means. This course is about that top layer. When something breaks, checking from the bottom layer up finds the fault fastest.

Encryption scrambles data with a key so that only someone with the right key can read it. Some schemes use a key pair: a public key you can give to anyone and a private key you keep secret, where what one locks only the other unlocks.

Some examples are terminal sessions, where you type commands as text: the $ is the prompt, you type what comes after it, and the lines below are the answer. Others are a few lines of Python, a programming language: from … import … loads a ready-made tool, print() shows a result, and you only need to read them, not write them.

$ ping -c 1 1.1.1.1
64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=11.8 ms

Practice

An IP address gets data to the right computer. What gets it to the right program?

More info

Quick reference

IP addressWhere to deliver a packet (IPv4 short, IPv6 long).
PortWhich program on the host gets the data.
TCP / UDPReliable and in order / quick, sent once.
Round tripA message there and the reply back.
LayersLink, IP, TCP or UDP, application; check from the bottom up.
Encryption, key pairScrambling with a key; a shared public key and a secret private one.
$The terminal prompt: type what follows it.

The other networking courses