← O Level

CS · Topic 2

Section 1 · Chapter 2 · IGCSE & O Level Computer Science

Data Transmission 📡

Every message, video call and download is chopped up, fired across a network, checked for damage and (hopefully) locked away from snoopers. This is how.

🕶️ with Guru Jazzy

🎯 What you'll unlock this chapter

  • 📦 How data is split into packets, what's inside one, and how packet switching gets them across a network
  • 🔌 Serial vs parallel, simplex / half-duplex / full-duplex, and why USB took over
  • ✅ Catching errors with parity checks, parity blocks, checksums and echo checks
  • 🔢 Check digits (ISBN-13 and Modulo-11) and automatic repeat requests
  • 🔐 Symmetric and asymmetric encryption, with public and private keys
  • ✏️ All 9 coursebook activities as auto-marked practice, and every worked example, step by step

📦 Data packets 2.1.1

Big files aren't sent as one long stream. They're chopped into small data packets (often around 64 KiB each). Small packets are easier to control, and each one can take a different route — great if part of the network is busy or broken. The only catch: the receiver has to put them back together.

PartWhat it holds
HeaderIP address of the sender · IP address of the receiver · sequence number (so packets can be reassembled in order) · packet size (often also how many packets there are in total)
PayloadThe actual data being carried
TrailerA marker showing the end of the packet · an error check — a cyclic redundancy check (CRC)
KEY TERM · Cyclic redundancy check (CRC) — the sender adds up all the 1-bits in the payload and stores the total (in hex) in the trailer. The receiver counts the 1-bits again. Same total → no error. Different → the packet is re-sent.

🔀 Packet switching 2.1.1

In packet switching, a message is broken into packets and each one is sent independently. At every stage of the journey there's a node with a router, which reads the destination IP address in the header and decides where to send the packet next.

  • 🛣️ Each packet follows its own route, picked by the routers
  • 🚦 The route depends on how busy each node is — the quickest available path, not always the shortest
  • 🔀 So packets can arrive out of order, and the receiver uses the sequence numbers to rebuild the message

✅ Benefits

  • • No single line is tied up for the whole message
  • • Failed, busy or faulty lines can be avoided by re-routing
  • • Easy to expand
  • • High data transmission rates are possible

⚠️ Drawbacks

  • • Packets can be lost and need re-sending
  • • More error-prone for real-time streaming (like a live match)
  • • A delay at the destination while packets are put back in order
🐇 Hopping (not on the syllabus, but it explains lost packets) — a packet can bounce around routers forever. So the header holds a hop number that drops by 1 every time the packet leaves a router. If it hits 0 before arriving, the next router deletes it, and the receiver asks for it to be re-sent.

🎮 Packet Switching Simulator

Type a message, split it into packets, and send them across the network. Watch them take different routes and arrive in a jumbled order.

↔️ Direction of transmission 2.1.2

When data is sent, three things need deciding: which direction it can travel, how many bits go at once, and how it stays in sync. These are usually set by a communication protocol.

ModeMeaningExample
SimplexOne direction onlyComputer → printer
Half-duplexBoth directions, but not at the same timeWalkie-talkie ("over!")
Full-duplexBoth directions at the same timeBroadband internet, a phone call

🧵 Serial vs parallel 2.1.2

Serial — one bit at a time down a single wire / channel. Bits arrive in order. Works well over long distances, but slower.
Parallel — several bits (usually a byte) sent at the same time down several wires, one bit per wire. Faster, but only over short distances.

Both serial and parallel can be simplex, half-duplex or full-duplex. Over long parallel cables (around 20 m+), the bits drift out of step and arrive at different times — the data is skewed.

SerialParallel
Less interference (fewer wires)Faster data transmission rate
More reliable over long distancesWorks well over short distances, e.g. inside a computer's circuit board
No risk of skewed dataBits can arrive out of sync (skewed) over long distances
Cheaper — less hardware neededMore hardware, so more expensive
Good for small amounts of data, e.g. USBBest when speed matters or data is time-sensitive
Used over long distances, e.g. telephone linesInput/output operations are easier to program

🎮 Transmission Visualiser

Pick a method and a direction. Green bits travel A → B, yellow bits travel B → A.

