Beruflich Dokumente
Kultur Dokumente
WLAN Channel Access: How WiFi Networks Talk and How You Can Make Them Talk More Clearly
Ben Miller, Global Knowledge Course Director
Introduction
The iPhone 4 can aptly be described as a cultural phenomenon; Apples newest gadget caused otherwise sane men to ring city blocks for hours in the hopes of obtaining one. This years second-most compelling gadget also became something of a wireless networking phenomenon, albeit unintentionally. Steve Jobs, the man recognized as one of the business worlds most charismatic and organized presenter, was made to look disorganized when his WiFi network stopped working. The unexpected nature of Jobs bobble was what made it such a spectacle. This white paper, then, is designed to be a lesson in avoidance. The goal here is to understand what the wireless folks at Apple could have done to avoid embarrassing their boss and how it can be applied in the IT guys everpresent quest to avoid a similar failure.
a r e
Q u i c k T i m e a n d d e c o m p r e s s o r n e e d e d t o s e e
a t h i s p i c t u r e .
Data
Figure 1. Inserted after the paragraph that begins The CCA is a physical carrier sense
The NAV is a virtual carrier sense. It doesnt involve any kind of listening to the channel. Its basically just a timer. Each AP and station has a NAV value that is set by the Duration field of the 802.11 header. Once an AP or station sees the Duration value in a frame where it is not the receiver, the AP or station counts down towards 0. Until the NAV completely counts down the channel is considered occupied. The NAV can certainly be helpful in crowded WiFi environments, but it only plays a large role in keeping channels clear if you configure the proper settings on APs and stations (more on that later). There is one other mechanism for WiFi channel access that affected the iPhone 4 introduction: the random backoff. The random backoff is something that comes from CSMA/CD (carrier sense multiple access with collision detection) in wired Ethernet LANs, but its placed differently in wireless WiFi LANs. 802.3 Ethernet involves having devices back off (stay quiet) after a collision by choosing a random number of slot times (short quiet periods). The idea is that since the number of slot times is chosen randomly, one device will begin transmitting on the wire before the other finishes counting down its slot times, thus avoiding a second collision. In 802.11 WiFi, stations use the same random choosing of slot times, but they do it before transmitting rather than after a collision. The idea is to do collision avoidance rather than collision detection.
The important thing to understand about the random backoff is just that it allows each AP and station to have randomized, yet equal, access to the channel when multiple devices have data to transmit. For a WiFi channel to work properly, the CCA, the NAV, and the random backoff have to be working correctly. If devices cant use the CCA and/or NAV to stay quiet while other devices are transmitting, there will be collisions. If there are so many devices attempting to transmit at the same time that identical numbers of slot times get chosen during the random backoff time, there will be collisions. The bottom line is that devices have to know to keep quiet, and the channel has to have a limited number of devices attempting to transmit at any given time in order for the DCF to work correctly.
CCNA Problem
CC A Pr o blem
a r e
Q u i c k T i m e a n d d e c o m p r e s s o r n e e d e d t o s e e
a t h i s p i c t u r e .
1 Mbps
a r e
Q u i c k T i m e a n d d e c o m p r e s s o r n e e d e d t o s e e
a t h i s p i c t u r e .
Data
Fig 2: Inserted after the paragraph that begins The CCA works by having devices listen to the channel
The CCA becomes a real problem in areas with multiple APs operating on the same channel. When there is only one AP on a channel, everything works in an orderly fashion. Stations that are close to the AP transmit at high rates (thus having a shorter range where frames are successfully demodulated) and stations that are far from the AP transmit at low rates (thus having a longer range). If a second AP appears on the channel, things start to break down. Stations are likely to be close to their associated AP. That means that all stations use high rates, and a laptop in the 35th row of the audience will transmit a frame that will have too short a range to be demodulated successfully on the stage where the iPhone 4 sits. That likely means that the iPhone 4 will not use the CCA, thus causing it to transmit a frame at the same time that another device, on the same channel, is transmitting a frame. Two frames on one channel at one time means a collision.
iPhone 4 Apples AP
(No CCA)
Fig 3: Inserted after the paragraph that begins The CCA becomes a real problem in areas with multiple Aps operating on the same channel.
When collisions happen due to having more than one AP on the same channel, the problem goes beyond the CCA. When the CCA fails, it causes a failure of the NAV as well. The NAV works when stations can successfully read the Duration field of the WiFi header. If the CCA fails and a collision results from that failure, then the header will not be read correctly. The bottom line is that there are two carrier sense mechanisms that keep APs and stations quiet in order to avoid collisions, and both of them tend to fail when more than one AP operates on the same channel, at the same time, in the same area. When the iPhone 4 introduction occured, more than 570 WiFi networks were operating in the same time, in the same area, because lots of journalists brought MiFi portable hotspots (which act as personal APs) to the event. That overabundance of APs is what caused the iPhone 4 demonstrations to go awry. (Admittedly, I was not present at the iPhone 4 introduction, and I certainly did not have the opportunity to perform a protocol analysis during the time that the WiFi network was failing. That said, the video evidence leads me to believe that the CCA breakdown described above is the reason for the failure.)
Copyright 2010 Global Knowledge Training LLC. All rights reserved. 6
The NAV is set by the Duration value in each WiFi header. That means that if a WiFi header can somehow reach vulnerable APs and stations before they attempt to send data, the channel can be kept clear even when the CCA has failed. The RTS (request to send) and CTS (clear to send) frames are non-data frames (so, just a header) that can be used to carry a Duration value in advance of a data frame transmission. The way WiFi works is that each AP and station has an RTS Threshold setting. If the RTS Threshold is set to a number that is less than the size (in bytes) of the data frame that is about to be transmitted, the AP or station will send an RTS frame and receive a CTS frame first. The RTS frame will set the NAV in all APs and stations within range of the transmitter, and the CTS frame will set the NAV in all APs and stations within range of the receiver. In laymans terms, that means that even if the CCA fails, the channel will stay clear. Unfortunately, not all WiFi equipment vendors allow the RTS Threshold setting to be manually configured. If it can be configured, though, dropping the setting to a low number perhaps even zero may help in areas where more than one AP occupy the same channel.
Having an understanding of how WLAN channel access works will allow you to create and maintain a network that supports this elegant design. But be diligent. A haphazard design can render the talking of WiFi devices unintelligible.
Learn More
Learn more about how you can improve productivity, enhance efficiency, and sharpen your competitive edge. Check out the following Global Knowledge courses: Analyzing TCP/IP Networks with Wireshark Wireless LAN Foundations Network+ Prep Course For more information or to register, visit www.globalknowledge.com or call 1-866-925-7765 to speak with a sales representative. Our courses offer practical skills, exercises, and tips that you can immediately put to use. Our expert instructors draw upon their experiences to help you understand key concepts and how to apply them to your specific work situation. Choose from our more than 1,200 courses, delivered through Classrooms, e-Learning, and On-site sessions, to meet your IT, project management, and professional skills training needs.