Carrier Sense Multiple Access (CSMA) is a network access control method used in computer networks to allow multiple devices to share a common communication channel.
In a shared network, several devices may try to transmit data through the same communication medium. If two or more devices transmit data at the same time, their signals may interfere with each other, resulting in a data collision.
To reduce these collisions, CSMA uses a technique called Carrier Sensing. Before sending data, each device listens to the communication channel to check whether another device is already transmitting.
- If the channel is free, the device can transmit data.
- If the channel is busy, the device waits until the channel becomes available.
- If two devices transmit at nearly the same time, a collision may still occur.
CSMA helps improve network performance by reducing unnecessary collisions and making better use of the shared communication channel.Carrier Sense Multiple Access (CSMA) is a contention-based channel access protocol in which a device first senses or listens to the communication medium before transmitting data. If the channel is idle, the device transmits its data. If the channel is busy, the device waits according to a particular access strategy.
CSMA is commonly associated with shared-medium networks and is based on the principle of Listen Before You Transmit.
Need for CSMA
In a computer network, multiple devices often share a single communication channel. When many devices attempt to transmit data simultaneously, collisions can occur.
CSMA is introduced to overcome or reduce this problem.
The main reasons for using CSMA are:
- To reduce collisions: Devices check the channel before transmitting, reducing the possibility of simultaneous transmissions.
- To improve channel utilization: It helps devices use the communication medium more efficiently.
- To control network traffic: Devices follow a specific procedure before accessing the shared channel.
- To improve communication efficiency: It reduces unnecessary retransmissions caused by collisions.
- To support multiple devices: Several devices can share the same communication medium using a common access method.
Working Principle of CSMA (Carrier Sense Multiple Access)
CSMA works on the principle of “Listen Before You Transmit.” Before sending data, a device checks whether the communication channel is free or busy.
The working principle of CSMA involves the following steps:
1. Carrier Sensing
When a device has data to transmit, it first listens to the communication channel to check whether another device is transmitting.
2. Checking Channel Status
After sensing the channel, the device identifies whether it is idle or busy.
- Idle Channel: No device is currently transmitting data.
- Busy Channel: Another device is already transmitting data.
3. Data Transmission
If the channel is idle, the device starts transmitting its data through the communication medium.
4. Waiting for Channel Availability
If the channel is busy, the device waits according to the selected CSMA method and checks the channel again before transmitting.
5. Collision Occurrence
Sometimes, two devices may find the channel idle and start transmitting at nearly the same time. This can cause a collision due to propagation delay.
6. Successful Transmission
If no collision occurs, the data is transmitted successfully to the destination device.
Flowchart of Working Principle

