What happens when you open a website?
You type a web address and press Enter. Many small steps happen in less than a second.
Your phone gets an address. It finds the server. It asks for the page. The page comes back safely. Each step has its own rules. A protocol is a set of rules that computers follow to talk to each other.
Key words
| Word | What it means | Example |
|---|---|---|
| IP address | A number that names a device on a network. | 10.0.10.1 |
| Encryption | Scrambling data so only the right people can read it. | HTTPS |
| Network | Computers joined to share data. | The college network |
| Packet | A small, addressed piece of data sent over a network. | One part of a photo |
| Router | A device that joins networks and sends data the right way. | A home router |
| Port | A number that says which program on a computer gets the data. | 443 for HTTPS |
The cells students fill in are left blank in this preview.
More key words
| Word | What it means | Example |
|---|---|---|
| Protocol | A set of rules computers follow to talk to each other. | HTTP |
| HTTP | Hypertext transfer protocol: it asks for web pages and sends them back. | Loading a page |
| HTTPS | HTTP with encryption, which keeps the page and your data private. | The padlock in the browser |
| SMTP | Simple mail transfer protocol: it sends email. | Pressing Send |
| POP | Post office protocol: it downloads email to one device. | Mail on one laptop |
| IMAP | Internet message access protocol: it keeps email on the server for every device. | Phone and laptop show the same mail |
| RIP | Routing information protocol: routers share how many steps away each network is. | Small networks |
| OSPF | Open shortest path first: routers share a map and find the best path. | Larger networks |
| FTP | File transfer protocol: it moves files between computers. | Uploading a website |
| SFTP | Secure file transfer protocol: it moves files with encryption. | A safer upload |
| DHCP | Dynamic host configuration protocol: it gives a device an IP address. | Joining the Wi-Fi |
| DNS | Domain name system: it turns a name into an IP address. | example.com to a number |
The cells students fill in are left blank in this preview.
Match the protocol to its job
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
The protocols at a glance
| Group | Protocol | Job |
|---|---|---|
| Web | HTTP | Web pages |
| Web | HTTPS | Web pages, encrypted |
| SMTP | Sending email | |
| POP | Download email | |
| IMAP | Read email on the server | |
| Routing | RIP, OSPF | Routers share routes |
| Application | FTP | Files, not encrypted |
| Application | SFTP | Files, encrypted |
| Application | DHCP | Gives IP addresses |
| Application | DNS | Names to IP addresses |
The cells students fill in are left blank in this preview.
Extra: Port numbers
| Protocol | Usual port |
|---|---|
| HTTP | 80 |
| HTTPS | 443 |
| SMTP | 25 or 587 |
| POP | 110 |
| IMAP | 143 |
| FTP | 21 |
| SFTP | 22 |
| DHCP | 67 and 68 |
| DNS | 53 |
| RIP, OSPF | Used between routers |
The cells students fill in are left blank in this preview.
Quick check: which protocol?
Have a go
Quick check: which protocol?
5 questionsHTTPS keeps web pages private
HTTP is how a browser asks a web server for a page. The server sends the page back. But HTTP is not private. Anyone between you and the server can read it.
HTTPS is HTTP with encryption. It scrambles the data so only you and the server can read it. Use it for logins and payments. Look for the padlock.
SMTP sends mail, POP and IMAP read it
SMTP sends email: from your device to your mail server, and from server to server.
To read email, you use POP or IMAP. POP downloads the mail to one device and often removes it from the server. IMAP leaves the mail on the server, so your phone and your laptop show the same inbox.
An email travels
flowchart LR
a["Sam's phone"] -->|"SMTP"| s1["Sam's mail server"]
s1 -->|"SMTP"| s2["Aisha's mail server"]
s2 -->|"IMAP or POP"| b["Aisha's laptop"]
Group the protocols
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
Routers tell each other what they know
Routers must learn which way to send each packet. A packet is a small piece of data. A routing protocol lets routers tell each other what they know.
RIP is simple. Each router tells its neighbours how many steps away each network is. It is fine for a small network, but slow to learn a change.
OSPF is newer and more complex. Each router learns a map of the whole network and works out the best path. It reacts faster to a change. It suits larger networks.
FTP, SFTP, DHCP and DNS
FTP moves files between computers. It sends passwords as normal readable text, so it is not safe. SFTP does the same job with encryption. Use SFTP.
DHCP gives a device an IP address when it joins a network. DNS is the list of names and numbers of the internet. It turns a name like example.com into an IP address.
Extra: Meet the server and two computers
dnslab statusA command for the lesson’s lab terminal. It is shown here and not run.
Extra: Ask for an address (about 12 seconds)
sudo dnslab renew pc1A command for the lesson’s lab terminal. It is shown here and not run.
Extra: Ask for a name with DNS
sudo ip netns exec server dig +noall +comments @10.0.10.1 files.labA command for the lesson’s lab terminal. It is shown here and not run.
Extra: What the lab shows
Note
Both requests failed, and that is the lesson. Notice that pc1 got no address and DNS said REFUSED. With no DHCP, a computer has no address to use. With no DNS, a name cannot become an address. Setting up the server is deeper than this course asks.
Your turn: DNS and DHCP in code
Write a tiny DNS and a tiny DHCP. POOL is a list of addresses that can be given out. dns_lookup(name) gives back the address for a name from the table, or "not found". dhcp_lease(leased) gives back the first address in POOL that is not in the list leased (leased means already given out). If none is left, it gives back "no address left". Press Run Tests to check.
POOL = ["192.168.1.10", "192.168.1.11", "192.168.1.12"]
NAMES = {"files.lab": "10.0.10.5", "printer.lab": "10.0.10.6"}
def dns_lookup(name):
# Give back the address for the name, or "not found".
return ""
def dhcp_lease(leased):
# leased is the list of addresses already given out.
# Give back the first address in POOL that is not in leased.
# If none is left, give back "no address left".
return ""
Make a free account to save your work, or press Start lab to work through the whole lesson.
True or false?
Have a go
True or false?
5 questionsFinal check
Have a go