The answersDownload the PDF
Worksheet

F10.6 The internet, DNS and the cloud

Networks · GCSE · OCR J277 1.3.1, Edexcel 1CP2 4.1.3 · about 20 min

BugBotLab
NameClassDate

What this lesson is about

The internet and the web, DNS, web servers and hosting, and the cloud.

Questions 5 marks in all

  1. [1 mark]What does DNS do?

    1. ATurns a domain name into an IP address
    2. BEncrypts web pages
    3. CStores websites
    4. DConnects a LAN to the internet
  2. [1 mark]Put the steps in order.

    Number the lines 1 to 4 to put them in the right order.

    1. The user types a URL into the browser
    2. The browser asks a DNS server for the IP address
    3. The DNS server returns the IP address
    4. The browser requests the page from the web server
  3. [1 mark]What is the difference between the internet and the World Wide Web?

    1. AThe internet is the network; the web is a service of pages that runs on it
    2. BThey are the same thing
    3. CThe web is the cables; the internet is the pages
    4. DThe internet is only for email
  4. [1 mark]What is web hosting?

    1. AStoring a website on a server that is always connected to the internet
    2. BVisiting a website
    3. CDesigning a website
    4. DSearching the web
  5. [1 mark]Which is a disadvantage of the cloud?

    1. AIt needs an internet connection
    2. BFiles can be reached from any device
    3. CThe provider handles backups
    4. DStorage can grow as needed

The task: look it up

Two robots are on the mat: scout.bot and rover.bot. Look up scout.bot with the DNS robot, then take the IP address from its reply. Send to <address>: where and the Scout answers at <x>,<y>. Drive to about 13 cm in front of it, into the green square, without touching anything. The helpers ask, numbers_in, go_to and near are ready to use.

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

def ask(question, seconds=1.0):
    # send a question and return the first reply that arrives within `seconds`, or None
    send(question)
    for tick in range(int(seconds * 10)):
        wait(0.1)
        for sender, text in messages():
            return text
    return None

def numbers_in(text):
    # every number in a message, as floats: "at 25,55" -> [25.0, 55.0]
    out = []
    for word in text.replace(",", " ").split():
        try:
            out.append(float(word))
        except ValueError:
            pass
    return out

def wrapped(h):
    return (h + 180) % 360 - 180

def go_to(x, y, speed=60):
    # one step of driving towards (x, y), measured from the start; call it in a loop
    px, py = position()
    a = math.radians(wrapped(math.degrees(math.atan2(x - px, y - py)) - heading()))
    drive(speed * math.cos(a), speed * math.sin(a), wrapped(0 - heading()) * 3)

def near(x, y, cm=4):
    px, py = position()
    return math.hypot(x - px, y - py) < cm

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

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

Challenges

  1. Keep a DNS cache: a dictionary of names you have already looked up, so you only ask once.
  2. Look up rover.bot too, and print both robots' positions.
  3. Why does a DNS server ask other DNS servers rather than knowing every name itself?