Carrier Sense Multiple Access (CSMA) | Computer Networks
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
Carrier sense multiple access (CSMA) requires that each station first listen to the medium and then send if sending doesn't lead to any collision. That means CSMA is based on "sense before transmit" principle. CSMA can reduce the possibility of collision, but it cannot eliminate it. The possibility of collision still exists because of propagation delay; when a station sends a frame, other stations are yet to sense that. Thus, a station may sense the medium and find it idle, only because the first bit sent by another station has not yet been received.
At time T1 station A senses the medium and finds it idle, so it sends a frame. At time T2 (T2> T1) station C senses the medium and finds it idle because the first bit from station A has not reached station C yet. Station C also sends a frame. The two signals collide and both frames are destroyed.
Let's see an example,
A
B
C
D
T2
T1
Vulnerable Time
The vulnerable time for CSMA is the propagation time Tp. The propagation time is needed for a signal to propagate from one end of the medium to other ends. When two stations try to send respective frames simultaneously a collision will result. But if the first bit of the frame reaches the end of the medium, every station must have already heard the bit and will refrain from sending them.
Persistence Methods for CSMA
There are basically three persistence methods:
- 1-Persistent
- Non-Persistent
- p-Persistent
1) 1-Persistent
The 1-persistent method is simple and straightforward. When a station finds the channel idle, it sends its frame immediately (with probability 1).
This method has the highest chance of collision because two or more stations may find the channel idle at the same time and send their frames immediately.
2) Non-persistent method
In the non-persistent method, a station that has a frame ready to be sent senses the line first. If the channel is idle, it sends immediately. If the channel is not idle, it waits a random amount of time(quite like
Aloha) and then senses the line again.
The non-persistent method reduces the chance of collision because it is unlikely that two or more stations will wait for the same amount of time since it’s random and retry to send simultaneously.
3) p-persistent method
The p-persistent method is used if the channel is slotted in time slots with a slot duration equal to or greater than the maximum propagation time. the p-persistent method reduces the chance of collision and improves efficiency. In this method, after the station finds the channel idle it follows these following steps:
- With probability p, the station sends its frame.
- With probability q = 1 -p, the station waits for the beginning of the next time slot and checks the line again.
- If the line is idle, it goes to step 1.
- If the line is busy, it acts as though a collision has occurred and uses the back-off procedure like Aloha.
Performance
CSMA/CA performance is based largely upon the modulation technique used to transmit the data between nodes. Studies show that under ideal propagation conditions (simulations),
direct-sequence spread spectrum (DSSS) provides the highest throughput for all nodes on a network when used in conjunction with CSMA/CA and the IEEE 802.11 RTS/CTS exchange under light network load conditions.
Frequency hopping spread spectrum (FHSS) follows distantly behind DSSS with regard to throughput with a greater throughput once network load becomes substantially heavy. However, the throughput is generally the same under real world conditions due to radio propagation factors.
[4]