Week 24 · 3.2 Data transmission and security · 3 lessons
1
Did it arrive intact?
Computing 8: Topic 3.2, pp. 244–254
GoalExplain how errors can appear in transmitted data and describe the steps of an echo check.
New words
error · a change in data, such as a 0 that arrives as a 1interference · a disturbance that can change signals while they travelecho check · a way to detect errors: the receiver sends back a copy and the sender compares it with the originalsender, receiver · the device that sends the data, and the device that gets it
Explanation
When data travels from one device to another, it can change on the way. Interference, or signals from nearby wires crossing, can turn a 0 into a 1. So the data that arrives may not be the same as the data that was sent. An echo check is a way to detect this. First, the sender sends the data to the receiver. Second, the receiver sends a copy of what it received back to the sender. Third, the sender compares the copy with the original. If they match, no error was found. If they do not match, there was an error, so the sender sends the data again.
sender sends data1→receiver sends a copy back2→sender compares copy and original3→same or different?
Worked examples
Step
What happens
Data
1
sender sends
10110010
2
receiver sends a copy back
10110010
3
sender compares
same
4
result
no error found
A sensor sends the code 10110010 to a computer. The computer sends back a copy: 10110010. The sender compares them and they match. The echo check finds no error.
Step
What happens
Data
1
sender sends
10110010
2
receiver gets and copies back
10100010
3
sender compares
different at bit 4
4
result
error found: send again
The same sensor sends 10110010 again, but interference changes the fourth bit on the way. The receiver gets 10100010 and sends that back. The sender compares: the fourth bit is different, so there was an error, and the sender sends the data again.
The check in Python. The two typed values stand for the original and the copy. They are compared with ==, and the program prints a result. Here 10110010 is typed as the original and 10100010 as the copy.
Class activity
Echo-check game (no computer). With a partner, play sender and receiver, sitting back to back. The sender writes an 8-bit code on a card and reads it out quietly. The receiver writes what they heard. A third person, standing between, may secretly change one digit when the code is read aloud (this is “interference”). The receiver then reads their copy back. The sender compares it with the card. Say “match” or “error: send again”. Swap roles three times. Count how often an error was found. An echo check can say that the data is different, but not which side was wrong. Explain why.
Practice
1
A sender sends 01101101 and gets back 01101101. What does the echo check tell the sender?
Original
Copy received back
Result
01101101
01101101
?
The two match, so no error was found.
2
A sender sends 11010011 and gets back 11010111. Which bit is different, counting from the left, and what happens next?
Position
1
2
3
4
5
6
7
8
original
1
1
0
1
0
0
1
1
copy
1
1
0
1
0
1
1
1
The sixth bit is different (0 became 1). The sender knows there was an error and sends the data again.
3
Put the echo check steps in order: (a) the sender compares; (b) the receiver sends back a copy; (c) the sender sends the data; (d) if they differ, send again.
(c), (b), (a), (d).
4
A pupil says, “If the copy matches, the receiver definitely got the right data.” Is this always true? Think about when the copy travels back.
Almost always, but not 100 %. A matching copy could only hide an error if a change on the way there were exactly undone by a change on the way back, which is very unlikely. An error on the way back can also make good data look wrong, and then the data is simply sent again. The echo check only detects errors; sending again is how they are fixed.