Lesson 62: Packets
이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Small pieces, any route
- Big data is not sent in one piece. It is split into small packets.
- Each packet has a header: who sent it, where it goes, and its packet number.
- Packets can take different routes, so they may arrive out of order. The receiver puts them back in order by number.
Words for this lesson
| Word | Meaning |
|---|---|
| packet | a small piece of the data, with a header |
| header | information about the packet, such as its number |
| payload | the data the packet carries |
| router | a device that chooses the route for each packet |
English
HELLO WORLD in packets of 4
| Header | Payload |
|---|---|
| 1/3 | HELL |
| 2/3 | O WO |
| 3/3 | RLD |
English
In the exam
- 0478/11/M/J/23 Q2(c): (i) two things in a packet header. Mark scheme: the destination address, the packet number, the sender's address. (ii) How packet switching works. Mark scheme: the data is split into packets; each packet may take a different route, chosen by a router; packets may arrive out of order; when the last packet arrives they are put back in order; a missing packet is requested again.
난이도 3/5 · 200코인 + 오늘 첫 완료 시 작은 보너스 추가
On the internet, data is split into packets. Each packet has a header with its number and the total number of packets. Type a message. The program has worked out total, the number of 4-character packets. Print each packet on its own line as number/total:data, for example 1/3:HELL.
출력을 보려면 '실행'을 클릭하세요.
난이도 4/5 · 280코인 + 오늘 첫 완료 시 작은 보너스 추가
Now be the receiver. Packets can take different routes, so they arrive out of order. The program reads the number n, the total and the data from each packet. Store the data in parts[n] and count the packets. When the last one has arrived, print Message: and the parts in order, from 1 to total.
출력을 보려면 '실행'을 클릭하세요.