The figure illustrates how multiple computers communicate through a common communication channel using Carrier Sense Multiple Access (CSMA).
In the diagram, three computers are shown: Station A, Station B, and Station C. All three computers are connected to the same shared communication channel.
1. Station A – Sensing the Channel
Station A wants to transmit data to another computer. Before sending the data, it first checks the communication channel to determine whether it is free or busy.
This process is called Carrier Sensing.
- If the channel is free, Station A can transmit data.
- If the channel is busy, Station A must wait.
2. Station B – Receiving Data
Station B is shown as the destination of the data transmitted by Station A.
The green arrow labelled Data (A → B) represents the movement of data from Station A to Station B through the shared communication channel.
When the channel is available, the transmitting station sends data through the communication medium.
3. Station C – Waiting for Channel Availability
Station C is also connected to the same communication channel.
When Station A is transmitting data, Station C senses the channel and finds that it is busy.
Therefore, Station C does not transmit data immediately. It waits until the channel becomes free and checks the channel again before transmitting.
4. Shared Communication Channel
The blue horizontal line represents the shared communication channel or transmission medium.
- All three computers are connected to this common channel.
- Data travels through this medium.
- Only one successful transmission can occupy the shared channel at a time in this simplified example.
- Other stations wait while the channel is busy.
Types of CSMA
Carrier Sense Multiple Access (CSMA) is divided into three main types based on how a device senses the communication channel and decides when to transmit data.
The three types are:
- 1-Persistent CSMA
- Non-Persistent CSMA
- P-Persistent CSMA
1. 1-Persistent CSMA
Definition:
1-Persistent CSMA is a channel access method in which a device continuously senses the communication channel and transmits data immediately when the channel becomes idle.
In this method, the device has a 100% probability of transmitting data whenever it finds the channel free. The term “1-Persistent” indicates that the device continuously tries to access the channel until transmission becomes possible.
Working of 1-Persistent CSMA:
- When a device has data to transmit, it first senses the communication channel.
- If the channel is idle, the device immediately starts transmitting data.
- If the channel is busy, the device continuously monitors the channel.
- As soon as the ongoing transmission is completed and the channel becomes free, the waiting device immediately starts transmitting.
- If two or more devices are waiting for the channel, they may detect the idle channel at almost the same time.
- When these devices transmit simultaneously, a collision may occur.
- If a collision occurs, the affected devices must follow the collision-handling procedure of the underlying protocol before attempting transmission again.
Example of 1-Persistent CSMA :
Suppose three computers, A, B, and C, are connected to a common communication channel. Computer A is transmitting data, while computers B and C also have data to send.
Computers B and C continuously monitor the channel. When computer A finishes transmitting, both B and C may detect that the channel is free and begin transmitting at the same time. This can result in a collision.
Advantages of 1-Persistent CSMA:
- Simple and easy to understand.
- Easy to implement in shared communication networks.
- Provides immediate transmission when the channel becomes idle.
- Reduces unnecessary waiting when the channel is free.
- Suitable for situations where network traffic is low.
Disadvantages of 1-Persistent CSMA:
- Collisions may occur when multiple devices are waiting for the channel.
- Continuous monitoring may increase network contention.
- Performance decreases when network traffic is heavy.
- Repeated collisions may result in retransmission delays.
2. Non-Persistent CSMA
Definition:
Non-Persistent CSMA is a channel access method in which a device does not continuously monitor the communication channel when it is busy. Instead, it waits for a randomly selected period before sensing the channel again.
Unlike 1-Persistent CSMA, this method avoids continuously checking the busy channel. It helps reduce the possibility of multiple devices transmitting simultaneously when the channel becomes free.
Working of Non-Persistent CSMA:
- When a device has data to transmit, it first senses the communication channel.
- If the channel is idle, the device immediately starts transmitting data.
- If the channel is busy, the device does not continue sensing it.
- Instead, it waits for a randomly selected period.
- After the waiting period, the device checks the channel again.
- If the channel is idle, it starts transmitting data.
- If the channel is still busy, it waits for another random period and repeats the process.
- This procedure continues until the channel becomes available for transmission.
Example of Non-Persistent CSMA :
Suppose three computers, A, B, and C, want to transmit data through a shared communication channel. Computer A is already transmitting data, while computers B and C are waiting.
Instead of continuously monitoring the channel, computers B and C wait for random periods. Computer B may wait for a shorter period than computer C. When the channel becomes free, computer B may transmit first, while computer C continues waiting.
This method reduces the possibility of collisions because all waiting devices do not necessarily attempt transmission at the same time.
Advantages of Non-Persistent CSMA :
- Reduces the possibility of collisions compared with 1-Persistent CSMA.
- Avoids continuous monitoring when the channel is busy.
- Reduces unnecessary competition among devices.
- Can perform better under heavy network traffic.
- Provides a more controlled channel access process.
Disadvantages of Non-Persistent CSMA :
- Increases the waiting time before data transmission.
- A device may wait even after the channel becomes free.
- Channel utilization may decrease because devices do not continuously monitor the channel.
- Transmission delays may increase when network traffic is high.
P-Persistent CSMA
Definition:
P-Persistent CSMA is a channel access method generally used in slotted communication channels. In this method, when the communication channel becomes idle, a device transmits data with a probability of P or waits for the next time slot with a probability of (1-P).
It uses a probability-based approach to decide whether a device should transmit immediately or wait for another time slot. This helps control the number of devices attempting to access the communication channel simultaneously.
Working of P-Persistent CSMA:
- When a device has data to transmit, it first senses the communication channel.
- If the channel is busy, the device waits until the channel becomes idle.
- When the channel becomes idle, the device generates a random decision based on the probability P.
- With probability P, the device transmits data in the current time slot.
- With probability (1-P), the device waits for the next time slot.
- In the next time slot, the device again checks the channel and follows the same probability-based procedure.
- If the channel becomes busy, the device waits until it becomes idle again.
- This process continues until the device successfully gets an opportunity to transmit data.
Example P-Persistent CSMA :
Suppose the probability P is 0.5.
When the communication channel becomes idle:
- There is a 50% probability that the device will transmit data immediately.
- There is a 50% probability that the device will wait for the next time slot.
This approach reduces the chances of multiple devices transmitting simultaneously and helps manage network traffic.
Advantages P-Persistent CSMA :
- Reduces the possibility of collisions by controlling transmission attempts.
- Provides a balance between immediate transmission and waiting.
- Helps improve channel utilization.
- Controls the number of devices accessing the channel at the same time.
- Suitable for slotted communication systems.
Disadvantages P-Persistent CSMA :
- More complex than 1-Persistent and Non-Persistent CSMA.
- Requires time-slot synchronization.
- The selection of probability P affects network performance.
- Collisions can still occur if multiple devices decide to transmit in the same time slot.
- Transmission delays may occur when devices choose to wait.
Comparison of Different Types of CSMA
| Basis | 1-Persistent CSMA | Non-Persistent CSMA | P-Persistent CSMA |
|---|---|---|---|
| Transmission | Transmits immediately when the channel is idle. | Transmits after sensing the channel idle. | Transmits based on probability P. |
| If channel is busy | Continuously senses the channel. | Waits for a random period. | Waits until the channel becomes idle. |
| If channel is idle | Transmits immediately. | Transmits immediately. | Transmits with probability P. |
| Collision chances | Higher under heavy traffic. | Comparatively lower. | Depends on probability P. |
| Waiting time | Usually less. | Usually more. | Depends on probability P. |
| Channel type | Shared channel. | Shared channel. | Slotted channel. |
| Complexity | Simple. | Simple. | More complex. |
Advantages of CSMA
- Reduces the possibility of data collisions by sensing the channel before transmission.
- Allows multiple devices to share a common communication channel.
- Improves communication efficiency.
- Reduces unnecessary data retransmissions.
- Makes better use of the available communication medium.
- Simple to understand and implement.
Disadvantages of CSMA
- Collisions can still occur when multiple devices transmit simultaneously.
- Network performance decreases under heavy traffic.
- Devices may experience waiting time before transmission.
- Propagation delay can cause transmission conflicts.
- Retransmission may be required when collisions occur.
- It cannot completely eliminate data collisions.
Applications of CSMA
- Ethernet Networks: Traditional shared Ethernet networks use CSMA/CD for collision detection.
- Wireless LANs: Wi-Fi networks use CSMA/CA to reduce the possibility of collisions.
- Local Area Networks (LANs): Used in shared-medium communication environments.
- Wireless Communication: Helps multiple devices access a shared wireless communication channel.
- Computer Networks: Provides a channel access mechanism for communication between multiple devices.