📜 ⬆️ ⬇️

Wi-Fi: unobvious nuances (for example, home network)

Now many people buy 802.11n access points, but not everyone can achieve good speeds. In this post we will talk about not very obvious small nuances that can significantly improve (or worsen) the work of Wi-Fi. Everything described below is applicable both to home Wi-Fi routers with standard and advanced (DD-WRT & Co.) firmware, as well as to corporate devices and networks. Therefore, as an example, take the "home" theme, as more familiar and close to the body. For even the most administrative of administrators and engineers of engineers live in apartment buildings (or villages with a sufficient density of neighbors), and everyone wants fast and reliable Wi-Fi.
[!!]: after comments on the publication of the first part, I cite the entire text. If you read the first part - continue from here .

A few notes before the start:


1. How to live well yourself and not interfere with the neighbors.


[1.1] It would seem - what is really there? He unscrewed the point at full power, got the maximum coverage possible - and rejoice. And now let's think: not only the signal of the access point must reach the client, but the signal of the client must reach the point. TD transmitter power is typically up to 100 mW (20 dBm). Now look in the datasheet to your laptop / phone / tablet and find the power of its Wi-Fi transmitter there. Found? You are very lucky! Often it does not indicate at all (you can search by FCC ID ). Nevertheless, we can confidently say that the power of typical mobile clients is in the range of 30-50 MW. Thus, if the TD is broadcasting at 100mW and the client is only at 50mW, there will be places in the coverage area where the client will hear the point well, and the client's TD will be bad (or not at all) - asymmetry. This is true even if the point is usually better than the reception sensitivity - look under the spoiler. Again, this is not about distance, but about symmetry. There is a signal - but there is no connection. Or downlink is fast and uplink is slow. This is true if you use Wi-Fi for online games or Skype, for normal Internet access is not so important (only if you are not on the edge of the cover). And we will complain about the poor provider, buggy point, driver curves, but not illiterate network planning.


Rationale (for those who are interested in the details):
Our task is to provide as much as possible a symmetrical communication channel between the client (STA) and the point (AP) in order to equal the speeds of uplink and downlink. For this we will rely on SNR (signal-to-noise ratio). Why on it is described in [3.1].
SNR (STA) = Rx (AP) - RxSens (STA); SNR (AP) - Rx (STA) - RxSens (AP)
where Rx (AP / STA) is the received signal power from the point / client, RxSens (AP / STA) is the point / client reception sensitivity. For simplicity, let us assume that the background noise threshold is below the sensitivity threshold of the AP / STA receiver. Such a simplification is quite acceptable, since if the level of background noise for the AP and STA is the same - it does not affect the symmetry of the channel.
Further,
Rx (AP) = Tx (AP) [transmitter power point at the antenna port] + TxGain (AP) [transmit antenna gain point taking into account all losses, gains and directivity] - PathLoss [signal loss from point to client] + RxGain (STA) [client antenna gain gain with all losses, gains and directivity given].
Similarly, Rx (STA) = Tx (STA) + TxGain (STA) - PathLoss + RxGain (AP) .
It is worth noting the following:
  • PathLoss is the same in both directions.
  • TxGain and RxGain antennas are the same for conventional antennas (true for AP and for STA). It does not consider cases with MIMO, MRC, TxBF and other tricks. So you can accept: TxGain (AP) === RxGain (AP) = Gain (AP) , similarly for STA.
  • The client's Rx / Tx Gain antenna is little known. Client devices are usually equipped with non-replaceable antennas, which allows you to specify the transmitter power and receiver sensitivity immediately taking into account the antenna. We note this in our calculations below.

Total we get:
SNR (AP) = Tx * (STA) [with antenna] - PathLoss + Gain (AP) - RxSens (AP)
SNR (STA) = Tx (AP) + Gain (AP) - PathLoss -RxSens * (STA) [including antenna]

