{"id":38,"date":"2017-12-09T13:39:49","date_gmt":"2017-12-09T20:39:49","guid":{"rendered":"https:\/\/www.syatech.com\/blog\/?p=38"},"modified":"2017-12-09T14:10:12","modified_gmt":"2017-12-09T21:10:12","slug":"more-wifi-madness","status":"publish","type":"post","link":"https:\/\/www.syatech.com\/blog\/2017\/12\/09\/more-wifi-madness\/","title":{"rendered":"More WiFi Madness"},"content":{"rendered":"<p>Last time we were left with a question:\u00a0 if RSSI is a measure of signal strength, and if link quality is a measure of the signal-to-noise, and if Windows provides a standard formula for converting link quality to dB, why does the Amped Wireless adapter report an RSSI value (dBm) that is lower than the signal-to-noise ratio?\u00a0 We can&#8217;t have negative noise, can we?\u00a0 (It seems some manufacturers might think we can.)<\/p>\n<p>You may recall that this investigation started when a customer reported that an app that I&#8217;d written was reporting signal strengths about 10dB lower than those reported by InSSIDer Office.\u00a0 I eventually realized that they seem to be reporting an RSSI value calculated from the link quality reading reported by Windows, whereas I was reporting the actual RSSI value.\u00a0 This leaves us with a very important question:\u00a0 which value matches the <em>actual<\/em> received signal strength.<\/p>\n<p>It turns out that measuring signal strengths with most wifi equipment can be difficult.\u00a0 The wifi spectrum is very crowded, making it difficult to directly measure signals over the air.\u00a0 Wifi is bursty and your signal is interleaved with all your neighbors transmitting on the same channel.\u00a0 How can you be sure you&#8217;re really measuring the right thing?<\/p>\n<p>The obvious answer is to measure your signal on the bench, cabling your equipment together to keep out unwanted interference.\u00a0 Unfortunately this doesn&#8217;t always work very well in practice because most wifi radios (and especially this Amped Wireless USB adapter) are not well shielded and signals leak in like you wouldn&#8217;t believe.\u00a0 The last time I did this I had to put the receiver in a shielded box about 50 feet down the hall and connect it to the transmitter with a high-quality cable just so it wouldn&#8217;t pick up the stray signal radiated out of the case rather than the connector.<\/p>\n<p>I happen to live in a forested rural area with very few neighbors, and this really simplified things because the only signal I see on wifi channel 1 is from my home access point.\u00a0 I first recorded the signal strength as reported by my app and by InSSIDer Office (-58 dBm vs -50 dBm), and then I measured it directly with a Tektronix RSA306 Real-Time Spectrum Analyzer.\u00a0 I was careful to mount the antenna and cable in place so it wouldn&#8217;t move when switching between the Amped Wireless radio and the spectrum analyzer.\u00a0 (A slight change can make a big difference in received signal strength, as can variations in the environment.)\u00a0 After repeating the measurement several times I determined that the actual received signal strength at the antenna was -57 dBm.\u00a0 After repeating this whole experiment with a few different signal strengths I convinced myself that the RSSI value reported by the Amped Wireless adapter is a better measure of signal strength than the calculation from link quality.<\/p>\n<p>So why do some applications use link quality instead?<\/p>\n<p>It turns out there&#8217;s another Windows Native Wifi call that returns signal strength for the currently connected network: WlanQueryInterface().\u00a0 One of the options you can pass to this routine is\u00a0<em>wlan_intf_opcode_rssi,\u00a0<\/em>which returns an RSSI value for the specified interface.\u00a0 Unfortunately, different wifi adapters return different values for this call.\u00a0 I&#8217;ve seen some adapters\/drivers that return dBm, some that return 0 &#8211; 100, and some return other ranges.\u00a0 This variation makes this RSSI value difficult to use.<\/p>\n<p>In the course of this investigation I&#8217;ve learned that the Intel adapter in the laptop I&#8217;m using to write this post returns values from 0 to about 100, where the conversion to dBm appears to be approximately -95 + rssi.\u00a0 The Realtek driver for the Amped Wireless card on Windows 10 returns values from 0 to 255, and the conversion to dBm seems to be treating this value as a signed byte (-128 to 127) and adding -50.\u00a0 I seem to recall some older Cisco radios returned 0 &#8211; 100 but require a table lookup to convert to dBm.\u00a0 In my experience none of these conversions are documented, other than the occasional obscure research paper or mapping table that pops up in deep, dark corners of the internet.\u00a0 With all this variation it&#8217;s no wonder that developers would rather use link quality to approximate signal strength, which all radios seem to report with a reasonable consistency.\u00a0 That way their application works reasonably well with all wifi adapters.<\/p>\n<p>Now back to the original question:\u00a0 why is the signal strength reported by RSSI 10 dB lower than that calculated from the link quality, which we&#8217;ve assumed to be a measure of signal-to-noise?<\/p>\n<p>My current theory is that manufacturers are playing a bit of a game with this value.\u00a0 Let&#8217;s say someone comes out with a new wifi adapter that has an low-noise amplifier (LNA) in the front end.\u00a0 This will improve the receiver sensitivity, allowing it to receive weaker signals than other adapters without an LNA.\u00a0 So they would naturally want to differentiate their product by reporting a higher link quality number.\u00a0 After all, if a -90 dBm signal can barely be decoded by a normal card, but their adapter can receive signals all the way down to -100 dBm, their reported link quality should be 10 dB better, right?\u00a0 We can&#8217;t really fault them for this reasoning, because the quality of their link would really be better than the other card.\u00a0 The problem really stems from Microsoft claiming a conversion between link quality and dBm, and that&#8217;s not the manufacturer&#8217;s fault, eh?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last time we were left with a question:\u00a0 if RSSI is a measure of signal strength, and if link quality is a measure of the signal-to-noise, and if Windows provides a standard formula for converting link quality to dB, why &hellip; <a href=\"https:\/\/www.syatech.com\/blog\/2017\/12\/09\/more-wifi-madness\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/posts\/38"}],"collection":[{"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":8,"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":46,"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/posts\/38\/revisions\/46"}],"wp:attachment":[{"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.syatech.com\/blog\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}