Skip to content

Data transmission

IGCSE Computer Science · Topic 2

Train
2.1

What is data transmission?

Data transmission 数据传输 means moving data from one place to another — for example from your computer to a website, or from a phone to a printer.

Data often travels along a cable. Two common ones are shown below.

A close-up of a network cable ending in a clear plastic plug with gold metal pins An Ethernet cable with an RJ45 plug, often used to carry data on a wired network

A cable opened up to show the thin glass fibres inside, with a ruler for scale A fibre-optic cable carries data as pulses of light along thin glass fibres

Before it is sent, the data is broken down into small, equal-sized pieces called packets 数据包. Each packet travels separately and they are put back together at the other end.

Using packets has benefits:

  • if one packet is lost or damaged, only that packet is sent again, not the whole file;
  • packets can take different routes, so a busy or broken route can be avoided;
  • many users can share the same connection at the same time.
Vocabulary Train
English Chinese Pinyin
data transmission 数据传输 shù jù chuán shū
packets 数据包 shù jù bāo
2.1

The structure of a packet

Syllabus
Candidates should be able to: Notes and guidance
1 (a) Understand that data is broken down into packets to be transmitted
(b) Describe the structure of a packet • A packet of data contains a: – packet header – payload – trailer • The packet header includes the: – destination address – packet number – originator’s address
(c) Describe the process of packet switching • Data is broken down into packets • Each packet could take a different route • A router controls the route a packet takes • Packets may arrive out of order • Once the last packet has arrived, packets are reordered
2 (a) Describe how data is transmitted from one device to another using different methods of data transmission • Including: – serial – parallel – simplex – half-duplex – full-duplex
(b) Explain the suitability of each method of data transmission, for a given scenario • Including the advantages and disadvantages of each method
3 Understand the universal serial bus (USB) interface and explain how it is used to transmit data • Including the benefits and drawbacks of the interface

Source: Cambridge International syllabus

Every packet has three parts.

A packet shown as three joined blocks — header, payload and trailer — with the header's contents listed below it A packet has a header, a payload (the data) and a trailer; the header carries the addresses and packet number

Part What it holds
packet header 包头 control information (see below)
payload 有效载荷 the actual data being carried
trailer 尾部 shows where the packet ends, plus an error check

The packet header holds:

  • the sender's IP address 地址 (where the packet came from),
  • the receiver's IP address (where it is going),
  • the packet number (so the packets can be put back in the right order).
Vocabulary Train
English Chinese Pinyin
packet header 包头 bāo tóu
payload 有效载荷 yǒu xiào zài hè
trailer 尾部 wěi bù
address 地址 dì zhǐ
2.1

Packet switching

Packet switching 数据包交换 is the way packets are sent across a network.

Two packets travelling from a sender to a receiver through a mesh of routers, each taking a different coloured route Routers forward packets, and different packets can take different routes to the same receiver

  • Special devices called routers 路由器 read each packet's header and choose the best route for it.
  • Each packet may take its own path, so packets can travel different ways.
  • Packets may arrive out of order.
  • When the last packet has arrived, the packets are reordered using their packet numbers.
Explore

How data travels in packets

Step through packet switching. Splitting a file into addressed packets is why one lost packet only needs resending, and why many users can share the same line.

Vocabulary Train
English Chinese Pinyin
packet switching 数据包交换 shù jù bāo jiāo huàn
routers 路由器 lù yóu qì
2.1

Methods of data transmission

Serial and parallel

Serial 串行 Parallel 并行
How one bit at a time, down one wire several bits at once, down several wires
Distance good over long distances good over short distances only
Cost cheaper (fewer wires) more expensive (more wires)
Errors bits stay in order bits can arrive at slightly different times over long wires

Serial sends one bit after another along a single wire. Parallel sends several bits at the same time along several wires, so it is faster over short distances.

Serial transmission as bits in a line on one wire, and parallel transmission as several bits travelling together on several wires Serial sends one bit at a time down one wire; parallel sends several bits at once down several wires

Simplex, half-duplex and full-duplex

These describe the direction data can travel.

Two devices A and B with arrows showing simplex (one way), half-duplex (both ways one at a time) and full-duplex (both ways at once) Simplex is one way only; half-duplex is both ways but one at a time; full-duplex is both ways at once

