Carrier sense multiple access
Carrier sense multiple access (CSMA) is a probabilistic media access control (MAC) protocol in which a node verifies the absence of other traffic before transmitting on a shared transmission medium, such as an electrical bus, or a band of the electromagnetic spectrum.
Carrier sense means that a transmitter uses feedback from a receiver to determine whether another transmission is in progress before initiating a transmission. That is, it tries to detect the presence of a carrier wave from another station before attempting to transmit. If a carrier is sensed, the station waits for the transmission in progress to finish before initiating its own transmission. In other words, CSMA is based on the principle "sense before transmit" or "listen before talk".
Multiple access means that multiple stations send and receive on the medium. Transmissions by one node are generally received by all other stations connected to the medium.
CSMA with collision detection
CSMA/CD is used to improve CSMA performance by terminating transmission as soon as a collision is detected, thus shortening the time required before a retry can be attempted.
CSMA with collision avoidance
In CSMA/CA collision avoidance is used to improve the performance of CSMA by attempting to be less "greedy" on the channel. If the channel is sensed busy before transmission then the transmission is deferred for a "random" interval. This reduces the probability of collisions on the channel.
Virtual time CSMA
VTCSMA is designed to avoid collision generated by nodes transmitting signals simultaneously, used mostly in Hard Real-Time systems. The VTCSMA uses two clocks at every node, a virtual clock (vc) and a real clock (rc) which tells "real time". When the channel is sensed to be busy, the vc freezes, when channel is free, it is reset. Hence, calculating vc runs faster than rc when channel is free, and vc is not initiated when channel is busy.
CSMA access modes
- When the sender (station) is ready to transmit data, it checks if the transmission medium is busy. If so, it then senses the medium continually until it becomes idle, and then it transmits the message (a frame). In case of a collision, the sender waits for a random period of time and attempts to transmit again. 1-persistent CSMA is used in CSMA/CD systems including Ethernet.
- This is a sort of trade-off between 1 and non-persistent CSMA access modes. When the sender is ready to send data, it checks continually if the medium is busy. If the medium becomes idle, the sender transmits a frame with a probability p. If the station chooses not to transmit (the probability of this event is 1-p), the sender waits until the next available time slot and transmits again with the same probability p. This process repeats until the frame is sent or some other sender starts transmitting. In the latter case the sender monitors the channel, and when idle, transmits with a probability p, and so on. p-persistent CSMA is used in CSMA/CA systems including Wi-Fi and other packet radio systems.
- Non persistent CSMA is less aggressive compared to P persistent protocol. In this protocol, before sending the data, the station senses the channel and if the channel is idle it starts transmitting the data. But if the channel is busy, the station does not continuously sense it but instead of that it waits for random amount of time and repeats the algorithm. Here the algorithm leads to better channel utilization but also results in longer delay compared to 1 –persistent.
- Each station is assigned a transmission order by a supervisor station. When medium goes idle, stations wait for their time slot in accordance with their assigned transmission order. The station assigned to transmit first transmits immediately. The station assigned to transmit second waits one time slot (but by that time the first station has already started transmitting). Stations monitor the medium for transmissions from other stations and update their assigned order with each detected transmission (i.e. they move one position closer to the front of the queue). O-persistent CSMA is used by CobraNet, LonWorks and the controller area network.
- Andrew S. Tanenbaum, Computer Networks. Prentice Hall, Upper Saddle River, NJ (2003). 892 pp. ISBN 0-13-066102-3