A short note on CSMA
Definition: Carrier Sense Multiple Access (CSMA) is a network protocol that listens to or senses network signals on the carrier/medium before transmitting any data. CSMA is implemented in Ethernet networks with more than one computer or network device attached to it. CSMA is part of the Media Access Control (MAC) protocol.
Explanation: Short forĀ CarrierĀ SenseĀ MultipleĀ Access /Ā CollisionĀ Detection,Ā a set of rules determining howĀ
networkĀ
devicesĀ respond when two devices attempt to use aĀ
data channelĀ simultaneously (called aĀ collision). StandardĀ
EthernetĀ networks use CSMA/CD to physically monitor the traffic on the line at participating stations. If no transmission is taking place at the time, the particular station can transmit. If two stations attempt to transmit simultaneously, this causes a collision, which is detected by all participating stations. After a random time interval, the stations that collided attempt to transmit again. If another collision occurs, the time intervals from which the random waiting time is selected are increased step by step. This is known as exponential back off.
CSMA works on the principle that only one device can transmit signals on the network, otherwise a collision will occur resulting in the loss of data packets or frames. CSMA works when a device needs to initiate or transfer data over the network. Before transferring, each CSMA must check or listen to the network for any other transmissions that may be in progress. If it senses a transmission, the device will wait for it to end. Once the transmission is completed, the waiting device can transmit its data/signals. However, if multiple devices access it simultaneously and a collision occurs, they both have to wait for a specific time before reinitiating the transmission process.
CSMA/CD is a type ofĀ
contentionĀ protocol.Ā Networks using the CSMA/CD procedure are simple to implement but do not have deterministic transmission characteristics. The CSMA/CD method is internationally standardized inĀ
IEEEĀ 802.3 and ISO 8802.3.
How it works: CSMA/CD is divided into several steps. The procedure is based on a normalĀ
group conversation: for good communication, it is important that the participants donāt all speak at once, which can be confusing. Instead, they should speak one after the other, so that each participant can fully understand what the others are contributing to the discussion. Without realizing, we actually behave like these ourselves in conversations: When someone else is talking, we stand back and listen.
After the other participant has finished their contribution for the time being, we wait a short time and only start talking when the same participant or another participant in the conversation doesnāt start to say anything else. If weĀ
happen to start talking to someone else at the same time, we stop our attempt, wait a bit, and then try again.
The CSMA/CD process is very similar. First, the station monitors the transmission medium. As long as this is occupied, the monitoring will continue.Ā
Only when the medium is freeĀ and for a certain time (in interface spacing), will the station send a data packet. Meanwhile, the transmitter continues to monitor the transmission medium to see if it detects any data collisions. If no other participant tries to send its data via the medium by the end of transmission, and no collision occurs, the transmission has been a success.
If, however, a collision is detected, the participant immediately interrupts the transmission and instead sends an interference signal (JAM signal) so that all other stations can also detect the collision. Now the participant waits for a random amount of time (backoff) before trying the transmission again. TheĀ
backoffĀ must be random so that the next collision doesnāt occur straight away. Since both stations select a random value, the probability that both of them will start a transport attempt at the same time is quite low.
The transmission attempts are counted. If the following attempts also fail and theĀ
maximum number of attempts (16)Ā is reached, the station reports the error to the next higher network layer and then terminates the transmission permanently. Since it is highly unlikely that a network participant will reach the maximum number of attempts during a normal process, it can be assumed that a system error has occurred.
If, however, a collision is detected, the participant immediately interrupts the transmission and instead sends an interference signal (JAM signal) so that all other stations can also detect the collision. Now the participant waits for a random amount of time (back off) before trying the transmission again. TheĀ
back offĀ must be random so that the next collision doesnāt occur straight away. Since both stations select a random value, the probability that both of them will start a transport attempt at the same time is quite low.
The transmission attempts are counted. If the following attempts also fail and theĀ
maximum number of attempts (16)Ā is reached, the station reports the error to the next higher network layer and then terminates the transmission permanently. Since it is highly unlikely that a network participant will reach the maximum number of attempts during a normal process, it can be assumed that a system error has occurred.