The difference between the SNR at both ends will be the asymmetry of the channel, we use arithmetic: D = SNR (STA) -SNR (AP) = Tx * (STA) - Tx (AP) - (RxSens * (STA) - (RxSens (AP)) .
')
Thus, the asymmetry of the channel does not depend on the type of antenna on the point and on the client (again, it depends if you use MIMO, MRC and so on, but then it will be rather difficult to calculate something), but depends on the power difference and sensitivity of the receivers. When D <0, the dot will hear the client better than the dot client. Depending on the distance, this will mean either that the data flow from the client to the point will be slower than from the point to the client, or the client will not be able to reach the point at all.
For the points we have taken (100mW = 20dBm) and the client (30-50mW ~ = 15-17dBm), the power difference will be 3-5dB. As long as the receiver point is more sensitive than the client receiver for these same 3-5dB - there will be no problems. Unfortunately, this is not always the case. Let's do the calculations for the HP 8440p laptop and the D-Link points of the DIR-615 for 802.11g@54Mbps (why it is important to also indicate the rate / MCS in the next section):
  • 8440p : Tx * (STA) = 17dBm, RxSens * (STA) = -76dBm @ 54Mbps
  • DIR-615 : Tx (AP) = 20dBm, RxSens (AP) = -65dBm @ 54Mbps.
  • D = (17 - 20) - (-76 +65) = 3 - 11 = -7dB.
Thus, problems can be observed in the work, moreover, due to the point.

Conclusion: it may be that in order to get a more stable connection, the power of the point will have to be reduced . That, you see, is not quite obvious :)

[1.2] It is also far from the most well-known fact that adds to the asymmetry, that the majority of client devices have reduced transmitter power on the “extreme” channels (1 and 11/13 for 2.4 GHz). Here is an example for the iPhone from the FCC documentation (power at the antenna port).

As you can see, on the extreme channels, the transmitter power is ~ 2.3 times lower than on average. The reason is that Wi-Fi - broadband connection, to keep the signal clearly within the channel frame will not succeed. So we have to reduce the power in "borderline" cases, so as not to hurt the ranges adjacent to the ISM. Conclusion: if your tablet does not work well in the toilet - try to move to channel 6.

2. Since we are talking about channels ...


Everyone knows the "non-intersecting" channels 1/6/11. So, they intersect! Because Wi-Fi, as mentioned earlier, the technology is broadband and it is impossible to completely contain the signal within the channel. The illustrations below demonstrate the effect for 802.11n OFDM (HT). The first illustration shows the spectral mask 802.11n OFDM (HT) for a 20 MHz channel at 2.4 GHz (taken directly from the standard). Vertically - power, horizontally - frequency (offset from the center frequency of the channel). In the second illustration, I superimposed the spectral masks of channels 1,6,11, taking into account the neighborhood. From these illustrations we will draw two important conclusions.



[2.1] Everyone thinks that the channel width is 22 MHz (that is). But, as the illustration shows, the signal does not end there, and even non-overlapping channels still overlap: 1/6 and 6/11 - by ~ -20dBr, 1/11 - by ~ -36dBr, and 1/13 - by -45dBr.
Attempting to put two access points configured on adjacent “non-overlapping” channels close to each other will cause each of them to create a neighbor of 20dBm - 20dB - 50dB interference [which will add to the loss of signal propagation over a small distance and a small wall] = -50dBm! This noise level can completely block any useful Wi-Fi signal from the next room, or block your communications entirely!
Why
802.11 uses the CSMA / CA medium access method (usually, using the EDCA / HCF method, for anyone interested, read about 802.11e). To determine whether the channel is busy, the CCA (Clear Channell Assesment) mechanism is used. Here is an excerpt from the standard:
The signal is taken to be 20 dB or more above the minimum modulation and the coding rate sensitivity (–82 + 20 = –62 dBm) in the 20 MHz channel.
Accordingly, the station (point or client) considers the air busy if it hears the -62dBm signal or higher, regardless of whether the transmission was on the same channel, on the next one, or if the microwave works in general. In the case of the client, it is still not so bad, but if you have an obstacle in> = - 62dBm around the point - the whole cell will suffer. For the same reason, all serious vendors simply do not release dual-radio APs, in which both modules can operate in 2.4 at the same time: it’s easier to prohibit than to explain every time that it’s not “VendorH - shit”, but “learn the materiel”.

