Welcome back to my series on WiFi. In Part 1 of the series, I began with some basics of RF and explained some differences about antennas. It should be apparent at this point that there is a science behind this activity, and I’ll take this moment to warn you thoroughly before we move on: These posts are a good way for you to become familiar with WiFi and should provide you with some solid knowledge to help improve your WiFi coverage. However, this brief education is not a replacement for having an actual RF engineer do a site survey of your environment! If you have a “must work right the first time” environment, and you’re reading this because you’re the decision-maker and don’t have the slightest hint about what all this is about, Get An Expert. They do this all day long. It’s money well spent.

If you do use these techniques below, Your Mileage May Vary. It’s also important to note that if you go to all this work, setup your access points, then your neighbor goes and installs his AP right next to yours on the same channel, then you’re going to be stuck re-doing these activities all over again. WiFi isn’t a static situation; as people get more WiFi-connected devices, the playing field changes, and it will change on you, I guarantee it.

Understanding RF Interference and What It Does to WiFi

You hear people joke about microwave ovens interfering with WiFi equipment pretty often. Most people laugh it off as an urban legend. It’s not. Below, I have included some RF spectrograms for your entertainment. If you haven’t seen images like this before, they are a visualization of signal frequency and intensity over time. Past-to-present is a top-to-bottom relationship, and the colors are a heatmap (with red being a strong signal.) As you look at both types of graphs, the channels start from 1 at the left hand side of the graph, and go up through 12 in the right hand side. NOTE: Quick Shout-Out to the guys at metageek.net for creating the awesome Wi-Spy and accompanying Chanalyzer Pro software. We paid full price for the DBx bundle (Comes with the Wi-Spy DBx and Chanalyzer Pro) and I definitely feel like it was money well spent. Check them out if you want to do these types of visualizations yourself.



These images show what the wireless signal looks like in my suburban home. Not a lot of interference in this visualization, you can see my home Cisco Aironet 1240 AP humming along happily as visualized by the wavy lines in the waterfall spectrogram, above. In the lower graph, we see signal strength (Amplitude) measured by frequency.


Let’s shake things up, and show what happens when you fire up a microwave oven:



Look out, here comes that microwave burrito exploding all over your RF Spectrum! For about 30 seconds, I nuked a mug of water and this was the result. You can see through the swamp of RF that the access point does its best to compensate for the signal interference, but that’s a pretty strong blast of RFI.


Do you have a baby monitor at home? Is it on 2.4ghz? Ready to see what it’s doing to your wireless signal?




These two charts were captures I took from my friend’s house (incidentally, the gentleman who I mentioned in the previous post – he has a penchant for wifi problems.) I was over his house and ran some traces to get a visualization of his wireless conditions in preparation for installing a new wireless router. I asked him if he noticed the WiFi being slower at night and he’d mentioned that it did indeed seem to be more problematic at night. Welcome to the wonderful world of random equipment in your home causing issues with your wifi. In the above trace, you can see the telltale wavy lines of the access point, trying to power its way through the interference. The graph below has just the slighest hint of bell curve, which is where his AP was situated in the RF Spectrum. I believe in this case his AP was on channel 3. Needless to say, we popped his new wifi router on channel 11, which is quiet in these graphs.

One final graph to show. If you scroll back up to the initial image I showed of my suburban home, this will give you an idea of what your general household’s 2.4gHz spectrum might look like. Now, compare that image to this:



This, my friends, is what the 2.4gHz spectrum looks from the Stack Exchange offices. We’re located down by Wall Street, on the 26th Floor of One Exchange Plaza. Our scenic vantage point does come with a cost! These spectrograms show just how much RF interference we are subject to at this location. Astute readers may notice the timescale difference on the graphic, but I assure you that the 30 second view is just as nasty.

What can we take away from these charts? One could safely summarize this entire section as “Location and the gadgets in your home both play a significant role in how your WiFi might perform.”

