Your Linux Data Center Experts

WDS (Wireless Distribution System) is a mechanism in which a single WiFi card (or radio) can be used both to act as an Access Point for other nodes, while also being able to connect to another AP. Typically, when you are running a card as an AP (in “Master” mode), you have no way to connect to other APs, since they talk to nodes running in client (or “Managed”) mode. WDS allows exactly this sort of wireless back-haul. WDS is straightforward to do, once you understand what's going on. However, I wasn't able to find anything that resolved my conceptual misunderstandings, so let me give some details on it.

At Hacking Society here, we have a nice meeting space, but it's fairly far through a commercial building from our access point to the conference rooms we use. I have heard several people put down the built-in antennas on laptops, saying they're “just wires run up by the screen. However, I don't think most people fully appreciate just how much most antennas resemble wires. Don't forget that most PC Card WiFi adapters just have small "antennas” etched as traces on the board, so…

That said, my Thinkpad tends to have great reception. I rarely if ever have problems on the network there, but many other folks have severe problems. Scott brings an external Lucent antenna to use with his laptop, for example.

We could set up a pair of APs between the meeting space and the normal AP, with one AP acting as a client, bridging to Ethernet, and the other AP acting as a real AP that we connect to. This would act as a repeater, but would require two APs. This is where WDS comes in. WDS allows you to use one AP with just a single radio or WiFi adapter to perform both tasks. It can act as an AP, but also forward the packets on to the other AP. This is useful in places such as our meeting space where we can't get Ethernet anywhere except where the normal AP is.

When using WDS under Linux (our APs and my laptop both run Linux), you do a “wds_add” with the MAC address of the other AP, which results in another virtual interface showing up on your machine, which you can then configure as normal.

Now, the thing that I didn't understand and was causing me problems is that this WDS interface isn't exactly like a regular wireless interface. By this, I mean that you do not configure it in “Managed” mode to get it to interface with the other AP. This interface is a WDS interface and can only communicate with another WDS interface on the other end. In other words, you must do the “wds_add” on both ends of the WDS connection, each listing the MAC address of the other end. Once you do this, you can put IPs on the interfaces or deal with them as normal.

So, to set up two Linux machines to act as APs, with a WDS connection between them, you would do (on both machines, assuming you are using the hostap driver at “wlan0”):

iwconfig wlan0 mode Master
iwconfig wlan0 essid whateveressid
iwpriv wlan0 wds_add <MAC address of remote interface>
brctl addbr br0
brctl addif wlan0
brctl addif wlan0wds0
ifconfig wlan0 0.0.0.0
ifconfig wlan0wds0 0.0.0.0
ifconfig br0 <local IP address>

This bridges the WDS and the AP interfaces, so that it looks like one big network. Usually, you would then NAT or bridge this with an Ethernet interface on one of the systems to get access to the public Internet, of course.

The big disadvantage of doing this is that both the APs and the WDS back-haul have to run on the same channel, effectively halving (or more, in the case of a mixed b/g network) the performance of the network. Using separate radios for the back-haul in this case is a huge win, since you can dedicate a channel just to back-haul. The transmissions between the APs aren't conflicting with the user data. However if you're hanging this off a DSL line or cable modem you may not really care if you only have 3mbps or 15mbps of bandwidth on the wireless link.

comments powered by Disqus

Join our other satisfied clients. Contact us today.