Medium Access Control and CSMA

1
0

Introduction

When multiple devices share the same cable or wireless channel, they cannot all transmit whenever they want. If two devices send data at the same time, their signals can interfere with each other and the transmission may fail. This is the basic shared-medium problem in networking.

Medium access control solves this problem by defining rules for who gets to use the medium and when. One of the most important families of such rules is CSMA, which is widely discussed in Ethernet and wireless networking.

What Medium Access Means

A communication medium is the path through which data travels. In networking, that medium may be a copper cable, a wireless channel, or another shared transmission path. If only one device uses it, there is no conflict. But if many devices share it, transmission must be controlled.

This is where medium access control, or MAC, becomes important. It decides how devices take turns, how they check whether the channel is free, and how they respond when multiple devices try to send data together.

Medium access control helps with:

  • Collision reduction: Limits signal overlap on a shared medium.

  • Fair access: Gives multiple devices a way to share the channel.

  • Efficiency: Reduces wasted time caused by repeated retransmissions.

  • Orderly communication: Makes shared-network behavior more predictable.

What CSMA Is

CSMA stands for Carrier Sense Multiple Access. It is a medium access method in which a device first listens to the communication medium before transmitting.

The idea is simple. If the channel is already busy, the device waits. If the channel appears free, the device starts sending data. This improves efficiency compared with blind transmission because devices do not send immediately into a busy channel.

The name itself explains the idea:

  • Carrier Sense: The device listens to the medium before sending.

  • Multiple Access: Many devices share the same communication channel.

Even with this rule, collisions can still happen. Two devices may both find the medium idle at nearly the same moment and begin transmitting together. That is why CSMA has different variants for handling collisions.

How a Collision Happens

Suppose Device A and Device B are connected to the same shared medium.

The flow may look like this:

  • Step 1: Both devices listen and find the medium idle.

  • Step 2: Both devices begin transmission at nearly the same time.

  • Step 3: Their signals overlap on the medium.

  • Step 4: A collision occurs and the data becomes corrupted.

This is the main reason medium access control is needed in shared networks. If collisions happen repeatedly, devices waste time retrying instead of carrying useful traffic.

Collisions can lead to:

  • Corrupted frames: The transmitted data cannot be used.

  • Retransmissions: Devices must send the same data again.

  • Extra delay: Useful communication takes longer.

  • Reduced efficiency: More bandwidth is consumed by failed attempts.

CSMA/CD

CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection. It was mainly used in older shared Ethernet environments, especially hub-based networks and half-duplex communication.

In CSMA/CD, a device first listens before transmitting. But if a collision still happens, the device detects that collision while it is transmitting.

Diagram explaining CSMA/CD in shared Ethernet networks, where devices sense the channel, transmit data, detect collisions while sending, stop transmission, wait for a random backoff period, and retry after the collision is resolved.

Diagram explaining CSMA/CD in shared Ethernet networks, where devices sense the channel, transmit data, detect collisions while sending, stop transmission, wait for a random backoff period, and retry after the collision is resolved.

How CSMA/CD Works

A device using CSMA/CD follows these steps:

  • Carrier sensing: It checks whether the medium is busy or idle.

  • Transmission: If the medium is idle, it starts sending data.

  • Collision detection: While transmitting, it monitors the medium for signs of a collision.

  • Stop transmission: If a collision is detected, it stops immediately.

  • Backoff: It waits for a random amount of time.

  • Retry: It attempts transmission again later.

This approach was practical in shared Ethernet because wired devices could monitor the medium while transmitting and detect a collision.

Why Random Backoff Is Necessary

If two devices collide and both retry at exactly the same time, they are likely to collide again. To reduce this, each device waits for a different random period before retrying.

For example:

  • Device A: Waits 10 units.

  • Device B: Waits 15 units.

Because their retry times are different, the chance of repeated collision becomes much lower. This random waiting period is called backoff and it is a key part of CSMA/CD.

CSMA/CA

CSMA/CA stands for Carrier Sense Multiple Access with Collision Avoidance. It is mainly associated with Wi-Fi and other wireless networks.

Instead of detecting collisions after they happen, CSMA/CA tries to reduce the probability of collisions before transmission begins.

Diagram illustrating CSMA/CA in wireless networks, where devices sense the channel, wait if busy, perform random backoff, transmit data when the channel is free, receive an acknowledgment (ACK), and retry if no ACK is received to avoid collisions.

Diagram illustrating CSMA/CA in wireless networks, where devices sense the channel, wait if busy, perform random backoff, transmit data when the channel is free, receive an acknowledgment (ACK), and retry if no ACK is received to avoid collisions.

How CSMA/CA Works

A device using CSMA/CA does not transmit immediately just because the channel becomes free. It first waits for a random backoff period. If the medium stays free during that time, the device transmits. If another device starts transmitting first, it waits again.

The process usually looks like this:

  • Carrier sensing: The device checks whether the channel is busy.

  • Deferral: If the channel is busy, it waits.

  • Random backoff: Even after the medium becomes free, it waits for a random period.

  • Transmission: It sends data only if the channel remains free.

  • Acknowledgement: The receiver sends an ACK if the transmission succeeds.

  • Retry if needed: If no ACK arrives, the sender assumes failure and tries again later.

This makes CSMA/CA more preventive than CSMA/CD.

Why Wi-Fi Uses Collision Avoidance

Wireless devices cannot reliably detect collisions during transmission in the same way old wired Ethernet devices could. A transmitting wireless device sends a strong signal of its own, which makes real-time collision detection difficult.

Because of that, Wi-Fi uses collision avoidance. The goal is to lower the chance of collision before transmission rather than detect it during transmission.

This is why CSMA/CA is a better fit for wireless networks, while CSMA/CD belonged to older shared Ethernet designs.

CSMA/CD vs CSMA/CA

Aspect

CSMA/CD

CSMA/CA

Full form

Carrier Sense Multiple Access with Collision Detection

Carrier Sense Multiple Access with Collision Avoidance

Main idea

Detect collision after transmission starts

Avoid collision before transmission starts

Typical use

Older shared Ethernet, hubs, half-duplex links

Wi-Fi and wireless networks

Collision handling

Stop transmission after collision is detected

Wait and reduce the chance of collision before sending

Retry behavior

Random backoff after collision

Random backoff before transmission and retry on failure

Acknowledgement role

Not the main focus

Important for confirming successful transmission

The practical difference is simple:

  • CSMA/CD: Send first, detect collision later.

  • CSMA/CA: Try to avoid collision before sending.

Summary

Medium access control is the set of rules that controls how multiple devices share the same communication medium. It exists to reduce collisions, improve fairness, and make shared communication more efficient.

CSMA is one of the most important MAC methods because it requires a device to sense the channel before transmitting. Its two well-known variants are CSMA/CD, which detects collisions after they happen in older shared Ethernet, and CSMA/CA, which tries to avoid collisions before transmission in wireless networks. Understanding these ideas makes it much easier to understand shared-medium communication, Ethernet history, and Wi-Fi behavior.

CS Core

Read Similar Blogs

Comments0