Networks · GCSE · OCR J277 1.3.2, AQA 8525 3.5, Edexcel 1CP2 4.1.7 · about 15 min
The four-layer TCP/IP model, encapsulation, and why layers are used.
[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.
ApplicationTransportLinkInternet[1 mark]At which layer does HTTP work?
[1 mark]Which layer adds IP addresses and routes packets between networks?
[1 mark]Which is an advantage of using layers?
[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)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.
ETH 3C-02>3C-09. Which other lines had to change?