Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

7.3 (7 of 8): Common network protocols

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

50 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

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

WordWhat it meansExample
IP addressA number that names a device on a network.10.0.10.1
EncryptionScrambling data so only the right people can read it.HTTPS
NetworkComputers joined to share data.The college network
PacketA small, addressed piece of data sent over a network.One part of a photo
RouterA device that joins networks and sends data the right way.A home router
PortA 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

WordWhat it meansExample
ProtocolA set of rules computers follow to talk to each other.HTTP
HTTPHypertext transfer protocol: it asks for web pages and sends them back.Loading a page
HTTPSHTTP with encryption, which keeps the page and your data private.The padlock in the browser
SMTPSimple mail transfer protocol: it sends email.Pressing Send
POPPost office protocol: it downloads email to one device.Mail on one laptop
IMAPInternet message access protocol: it keeps email on the server for every device.Phone and laptop show the same mail
RIPRouting information protocol: routers share how many steps away each network is.Small networks
OSPFOpen shortest path first: routers share a map and find the best path.Larger networks
FTPFile transfer protocol: it moves files between computers.Uploading a website
SFTPSecure file transfer protocol: it moves files with encryption.A safer upload
DHCPDynamic host configuration protocol: it gives a device an IP address.Joining the Wi-Fi
DNSDomain 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

GroupProtocolJob
WebHTTPWeb pages
WebHTTPSWeb pages, encrypted
MailSMTPSending email
MailPOPDownload email
MailIMAPRead email on the server
RoutingRIP, OSPFRouters share routes
ApplicationFTPFiles, not encrypted
ApplicationSFTPFiles, encrypted
ApplicationDHCPGives IP addresses
ApplicationDNSNames to IP addresses

The cells students fill in are left blank in this preview.

Extra: Port numbers

ProtocolUsual port
HTTP80
HTTPS443
SMTP25 or 587
POP110
IMAP143
FTP21
SFTP22
DHCP67 and 68
DNS53
RIP, OSPFUsed 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 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

HTTPS 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

Command
dnslab status

A command for the lesson’s lab terminal. It is shown here and not run.

Extra: Ask for an address (about 12 seconds)

Command
sudo dnslab renew pc1

A command for the lesson’s lab terminal. It is shown here and not run.

Extra: Ask for a name with DNS

Command
sudo ip netns exec server dig +noall +comments @10.0.10.1 files.lab

A 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.

Code: python
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 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Final check

Have a go

Final check

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.