The three parts of a packet

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

The three parts of a packet

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which shows the correct order of the three parts of a packet?
A Payload, header, trailer
B Header, payload, trailer
2. Where is the header found in a packet?
A At the start of the packet
B At the end of the packet
3. Which part of a packet holds the actual data being sent, such as part of an email?
A The payload
B The header
4. Which part of a packet marks where the packet ends?
A The payload
B The trailer
5. A packet is drawn as three blocks side by side. Which block goes in the middle?
A Payload
B Trailer

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1[ HEADER | PAYLOAD | TRAILER ] AThe middle part of the packet that carries the actual data being sent
2PAYLOAD = "Hello Sam" BThe trailer is placed in the middle, but it must be at the end after the payload
3The header is the first part of a packet and holds the destination address, the originator's address and the packet number CHEADER = [dest, source, packet_no]
4The trailer is the last part of a packet and marks where the packet ends DThe parts are in the wrong order: the header must come first, then the payload, then the trailer
5[ PAYLOAD | HEADER | TRAILER ] ETRAILER = "END"
6[ HEADER | TRAILER | PAYLOAD ] FA packet drawn as three blocks in the correct order: header first, payload in the middle, trailer last

Definitions

header, payload, trailer

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
packet ← ______ + payload + trailer
2.
packet ← header + _______ + trailer
3.
packet ← header + payload + _______
4.
blocks ← _
5.
_____ ← header middle ← payload end ← trailer

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A PACKET P1
B HEADER: dest, from, number
C PAYLOAD: data
D TRAILER: packet number
E END PACKET
Question 2
A pkt = payload+header+trailer
B first = header
C middle = payload
D last = trailer
Question 3
A [ HEADER | TRAILER | PAYLOAD ]
B # left block: start of packet
C # middle block: the data
D # right block: end of packet
Question 4
A header = [dest, origin, num]
B payload = [dest, origin, num]
C trailer = 'END'
D pkt = [header,payload,trailer]
Question 5
A pkt ← NEW Packet
B pkt.start ← header
C pkt.middle ← trailer
D pkt.end ← trailer

Answer Key

The three parts of a packet
Section A: Quick Questions
Q1
B — Header, payload, trailer
Q2
A — At the start of the packet
Q3
A — The payload
Q4
B — The trailer
Q5
A — Payload
Section B: Match the Pairs
Q1
[ HEADER | PAYLOAD | TRAILER ] → A packet drawn as three blocks in the correct order: header first, payload in the middle, trailer last
Q2
PAYLOAD = "Hello Sam" → The middle part of the packet that carries the actual data being sent
Q3
The header is the first part of a packet and holds the destination address, the originator's address and the packet number → HEADER = [dest, source, packet_no]
Q4
The trailer is the last part of a packet and marks where the packet ends → TRAILER = "END"
Q5
[ PAYLOAD | HEADER | TRAILER ] → The parts are in the wrong order: the header must come first, then the payload, then the trailer
Q6
[ HEADER | TRAILER | PAYLOAD ] → The trailer is placed in the middle, but it must be at the end after the payload
Section C: Definitions
Q1
header, payload, trailer — The three parts of a packet, in order: the header (start) holds addresses and packet number, the payload (middle) holds the data, the trailer (end) marks the packet's end.
Section D: Fill in the Blanks
Q1
packet ← header + payload + trailer
Q2
packet ← header + payload + trailer
Q3
packet ← header + payload + trailer
Q4
blocks ← 3
Q5
start ← header middle ← payload end ← trailer
Section E: Spot the Error
Q1
D — The packet number is stored in the header, not the trailer. The trailer at the end only marks the end of the packet, so it should read TRAILER: end marker.
Q2
A — A packet is built in the order header, payload, trailer. The header must come first, so the line should be pkt = header+payload+trailer.
Q3
A — The drawing has the middle and last blocks swapped. The payload goes in the middle and the trailer goes at the end: [ HEADER | PAYLOAD | TRAILER ].
Q4
B — The payload holds the data being sent, such as the message. Addresses and the packet number belong in the header, so the payload should be a data value like 'Hi Sam!'.
Q5
C — The middle of the packet holds the payload, not the trailer. The trailer goes at the end, so the line should be pkt.middle ← payload.