Carrier sense multiple access (CSMA) is a random access protocol for multiple access channels. The core idea is that you: listen before transmitting.
- If the channel is sensed idle, then you transmit the entire frame.
- If the channel is sensed busy, then you defer transmission.
- 1-persistent — keep sensing until the channel becomes idle, then transmit.
- -persistent — wait until the channel becomes idle, then transmit with probability and wait another timeslot with probability .
- Non-persistent — relinquish the channel, wait a random time, then sense the channel again. In this sense, like
sleeping and then checking again.
Collisions can still occur with carrier sensing. The inherent propagation delay means two nodes may not hear each others’ just-started transmissions.
CSMA/CD is CSMA with collision detection. Collisions are detected within a short time, and any colliding transmissions are aborted as soon as collision is detected to reduce channel wastage. Collision detection is easy in wired systems but difficult with wireless.
- In wired, you can measure signal strengths, compare transmitted and received signals. i.e., you can transmit and sense at the same time.
- With wireless LANs, the received signal strength is overwhelmed by local transmission strength, so CSMA/CD cannot be used in wireless LAN.
Ethernet uses CSMA/CD. See that page for the algorithm they use.
Analysis
The efficiency of CSMA/CD is given by:
The efficiency approaches 1 as goes to 0 and as goes to infinity. The implication? Much better performance than ALOHA, and it’s simple, cheap, and decentralised!