Monday, November 14, 2005

Freifunk success.

To address the DHCP question I hunted around and eventually found this site which describes making a small mesh of WRT54Gs with Freifunk firmware. The Marseille-Wireless site was very helpful with its screen shots and an IP subnetting tool was invaluable.

What I learned was that the OLSR DHCP facility gives out IP addresses to anything requesting them and that you configure a range of addresses to be available from each WRT that doesn't clash with others. The first IP address in the subnet identifies the network, the next one is used for the wireless side of the WRT (set manually as a fixed IP) and subsequent ones are given out up to the last one which is used as a broadcast address.

So, as an example, 192.168.3.16/29;255.255.255.248 is entered into the OLSR/DHCP field of the setup page. This range covers addresses 192.168.3.16 to 192.168.3.23 of which .17 is used for the WRT, .23 is the broadcast address and .18 through .22 are available for DHCP clients such as passing laptops.

My first attempt was to use these ranges but with the wireless side of the WRT set to my previous addresses, which then fell outside the OLSR DHCP range.

With the WRT set to the correct addresses the laptop was able to collect an IP address by DHCP, for some reason it picked up the address from the downstairs WRT even though it was sat next to the upstairs one. It is not clear if this was chance (both would have been in range) or if the OLSR/DHCP address is only given out by WRTs that have an active WAN port connection to the internet ie only gateways do DHCP and point the client to themselves as default gateway.

With that issue resolved the Freifunk setup appeared to be working as it should, with internet access provided seemlessly by the ad-hoc wireless network and OLSR routing looking after the how and why.

My final activity with this firmware will be to test performance and see if I can deduce the rules about which WRT hands out the OLSR/DHCP addresses.

The network IP addressing as finalised is shown below.


3 Comments:

Blogger Dan said...

Hi Phil,

Just to clarify about how (I think) the Freifunk OLSR/DHCP setting works. I've read http://www.freifunk.net/wiki/FreifunkFirmwareEnglish over again. Say specify

192.168.3.16/29;255.255.255.248

The subnetting tool will tell you that a /29 subnet is the same size subnet as 255.255.255.248 - they both mean the same thing. In the freifunk firmware, the /29 is the size if the overall subnet for that particular WRT, and the 255.255.255.248 bit is the size of the subnet that will be controlled by DHCP. So the second subnet needs to be the same or smaller than the first subnet specified. If you specify them to be the same size, you are giving all your node's spare IPs away as DHCP addresses - and nodes using these addresses will be hidden from the rest of the mesh behind NAT.

What I'm not sure about is what happens if you specify a DHCP netmask that is smaller than half of the overall node netmask. e.g 192.168.1.1/29;255.255.255.0. I'm guessing you get a small DHCP range, but what range of IPs are DHCP within the overall node subnet?

Also, what about non-dhcp clients to the OLSR node? They can't really communicate to the rest of the mesh unless the OLSR node advertises it's subnet via HNA (for routing to work, the node you are communicating with must have a route back to you). What's the reason for having non-NAT IP addresses? They would seem to be fairly useless without an HNA.

Finally, with regards to which WRT hands out the DHCP addresses - if the client is within direct wireless range of both WRTs then OLSR is bypassed - the nodes are talking to each other at the Ethernet level. DHCP relies on broadcast packets, so when the client is within direct range of both WRTs I would think it would be a similar situation to having two DHCP servers on a wired network. OLSR does not forward broadcast packets, so if your client is within range of one of your WRTs but not the other then it should always get a lease from the in-range WRT. The in-range WRT will not forward the clients' DHCP requests (which are broadcast traffic) on to the rest of the network. At least, that what I think happens.

3:39 AM  
Blogger PhilT said...

I figured out my OLSR/DHCP issue, one of the WRTs was set to "11g only" mode so the 802.11b card I was using had to talk to the further away WRT which was also in range.

If its in range of a gateway node it still uses the OLSR/DHCP functions to get an IP address etc and it does route through the node allocating it the address, even though its in range of the gateway. I could see this from the default gateway and by tracerouting it.

Thanks for clarifying the /29 and subnet mask, I hadn't twigged they were different things. The laptop given a DHCP address isn't hidden in the sense that I could ping a 192.168.3.x wireless laptop from 10.0.0.24 which is hanging off the Belkin ADSL router. Might be NATted, but not hidden.

Phil

7:41 AM  
Blogger Unknown said...

Dear Phil,
U know lots of things, so I hope u can help me out. I can access my sagem livebox through telnet and would like to change or remove the prefix fti so as I can use my LB with another Provider. Could u help? thks Ng
ngtatchung@andorra.ad

12:19 AM  

Post a Comment

<< Home