The answersDownload the PDF
Worksheet

F10.7 Protocols

Networks · GCSE · OCR J277 1.3.2, AQA 8525 3.5, Edexcel 1CP2 4.1.6 · about 15 min

BugBotLab
NameClassDate

What this lesson is about

Standards, and TCP, UDP, IP, HTTP, HTTPS, FTP, SMTP, POP and IMAP.

Questions 6 marks in all

  1. [1 mark]Which protocol sends email to a mail server?

    1. ASMTP
    2. BIMAP
    3. CPOP
    4. DHTTP
  2. [1 mark]Why is HTTPS used for logins and payments?

    1. AThe data is encrypted, so it cannot be read if intercepted
    2. BIt is faster than HTTP
    3. CIt compresses the page
    4. DIt stops the page loading twice
  3. [1 mark]How is IMAP different from POP?

    1. AIMAP keeps email on the server so it stays in sync on every device
    2. BIMAP sends email; POP receives it
    3. CIMAP is for files; POP is for email
    4. DThere is no difference
  4. [1 mark]Why are standards needed?

    1. ASo equipment and software from different makers work together
    2. BSo all devices are made by one company
    3. CSo networks are faster
    4. DSo data is encrypted
  5. [1 mark]Which protocol is used to transfer files between computers?

    1. AFTP
    2. BSMTP
    3. CIMAP
    4. DUDP
  6. [1 mark]What does this program print?

    reply = "404 Not Found"
    code, rest = reply.split(" ", 1)
    print(int(code) == 200, rest)

The task: a tiny web client

Write request(path), which sends GET <path>, waits up to a second for the reply, and returns the status code as a number and the rest of the reply as text. Request /battery, /camera and /lights. For a status of 200, print <name>: <rest> (for example battery: 87, without the OK); otherwise print <name>: error <status>. Turn the LED green if the battery is above 50, and red if not.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f10-7-protocols/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Add a timeout: if no reply comes, print <name>: no reply.
  2. What status code would mean "you are not allowed"? Look up 403.
  3. For each of these, say which protocol is used: uploading a website to a server; reading email on a phone and a laptop; a live video call.