Networks · GCSE · OCR J277 1.3.2, AQA 8525 3.5, Edexcel 1CP2 4.1.3 · about 15 min
MAC and IP addresses, IPv4 and IPv6, and packet switching.
[1 mark]Which of these is a valid IPv4 address?
[1 mark]What is a MAC address used for?
[1 mark]How many bits is an IPv6 address?
[1 mark]Why do packets have sequence numbers?
[1 mark]Which is in a packet header?
[1 mark]What does this program print?
packets = ["2/2:Bot", "1/2:Bug"]
packets.sort()
print("".join(p[4:] for p in packets))Write make_packets(message, size), which splits message into pieces of size characters and returns them as packets in the form <number>/<total>:<piece>. Make the packets for message with a size of 10, print each one, and send each by radio. The packets arrive in the order [packets[2], packets[0], packets[1]]: sort them back into order by their sequence numbers, and print reassembled: <message> and matches: True (or False).
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() message = "robot 7 at 25,40 battery 87%"
Plan your program here, then type it in and press Run.
random.shuffle and check they still reassemble.ord() values of its characters, modulo 100. Check it on arrival.2 32 and 2 128.