Method Direction
simplex 单工 one direction only (e.g. computer → printer)
half-duplex 半双工 both directions, but only one at a time (e.g. walkie-talkie)
full-duplex 全双工 both directions at the same time (e.g. phone call)

Choosing a method

The choice depends on the distance, the speed needed, the cost, and whether data must travel both ways at once.

Vocabulary Train
English Chinese Pinyin
serial 串行 chuàn xíng
parallel 并行 bìng xíng
simplex 单工 dān gōng
half-duplex 半双工 bàn shuāng gōng
full-duplex 全双工 quán shuāng gōng
2.1

USB

The universal serial bus 通用串行总线 (USB) is a common interface 接口 (a connection point) for joining devices to a computer.

Benefits:

  • the same connector is used by many devices (one standard);
  • the device is detected automatically and the correct driver is loaded;
  • it carries power, so it can charge or run a device;
  • the connector only fits one way, so it is hard to plug in wrongly.

Drawbacks:

  • the cable can only be a limited length (a few metres);
  • older USB versions are slower than newer ones;
  • transfer speeds can be lower than some other connection types.

Five different USB plug shapes side by side — micro, mini, type-B, and type-A — with a 5 cm scale bar A few of the USB connector shapes. All use the same USB standard, so devices are detected automatically.

Vocabulary Train
English Chinese Pinyin
universal serial bus 通用串行总线 tōng yòng chuàn xíng zǒng xiàn
interface 接口 jiē kǒu
2.2

Why we check for errors

Syllabus
Candidates should be able to: Notes and guidance
1 Understand the need to check for errors after data transmission and how these errors can occur • Errors can occur during data transmission due to interference, e.g. data loss, data gain and data change
2 Describe the processes involved in each of the following error detection methods for detecting errors in data after transmission: parity check (odd and even), checksum and echo check • Including parity byte and parity block check
3 Describe how a check digit is used to detect errors in data entry and identify examples of when a check digit is used, including international standard book numbers (ISBN) and bar codes
4 Describe how an automatic repeat query (ARQ) can be used to establish that data is received without error • Including the use of: – positive/negative acknowledgements – timeout

Source: Cambridge International syllabus

While data travels, interference 干扰 can change it. Three things can go wrong:

  • data loss — some bits do not arrive;
  • data gain — extra bits are added;
  • data change — some bits are flipped.

So the receiver checks whether the data arrived correctly.

Vocabulary Train
English Chinese Pinyin
interference 干扰 gān rǎo
2.2

Error detection methods

Parity check

A parity check 奇偶校验 adds one extra bit, the parity bit 奇偶校验位, to each byte. There are two types:

Data with four 1s (even); a parity bit of 0 keeps it even A parity bit is added to make the number of 1s even (or odd)

  • even parity — the total number of 1s in the byte (including the parity bit) must be even;
  • odd parity — the total number of 1s must be odd.

Example (even parity): the data 1011001 has four 1s, which is already even, so the parity bit is 0:

parity bit + data
    0        1011001

To find an error: the receiver counts the 1s. If even parity was agreed but a byte arrives with an odd number of 1s, an error has happened during transmission.

A parity check cannot find every error. If two bits flip, the count may still look correct.

Worked example. A single parity bit tells you that an error happened, but not where. A parity block 奇偶校验块 can find the exact bit. Several bytes are sent together, each with a row parity bit, and one extra parity byte 奇偶校验字节 at the bottom holds a parity bit for each column. Even parity is used below, and one bit was flipped during transmission. Find it.

          b1 b2 b3 b4 b5 | parity
 byte 1    1  0  1  1  0 |   1
 byte 2    0  1  1  0  1 |   1
 byte 3    1  1  1  1  0 |   1    <- row: odd number of 1s
 byte 4    0  0  1  1  0 |   0
 ------------------------------
 parity    0  0  1  1  1 |   1
                 ^ column b3: odd number of 1s

Row byte 3 breaks even parity, and column b3 breaks even parity. The flipped bit is where they cross: byte 3, bit b3. Changing it back from 1 to 0 repairs the data. A single parity bit only says an error happened; a parity block says exactly where, so the receiver can even fix it.

Checksum

A checksum 校验和 is a value worked out from all the data before sending. The receiver works out the checksum again from the data it received. If the two values do not match, an error has occurred and the data is resent.

Echo check

In an echo check 回送校验, the receiver sends the data back to the sender. The sender compares it with the original. If they differ, an error happened. (This needs the data to be sent twice, so it is slow.)

