← Back to Hub ← 返回主页

Week 8: Data Communications Fundamentals (Part 2) 第 8 周:数据通信基础(第二部分)

Core Concepts 核心概念

1. Asynchronous vs. Synchronous Transmissions (5.3)

  • Asynchronous: Data is sent character-by-character. Start (0) and stop (1) framing bits synchronize the receiver for each character. Simple and cheap, but incurs 20% or more overhead.
  • Synchronous: Data is sent in continuous blocks (frames). Clock synchronization is embedded in the line signal or provided on a separate clock line. Highly efficient for large data transfers.

2. Error Detection Methods (5.4)

  • Parity Check: Appends a single bit to ensure total count of 1-bits is even (Even Parity) or odd (Odd Parity). Simple, but fails to detect double bit errors.
  • Cyclic Redundancy Check (CRC): Sender divides the binary frame by a predetermined generator polynomial. The remainder is appended as the Checksum (FCS). The receiver divides the frame by the same polynomial; if the remainder is non-zero, an error occurred. Highly reliable.

1. 异步与同步传输 (5.3)

  • 异步传输 (Asynchronous):数据按字符逐个发送。通过起始位 (0) 和停止位 (1) 在每个字符传输时进行同步。简单且便宜,但会产生 20% 或更多的控制开销。
  • 同步传输 (Synchronous):数据以连续块(帧)的形式发送。时钟同步信息直接嵌入在传输信号编码中,或通过专门的时钟线路提供。对于大数据量传输非常高效。

2. 差错检测方法 (5.4)

  • 奇偶校验 (Parity Check):附加一个比特,确保 1 的总数为偶数(偶校验)或奇数(奇校验)。简单但无法检测到偶数个比特同时翻转的错码。
  • 循环冗余校验 (CRC):发送方将二进制帧除以预先确定的生成除数多项式。余数被作为帧校验序列 (FCS) 附加。接收方将整帧除以相同的多项式,如果余数不为零,则发生差错。高度可靠,在局域网等物理链路层被广泛使用。

Concept Visualization: Cyclic Redundancy Check (CRC) Validation 概念可视化:循环冗余校验 (CRC) 验证

This diagram shows how a sender appends a CRC remainder (FCS) to the data packet. The packet travels over the wire where it is validated at the receiver using polynomial division.

此图显示了发送方如何将 CRC 余数 (FCS) 附加到数据包中。数据包通过导线传输,并在接收端使用多项式除法进行验证。

Sender Data + CRC Receiver Check FCS Link Medium

Tips 提示

  • Odd vs Even Parity: In even parity, if the data is 1010000 (two 1-bits), the parity bit is 0. If the data is 1011000 (three 1-bits), the parity bit must be 1 to make the total count of 1-bits even (four).
  • CRC Polynomial Division: CRC arithmetic uses modulo-2 division, which is mathematically implemented using XOR operations instead of standard subtraction.
  • 奇偶校验:在偶校验中,如果数据是 1010000(两个 1),则校验位为 0。如果数据是 1011000(三个 1),则校验位必须为 1,使 1 的总数变为偶数(四个)。
  • CRC 多项式除法:CRC 算术使用模 2 除法,它在数学上使用异或 (XOR) 操作而不是标准的减法来实现。

Practical Exercises & Step-by-Step Guide 实践练习与分步指南

Exercise 1: Modulo-2 CRC Calculation Step-by-Step 练习 1:模 2 CRC 分步计算过程

Steps to calculate:

  1. Determine the divisor length: Generator divisor polynomial is 1101 (4 bits). Thus, the Frame Check Sequence (FCS) will be 3 bits (divisor length - 1).
  2. Pad three zeros to the end of the data payload: Data 101000 becomes 101000000.
  3. Perform modulo-2 division (using XOR operations where same bits yield 0 and different bits yield 1).
  4. Write down the remainder (3 bits). This remainder is the FCS.
  5. Append the FCS to the original data payload to create the final transmitted frame.

计算步骤:

  1. 确定校验位长度:生成除数多项式为 1101(4位)。因此,帧校验序列 (FCS) 长度为 3位(除数长度 - 1)。
  2. 在数据有效载荷末尾填充三个零:数据 101000 变为 101000000。
  3. 执行模 2 除法(利用 XOR 异或运算:相同比特结果为 0,不同比特结果为 1)。
  4. 得出最终的余数(3位)。该余数即为 FCS 校验和。
  5. 将 FCS 校验和附加在原始数据末尾,即为最终发送的数据帧。

Exercise 2: Analyzing Port CRC Errors in Cisco IOS 练习 2:分析 Cisco IOS 端口中的 CRC 错误

Steps to complete:

  1. In Packet Tracer, double click the switch and open the CLI.
  2. Type enable to enter privileged mode.
  3. Run the command show interface fastEthernet 0/1.
  4. Inspect the output lines. Look for the "input errors" counter and the "CRC" count.
  5. If the CRC count is high, check: cable length (must be < 100m), physical interface pin conditions, or speed/duplex mismatch between the switch and the connected client PC.

完成步骤:

  1. 在 Packet Tracer 中,双击交换机并打开 CLI。
  2. 输入 enable 进入特权模式。
  3. 运行命令 show interface fastEthernet 0/1。
  4. 检查输出行。查找 "input errors"(输入错误)计数器和 "CRC" 计数。
  5. 如果 CRC 错误计数很高,排查:电缆长度(必须小于 100 米)、物理接口引脚状况,或交换机与连接的 PC 之间的速度/双工不匹配。

Self-Check Practice Questions 自测练习题

1. Explain synchronous transmission characteristics. 解释同步传输的特征。

2. Describe asynchronous transmission characteristics. 描述异步传输的特征。

3. Explain parity check error detection limitations. 解释奇偶校验的检错局限性。

4. Identify the mathematical operation used in CRC error checking. 识别 CRC 差错检验中所使用的数学运算。

5. Describe a disadvantage of the simple parity check method. 描述简单奇偶校验方法的一个缺点。

6. Explain the error detection capability of CRC check. 解释 CRC 校验的差错检测能力。

7. What does the FCS represent in a Cyclic Redundancy Check? 在循环冗余校验 (CRC) 中,FCS 代表什么?

8. If a switch port registers high CRC errors, what is the most likely cause? 如果交换机端口显示高 CRC 错误,最可能的原因是什么?

Vocabulary Matching Game 词汇配对游戏

Match the transmission concept on the left with its definition on the right. (Click a term, then click its matching definition). 将左侧的传输概念与右侧的定义进行配对。(点击术语,然后点击匹配的定义)。

Even Parity
CRC Checksum
Start/Stop Bits
Synchronous Frame
XOR Operator
Modulo-2 division remainder appended to the frame for error checking 用于检错而附加到数据帧末尾的模 2 除法余数
Large block of data sent with embedded clock synchronization 带有嵌入式时钟同步信息、整块进行传输的数据帧
Appends a single bit to ensure the total count of binary 1s is even 添加单个校验位以使二进制数据中 1 的总数变为偶数
Logical operation used in modulo-2 division where different bits yield 1 模 2 除法中使用的逻辑运算,其中相异比特结果为 1
Control framing elements used in asynchronous character-level links 在异步字符级传输链路中用于定位边沿的控制帧边界位