跳到主要内容

数据传输

IGCSE 计算机科学 · 知识点 2

本主题的视频课程 打开视频页面
10:56

数据传输

你将一张照片发送给地球另一端的朋友。它不会作为一个整体传输。它被切分成数百个小数据包,每个都标有…

英语旁白 · 英中内嵌字幕

2.1

什么是数据传输?

English

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.
词汇 训练
English 中文 拼音
data transmission/ˈdeɪtə trænˈsmɪʃn/ 数据传输 shù jù chuán shū
packets/ˈpækɪts/ 数据包 shù jù bāo
2.1

数据传输的类型与方法

教学大纲
考生应能: 注释与指导
1 (a) 理解数据被分解为数据包进行传输
(b) 描述数据包的结构 • 数据包包含: – 数据包头 – 有效载荷 – 尾部 • 数据包头包括: – 目的地址 – 数据包编号 – 发送方地址
(c) 描述分组交换的过程 • 数据被分解为数据包 • 每个数据包可能采取不同的路由 • 路由器控制数据包的路由 • 数据包可能按乱序到达 • 一旦最后一个数据包到达,数据包将被重新排序
2 (a) 描述使用不同数据传输方法从一台设备向另一台设备传输数据的方式 • 包括: – 串行 – 并行 – 单工 – 半双工 – 全双工
(b) 解释每种数据传输方法在特定场景下的适用性 • 包括每种方法的优点和缺点
3 理解**通用串行总线(USB)**接口并解释其如何用于传输数据 • 包括该接口的优点和缺点

来源:Cambridge International 教学大纲

English

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).
词汇 训练
English 中文 拼音
packet header/ˈpækɪt ˈhedə/ 包头 bāo tóu
payload/ˈpeɪləʊd/ 有效载荷 yǒu xiào zài hè
trailer/ˈtreɪlə/ 尾部 wěi bù
address/əˈdres/ 地址 dì zhǐ
2.1

分组交换

English

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.
探索

数据如何以数据包传播

逐步看分组交换。把一个文件分成有地址的数据包,这就是为什么一个丢失的包只需要重发,以及为什么许多用户能共享同一条线路。

词汇 训练
English 中文 拼音
packet switching/ˈpækɪt ˈswɪtʃɪŋ/ 数据包交换 shù jù bāo jiāo huàn
routers/ˈruːtəz/ 路由器 lù yóu qì
2.1

数据传输方式

English

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 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 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.

词汇 训练
English 中文 拼音
serial/ˈsɪərɪəl/ 串行 chuàn xíng
parallel/ˈpærəlel/ 并行 bìng xíng
simplex/ˈsɪmpleks/ 单工 dān gōng
half-duplex/hɑːf ˈdjuːpleks/ 半双工 bàn shuāng gōng
full-duplex/fʊl ˈdjuːpleks/ 全双工 quán shuāng gōng
2.1

USB

English

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.
词汇 训练
English 中文 拼音
universal serial bus/ˌjuːnɪˈvɜːsl ˈsɪərɪəl bʌs/ 通用串行总线 tōng yòng chuàn xíng zǒng xiàn
interface/ˈɪntəfeɪs/ 接口 jiē kǒu
2.2

差错检测方法

教学大纲
考生应能: 注释与指导
1. 理解数据传输后检查错误的必要性,以及这些错误是如何产生的 • 由于干扰(例如数据丢失、数据增加和数据改变),错误可能发生在数据传输过程中
2. 描述以下每种错误检测方法在传输后检测数据错误所涉及的过程:奇偶校验(奇数和偶数)、校验和及回送校验 • 包括奇偶字节和奇偶块校验
3. 描述如何使用校验位来检测数据输入中的错误,并识别使用校验位的示例,包括国际标准书号(ISBN)和条形码
4. 描述如何使用**自动重传请求(ARQ)**来确认数据无错接收 • 包括以下用途:– 正/负确认 – 超时

来源:Cambridge International 教学大纲

English

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.

词汇 训练
English 中文 拼音
interference/ˌɪntəˈfɪərəns/ 干扰 gān rǎo
2.2

错误检测方法

English

Parity check

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

The byte 0 1011001: the parity bit 0 sits in front of the seven data bits, which hold four 1s, so the count stays 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. 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.

Three sender and receiver timelines for packet 4: (A) the packet passes the check, a positive acknowledgement comes back and the sender stops its timer and sends packet 5; (B) the packet fails the check, a negative acknowledgement comes back and the sender resends packet 4; (C) the packet is lost, no reply comes, the timer runs out and the sender resends packet 4
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).

探索

计算概念实验

根据它们所演示的计算概念对具体示例进行分类。

词汇 训练
English 中文 拼音
parity check/ˈpærɪti tʃek/ 奇偶校验 jī ǒu jiào yàn
parity bit/ˈpærɪti bɪt/ 奇偶校验位 jī ǒu jiào yàn wèi
parity block/ˈpærɪti blɒk/ 奇偶校验块 jī ǒu jiào yàn kuài
parity byte/ˈpærɪti baɪt/ 奇偶校验字节 jī ǒu jiào yàn zì jié
checksum/ˈtʃeksəm/ 校验和 jiào yàn hé
echo check/ˈekəʊ tʃek/ 回送校验 huí sòng jiào yàn
automatic repeat request/ˌɔːtəˈmætɪk rɪˈpiːt rɪˈkwest/ 自动重传请求 zì dòng chóng chuán qǐng qiú
acknowledgements/əkˈnɒlɪdʒmənts/ 确认 què rèn
timeout/ˈtaɪmaʊt/ 超时 chāo shí
check digit/tʃek ˈdɪdʒɪt/ 校验码 jiào yàn mǎ
transposition error/trænspəˈzɪʃn ˈerə/ 换位错误 huàn wèi cuò wù
barcodes/ˈbɑːkəʊdz/ 条形码 tiáo xíng mǎ
2.3

加密

教学大纲
考生应能: 注释与指导
1 理解在数据传输时进行加密的必要性和目的
2 理解如何使用对称加密和非对称加密对数据进行加密 • 非对称加密包括使用公钥和私钥

来源:Cambridge International 教学大纲

English

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 private 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
探索

凯撒密码

移位每个字母以加密消息——密码及其密钥的最基本概念。

词汇 训练
English 中文 拼音
encryption/enˈkrɪpʃn/ 加密 jiā mì
intercepted/ˌɪntəˈseptɪd/ 拦截 lán jié
plaintext/ˈpleɪntekst/ 明文 míng wén
ciphertext/ˈsaɪfətekst/ 密文 mì wén
symmetric encryption/sɪˈmetrɪk enˈkrɪpʃn/ 对称加密 duì chèn jiā mì
key/kiː/ 密钥 mì yào
asymmetric encryption/ˌeɪsɪˈmetrɪk enˈkrɪpʃn/ 非对称加密 fēi duì chèn jiā mì
public key/ˈpʌblɪk kiː/ 公钥 gōng yào
private key/ˈpraɪvət kiː/ 私钥 sī yào
2.3

考试技巧

English
  • 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.

该知识点的互动课程

逐步完成,配合即时检查练习。

历年真题

更多 IGCSE 计算机科学 知识点

登录或创建账户

IGCSE, A-Level & AP