# Carrier-Sense Multiple Access
**A collision avoidance [[channel access method]] in which a device checks if the transmission link is in use before transmitting.**
**Carrier-sense multiple access** or **CSMA** is a *collision avoidance* [[channel access method]] in which a device verifies that a shared transmission link is not in use before transmitting. If a device detects that the transmission link is busy, it will *defer transmission* until later.
CSMA can be characterised by the *transmission algorithm* used, which determines when transmission is reattempted after deferring as well as how a collision is dealt with. CSMA has also been modified with additional collision avoidance and collision detection techniques in the variants CSMA/CA and CSMA/CD.
## Transmission algorithms
### 1-persistent
In **1-persistent CSMA**, a device which deferred transmission will *persistently check* if the transmission link becomes idle. If the link becomes idle, then the device will retransmit *unconditionally*, that is, with a probability of one.
If a collision occurs, the device attempts the process again after a *random period* of time.
1-persistent CSMA was used with CSMA/CD in Ethernet.
### Non-persistent
In **non-persistent CSMA**, a device which deferred transmission will simply try to retransmit after a *random period* of time and does not check during this time whether the transmission link becomes idle.
### P-persistent
In **P-persistent CSMA**, a device which deferred transmission will also *persistently check* if the transmission link becomes idle. If the link becomes idle, the device will retransmit with a set probability $p$.
If the device did not retransmit, then it waits for a *random period* of time before attempting the procedure again.
P-persistent CSMA is currently in use with CSMA/CA in Wi-Fi.
## Modifications
#### Carrier-sense multiple access with collision avoidance
**Carrier-sense multiple access with collision avoidance** or **CSMA/CA** is a modification of CSMA in which devices defer transmissions for a *random period* of time instead of until the transmission link is idle.
Randomly deferring transmissions lowers the chance that multiple devices which deferred transmissions transmit simultaneously after the transmission link becomes idle.
CSMA/CA is currently used in Wi-Fi as well as other wireless protocols, as the collision detection in CSMA/CD is not possible in wireless transmitters which disable their receivers during transmission.
#### Carrier-sense multiple access with collision detection
**Carrier-sense multiple access with collision detection** or **CSMA/CD** is a modification of CSMA in which devices *listen for collisions*, immediately stopping transmission if one is detected.
A jam signal is transmitted to all devices to inform then of a collision, and all transmissions are reattempted after a *random exponential backoff* period.
CSMA/CD was used in Ethernet but became obsolete with the introduction of network switches.