Data Transmission
How data moves between devices: packets and packet switching, serial and parallel methods, the USB interface, error detection from parity to ARQ, and encryption. Topic 2 of the 0478 / 2210 syllabus in full.
When you send a message, stream a video, or load a web page, data has to travel from one device to another. That journey raises three questions this chapter answers: how is the data packaged and routed, how is it physically sent down the wire, and how do we make sure it arrives without being corrupted or read by the wrong person?
Packets and Their Structure
Data is not sent across a network in one huge block. Instead it is broken down into small units called packets. Each packet travels independently and is reassembled at the other end. Splitting data this way means the network can share its capacity between many users at once, and a single damaged packet can be re-sent without resending everything.
Every packet has three parts: a header, a payload, and a trailer.
Header
- Destination IP address
- Originator's (sender's) IP address
- Packet number
- Total number of packets
Payload
- The actual data being carried
- This is the content of the message
Trailer
- Error-checking data, such as a checksum
- A marker showing the end of the packet
Packet Switching
Packet switching is the method used to send packets across a network. The clever part is that packets do not all follow the same path. Each one is routed independently along whatever route is best at that moment.
- The sending device breaks the data into packets
- Each packet is given a header with the destination address and a packet number
- Packets are sent onto the network, and each may take a different route
- Routers direct each packet along the best available path
- Because routes differ, packets may arrive out of order
- Once the final packet arrives, the destination device reassembles them in the correct order using the packet numbers
Press play to send four packets from sender to receiver. Watch them take different routes through the routers and arrive out of order, then get reassembled.
Serial and Parallel Transmission
This is about how the individual bits physically travel. The choice comes down to how many wires carry data and over what distance.
Play to compare. Serial sends one bit at a time down a single wire. Parallel sends 8 bits at once down 8 wires.
| Serial | Parallel | |
|---|---|---|
| How it works | Bits sent one at a time down a single wire | Multiple bits sent at once down multiple wires |
| Speed (short distance) | Slower | Faster |
| Over long distance | More reliable, no timing problems | Suffers from skew, bits arrive at slightly different times |
| Typical use | USB, SATA, network cables | Internal connections such as CPU buses |
Simplex, Half-Duplex and Full-Duplex
This describes the direction data can flow, regardless of whether the link is serial or parallel.
| Direction | Description | Example |
|---|---|---|
| Simplex | Data flows in one direction only | A keyboard sending to a computer, a TV broadcast |
| Half-duplex | Data flows both ways, but only one direction at a time | A walkie-talkie |
| Full-duplex | Data flows both ways at the same time | A phone call or video call |
The USB Interface
USB (Universal Serial Bus) is a serial interface standard for connecting peripheral devices to a computer. Data travels one bit at a time.
| Benefits of USB | Drawbacks of USB |
|---|---|
| Universal standard that works across many devices | Cable length is limited, usually to around 5 metres |
| Hot-pluggable: connect or disconnect without restarting | Slower than some alternatives such as Thunderbolt |
| Can supply power to connected devices | Several connector types (A, B, C, Micro) can confuse users |
| Simple plug-and-play setup, widely supported | A limited number of devices can connect without a hub |
Why Errors Occur in Transmission
As data travels, it can be corrupted. The usual cause is interference: electrical noise or electromagnetic interference on the cable can flip bits. There are three possible effects:
Data loss
Bits disappear during transmission.
Data gain
Extra unwanted bits appear.
Data change
Bits flip from 0 to 1 or 1 to 0.
Because of this, every reliable system needs a way to detect errors after transmission. The next five sections cover the methods the syllabus requires.
Parity Check
A parity check adds one extra bit, the parity bit, to each byte. The parity bit is set so that the total number of 1s follows an agreed rule, either always even (even parity) or always odd (odd parity).
Tap the data bits (blue) to flip them. The amber parity bit sets itself so the total number of 1s stays even.
Worked example
Count the 1s in 1011001: there are three 1s, which is odd.
How errors are detected
The sender and receiver agree on even or odd parity in advance. After transmission the receiver counts the 1s. If the count breaks the agreed rule, an error has been detected.
Checksum
A checksum is a value calculated from the data before it is sent. The receiver recalculates it from the data it actually received and compares the two. If they differ, the data was corrupted.
- The sender calculates a checksum from the data, for example by summing all the byte values
- The sender transmits both the data and the checksum
- The receiver recalculates the checksum from the received data
- The receiver compares its checksum with the one that was sent
- If they match, no error is detected. If they differ, an error has occurred
Echo Check
In an echo check, the receiver sends the received data straight back to the sender. The sender then compares the returned data with what it originally sent. If the two match, the data was transmitted correctly.
Check Digit
A check digit is an extra digit added to the end of a number, calculated from the other digits. Unlike the methods above, it detects errors in data entry, not data transmission. It catches mistakes like a mistyped or swapped digit.
| Example | Where used | Purpose |
|---|---|---|
| ISBN-13 | Books, a 13-digit identifier | The final digit is calculated from the first 12 |
| Barcodes | Products in shops | The last digit verifies the barcode scanned correctly |
| Credit cards | Card number verification | The Luhn algorithm detects single-digit errors |
Automatic Repeat Query (ARQ)
ARQ is an error-control method that not only detects errors but also fixes them by re-sending data. It uses acknowledgements and a timeout.
| Signal | Meaning | Sender's response |
|---|---|---|
| Positive ACK | Data received correctly | Send the next packet |
| Negative ACK (NAK) | Data received but errors detected | Retransmit the same packet |
| Timeout | No acknowledgement arrived in the time limit | Retransmit the same packet |
In short: after sending a packet the sender waits. If it receives a positive acknowledgement it moves on. If it receives a negative acknowledgement, or if the timeout expires with no reply at all, it sends the packet again.
Encryption
Encryption scrambles data so that anyone who intercepts it during transmission cannot read it. Only the intended recipient, who has the correct key, can decrypt and read it. Encryption does not stop data being intercepted; it makes intercepted data useless.
Symmetric encryption
- The same key is used to both encrypt and decrypt
- Faster than asymmetric encryption
- The problem: how do you share the key securely? If the key is intercepted, all the data is compromised
- Example: AES
Asymmetric encryption
- Uses a key pair: a public key and a private key
- The public key is shared openly and used to encrypt
- The private key is kept secret and used to decrypt
- This solves the key-sharing problem, but it is slower. Used in HTTPS and secure email
Play to watch a message be encrypted with the receiver's public key, travel as scrambled text, and be decrypted only by the private key.
Exam Practice
The header contains the destination and originator addresses, the packet number and the total number of packets. The payload contains the actual data being transmitted. The trailer contains error-checking data such as a checksum and a marker showing the end of the packet.
It is efficient because the network load is shared, so the available capacity is used well rather than reserving a single fixed path. It is reliable because each packet can take a different route, so if one route is congested or fails the packets can take an alternative path and still reach the destination.
Serial sends one bit at a time down a single wire and is more reliable over long distances because it has no timing problems, so it is used for USB and network cables. Parallel sends multiple bits at once down multiple wires and is faster over short distances but suffers from skew over long distances, so it is used for internal connections such as the CPU buses.
The data 0110100 contains three 1s. For even parity the total must be even, so the parity bit is 1, giving 01101001 with four 1s. The receiver counts the 1s after transmission. If the count is odd rather than even, the agreed even-parity rule has been broken and an error has been detected.
The receiver detects the error and sends a negative acknowledgement back to the sender. On receiving the negative acknowledgement, the sender retransmits the same packet. If no acknowledgement arrives at all within the set time limit, a timeout occurs and the sender also retransmits the packet.
The receiver shares their public key openly. The sender encrypts the message using that public key. The encrypted message is transmitted and is unreadable to anyone who intercepts it. Only the receiver's private key, which is never shared, can decrypt the message, so only the intended receiver can read it.
