Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1routing | Afor packet in packets: route = router.choose(packet) | |
| 2next_hop = router.read(packet.header.destination) | Brouter2.forward(packet, router3) | |
| 3A router decides the route for each packet separately, so two packets from the same file can be sent different ways. | CThe router uses the payload to choose the route. The payload is just the data being carried. The router must read the header, which holds the destination address. | |
| 4A router does not plan the whole journey. It only forwards the packet to the next router, which then makes its own decision. | DThe router reads the destination address in the packet header to decide which router to forward the packet to next. | |
| 5router.read(packet.payload) # to find the route | EA router reads each packet's destination address in its header and picks the next router to send it to, so every packet's route is decided one step at a time. | |
| 6route = router.choose(all_packets) # one route for the whole message | FA router does not pick one route for the whole message. It decides the route for each packet separately, so packets may take different routes. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
routing — A router reads each packet's destination address in its header and picks the next router to send it to, so every packet's route is decided one step at a time.address ← packet.header.destinationaddress ← packet.header.destination
next ← router.chooseRoute(address)next ← router.chooseRoute(address)
router.forward(packet, next)FOR EACH packet IN message
router.route(packet)address ← packet.header.destination
next ← router.chooseRoute(address)
router.forward(packet, next)