Sitemap

How Networks Catch Errors and Share a Connection

6 min readOct 18, 2026

--

A practical look at parity, checksums, CRC, ALOHA and CSMA

UNIT 5: Link Layer | Computer Network

Why the data link layer matters

Reliable networking depends on two things: data must arrive without unnoticed corruption, and devices sharing a connection need a way to take turns transmitting. The data link layer helps with both. It detects transmission errors and manages access to a shared communication medium, making it an important part of everyday networks.

In the OSI model, the data link layer sits at Layer 2. It wraps network-layer packets into frames for the next link in their journey. Logical Link Control (LLC) supports functions such as flow and error control, while Media Access Control (MAC) manages access to the medium. The physical layer transmits bits as electrical, optical, or radio signals.

Press enter or click to view image in full size
The data link layer connects network-layer packets with the physical transmission of bits.

When bits go wrong

Data does not always arrive exactly as it was sent. Electrical noise, radio interference, or a weak connection can flip one bit, affect several bits, or damage a run of consecutive bits. These are called single-bit, multiple-bit, and burst errors.

Think of a frame as a parcel with a checking label attached: the extra bits do not stop damage, but they help the receiver notice when something may have gone wrong. If a check fails, the frame can be discarded and sent again.

Four ways to catch errors

Simple parity

Parity is the simplest of the four methods. With even parity, the sender adds one bit to make the total number of 1s even. Take 101010: it contains three 1s, so the parity bit is 1 and the transmitted sequence becomes 1010101. It is quick and cheap, but has a blind spot: if two bits flip, the total may still look correct. It is a little like checking that a group has an even number of people; that check alone cannot tell you whether two people have swapped places.

Two-dimensional parity

Two-dimensional parity arranges bits in rows and columns. If one bit changes, one row check and one column check fail, allowing the receiver to locate and correct it. However, four flipped bits at the corners of a rectangle can escape detection.

Checksum

A checksum adds equal-sized data words using one’s-complement arithmetic, wraps any carry around, and complements the result. For example, the four 8-bit words produces a folded sum of 00100101 and checksum 11011010. At the receiver, the data and checksum should add to all 1s, complementing on which gives zero. Some error patterns can still produce a matching checksum.

Press enter or click to view image in full size

CRC: a stronger check

CRC (Cyclic Redundancy Check) uses binary division instead of addition. The sender adds temporary zeros to the data, divides by an agreed binary generator, and uses the remainder as the CRC bits. For example, data 1010000 divided using generator 1001 (x³ + 1) gives remainder 011, so the transmitted codeword is 1010000011. The receiver repeats the division. A zero remainder means the check passed, although no method catches every possible error. CRC is widely used because suitable generators detect many common error patterns [1, 2]. Think of it as a carefully calculated check value attached to a frame, rather than a simple count of the bits.

Press enter or click to view image in full size
CRC calculates a remainder at the sender and checks the received frame using the same generator.

When everyone wants to transmit

Now consider the other problem: what happens when several devices want to transmit at once? Without rules, their signals can collide and waste channel time. Multiple access protocols, managed by the MAC sublayer, help coordinate transmission. They fall into three broad groups: random access, controlled access, and channelization. Controlled access includes reservation, polling, and token passing, while channelization separates traffic by frequency (FDMA), time (TDMA), or code (CDMA).

Press enter or click to view image in full size
The three families of multiple access protocols and examples of each.

ALOHA: send first, retry later

ALOHA follows a simple idea: send the frame and see whether it gets through. In pure ALOHA, a station waits for an acknowledgement and retries after a random back-off if none arrives. Another frame can overlap the start or end of a transmission, so the vulnerable period is two frame times. Slotted ALOHA allows transmissions only at slot boundaries, cutting that period to one frame time.

CSMA: listen before sending

CSMA (Carrier Sense Multiple Access) adds a useful step: listen before sending. If the channel seems idle, the station transmits, if it is busy, the station waits according to the protocol’s persistence rule.

Get Adityadev Sinha’s stories in your inbox

Join Medium for free to get updates from this writer.

So why can collisions still happen? Signals take time to travel. Two stations may both hear silence and begin transmitting before either one hears the other. It is similar to two people starting to speak because neither has heard the other begin, except that in a network the delay comes from signal propagation.

That leads to two related protocols. CSMA/CD stands for collision detection: in traditional shared, half-duplex Ethernet, a station monitors the medium while sending, stops if it detects a collision, and retries after a random back-off. CSMA/CA stands for collision avoidance. Wireless devices cannot reliably listen for a collision while transmitting, so they use channel sensing and coordination to lower the chance of one. In a busy classroom Wi-Fi network, several phones and laptops may have data ready at once. They listen and use waiting and acknowledgement mechanisms to reduce interference. Modern switched full-duplex Ethernet does not use CSMA/CD [3].

Press enter or click to view image in full size
In traditional shared, half-duplex Ethernet, CSMA/CD detects collisions and retries after a random back-off.

From ALOHAnet to cable internet

ALOHAnet, developed at the University of Hawaii, began operating in June 1971 to connect terminals across the islands using packet radio [4]. Its random-access approach influenced later thinking about shared networks. In a 1976 paper, Robert Metcalfe and David Boggs described Ethernet, which also needed a way for stations to share a medium [5]. Ethernet frames include a Frame Check Sequence (FCS), a 32-bit CRC, to detect corruption [3]. This illustrates the two themes together: getting frames onto a link and checking that they arrived intact.

Cable broadband offers another practical example. DOCSIS lets internet service run over hybrid fibre-coaxial networks originally built for cable television. CableLabs lists DOCSIS 4.0 specification capacities of up to 10 Gbps downstream and 6 Gbps upstream, although actual customer speeds depend on how the network is deployed [6].

The main takeaways

  • The data link layer wraps network-layer packets into frames and helps manage communication over one link.
  • Parity is simple, two-dimensional parity can locate a single-bit error, checksums use addition, and CRC uses binary division.
  • Error detection helps identify corruption, but it is not the same as correcting every error.
  • ALOHA transmits and retries; CSMA listens before transmitting. CSMA/CD detects collisions on traditional shared Ethernet, while CSMA/CA reduces collision risk on wireless networks.
  • ALOHAnet, Ethernet, and DOCSIS show how channel sharing and error checks support real communication systems.

Sources and further reading

  1. IEEE Technology Navigator, “Cyclic Redundancy Check.”
  2. Cisco, “What Is Ethernet?”
  3. Cisco, documentation on Ethernet frame formats and the Frame Check Sequence (FCS).
  4. University of Hawaiʻi at Mānoa, “AlohaNet.”
  5. R. M. Metcalfe and D. R. Boggs, “Ethernet: Distributed Packet Switching for Local Computer Networks,” Communications of the ACM, vol. 19, no. 7, pp. 395–404, 1976. https://doi.org/10.1145/360248.360253
  6. CableLabs, “DOCSIS 4.0 Technology.”

--

--

Adityadev Sinha
Adityadev Sinha

Written by Adityadev Sinha

0 followers

3rd year @Symbiois Institute of Technology, Pune