Carrier Sense with Collision Avoidance
We have already remarked that wireless systems cannot normally detect a collision while it is occurring. The received signal at a station may be tiny, perhaps a million times fainter than the signal that is being transmitted.
A naive approach to using a wireless LAN might be to try CSMA: just listen for other transmissions and only transmit if no one else is doing so. The trouble is, this protocol is not really a good way to think about wireless because what matters for reception is interference at the receiver, not at the sender.

The radio range is such that A and B are within each other’s range and can potentially interfere with one another. can also potentially interfere with both B and D, but not with A.
If A sends and then C immediately senses the medium, it will not hear A because A is out of range. Thus C will falsely conclude that it can transmit to B. If C does start transmitting, it will interfere at B, wiping out the frame from A. The problem of a station not being able to detect a potential competitor for the medium because the competitor is too far away is called the hidden terminal problem.
B transmitting to A at the same time that C wants to transmit to D. If C senses the medium, it will hear a transmission and falsely conclude that it may not send to D. In fact, such a transmission would cause bad reception only in the zone between B and C, where neither of the intended receivers is located. We want a MAC protocol that prevents this kind of deferral from happening because it wastes bandwidth. The problem is called the exposed terminal problem.
802.11 tries to avoid collisions with a protocol called CSMA/CA (CSMA with Collision Avoidance. This protocol is conceptually similar to Ethernet’s CSMA/CD, with channel sensing before sending and exponential back off after collisions.
Avoided using following strategies:

The station waits until the channel is idle, by sensing that there is no signal for a short period of time (called the DIFS, as we explain below), It sends its frame when the counter reaches 0.
-
Inter-frame space: Collisions are avoided by deferring transmission even if the channel is found idle. When channel is found idle, the station does not send immediately, it waits for a period of time called IFS. After IFS time if the channel is still idle, the station still needs to wait a time equal to the contention time. In CSMA/CA, the IFS can also be used to define the priority of a station or a frame. A station having shorter IFS has higher priority.
-
Contention window: It is an amount of time divided into slots. A station that is ready to send chooses a random number of slots as its wait time, say from 0 to 15 in OFDM physical layer. The number of slots in the window changes according to the binary exponential backoff strategy. and counts down idle slots, pausing when frames are sent. It is set to one slot the first time and then doubles each time the station detects collision.
-
Acknowledgement: With both precautions, there still may be a collision or during transmission the data may be corrupted. The positive acknowledgement and the time-out times can help guarantee that the receiver has received the frame. If the frame gets through, the destination immediately sends a short acknowledgement. Lack of an acknowledgement is inferred to indicate an error, whether a collision or otherwise. In this case, the sender doubles the backoff period and tries again, continuing with exponential backoff as in Ethernet until the frame has been successfully transmitted or the maximum number of retransmissions has been reached.
-
The second problem is that the transmission ranges of different stations may be different. With a wire, the system is engineered so that all stations can hear each other. With the complexities of RF propagation this situation does not hold for wireless stations. To reduce ambiguities about which station is sending 802.11 defines channel sensing to consist of both physical sensing and virtual sensing. With virtual sensing, each station keeps a logical record of when the channel is in use by tracking the Network Allocation Vector. Each frame carries a NAV field that says how long the sequence of which this frame is part will take to comlete. Stations that overhear this frame know that the channel will be busy for the period indicated by the NAV, regardless of whether they can sense a physical signal.
(tei hidden and expose terminal problem)
An early and influential protocol that tackles these problems for wireless LANs is MACA (Multiple Access with Collision Avoidance). The basic idea behind it is for the sender to stimulate the receiver into outputting a short frame, so stations nearby can detect this transmission and avoid transmitting for the duration of the upcoming (large) data frame. This technique is used instead of carrier sense. (some earlier weird protocols are here not used in 802.11 hai)
To reduce ambiguities about which station is sending, 802.11 defines channel sensing to consist of both physical sensing and virtual sensing. Physical sensing simply checks the medium to see if there is a valid signal. With virtual sensing, each station keeps a logical record of when the channel is in use by tracking the NAV (Network Allocation Vector). Each frame carries a NAV field that says how long the sequence of which this frame is part will take to complete. Stations that overhear this frame know that the channel will be busy for the period indicated by the NAV, regardless of whether they can sense a physical signal.
An optional RTS/CTS mechanism uses the NAV to prevent terminals from sending frames at the same time as hidden terminals.