140 Chapter 5 www.newnespress.com to properly detect the frame. If, however, the receiver is out of range, the receiver will hear garbage. The garbage will not pass the checksum (also garbage), and so will be discarded. To prevent radios from interpreting noise as a preamble, and locking to the wrong data rate for a possibly very long length, the frame-specific information has its own checksum bit or bits, depending on the radio type. Only on rare occasions will the checksum bit fail and cause a false reception; thus, there is no concern for real deployments. In summary, a receiver then works by first setting its radio to the lowest common denominator: the lowest data rate for the radio. If the fixed sequence of a preamble comes in, followed by the data rate and length, then the radio moves its modem up to the data rate of the frame and tries to gather the number of bits it calculates will be sent, from the length given. Once the amount of time necessary for the length of the frame has concluded, the radio then resets back to the lowest data rate and starts attempting to receive again. 5.4.3 Clear Channel Assessment and Details on Carrier Sense Now that we’ve covered the preamble, you can begin to understand what the term carrier sense would mean in wireless. The term clear channel assessment (CCA) represents how a radio determines if the air is clear or occupied. Informally, this is referred to as carrier sense. As mentioned previously, transmitters are required to listen before they transmit, to determine whether someone else is also speaking, and thus to help avoid collisions. When listening, the receiver has a number of tools to help discover if a transmission is under way. The most basic concept is that of energy detection. A radio can figure out whether there is energy in the channel by using a power meter. This power meter is usually the one responsible for determining the power level, often stated as the Receive Signal Strength Indication (RSSI) of a real signal. When applied to an unoccupied channel, the power meter will detect the noise floor, often around −95dBm, depending on the environment. However, when a transmission is starting, the power meter will detect the signal being sent, and the power level measured will jump—let’s say, to -70dBm for this example. That difference of 25dB can be used by the radio to clue in that it should attempt to turn on its modem and seek out the preamble. This allows the radio to have its modem off until real signals come by. Energy detection can be used as a form of carrier sense to trigger the CCA. When done that way, non-802.11 noise that crosses a certain threshold, determined by the radio, will show up as an occupied channel for as long as the noise is present. This allows the radio to avoid transmitting into a channel at the same time as interference is present. In the 2.4GHz band, microwave ovens can often trigger the energy detection thresholds on radios, causing the radios to stop transmitting at that time. Introduction to Wi-Fi 141 www.newnespress.com On the other hand, energy detection for CCA has its limitations. If the noise coming in is something that would not interfere with the transmission, but does trip the energy detection threshold, then airtime is being wasted. Therefore, the carrier acquisition portion of CCA comes into play. Radios know to look for specific bit patterns in a transmission, such as the preamble. When they detect these bit patterns, they can assert CCA as well. Or, more importantly, when they detect some energy in the channel but cannot detect these bit patterns, they can conclude that there is no legitimate 802.11 signal and suppress CCA. 5.4.4 Capture Radios are very sensitive, and can usually sense far-off transmissions. Here, sensing does not mean receiving the data within the frame correctly, but rather, hearing the preamble or the energy of the signal and deferring its own transmission for the proper time. Often, however, multiple signals come in at overlapping times, and at widely different power levels. The receiver locked into a distant signal will have that signal drowned out when a higher power signal comes in. That need not result in the loss of both signals. If the higher power signal is powerful enough, the receiver might be able to lock onto that higher signal. This concept is called capturing, as the receiver is captured by the more powerful transmission. Capture works when the higher signal is more powerful than the lower signal by at least the SNR required for the data rate of the signal. In this sense, the receiver can look at the original, lower-powered signal as noise, rather than as a valid 802.11 signal. The capture effect may be an important phenomenon within dense wireless deployments. Devices are most likely to allow for capture when they are receiving signals that are so weak that only CCA has been enabled, and the receiver is not making headway in receiving the distant signal. In those cases, the receiver may have not locked onto a signal, and so might be able to lock onto the stronger signal when it overlaps. For radios where the distant signal is being detected and demodulated correctly enough that the radio has locked into the distant signal, meaning that it has trained to the signal and is receiving what it believes to be in-range information (even if corrupt), it is unclear whether the radio will unlock and look for a new signal on an energy jump. Some radios will, and others won’t, and it is difficult to know, from the packaging and documentation, whether a given radio will capture effectively. 5.4.5 Desensitization and Noise Immunity One way of addressing the problem with CCA is for the access point to support noise immunity or desensitization. Noise immunity increases the amount of energy required before the radio defers, by making the radio less sensitive to weaker signals. This has the effect of reducing the access point’s receive range, or the range that the radio can hear other 142 Chapter 5 www.newnespress.com transmissions within. But it also has the effect of increasing the strength of noise required to block the radio from sending. This is useful, for example, when there are nearby non-802.11 noise sources, such as those from cordless phone systems or microwave ovens. If the noise source’s signals reach the radio at −85dBm, and the radio used energy detection sensitive to −90dBm, then the radio would be unable to transmit. However, desensitizing the radio by adjusting the minimum energy level required to sense carrier to above −85dBm, such as −80dBm, would allow the radio to transmit. Noise immunity settings are not the solution to every problem with noise, however. Desensitizing the radio reduces the receive range of the radio, increasing the risk of creating hard-to-detect coverage holes and causing interference to other 802.11 devices because of hidden nodes. 5.4.6 Hidden Nodes Carrier sense lets the transmitter know if the channel near itself is clear. However, for one transmitter’s wireless signal to be successfully received, the channel around the receiver must be clear—the transmitter’s channel doesn’t matter. The receiver’s channel must be clear to prevent interference from multiple signals at the same time. However, the transmitter can successfully transmit with another signal in the air, because the two signals will pass through each other without harming the transmitter’s signal. So why does 802.11 require the transmitter to listen before sending? There is no way for the receiver to inform the transmitter of its channel conditions without itself transmitting. In networks that are physically very small—well under the range of Wi-Fi transmissions—the transmitter’s own carrier sensing can be a good proxy for the receiver’s state. Clearly, if the transmitter and receiver are immediately next to each other, the transmitter and receiver pretty much see the same channel. But as they separate, they experience different channel conditions. Far enough away, and the transmitter has no ability to sense if a third device is transmitting to or by the receiver at the same time. This is called the hidden node problem. Figure 5.10 shows two transmitters and a receiver in between the two. The receiver can hear each transmitter equally, and if both transmitters are sending at the same time, the receiver will not be able to make out the two different signals and will receive interference only. Each transmitter will perform carrier sense to ensure that the channel around it is clear, but it won’t matter, because the other transmitter is out of range. Hidden node problems generally appear this way, where the interfering transmitters are on the other side of the receiver, away from the transmitter in question. 802.11 uses RTS/CTS as a partial solution. As mentioned when discussing the 802.11 protocol itself, a transmitter will first send an RTS, requesting from the receiver a clear channel for the entire length of the transmission. By itself, the RTS does not do anything for Introduction to Wi-Fi 143 www.newnespress.com Transmitter 1 Cell Bounds Transmitter 2 Receiver Figure 5.10: Hidden Nodes: The receiver can hear both transmitters equally, but neither transmitter can hear the other. the transmitter or receiver, because the data frame that should have been sent would have the same effect, of silencing all other devices around the sender. However, what matters is what the receiver does. The CTS it sends will silence the devices on the far side from the sender, using the duration value and virtual carrier sense to cause those devices to not send, even though they cannot detect the following real data frame (see Figure 5.11). This is only a partial solution, as the RTSs themselves can get lost because of hidden nodes. The advantage of the RTS, however, is that it is usually somewhat shorter than the data frame or frames following. For the RTS/CTS protocol to be the most effective against hidden nodes, the RTS and CTS must go out at the lowest data rate. However, many devices send the RTSs at far higher rates. This is done mostly to just take advantage of RTSs determining whether the receiver is in range, and not to avoid hidden nodes. Furthermore, the RTS/CTS protocol has a very high overhead, as many data packets could be sent in the time it takes for an RTS/CTS transmission to complete. 5.4.7 Exposed Nodes Unfortunately, the opposite problem to hidden nodes also occurs. Many times, especially in dense networks, the protocol or carrier sense causes devices that could transmit successfully to defer instead. This is called the exposed node problem, because nodes are exposed to being blocked when they need not be. Because there are two carrier sense types—virtual and physical—there are two types of exposed node problems. The first type happens when a device sets its virtual carrier sense based on an RTS but does not hear the subsequent data frame. 802.11 has a partial 144 Chapter 5 www.newnespress.com Sender Cell Bounds RTS First, the RTS allocates airtime and prevents devices in the sender’s cell from transmitting including the receiver. Interferer Receiver Sender Cell Bounds CTS Them, the CTS allocates airtime and prevents devices in the receiver’s cell from transmitting including the interferer. Now the sender can transmit the data free of interference. Interferer Receiver Figure 5.11: RTS/CTS for Hidden Nodes: The CTS silences the interfering devices. provision for this, called NAV resetting. If a device hears an RTS, sets its carrier sense, but fails to sense the data frame that should have come after the CTS, it may reset its virtual carrier sense and begin transmitting. Unfortunately, this solution addresses only the RTS case, and RTSs are somewhat rare. Introduction to Wi-Fi 145 www.newnespress.com Transmitter 1 Cell Bounds Transmitter 2 Receiver 1 Receiver 2 Figure 5.12: The Exposed Node Problem. Transmitter 1 inadvertently prevents Transmitter 2 from transmitting to Receiver 2, even though there would be no interference. The second type, more damaging to dense voice networks, is with physical carrier sense. Here, a far away device triggers the sender to not transmit, as the sender picks up and obeys the far away device’s preamble fields or signal energy. However, in many cases, the faraway device is sending to a device even farther away, and there is no risk of interfering with that signal if the transmitter were to transmit. Figure 5.12 illustrates this idea. 5.4.8 Collisions, Backoffs, and Retries Multiple radios that are in range of each other and have data to transmit need to take turns. However, the particular flavor of 802.11 that is used in Wi-Fi devices does not provide for any collaboration between devices to ensure that two devices do take turns. Rather, a probabilistic scheme is used, to allow for radios to know nothing about each other at the most primitive level and yet be able to transmit. This process is known as backing off, as is the basis of Carrier Sense Multiple Access with Collision Avoidance, or CSMA-CA. The process is somewhat involved, and is the subject of quite a bit of research, but the fundamentals are simple. Each radio that has something to send waits until the channel is free. If they then transmitted immediately, then if any two radios had data to transmit, they would transmit simultaneously, causing a collision, and a receiver would only pick up interference. Carrier sense before transmission helps avoid a radio transmitting only when another radio has been transmitting for a while. If two radios do decide to transmit at roughly the same time—within a few microseconds—then it would be impossible for the two to detect each other. 146 Chapter 5 www.newnespress.com To partially avoid the collisions, each radio plays a particular well-scripted game. They each pick a random nonnegative integer less than a value known as the contention window (CW), a small power of 2. This value will tell the radio the number of slots, or fixed microsecond delays, that the radio must wait before they can transmit. The goal of the random selection is that, hopefully, each transmitter will pick a different value, and thus avoid collisions. When a radio is in the process of backing off, and another radio begins to transmit during a slot, the backing-off radio will stop counting slots, wait until the channel becomes free again, and then resume where it left off. That lets each radio take turns (see Figure 5.13). However, nothing stops two radios from picking the same value, and thus colliding. When a collision occurs, the two transmitters find out not by being able to detect a collision as Ethernet does, but by not receiving the appropriate acknowledgments. This causes the unsuccessful transmitters to double their contention window, thus reducing the likelihood that the two colliders will pick the same backoff again. Backoffs do not grow unbounded: there is a maximum contention window. Furthermore, when a transmitter with an inflated contention window does successfully transmit a frame, or gives up trying to retransmit a frame, it resets its contention window back to the initial, minimum value. The key is to remember that the backoff mechanism applies to the retransmissions only for any one given frame. Once that frame either succeeds or exceeds its retransmission limit, the backoff state is forgotten and refreshed with the most aggressive minimums. The slotted backoff scheme had its origin in the educational Hawaiian research network scheme known as Slotted ALOHA, an early network that addressed the problem of figuring out which of multiple devices should talk without using coordination such as that which token-based networks use. This scheme became the foundation of all contention-based network schemes, including Ethernet and Wi-Fi. However, the way contention is implemented in 802.11 has a number of negative consequences. The denser and busier the network, the more likely that two radios will collide. For example, with a contention window of four, if five stations each have data, then a collision is assured. The idea of doubling contention windows is to exponentially grow the window, reducing the chance of collisions accordingly by making it large enough to handle the density. This would allow for the backoffs to adapt to the density and business of the network. However, once a radio either succeeds or fails miserably, it resets its contention window, forgetting all adaptation effects and increasing the chance of collisions dramatically. Furthermore, there is a direct interplay between rate adaptation—where radios drop their data rates when there is loss, assuming that the loss is because the receiver is out of range and the transmitter’s choice of data rate is too aggressive—and contention avoidance. Normally, most devices do not want to transmit data at the same time. However, the busier the channel is, the more likely that devices that get data to send at different times are forced to wait for the same opening, increasing the contention. As contention goes up, collisions go up, and rate Introduction to Wi-Fi 147 www.newnespress.com AIFS Backoff Time Wireless Station Channel Busy Station’s Transmitted Frame Arbitration Interframe Spacing (AIFS): 16 µs + 18 µs a) Wireless Station (client or access point) backing off after the channel becomes idle. This particular example shows the station waiting for six backoff slots before transmitting Backoff Slots (Six of them): 9 µs each Station 2’s Transmitted Frame Time Wireless Station 1 Channel Busy Station 1’s Transmitted Frame Acknowledgement from Receiver AIFS b) Wireless Station 1 backs off for two slots; Wireless Station 2 backs off for six. After the first two slots, Station 1 transmits and Station 2 detects the transmission and cancels the backoff. After Station 1 is finished, Station 2 resumes with a new AIFS, then continues where it left off. Notice how the total number of whole slots Station 2 waited for is six, as expected. Backoff SIFS No Ack No Ack Wireless Station 2 AIFS Resumed Backoff Station 2’s Retansmitted Frame AIFS Doubled Backoff AIFS Doubled Backoff AIFS Backoff Time Wireless Station 1 Channel Busy Station 1’s Transmitted Frame Station 2’s Transmitted Frame AIFS b) Bpth Wireless Stations back off for two slots and then transmit. Therefore, both transmissions collide. Because Wi-Fi uses Collision Avoidance, and cannot detect collisions directly, the only indication to the stations is the lack of an Acknowledgement. After the time passes that an Acknowledgement should have been received by, both stations double their contention window, pick new random backoffs (which may be a larger number of slots than before, and likely will not be equal again) and start over. Backoff Wireless Station 2 Figure 5.13: The backoff procedure for two radios. 148 Chapter 5 www.newnespress.com adaptation falsely assumes that the loss is because of range issues and drops the data rate. Dropping the data rate increases the amount of time each frame stays on air—a 1Mbps data frame takes 300 times the amount of time a 300Mbps data frame of the same number of bytes takes—thus increasing the business of the channel. This becomes a vicious cycle, in a process known as congestion collapse that causes the network to spend an inordinate amount of time retransmitting old data and very little time transmitting new data. This is a major issue for voice mobility networks, because the rate of traffic does not change, no matter what the air is doing, and so a network that was provisioned with plenty of room left over can become extremely congested by passing over a very short tipping point. 5.4.9 Challenges to Voice Mobility You may ask why 802.11 has as many seemingly negative aspects as have been mentioned. It is important to remember that 802.11 was designed to reduce the cost and complexity of the radio as much as possible, and this simplicity has allowed Wi-Fi to blossom as much as it has. However, because the design was not originally geared at large, dense, and mobile deployments, many challenges exist for voice mobility deployments over Wi-Fi. This chapter and the next will address the ways in which voice mobility deployments can be successfully produced over Wi-Fi networks, and will explore where each type of deployment works and where it may be limited. 5.5 The Wi-Fi Radio Types Let’s now look at the types of radios. Radio types, in Wi-Fi, are designated by the amendment letter for the part of the standard that added the description of the specific radio type. The original 802.11 standard, produced in 1999, has only one radio type, but was so limited in bandwidth that it was not broadly used commercially. Subsequent amendments have provided new radio types, starting with 802.11b, which launched wireless LANs into the forefront, and this constant stream of amendments has kept Wi-Fi at the cutting edge of wireless. It’s worthwhile to spend a little bit of time going through the mechanics of how these radios transmit their signals. Voice mobility networks require a keener sense of how wireless operates than convenience or data networks, and having some insight on how wireless transmitters operate can provide significant benefit in planning for and understanding the network. Feel free to skim this section and use it as a reference. 5.5.1 802.11b 802.11b is the first radio that was added to the original 802.11 standard. 802.11b builds on the original technology used for 802.11 radios, and because of this, we will refer to 802.11b as including the original 802.11. 802.11b has four data rates, and is designed to be able to transmit at data rates as high as 11Mbps. See Table 5.11. Introduction to Wi-Fi 149 www.newnespress.com The lowest two data rates—1Mbps and 2Mbps—belong to the original 802.11-1999 standard, and were what broke the ground into the concept of a wireless “Ethernet.” They happen to be referred to here as 802.11b rates in keeping with current industry practices. 802.11 signals are radio waves, and the goal of any digital radio is to encode a binary signal on those radio waves in a way that maximizes the chance of the signal being received while simultaneously minimizing the complexity of the receiver. The original 802.11-1999 signals are of a type known as Direct Sequence Spread Spectrum (DSSS). The starting point for the 802.11b signals is known as the carrier. The carrier has the center frequency of the signal; channel 11’s carrier frequency is at 2.462GHz. By itself, a carrier is a pure tone—a sine wave—at that frequency. These carriers do not possess any information, but they do carry energy in a distinct form that the receivers can use to identify a real signal, rather than just noise. The radio’s job is to add the information in on top of the carrier. What makes a radio technology distinct is precisely how it encodes that information onto the carrier. The manner of encoding is known as a modulation technique. Two well-known ones are amplitude modulation (AM) and frequency modulation (FM). Both are used in car radios, and so should be familiar places to start. Amplitude modulation works by varying the amplitude, not surprisingly, of the carrier to convey the information. The receiver locks onto the carrier, and then uses the change in amplitude to determine what the original signal was. For a car radio that uses AM (Figure 5.14), the original signal will vary at the frequencies that are audible—usually up to 3000 Hz. The carrier, however, varies much faster, at the 1000 kilohertz range. When the original signal moves up in amplitude, so does the carrier; thus, when plotted with amplitude over time, the carrier looks like it has the original signal as an envelope, limiting the bounds it can oscillate in. Receivers can be incredibly simple, by just filtering out the high-frequency portion of the signal—using basic circuits to blend out oscillations around the carrier frequency but allowing the audible frequencies through—the original signal can be recovered. Frequency modulation, on the other hand (Figure 5.15), works by varying the center frequency based on the data. Instead of varying the amplitude, the carrier’s frequency is offset by the value of the data signal. The receiver notices as the carrier drifts one way or Table 5.11: The 802.11b data rates Speed Preamble Type 1Mbps Long 2Mbps Long/Short 5.5Mbps Long/Short 11Mbps Long/Short . whether the radio will unlock and look for a new signal on an energy jump. Some radios will, and others won’t, and it is difficult to know, from the packaging and documentation, whether a given. exist for voice mobility deployments over Wi-Fi. This chapter and the next will address the ways in which voice mobility deployments can be successfully produced over Wi-Fi networks, and will explore. planning for and understanding the network. Feel free to skim this section and use it as a reference. 5.5.1 802.11b 802.11b is the first radio that was added to the original 802.11 standard. 802.11b