Mapping Your Wireless Landscape

It’s worth noting that even though the above charts were taken using a very expensive measuring tool, your laptop’s WiFi card is a potent ally in your quest to improve your coverage. For the next section, I am assuming that you firstly are running Windows and have downloaded and installed both Vistumbler as well as Microsoft SQL express. I am aware that a strong number of our readership are Linux based, and there is also a big Mac contingent. I’ll unabashedly say that the steps I’m following and the software choices I made were purely for my convenience, but I hope that I explain the process in easy enough terms so that the tinkerers out there can take the wheat from the chaff, so to speak.

Step 1 – Take some measurements!

Vistumbler is a wardriving utility that, when attached to a gps, can help you map where there are wireless access points in range of your device. We’re going to borrow it for a more sedentary purpose. Fire up Vistumbler, set your laptop in the areas where you want to consume your WiFi signal, and then start the scan/capture process. Leave the laptop there for at least 30-60 minutes, as we want a whole lot of datapoints to work with. It will keep track of every time it hears of an access point and record the relative strength of the signal. Once the time is up, you can either run the detailed export to CSV now, or “Exit (Save DB)” and come back to export the file later. NOTE: If you’re in a tight urban region like we are at Stack Exchange, leaving Vistumbler up for 30+ minutes will result in a tremendous amount of data! It’s wise to have a very powerful PC to handle the vistumbler export process, or do seperate scans and aggregate the data together in a later step.

Step 2 – Massage the data!

Sadly, Vistumbler’s export to CSV does leave a bit to be desired with its field quoting. We’re going to open the csv in Excel, since it seems to be especially forgiving. Once we’ve opened it in Excel, we’ll do the following steps:

  • Make a new column for Location. Populate the column with a location name. You’ll want this when you’re querying SQL later on.
  • Save the file as an Excel spreadsheet.
  • Fire up SQL Server Management Studio.
  • Create a new database if you don’t already have a good scratch database, then right-click the db and select tasks->import data.
  • Using “Microsoft Excel” as a datasource, submit your new excel file as the source data. HINT: If you’re getting an error about unable to find a particular OLE provider, and you’re on 2010 like me, with 64bit windows, you will likely need this link to load said provider.
  • Select the destination database; elementary stuff here. From this point on, “Just Keep Hitting Next,” except for the prompt where you specify the destination table name. I strongly advise you to change that name to something easier to type rather than the default date/time string. Finally, Finish to start the import job. This may take a while, so don’t be afraid if it seems like it’s taking too long.
  • Repeat these steps for each file of data. Be sure to specify the same table name for each import, it will append to the database.

Step 3 – Analyze!

With this complete, congratulations! You now have data in a sql server that you can use to leverage the power of SQL to get some statistics from. I’ll admit I’m a SQL neophyte — I can do some joins and “GROUP BY”s but I’m sure others could tease a lot more information out of it than I have. Here are some basic queries for your dataporn pleasure:

Get a sorted list of strongest access points across all locations:

select LOCATION, SSID, AVG(SIGNAL) AS AVGSIGNAL
FROM [dbo].[wifilog]
GROUP BY LOCATION,SSID
ORDER BY AVGSIGNAL DESC

LOCATION SSID AVGSIGNAL
sysadmin SO-GUEST 90
cantremember SO-GUEST 89.7431436154527
cantremember NULL 73.9324583394779
cantremember ROVIO 70.6069006192864
sysadmin ROVIO 69.875
sysadmin NULL 61.5
sysadmin hpsetup 61
cantremember Grusslife 60.2857564140372
sysadmin Grusslife 59.5625
cantremember HPC7B114 55.2590909090909

In the above query, we see that in our sysadmin office, as well as somewhere in our office (for shame, I forget where I took the trace!) the strongest signals are SO-GUEST (our current guest wireless AP) and ROVIO (for our cute little mobile webcam.) We’ve also got a couple shadow AP’s (as specified by NULL) followed up by some other AP’s that I’m not sure who or where they are. Suffice to say, our current AP is pretty strong in these two locations.