🔌 Universal serial bus (USB) 2.1.3

USB is a form of serial transmission and the most common input/output port on computers. It supports both half-duplex and full-duplex. A standard USB cable has four wires: two for power (red and black) and two for data (white and green).

When you plug a device in:

  1. The computer detects it automatically (a small voltage change on the data wires).
  2. The device is recognised and the right device driver is loaded so they can communicate.
  3. If it's a new device with no driver available, the user is asked to download one (or it happens automatically).

✅ Benefits

  • • Devices are detected and drivers loaded automatically
  • • Connectors only fit one way, so no wrong connections
  • • An industry standard — lots of support
  • • Supports different transfer rates
  • • No separate power supply needed — the cable carries power
  • • The USB protocol re-sends data if errors are detected
  • • Easy to add more ports with a USB hub
  • • Backward compatible with older versions

⚠️ Drawbacks

  • • Standard cables max out at about 5 m — longer needs hubs
  • • Very early versions may not be supported by the newest computers
  • • Slower than some other connections, such as Ethernet
⚡ USB-C — a small, symmetrical 24-pin connector that fits either way round. It can deliver up to 100 W of power (enough to charge a laptop) and carry fast enough data for 4K video. With an adaptor it works with older USB versions.

🧯 Why check for errors? 2.2.1

Data can be corrupted, lost or even gained during transmission because of:

  • ⚡ Interference — every type of cable can pick up electrical interference
  • 📦 Problems during packet switching — packets lost or duplicated
  • 🧵 Skewing — parallel bits arriving out of sync

You can probably read "Tihs is a smlpe sntenece", but a computer can't guess. So it needs ways to detect errors after transmission: parity checks, checksums and echo checks.

⚖️ Parity checks 2.2.2

Sender and receiver first agree to use even or odd parity. One bit of each byte — usually the left-most — is the parity bit. It's set so the whole byte has an even (or odd) number of 1-bits.

7 data bits: 101 1010  → four 1-bits
even parity → parity bit 0 → 0101 1010   (still four 1s: even ✓)
odd parity  → parity bit 1 → 1101 1010   (now five 1s: odd ✓)

The receiver counts the 1-bits again. If the parity has changed (e.g. an even-parity byte arrives with an odd number of 1s), an error is flagged.

⚠️ Two weaknesses — a parity check can't tell you which bit changed. And if two bits change, the parity stays the same, so the error isn't detected at all.

🎮 Parity Lab

Set the 7 data bits and the parity type. Then send the byte — cleanly, with 1 bit flipped, or with 2 bits flipped — and see if the receiver notices.

🧱 Parity blocks 2.2.2

A parity block fixes the "which bit?" problem. A block of bytes is sent, and parity is checked both horizontally (each byte) and vertically (each column). An extra parity byte at the end holds the vertical parity bits.

If one bit flips, exactly one row and one column have the wrong parity. The bad bit is where they cross — so it can be corrected automatically, or the sender asked to re-transmit.

🎮 Parity Block Hunt

One bit in bytes 1–9 got flipped in transit. Tap the bit you think is wrong. Use "Show 1-bit counts" if you get stuck.

➕ Checksum 2.2.2

Data is sent in blocks, with an extra value — the checksum — on the end.

  1. Before sending, the checksum is calculated from the block using an agreed algorithm.
  2. The checksum is sent along with the block.
  3. The receiver recalculates the checksum from the block it received, using the same algorithm.
  4. If the two checksums match, there was no error. If not, a request is made to re-send the block.

🔁 Echo check 2.2.2

The receiver sends a copy of the data back to the sender. The sender compares the two. If they match, the data was sent without error.

⚠️ Not very reliable — if the copies differ, you can't tell whether the error happened on the way there or on the way back.

🔢 Check digits 2.2.3

A check digit is the final digit of a code, calculated from all the other digits. It's used on barcodes, ISBNs (book numbers) and VINs (vehicle numbers) to catch data entry mistakes — mistyping or mis-scanning. It can usually detect:

