5. Wireless Local Area Networks (IEEE 802.11)
5.4. Medium Access Control (MAC) Layer
5.4.1. Collision Handling
As with all other transmission mediums in the wired world, i.e. the Ethernet twisted pair cable, only one station can send data at a given time. If more than one station sends data it will collide, rendering the data sent by two or more stations unusable for the intended receivers.
So collisions should be avoided or suppressed completely.
If a station wants to send data, it first checks if the wireless medium is free, by trying to receive. If the wireless medium seems to be free the station starts sending data. This basic rule is known as Carrier Sense Multiple Access (CSMA). Due to wireless transmission, it is not possible to send and receive data at the same time. Therefore it is not possible for a sending station to listen on the wireless medium, if some other station is sending and to abort its own transmission. So a collision cannot be detected (collision detection) while a station is sending the message. The sender never knows if the station has received the message or if it has to be retransmitted due to a collision. This problem is handled by acknowledgements that are sent back by the receiver every time a message is received properly.
To avoid that two stations think that the wireless medium is free at the same time, which is still possible with CSMA, IEEE 802.11 introduces a collision avoidance mechanism (CA), trying to minimize the number of collisions to minimize the retransmission overhead.
To enable time critical applications IEEE 802.11 also specifies a collision free access mechanism, called the Point Coordination Function (PCF), which is described later in 5.4.1.2.
9 CRC codes allow to detect single bit errors and also burst errors. They assume that the data checksummed is randomly distributed [55].
5.4.1.1. CSMA/CA
Carrier Sense Multiple Access (CSMA) with Collision Avoidance (CA) is split into two parts, the first part is to detect, that the wireless medium is physically free (CSMA), while the second part is to logically ensure that collisions are avoided to maximize the use of the bandwidth.
Carrier sense multiple access uses a physical layer function (CCA10) to detect if anything is received on the wireless medium. If nothing is received the station can assume that there are no transmissions and can transmit, but this is only an assumption. More than one station might detect no signal on the wireless medium at the same time, so they both think it is free and both start to send. Another case where CSMA cannot avoid collisions is, if two stations are not in mutual range with each other and therefore cannot detect if the other station is using the wireless medium, this is known as the hidden station problem, which is described in detail in 5.4.1.3.
Additionally to listening if the wireless medium is free for sending each station keeps track of the logical use, by updating a timed counter called Network Allocation Vector (NAV11).
The NAV tells the station how much time it has to wait before the wireless medium is expected to be free for transmission. The NAV is counted down until it reaches zero, a simplified version of CSMA/CA is shown in Figure 5.18.
A station updates the NAV whenever it receives a message, with the value that is contained in the message header field called Duration/ID. This field among others can be found in every frame header, as shown in Figure 5.15.
The duration information is set by the sending station to reserve the wireless medium for the length of the ongoing transmission. The value for the duration field is the time it takes to transmit the data plus the time it needs to send the acknowledgement back. This allows also for the acknowledgement being able to be sent back, without high likelihood of collision. Figure 5.16. shows the timeline of a sending, a receiving and a waiting station using NAV.
DIFS
Figure 5.16. Sending a frame utilizing NAV to reserve wireless medium [43]
At the beginning Station A and Station C both want to send data and therefore wait until the medium is no longer busy, then waiting a defined amount of time (DIFS) and a randomly selected Back-off time.
Assuming that Stations A Back-off time is the shortest, it will find the medium still free and start sending the Data Frame. Station C and other Stations within transmission range now receive the frame header and the duration information calculated by the sender. The NAV is updated by all other stations to reserve the medium for the data sent by Station A and the acknowledgement frame sent by Station B.
After Station B has received the Data Frame it waits a shorter specified amount of time (SIFS) and then sends the acknowledgement. If Station C will find the wireless medium still free after waiting another predefined DIFS time period and another random Back-Off time period it will be able to send.
10 IEEE 802.11 clear channel assessment (CCA) function: That logical function in the physical layer (PHY) that determines the current state of use of the wireless medium (WM).
11 IEEE 802.11 network allocation vector (NAV): An indicator, maintained by each station, of time periods when transmission onto the wireless medium (WM) will not be initiated by the station whether or not the station’s clear channel assessment (CCA) function senses that the WM is busy.
Figure 5.17. Increase of the contention window specifying the back-off time [26]
If Station A does not receive the acknowledgement within a given time it will wait a back-off time, that will increase exponentially with every retry (Figure 5.17.), and then try to resend the data frame. The back-off time is calculated by selecting a random value from the interval [0,CW] and multiplying it with the SlotTime, a physically fixed parameter, which is 20 µsec in IEEE 802.11b networks. The time interval that a station waits before the retransmission of a message can therefore increase to a maximum time of 51000 µsec. Figure 5.14. shows an abstraction of this process.
Start (Frame to send)
NAV==0
? NO YES
Is
Medium Wait random
free ? NO back-off time YES
Send Frame
* Only for some frame types
Wait for ACK * acknowledgements are generated.
ACK received
? NO
YES
STOP (Frame successfully sent)
Figure 5.18. Basic procedure for sending a frame, translated from [43]
5.4.1.2. PCF
The Point Control Function (PCF) provides an optional access mechanism build on the CSMA/CA mechanism. But rather than being a distributed medium access control function like the CSMA/CA, it is a centralised mechanism provided and managed by the access point. The PCF is used if collisions must be avoided and if the waiting time must be more predictable, so it can be used for time critical applications over a IEEE 802.11 wireless LAN. The PCF allows for so called content free periods (CFP) where it exclusively reserves the wireless medium for the use by one station only. The implementation of this PCF and the CFP mechanism is made optional by the IEEE 802.11 standard.
To reserve the wireless medium even if station not having implemented the optional mechanism, the PCF uses the NAV value to stop other stations from using the wireless medium. To exclusively allow a specific station to send one frame the access point sends a special Data Frame called CF-Poll-Frame to the station granted exclusive sending rights.
5.4.1.3. Hidden Station Problem and RTS/CTS-mechanism
The CSMA/CA will only work correctly if all the stations are within mutual transmission range.
Figure 5.19. shows an example of how it is possible for two mobile stations to still communicate with an third station, while not receiving any duration information by receiving the other stations message nor being able to detect properly if the wireless medium is free.
Figure 5.19. Hidden station problem
The station STA 2 can still communicate with all the other stations, but problems arise if for example station 1 would like to send and will sense with CSMA/CA that the wireless medium is free, while in the worst case station 3 is already sending, a collision at station 2 will therefore not be prevented by the CSMA/CA.
IEEE 802.11 solves this problem by the use of very short frames called RTS (request to send) and CTS (clear to send). The RTS and CTS frames are very short and contain among other information the duration value that is used to set the NAV accordingly. The station that wants to sent data first obeys all the rules set out by the CSMA/CA, but instead of sending the data frame when allowed, it sends a very short RTS frame to the station that it wants to send the data to. The receiving station will send a CTS frame back, if the wireless medium is free for the duration requested. On receipt of the CTS, the sending station will start to send the actual data.
In the example given in Figure 5.19. station 1 will send a RTS frame, that only station 2 will receive.
Station 2 will send a CTS frame back, this will also be picked up by station 3, allowing station 3 to update the NAV value accordingly.
Using RTS/CTS-frames allows stations to overcome the effects of the hidden station problem, but it is an overhead, as it has to be transmitted additionally.
Every station can decide whether or not to send an RTS frame first; this is usually done above a specified size of data to be transmitted, to provide a trade-off.