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.
An Ethernet cable with an RJ45 plug, often used to carry data on a wired networkA 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.
bits can arrive at slightly different times over long wires
Serial sends one bit after another along a data path. Parallel sends several bits at the same time along separate data paths. With otherwise comparable timing, this can transfer more bits per clock cycle, but parallel transmission is not always faster than a modern serial link.
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.
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.
A parity check 奇偶校验 adds one extra bit, the parity bit 奇偶校验位, to each byte. There are two types:
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.
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. With the stated single-bit-error assumption, the failed row and column locate the bit, so the receiver can correct it. Multiple-bit errors may escape detection or give an ambiguous result.
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 syllabus calls this automatic repeat query; automatic repeat request is another name for the same method. The sender starts a timeout 超时 timer when it sends a packet. The receiver uses an error check on the received packet. If the check passes, it sends a positive acknowledgement. If an error is detected, it sends a negative acknowledgement.
ARQ: a positive acknowledgement moves on; a negative acknowledgement or a timeout makes the sender resend
Try it — packet 4. In three separate cases, packet 4 (A) passes the receiver's error check, (B) fails the check, or (C) never arrives. For each case, choose the receiver's response and the sender's next action.
Worked trace.
Case
Receiver
Sender
A
Sends a positive reply
Receives it; stops timer; can send next packet
B
Sends a negative reply
Receives it; resends packet 4; restarts timer
C
Has no packet to check
Timeout; resends packet 4; restarts timer
A negative reply can cause a repeat before the timer expires. If no positive acknowledgement arrives before timeout, the sender repeats the transmission. The timer handles silence, including a lost packet or a lost reply.
Transfer — a lost reply. Packet 4 arrives and passes its check. The receiver sends a positive acknowledgement, but this reply is lost. What does the sender do when its timer expires? Does timeout prove that packet 4 was damaged?
Answer. The sender resends packet 4 and restarts its timer. The receiver knows the packet arrived successfully, but the sender has no confirmation. Timeout does not tell the sender whether the packet or the reply was lost or delayed. ARQ requests another transmission; it does not itself repair damaged bits. It uses an error check to decide whether to accept a received packet.
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. Depending on the method, it can detect some of these errors; no check digit guarantees that every entry error is found:
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).
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 private key never has to be shared. This is safer than sharing one secret key.
Symmetric uses one shared key; asymmetric uses a public key to encrypt and a private key to decrypt
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 parity bit detects an odd number of flipped bits. A parity block locates the wrong bit when exactly one bit has flipped — the failed row and column cross there.
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.