ErrorExample (should be 5307)
An incorrect digit5327
A transposition (two digits swapped)5037
An omitted or extra digit537 · 53107
A phonetic error13 (thirteen) instead of 30 (thirty)
📌 Exam tip — you don't need to memorise these algorithms; the steps are given in the question. You need to be able to follow them to generate or verify a check digit.

📚 ISBN-13 2.2.3

Generate the check digit (from 12 digits)

  1. Add all the odd-position digits (1st, 3rd, 5th …).
  2. Add all the even-position digits and multiply by 3.
  3. Add the two results and divide by 10.
  4. If the remainder is 0, the check digit is 0. Otherwise, check digit = 10 − remainder.

Verify a full 13-digit code

  1. Add the odd-position digits — including the check digit.
  2. Add the even-position digits and multiply by 3.
  3. Add the two results and divide by 10.
  4. The code is correct if the remainder is 0.

🔟 Modulo-11 2.2.3

Modulo-11 works for codes of different lengths, so it suits product codes and VINs. For a 7-digit number (which becomes 8 digits with the check digit):

Generate

  1. Give the digits weights 8, 7, 6, 5, 4, 3, 2 from the left.
  2. Multiply each digit by its weight and add them up.
  3. Divide the total by 11.
  4. Check digit = 11 − remainder. If that gives 10, use X; if the remainder was 0, use 0.

Verify

  1. Give all 8 digits weights 8, 7, 6, 5, 4, 3, 2, 1 (X counts as 10).
  2. Multiply and add up.
  3. Divide by 11.
  4. The code is correct if the remainder is 0.

🎮 Check Digit Lab

Type the digits (without a check digit). Then simulate a data-entry mistake and see whether the check digit catches it.

🔂 Automatic Repeat Request (ARQ) 2.2.4

  • 🧾 The receiver gets an error detection code with the data (usually a CRC) and uses it to check for errors.
  • 👍 No error → it sends a positive acknowledgement (ACK) back.
  • 👎 Error found → it sends a negative acknowledgement (NAK) and asks for the data again.
  • ⏱️ The sender also uses a timeout: if no acknowledgement arrives in time, it re-sends automatically …
  • 🔁 … until it gets a positive acknowledgement, or a set number of re-transmissions has been reached.

ARQ is often used by mobile phone networks to guarantee data integrity.

🎮 ARQ Simulator

Turn the noise up and watch acknowledgements, timeouts and re-sends keep the data correct.

  • Press send to start.

🕵️ Why encrypt? 2.3.1

Data sent over any public network — wired or wireless — can be intercepted by a hacker (an eavesdropper). Encryption turns the data into a form that's unreadable to anyone it isn't meant for.

⚠️ Common mistake — encryption doesn't stop data being intercepted. It stops the intercepted data from making sense. It matters most for sensitive data: bank details, medical records, legal documents.
plaintext  ──▶  encryption algorithm + key  ──▶  ciphertext
(readable)                                       (unreadable)

🔑 Symmetric encryption 2.3.2

Symmetric encryption uses one key — the same key encrypts and decrypts the message.

A simple example uses a 10-digit denary key like 4 2 9 1 3 6 2 8 5 6: shift the 1st letter forward 4 places, the 2nd forward 2, the 3rd forward 9, and so on. To decrypt, apply the same key in reverse (shift backwards). A 10-digit key gives 10¹⁰ possible keys — a modern computer could try them all in seconds, so real systems use 256-bit keys (2²⁵⁶ ≈ 1.2 × 10⁷⁷ possibilities).

⚠️ The big problem — the sender and receiver both need the key, so it has to be sent somehow (email, message …), and it could be intercepted. This is the key distribution problem, the main drawback of symmetric encryption.

🎮 Key Cipher

Each letter is shifted by the next digit of the key (the key repeats if the message is longer). Spaces and symbols are left alone and don't use up a key digit.

🗝️ Asymmetric encryption 2.3.2

Asymmetric encryption solves the key distribution problem with two keys:

Public key — given to everybody. Used to encrypt messages for its owner.
Private key — known only to its owner. The only key that can decrypt those messages.

The two keys are a matching pair: mathematically linked, but you can't work one out from the other. The private key never leaves its owner's computer, so there's nothing secret to intercept.

🎮 Tom sends Jane a secret document