Automatic Repeat reQuest (ARQ)

Automatic Repeat reQuest 自动重传请求 (ARQ) uses messages called acknowledgements 确认.

  • The receiver sends a positive acknowledgement if a packet arrived correctly, or a negative acknowledgement if it did not.
  • The sender starts a timeout 超时 timer. If no positive acknowledgement comes back in time, the sender sends the packet again.

Check digit

A check digit 校验码 is an extra digit placed at the end of a number, worked out from the other digits. It is used to find mistakes when a number is typed in.

When the number is entered, the check digit is calculated again and compared. It can catch:

  • an incorrect digit entered,
  • a transposition error 换位错误 (two digits swapped, e.g. 21 typed as 12),
  • a digit left out or an extra digit added,
  • a phonetic error (a digit that sounds similar, e.g. 13 and 30).

Check digits are used in barcodes 条形码 and ISBNs (book numbers).

Explore

Computing concept lab

Classify concrete examples by the computing idea they demonstrate.

Vocabulary Train
English Chinese Pinyin
parity check 奇偶校验 jī ǒu jiào yàn
parity bit 奇偶校验位 jī ǒu jiào yàn wèi
parity block 奇偶校验块 jī ǒu jiào yàn kuài
parity byte 奇偶校验字节 jī ǒu jiào yàn zì jié
checksum 校验和 jiào yàn hé
echo check 回送校验 huí sòng jiào yàn
automatic repeat request 自动重传请求 zì dòng zhòng chuán qǐng qiú
acknowledgements 确认 què rèn
timeout 超时 chāo shí
check digit 校验码 jiào yàn mǎ
transposition error 换位错误 huàn wèi cuò wù
barcodes 条形码 tiáo xíng mǎ
2.3

Encryption

Syllabus
Candidates should be able to: Notes and guidance
1 Understand the need for and purpose of encryption when transmitting data
2 Understand how data is encrypted using symmetric and asymmetric encryption • Asymmetric encryption includes the use of public and private keys

Source: Cambridge International syllabus

Why we need encryption

Encryption 加密 scrambles data so that it cannot be understood if it is intercepted 拦截 (caught) by the wrong person. The readable data is called plaintext 明文; after encryption it becomes ciphertext 密文.

Encryption does not stop data from being intercepted. It only stops the data from being understood.

Symmetric encryption

Symmetric encryption 对称加密 uses a single key 密钥 to both encrypt and decrypt the data. The sender and receiver must share this same secret key. The risk is that the key itself could be stolen while being shared.

Asymmetric encryption

Asymmetric encryption 非对称加密 uses two different keys:

  • a public key 公钥 that anyone can have, used to encrypt;
  • a private key 私钥 that is kept secret, used to decrypt.

Data encrypted with the public key can only be decrypted with the matching private key, so the key never has to be shared. This is safer than sharing one secret key.

Symmetric encryption using one shared key for both steps, and asymmetric encryption using a public key to encrypt and a private key to decrypt Symmetric uses one shared key; asymmetric uses a public key to encrypt and a private key to decrypt

Explore

The Caesar cipher

Shift each letter to encrypt a message — the simplest idea of a cipher and its key.

Vocabulary Train
English Chinese Pinyin
encryption 加密 jiā mì
intercepted 拦截 lán jié
plaintext 明文 míng wén
ciphertext 密文 mì wén
symmetric encryption 对称加密 duì chèn jiā mì
key 密钥 mì yào
asymmetric encryption 非对称加密 fēi duì chèn jiā mì
public key 公钥 gōng yào
private key 私钥 sī yào
2.3

Exam tips

  • Data is sent in packets (a header with the addresses and packet number, a payload, and a trailer). Packets can take different routes and arrive out of order, then are reordered by their packet numbers.
  • Match the transmission types: serial (one bit at a time, good over long distances) vs parallel (several bits at once, short distances); simplex / half-duplex / full-duplex describe the direction.
  • A single parity bit only shows that an error happened; a parity block locates the exact wrong bit — the row and the column that both fail.
  • Learn the error-detection methods and what each does: parity check, checksum, echo check, ARQ, and the check digit (for typed-in numbers).
  • Symmetric encryption uses one shared key; asymmetric uses a public key to encrypt and a private key to decrypt, so no secret key is ever shared.

Log in or create account

IGCSE & A-Level