Introduction to CSMA
Carrier-sense multiple access (CSMA) is a type of media access control (MAC) protocol in which a node confirms that there is no other traffic on a shared transmission channel, such as an electrical bus or a band of the electromagnetic spectrum, before sending.
Before commencing a transmission under CSMA, a transmitter uses a carrier-sense method to determine if another transmission is in progress. Before attempting to transmit, it tries to detect the presence of a carrier signal from another node. If a carrier is detected, the node waits for the current transmission to finish before commencing its own. Multiple nodes can send and receive data on the same media using CSMA. All other nodes linked to the medium receive transmissions from a single node.
Collision-detection (CSMA/CD),Collision-avoidance (CSMA/CA), and collision-resolution techniques are all variations on basic CSMA.
Access Modes
Different CSMA variants use different algorithms to determine when transmission onto the shared medium should begin. A significant distinguishing trait is aggressiveness or persistence with which these algorithms initiate communication. A more aggressive algorithm can start transmitting faster and use a higher percentage of the medium's available bandwidth. This usually comes at the cost of a higher risk of colliding with other transmitters.
1-persistent
1-persistent CSMA is a transmission algorithm that is very aggressive. The transmitting node detects whether the transmission medium is idle or busy when ready to send. It transmits immediately if it is inactive. If the transmission medium is busy, it continuously senses it until it becomes idle, at which point it sends the message (a frame) unconditionally (i.e., with probability=1). In a collision, the sender waits a random amount of time before repeating the procedure. In CSMA/CD systems, such as Ethernet, 1-persistent CSMA is employed.
Non-persistent
A non-aggressive transmission algorithm is a non-persistent CSMA. The transmitting node detects whether the transmission medium is idle or busy when it is ready to transmit data. It sends immediately if it is idle. If the channel is busy, it immediately skips to the final random waiting step of 1-persistent CSMA before repeating the entire logic cycle: it does not continue to check the busy channel in the hopes of getting its signal through, hence the name. Compared to 1–persistent, this strategy reduces the likelihood of collision and results in higher overall medium-throughput, but at the cost of longer initial latency.
P-persistent
The transmitting node detects whether the transmission medium is idle or busy when it is ready to transmit data. It transmits immediately if it is idle. If it is busy, it continuously senses the transmission medium until it becomes idle, at which point it transmits with probability p. If the node does not broadcast (which has a 1-p chance), it waits for the next available time slot. If the transmission medium is not congested, it transmits with the same probability p. This probabilistic hold-off continues until the frame is eventually transferred or the medium becomes busy once more (i.e., some other node has already started transmitting). In the latter situation, the node repeats the entire logic cycle (which began with sensing the transmission medium to determine if it is idle or busy). In CSMA/CA systems, such as Wi-Fi and other packet radio systems, p-persistent CSMA is employed. It's important to note that p = 0-persistent CSMA is not the same as non-persistent CSMA. Both can only transmit when the channel is idle at the start of the procedure, but their behavior on a busy channel differs: non-persistent CSMA doesn't try to detect the channel and repeats its logical cycle, whereas p = 0 is forced to wait in an infinite loop (since it has zero probability of transmission even the channel goes back to being idle).
O-persistent
A supervisory node assigns a transmission order to each node. Nodes wait for their time slot in line with their allocated transmission sequence when the transmission channel is idle. The node that is assigned to broadcast first does so right away. The node in charge of transmitting the second must wait for a one-time slot (but by that time, the first node has already started transmitting). Nodes keep an eye on the medium for transmissions from other nodes and change their allocated order as soon as one is discovered (i.e., they move one position closer to the front of the queue).CobraNet, LonWorks, and the controller area network all use O-persistent CSMA.