The answersDownload the PDF
Worksheet

F10.8 Layers

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

BugBotLab
NameClassDate

What this lesson is about

The four-layer TCP/IP model, encapsulation, and why layers are used.

Questions 5 marks in all

  1. [1 mark]Put the TCP/IP layers in order, from the top.

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

    1. Application
    2. Transport
    3. Link
    4. Internet
  2. [1 mark]At which layer does HTTP work?

    1. AApplication
    2. BTransport
    3. CInternet
    4. DLink
  3. [1 mark]Which layer adds IP addresses and routes packets between networks?

    1. AInternet
    2. BApplication
    3. CTransport
    4. DLink
  4. [1 mark]Which is an advantage of using layers?

    1. AOne layer can be changed without changing the others
    2. BData is sent without headers
    3. CIt removes the need for protocols
    4. DOnly one company can make network software
  5. [1 mark]What does this program print?

    frame = "IP 1>2 | TCP 80 | hello"
    for n in range(2):
        frame = frame.split(" | ", 1)[1]
    print(frame)

The task: wrap and unwrap

Write wrap(data, headers) and unwrap(frame). wrap adds each header in headers, in order, in front of the data with | between, printing <layer>: <data so far> after each (starting with application: GET /battery before any header). Send the finished frame by radio. Then unwrap removes the three headers, and you print received by application: <data>.

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

data = "GET /battery"
names = ["transport", "internet", "link"]
headers = ["TCP 80", "IP 10.0.0.2>10.0.0.9", "WIFI 3C-02>3C-09"]

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

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

Challenges

  1. Change the link layer header to ETH 3C-02>3C-09. Which other lines had to change?
  2. A router reads the internet layer header but not the application data. Print just the header a router needs.
  3. Match each device to the highest layer it reads: switch, router, web browser.