Conclusion: if you put a dot near the wall, and your neighbor on the other side of the wall, his dot on the adjacent “non-overlapping” channel can still cause you serious problems. Try to calculate the interference values ​​for channels 1/11 and 1/13 and make your own conclusions.
Similarly, some try to “seal up” the coverage by setting two points tuned to different channels at each other by a stack — I think you no longer need to explain what will happen (an exception will be correct shielding and competent antenna separation — anything is possible if you know how).

[2.2] The second interesting aspect is the attempts of slightly more advanced users to “escape” between the standard channels 1/6/11. Again, the logic is simple: “I’ll say less interference between channels”. In fact, interference is usually caught not less, but more. Previously, you suffered in full only from one neighbor (on the same channel as you). But it was not interference of the first OSI level (interference), but of the second - collisions - because your point shared a conflict domain with a neighbor and civilizedly coexisted on a MAC level. Now you catch the interference (Layer1) from two neighbors on both sides.
As a result, delay and jitter may have tried to decrease slightly (since there are no conflicts now), but the signal-to-noise ratio also decreased. And with it, the speeds decreased (since each speed requires some minimum SNR - about this in [3.1]) and the percentage of valid frames (since the SNR margin decreased, sensitivity to random spikes of interference increased). As a result, retransmit rate, delay, jitter usually increases, throughput decreases.
In addition, with a significant overlap of the channels, it is possible to correctly receive the frame from the adjacent channel (if the signal-to-noise ratio allows) and still get a collision. And with interference above -62dBm, the aforementioned CCA mechanism simply will not allow using the channel. This only aggravates the situation and negatively affects throughput.
Conclusion: do not try to use non-standard channels without considering the consequences, and discourage neighbors from this. In general, the same as with power: discourage neighbors from cutting points into full power on non-standard channels - there will be less interference and collisions for everyone. How to calculate the consequences will be clear from [3].

[2.3] For about the same reasons, you should not put an access point at the window, unless you plan to use / distribute Wi-Fi in the courtyard. There is no sense to you from the fact that your point will shine into the distance - but you will collect collisions and noise from all your neighbors in direct view. And add to the clutter of the ether. Especially in the zigzag apartment buildings where the windows of the neighbors look at each other from a distance of 20-30 meters. Bring lead paint to the neighbors with dots on windowsills ... :)

[2.4] [UPD] Also, the issue of 40MHz channels is relevant for 802.11n. My recommendation is to turn on 40MHz in the “auto” mode at 5GHz, and not to turn on (“20MHz only”) at 2.4GHz (except for the complete absence of neighbors). The reason is that in the presence of 20MHz neighbors you are more likely to get interference on one of the 40MHz channel halves + the 40 / 20MHz compatibility mode will turn on. Of course, you can rigidly fix 40MHz (if all your clients support it), but the interference will still remain. As for me, it is better to have stable 75Mbps per stream than unstable 150. Again, exceptions are possible - the logic from [3.4] is applicable. Details can be found in this comment thread (read [3.4] first).

3. Since we are talking about speeds ...


[3.1] Already several times we mentioned speeds (rate / MCS - not throughput) in conjunction with SNR. Below is a table of the required SNRs for rebates / MCS, compiled by me according to the materials of the standard. Actually, this is why for higher speeds the sensitivity of the receiver is less, as we noted in [1.1].

In 802.11n / MIMO networks, thanks to MRC and other multi-antenna tweaks, the desired SNR can also be obtained with a lower input signal. Usually, this is reflected in the sensitivity values ​​in datasheet.
From here, by the way, we can draw one more conclusion: the effective size (and shape) of the coverage area depends on the chosen speed (rate / MCS). This is important to consider in your expectations and when planning a network.

[3.2] This item may not be feasible for owners of access points with very simple firmware, which do not allow exhibiting Basic and Supported Rates. As mentioned above, the speed (rate) depends on the signal-to-noise ratio. If, say, 54Mbps requires SNR at 25dB, and 2Mbps requires 6dB, then it is clear that frames sent at 2Mbps will “fly” further, i.e. they can be decoded from a greater distance than faster frames. Here we come to the Basic Rates: all service frames, as well as Broadcast (if the point does not support the BCast / MCast acceleration and its variants), are sent at the lowest Basic Rate. And this means that your network will be visible for many quarters. Here is an example (thanks to Motorola AirDefense).

