CampusLearn
← CSC 216 Data Communication and Computer Networks

Data Link Layer, Framing, and Error Detection

Notes

Role of the Data Link Layer The data link layer is responsible for node-to-node frame delivery across a common local link. While the physical layer simply shifts raw bits across a medium, the data link layer provides structural organization, flow control, error detection, and media access control to ensure these bits are converted into meaningful frames. Framing and Flow Control Framing involves encapsulating network-layer packets into discrete data frames. Frame delimitations use byte stuffing or bit stuffing so the receiver can locate the exact start and end of a frame. Flow control manages the rate of data transmission between communicating entities so a fast sender does not overwhelm a slow receiver. Common strategies include Stop-and-Wait and Sliding Window protocols. Error Detection Mechanisms Because physical media introduce bit-flip errors, the data link layer incorporates error-detection codes into the frame trailer. The simplest method is the parity bit, which detects single-bit errors but misses even-numbered bit flips. Checksums sum segmented bit blocks using one's complement arithmetic. The most powerful widely used method is the Cyclic Redundancy Check (CRC). In CRC, a sequence of redundant check bits is appended to the payload. These bits are computed by treating the frame bitstream as a polynomial and dividing it by a predetermined generator polynomial using modulo-2 arithmetic. If the received frame divided by the generator polynomial yields a non-zero remainder, the frame is corrupted and discarded. Practical example Consider an automated Safaricom M-Pesa agent terminal in Kisumu connected via an Ethernet switch to an optical network terminal. When the agent submits a cash float deposit, an Ethernet frame is constructed. The frame contains a 6-byte source MAC address, a 6-byte destination MAC address, the IP payload, and a 4-byte CRC-32 Frame Check Sequence (FCS) trailer calculated using the standard IEEE 802.3 generator polynomial. If electrical noise caused by an industrial refrigeration unit nearby induces a bit flip on the copper patch cord, the receiver at the local switch recalculates the CRC remainder. Because the remainder is non-zero, the switch immediately drops the malformed frame instead of forwarding bad accounting data to the Safaricom core financial database in Nairobi, prompting the transport layer to initiate a clean retransmission.

Quiz

1. What is the primary action taken by an Ethernet switch when a received frame fails the Cyclic Redundancy Check?

2. What technique is used in bit-oriented framing to prevent a flag sequence pattern from accidentally appearing in the user data field?

3. Which mathematical operation forms the basis of Cyclic Redundancy Check calculations?

Sign in to submit and securely grade your quiz.