Step through it — and watch what Eve the eavesdropper manages to get.

👦 Tom

🕵️ Eve (listening in)

👩 Jane

👥 More than two people

Jane can give her public key to anyone — Tom, Susan, Mike, Megan — so they can all send her encrypted messages, which only her private key can decrypt. But for two-way secure messages between everyone, each person needs their own key pair, and everyone has to share their public key with everyone else.

✏️ Practice hub 9 activities · every example

Every activity from the coursebook chapter, as an auto-marked practice set. Same skill as the book's activity with the same number — but fresh questions every time you hit 🔀 New questions.

📘 Worked examples

Every type of worked example in the chapter, solved step by step. Hit 🔀 Another example on any of them for a new one.

🃏 Key-term flashcards Tap to flip

🧠 Mini-quiz

📝 Exam-style questions Try, then peek

  • ✅ Header — sender's and receiver's IP addresses, sequence number, packet size.
  • ✅ Payload — the actual data being sent.
  • ✅ Trailer — marks the end of the packet and holds an error check (CRC).
  • ✅ Over long distances the bits on the different wires get out of sync — the data becomes skewed…
  • ✅ …so it arrives corrupted. Serial sends bits one at a time on one wire, so it stays in order. (Also: parallel needs more wires — more cost and more interference.)
  • ✅ Yes — the byte has five 1-bits, which is an odd number.
  • ✅ With even parity it should have an even number of 1-bits, so at least one bit has changed.
odd positions:  9 + 8 + 8 + 1 + 6 + 0 = 32
even positions: 7 + 1 + 4 + 4 + 2 + 8 = 26 × 3 = 78
32 + 78 = 110 → 110 ÷ 10 = 11 remainder 0
remainder is 0 → check digit = 0
(8×4) + (7×2) + (6×7) + (5×1) + (4×6) + (3×0) + (2×3)
= 32 + 14 + 42 + 5 + 24 + 0 + 6 = 123
123 ÷ 11 = 11 remainder 2
11 − 2 = 9   → full code 4 2 7 1 6 0 3 9
verify: 123 + (1×9) = 132 = 12 × 11 → remainder 0 ✓
  • ✅ The receiver uses an error detection code (e.g. CRC) to check the data.
  • ✅ No error → a positive acknowledgement is sent back; error → a negative acknowledgement and a request to re-send.
  • ✅ The sender waits a set time (timeout) for an acknowledgement.
  • ✅ If none arrives, it re-sends automatically, until a positive acknowledgement is received or a set number of attempts is reached.
  • ✅ Symmetric encryption uses one key that has to be sent to the receiver, so it can be intercepted.
  • ✅ Asymmetric uses a public key to encrypt and a matching private key to decrypt.
  • ✅ The private key is never sent anywhere, and the public key can't decrypt the message — so intercepting it is useless.
  • ✅ Benefits (any two): devices detected and drivers loaded automatically; connector only fits one way; industry standard; powers the device; backward compatible; errors are re-sent.
  • ⚠️ Drawback: maximum cable length of about 5 m without a hub; slower than e.g. Ethernet; very old versions may not be supported.

🚀 Going further A Level preview

Quantum cryptography isn't on the IGCSE / O Level syllabus. Instead of maths, it uses the physics of light: single photons are polarised to represent 0s and 1s. In quantum key distribution (QKD, e.g. the BB84 protocol), the sender and receiver each pick a random basis (rectilinear + or diagonal ×) for every photon. They only keep the bits where their bases matched. Anyone measuring the photons in between disturbs them, so eavesdropping shows up.

📌 Chapter summary — Data is split into packets (header, payload, trailer) that are packet-switched across routers and reassembled by sequence number. Transmission can be serial or parallel, and simplex, half-duplex or full-duplex; USB is serial and the industry standard. Errors are detected with parity checks (and parity blocks, which can find the bit), checksums, echo checks and ARQ; data-entry errors with check digits. Encryption makes intercepted data unreadable: symmetric uses one shared key, asymmetric uses a public key to encrypt and a private key to decrypt.
Guru Jazzy 🕶️ · Chapter 2 · Data Transmission · packets out, vibes in 📡