Find the average signal strength of all APs at a particular location:


select SSID, AVG(SIGNAL) AS AVGSIGNAL
FROM [dbo].[wifilog]
WHERE LOCATION='sysadmin'
GROUP BY SSID
ORDER BY AVGSIGNAL DESC

SSID AVGSIGNAL
SO-GUEST 90
ROVIO 69.875
NULL 61.5
hpsetup 61
Grusslife 59.5625
Akin Law 55

Similar to the first query, you can drill down by a particular location and see the top AP’s seen at that location. This is useful, but what we’re really looking for is the least used channels at a certain location.

Get a channel utilization chart


select LOCATION,CHANNEL,SSID,AVG(SIGNAL) AS AVGSIGNAL
FROM [dbo].[wifilog]
GROUP BY LOCATION,CHANNEL,SSID
ORDER BY AVGSIGNAL DESC

LOCATION CHANNEL SSID AVGSIGNAL
cantremember 8 NULL 90.034808259587
sysadmin 8 SO-GUEST 90
cantremember 8 SO-GUEST 89.7431436154527
sysadmin 8 NULL 88
cantremember 11 ROVIO 70.6069006192864
sysadmin 11 ROVIO 69.875
sysadmin 6 hpsetup 61
cantremember 11 Grusslife 60.2857564140372
sysadmin 11 Grusslife 59.5625

The above gives us some pretty useful information. We can see here that channels 8 and 11 have several entries, and only one device in range of our scans is on channel 6. Using some critical thinking, it’d indicate that channel 3 might be a good choice should we want to add a new AP to this environment. Lets massage the query a bit to see if that’s confirmed by our other data:


select LOCATION,CHANNEL,SSID,AVG(SIGNAL) AS AVGSIGNAL
FROM [dbo].[wifilog]
WHERE CHANNEL in (1,2,3,4,5,6)
GROUP BY LOCATION,CHANNEL,SSID
ORDER BY AVGSIGNAL DESC

LOCATION CHANNEL SSID AVGSIGNAL
sysadmin 6 hpsetup 61
cantremember 2 NULL 57.8348569743439
sysadmin 1 cisco-voice-axiomSL 55
sysadmin 6 Akin Law 55
sysadmin 1 cisco-data-axiomSL 55
cantremember 6 Akin Law 54.2220583898555
cantremember 2 BLUESKY-NYC 51.3716814159292
sysadmin 2 BLUESKY-NYC 51
sysadmin 1 cisco-scan-axiomSL 51
cantremember 6 OpenWrt 50.7345132743363
sysadmin 6 OpenWrt 50
cantremember 6 EPAD 49.154272517321
cantremember 1 FGAwireless 48.0518896220756
sysadmin 6 EPAD 48
cantremember 1 cisco-voice-axiomSL 47.982855143457
cantremember 1 cisco-scan-axiomSL 47.9389792899408
cantremember 1 cisco-data-axiomSL 47.4301110385369
sysadmin 6 VX7E7 46
cantremember 4 Corner 45.3483043079743

At first blush, one might be enthusiastic about channel 3 given the fact it’s not used as the main carrier frequency in any of our entries. Be careful, though, for WiFi channels have some pretty strong overlap:

Image courtesy of prophotowiki

As this graphic shows, each wifi “Channel” is merely just a 5MHz swatch of the 2.4ghz ISM band. WiFi signals have a 22Mhz bandwidth, so realistically there’s only 3 channels one can use in an environment without any fear of interference or overlap. Because of this, one needs to take into account not only the channel but also the signal strength of potentially interfering access points.