Again, this adds to the collision picture discussed in [2.2]: for the situation with neighbors on the same channel, and for the situation with neighbors on close overlapping channels. In addition, ACK frames (which are sent in response to any unicast packet) also run at the minimum Basic Rate (if the point does not support their acceleration)
More math
Suppose your dot works in 802.11 with all MCS. She sends you a frame on MCS7 (65.5 Mbps) and you respond with ACK on MCS0 (6.5Mbps). By removing support for, say, MCS0-3, you will send ACKi to MCS4 (39Mbps) - 6 times faster than on MCS0. With such a simple trick, we just reduced the guaranteed network latency, which is nice if you want low ping in games and even voice / video conferencing.

Conclusion: disable low speeds - the network will work faster for both you and your neighbors. You have - due to the fact that all service traffic will start to move sharply faster, from neighbors - due to the fact that you do not create collisions for them now (although you still create interference for them - the signal has not gone anywhere - but usually enough low). If you convince your neighbors to do the same, your network will work even faster.

[3.3] It is clear that if you turn off low speeds, you can also connect to it only in the zone of a stronger signal (SNR requirements have become higher), which leads to a decrease in effective coverage. As well as in the case of power reduction. But here you decide what you need: maximum coverage or fast and stable connection. Using the nameplate and datasheet of the point manufacturer and customers is almost always possible to achieve an acceptable balance.

[3.4] Another interesting issue is compatibility modes (the so-called “Protection Modes”). Currently there is bg (ERP Protection) and a / gn (HT Protection) compatibility mode. In any case, the speed drops. A lot of factors affect how much it falls (there is enough material for two more articles), I usually just say that the speed drops by about a third. At the same time, if you have a 802.11n dot and a 802.11n client, but the neighbor behind the wall has a dot g, and its traffic reaches you - your dot will fall into compatibility mode in the same way, because the standard requires it. It is especially nice if your neighbor is a DIY and sculpts something based on an 802.11b transmitter. :) What to do? Just as with the care on non-standard channels - assess what is more important for you: collisions (L2) or interference (L1). If the signal level from the neighbor is relatively low, switch points to pure 802.11n (Greenfield) mode : the maximum throughput may decrease (SNR will decrease), but traffic will run more evenly due to getting rid of excessive collisions, protection frame packets and switching modulations. Otherwise, it is better to endure and talk to your neighbor about the power / movement of the AP. Well, or put a reflector ... Yes, and do not put a dot on the window! :)

[3.5] Another option is to move to 5 GHz, the air is cleaner there: there are more channels, less noise, the signal is weakened faster, and corny points are more expensive, which means they are fewer. Many people buy a dual radio point, configure 802.11n Greenfield at 5 GHz and 802.11g / n at 2.4 GHz for guests and all kinds of gadgets that don't need speed anyway. Yes, and safer: the majority of script kiddies do not have money for expensive toys with 5 GHz support.
For 5 GHz one should remember that only 4 channels work reliably: 36/40/44/48 (for Europe, for the USA there are 5 more). On the others, coexistence with radars ( DFS ) is enabled. As a result, the connection may periodically disappear.

4. Since we are talking about security ...


Let us mention some interesting aspects here.
[4.1] What should be the length of the PSK? Here is an excerpt from the text of the standard 802.11-2012, section M4.1:
Relatively low levels of security, especially with keys generated form short passwords, since they are subject to dictionary attack. It is recommended that you use it. A key is generated from a little bit different than to deter attacks.
Conclusion: well, who has the password for the home point consists of 20+ characters? :)

[4.2] Why doesn't my 802.11n dot “accelerate” above a / g speeds? And what does this have to do with security?
The 802.11n standard only supports two encryption modes: CCMP and None. Certification Wi-Fi 802.11n Compatible requires that when you turn on TKIP on the radio, the point ceases to support all new 802.11n speed modes, leaving only 802.11a / b / g speeds. In some cases, you can see associations at higher rates, but throughput will still be low. Conclusion: we forget about TKIP - it will still be banned from 2014 (plans for the Wi-Fi Alliance).

[4.3] Should I hide (E) SSID? (this is a more well-known topic)
hid
Firstly, it should be understood that while hiding the ESSID, your point does not disappear from the air. She also diligently sends beacons, simply without indicating the ESSID in them. And this ESSID will cease to be hidden as soon as a client tries to connect to a point (which, for a successful connection, must correctly specify the ESSID). At this point, the binding of the ESSID to the BSSID is caught - and the game of hide and seek ends. The process can be accelerated by shooting an existing client with a disassociation frame. So there is no benefit from this concealment. Conclusion: the effectiveness of hiding the SSID is approximately equal to the effectiveness of hiding the text under the spoiler.
Nevertheless, it is worth hiding - no harm from that either. But there are two important exceptions: devices with crooked drivers ( Apple IOS , for example, have a number of funny jambs associated with saved profiles of hidden networks) that cannot confidently connect to hidden ESSIDs. Also, computers running Windows XP with WZC are constantly looking for adventures Networks with hidden SSIDs configured on the client, which not only give out their names, but also suggest the evil twin attacks.


5. Anything.


[5.1] A little bit about MIMO. For some reason, to this day I come across formulations like 2x2 MIMO or 3x3 MIMO. Unfortunately, for 802.11n this formulation is of little use, since it is important to know the number of spatial streams (Spatial Streams). A 2x2 MIMO point can support only one SS, and will not rise above 150Mbps. A point with 3x3 MIMO can support 2SS, limited to only 300Mbps. The complete MIMO formula looks like this: TX x RX: SS. It is clear that the number of SS cannot be greater than min (TX, RX). Thus, the points above will be recorded as 2x2: 1 and 3x3: 2. Many wireless clients implement 1x2: 1 MIMO (smartphones, tablets, cheap laptops) or 2x3: 2 MIMO. So it’s useless to expect 450Mbps speed from a 3x3: 3 access point when working with a 1x2: 1 client. Nevertheless, buying a point like 2x3: 2 is still worth it , since more receiving antennas adds a point of sensitivity (MRC Gain). The greater the difference between the number of receiving point antennas and the number of client transmitting antennas - the greater the gain (if on the fingers). However, multipath comes into play.

[5.2] As you know, the multipath for 802.11a / b / g networks is evil. An access point placed by the antenna in the corner may not work in the best way, and extended from this angle by 20-30cm may show a significantly better result. Similarly for customers, premises with a complex layout, a bunch of metal objects, etc.
For MIMO networks with MRC and in particular for operation of several SS (and therefore, to obtain high speeds) multipath is a necessary condition. For if it does not exist, it will not be possible to create several spatial streams. Predicting anything without special planning tools is difficult here, and it’s not easy with them. Here is an example of calculations from Motorola LANPlanner, but only radio intelligence and testing can give a definite answer.

Creating a favorable multipath environment for working with three SS is more difficult than working with two SS. Therefore, newfangled points 3x3: 3 work with maximum performance, usually only in a small radius, and even then not always. Here is an eloquent example from HP (if you dig deeper into the materials of the announcement of their first point 3x3: 3 - MSM460 )

[5.3] Well, and a few interesting facts for the collection:


Total


802.11 technology (and the radio network as a whole) has many non-obvious features. Personally, I have great respect and admiration for the fact that people have honed how complex technology to the level of "stick-work." We examined (in different volumes) different aspects of the physical and data link layer of 802.11 networks:

Not everything was considered in full and exhaustive form, as well as unobvious aspects of customer coexistence, load balancing, WMM, power and roaming, exotics such as Single-Channel Architecture and individual BSS were left behind - but this is a topic for networks of a completely different scale. If you follow at least the above considerations, in a normal residential building you can get quite decent communism microcell, as in high-performance corporate WLAN. I hope the article was interesting for you.

Source: https://habr.com/ru/post/149447/


All Articles