In our case at Stack Exchange, there are just so many APs utilizing so many channels that we’ve ultimately decided to go with a Cisco controller-based access point layout, which will dynamically change channels based on signal conditions in realtime. For those of us at home, this is way too expensive of an option for most. Sadly, we’ll just have to take these data queries and give it our best shot.

I hope this blog series helps you a bit with your next WiFi installation. In summary:

  • Antenna choice matters when you’re trying to cut through interference or travel long distances.
  • Most residential building materials will not diffuse wireless signals to an appreciable amount unless you’re talking about very far distances, (i.e. trying to use your laptop on the third floor at the far side of your house when the AP is in the basement, for instance.)
  • Be aware of electronics in your home that might share the 2.4GHz radio spectrum; they can seriously affect your wireless transfer rate and signal strength.
  • Apps like Vistumbler can catalog used channels in your environment and you can then use this data to find a quiet spot in the spectrum.

As always, I welcome your comments and criticisms, below. Also, feel free to share any specific SQL queries you used that might help glean even more information from the datasets you’ve gathered!

«
»
  1. Luis Teixeira says:

    Awesome! I’m about to graduate from college, and my graduation papar will be about site surveys for WiFi networks. I didn’t know about vistumbler and never thought about dumping capture data into a db for later analysis. Really clever, specially if you’re on a short budged as I am (spent it all on my brand new WiSpy – worth every penny).

  2. Peter Grace says:

    Thanks, Luis!  I definitely agree, the WiSpy is really awesome if you’re into doing RF interference surveying.

  3. Jeff Blaine says:

    Thanks for this.  I aim to solve my parents’ nasty wi-fi problems.

    PS: You have some broken HTML under your “Get a channel utilization chart”

  4. Fynamo says:

    Woot! Awesome! Fantastic analysis.

  5. Kev says:

    Very enlightening article. Probably explains why in the last few urban locations I resided in I could never get WiFi to work satisfactorily despite changing the hardware several times. Now that I live in rural Ireland the only interference I have to suffer from is cows mooing in the night :)

  6. Chris Hearn says:

    A good app for doing this on the Mac is NetSpot: http://www.netspotapp.com/

  7. Paul Weber says:

    One thing that helped me pretty much is to enable the neighbour friendly mode of my n draft network, after finding out that there are around 40 wireless networks in my environment at home with kismet. No wireless problems now (but I also do not have a babyphone or microwave)

  8. Peter Grace says:

    Newer consumer wireless routers will do a lot of this work for you, with features like Neighbor Friendly Mode and auto-channel-selection.  It does make life a lot easier, but I think we’re all better off if we know how to do it by hand if we have to.  Thanks for the input!

  9. Peter Grace says:

    One of my fellow Stackers also mentioned that iStumbler is an analogous software for the Mac that would fill the role of Vistumbler in the above tutorials.  I haven’t used it myself so can’t comment authoritatively, but if it comes from the same roots (the old NetStumbler project) I have to assume the feature sets are nearly in parity.

  10. Peter Grace says:

    Thanks for the praise, I aim to please.

  11. Peter Grace says:

    Thanks, I do get ridiculed here at StackExchange for writing my posts in raw html, bypassing WordPress’s WYSIWYG editor entirely.  Thanks for the catch; shame on me for not proofreading thoroughly!

  12. Chris Hearn says:

    Yeah I use iStumbler too, but it doesn’t help map/plot an area.  NetSpot does, but it requires you to use your own map & you have to tell it where you are on the map.  No GPS.  I think that’s OK though.

  13. Eli Lansey says:

    Any sense as to why the microwave oven messes with things that much? I thought the MW resonances were isolated (skin effect and so on).

  14. Apollo Shockman says:

    This is really missleading to say outloud :

    “so realistically there’s only 3 channels one can use in an environment without any fear of interference or overlap”

    You should be pointing out that those 3 channels are the only 3 that won’t over lap with each other!, not that using one of these 3 will always or somehow avoid interferance or overlap and give a perfect signal.

Leave a Reply