Mesh Networking with OLSR

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:10, 5 June 2008 (edit)
Sash (Talk | contribs)
m (v.24 Final Broadcom)
← Previous diff
Current revision (23:28, 23 March 2018) (edit) (undo)
Ian5142 (Talk | contribs)
(Added Linking Routers Category.)
 
(43 intermediate revisions not shown.)
Line 1: Line 1:
-[[Category:English documentation]]+{{Languages|Mesh Networking with OLSR}}
 + 
 +'''''Wiki Path''''': [[Main_Page|DD-WRT Wiki Main]] / [[Tutorials]] / [[Linking Routers]] / '''Mesh Networking with OLSR'''
=General= =General=
Line 70: Line 72:
'''Plugins:''' '''Plugins:'''
 +
 + olsrd OLSR (Optimized Link State Routing) daemon
 + olsrd-mod-dyn-gw-plain Dynamic internet gateway plain plugin
 + olsrd-mod-bmf Basic multicast forwarding plugin, dependece: kmod-tun
 + olsrd-mod-httpinfo Small informative web server plugin
 + olsrd-mod-quagga Quagga plugin
 + olsrd-mod-dyn-gw Dynamic internet gateway plugin
 + olsrd-mod-txtinfo Small informative web server plugin
 + olsrd-mod-nameservice Lightweight hostname resolver plugin
 + olsrd-mod-dot-draw Dot topology information plugin
 + olsrd-mod-mdns Multicast DNS plugin
 + olsrd-mod-watchdog Watchdog plugin
 + olsrd-mod-arprefresh Kernel ARP cache refresh plugin
 + olsrd-mod-p2pd Peer to Peer Discovery plugin
 + olsrd-mod-secure Message signing plugin to secure routing domain
 + olsrd-mod-pud Position update plugin
 + olsrd-mod-jsoninfo
 + olsrd-mod-sgwdynspeed Select dynamic smart gateway based on gw speed
'''Sample config file:''' '''Sample config file:'''
Line 125: Line 145:
==DD-WRT > v.23 SP3== ==DD-WRT > v.23 SP3==
-try the following steps to get OLSR running:+You always can check the OLSRD status on the daemons web gui:
-under Wireless -> Basic Settings+ 
-*enable adhoc mode+ http://yourip:8080
-*set our wlan mode (b,g,mixed...)+ 
 +*enable your prefered networking mode. OLSR can run on any interface (lan or wifi).
 + 
 +Try the following steps to get OLSR running:
 + 
 +===OLSR on WiFi===
 + 
 +Under '''Wireless -> Basic Settings'''
 +*connect your devices with the preferred WiFi mode (WDS, adhoc, etc)
 +*set your wlan mode (b,g,mixed...)
*set your SSID *set your SSID
*set your channel *set your channel
-*unbridge the wlan+ 
-*set an ip+Before you go on test that the link is working, that the devices are connected and can reach each other.
-*set the network mask '''255.255.255.255'''+ 
-under Setup -> Advanced Routing+*unbridge the wlan on the wireless page
 +*set an ip from a different network than the router uses already
 +*set the network mask (e.g. to '''255.255.255.0''' for a /24 network)
 +*set your preferred encryption
 + 
 +===setup OLSR ===
 + 
 +Under '''Setup -> Advanced Routing'''
*set Operating Mode to OLSR *set Operating Mode to OLSR
*keep the basic olsr settings. they are ok for the first tests *keep the basic olsr settings. they are ok for the first tests
-*add the correct wlan interface to olsr (e.g. on most buffalos its eth1)+*add the correct wlan interface to olsr dependend on your wifi chip vendor and platform (e.g. on atheros wifi based systems its athX, on broadcom its mostly eth0, on ralink its raX)
*keep the interface settings for testing *keep the interface settings for testing
-===v.24 Final Broadcom===+====Enabling NAT routing====
-we have a bug in the broadcom tree that pevents olsr to run correct.+In Gateway mode the router performs NAT, while in other modes it doesn't. When you switch the Advanced Routing Operating Mode to OLSR Router, it turns off NAT. Here is how to turn the NAT back on, assuming you followed the instructions on unbridging the wlan. You must change the interfaces according to your system.
-olsr should work ok with settings above, but with the bug the wlan interface is '''NOT''' correctly unbridged in adhoc mode.+
-connect to the device via telnet or ssh and check the following output+
-<pre>wl status+Under '''Administration -> Commands'''
 +paste the script below into Commands and click "Save Firewall"
 +Do this on each device.
 +<pre>iptables -t nat -A POSTROUTING -o $(nvram get wan_ifname) -j MASQUERADE
 +iptables -t nat -A POSTROUTING -o $(nvram get wl0_ifname) -s $(nvram get eth1_ipaddr)/$(nvram get eth1_netmask) -d $(nvram get eth1_ipaddr)/$(nvram get eth1_netmask) -j MASQUERADE
 +iptables -t nat -A POSTROUTING -o $(nvram get lan_ifname) -s $(nvram get lan_ipaddr)/$(nvram get lan_netmask) -d $(nvram get lan_ipaddr)/$(nvram get lan_netmask) -j MASQUERADE
</pre> </pre>
-should show your device in adhoc mode. rssi & noise should have equal values as below, '''NOT''' 0dBm (in this case you should reboot and check again)!+ 
-<pre>+==External Links==
-SSID: "dd-wrt"+ 
-Mode: Ad Hoc RSSI: -49 dBm noise: -96 dBm Channel: 10+*[http://wiki.openwrt.org/inbox/mesh.olsr OpenWRt WIKI]
-BSSID: 2E:12:8F:xx:xx:xx Capability: IBSS+*[http://www.dd-wrt.com/phpBB2/viewtopic.php?t=37857&highlight=olsr True life stories]
-Supported Rates: [ 1(b) 2(b) 5.5(b) 11(b) ]+*[http://staros.tog.net/wiki/OLSR staros_olsr]
-</pre>+
-and+
-<pre>+
-ifconfig+
-</pre>+
-there should be shown the ip you set for the wlan interface. +
-here its eth1+
-<pre>+
-eth1 Link encap:Ethernet HWaddr 00:16:01:xx:xx:xx+
- inet addr:10.0.10.4 Bcast:10.255.255.255 Mask:255.255.255.255+
- UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1+
- RX packets:2337 errors:0 dropped:0 overruns:0 frame:860+
- TX packets:2940 errors:0 dropped:0 overruns:0 carrier:0+
- collisions:0 txqueuelen:1000+
- RX bytes:172534 (168.4 KiB) TX bytes:234432 (228.9 KiB)+
- Interrupt:2 Base address:0x5000+
-</pre>+
-if not, set your ip manualy like this+
-<pre>+
-ifconfig "your wlan interface, e.g. eth1" netmask 255.255.255.255 +
-</pre>+
-and check ifconfig again+
<br><br> <br><br>
-if everything is ok, connect to http:"your-router-ip:8080. Here you have the OSLR interface and you can see the connected nodes on the Links tab.+--[[User:Sash|Sash]] 22:00, 7 June 2008 (CEST)
-<br>+ 
-<br>+[[Category:Routing]]
---[[User:Sash|Sash]] 22:49, 5 June 2008 (CEST)+[[Category:Wlan]]
 +[[Category:Linking Routers]]

Current revision


Wiki Path: DD-WRT Wiki Main / Tutorials / Linking Routers / Mesh Networking with OLSR

Contents

[edit] General

[edit] What is mesh networking?

Mesh networking is used to route data, voice and instructions between nodes (typically routers). A mesh network typically consists of 2 or (many) more nodes, which exchange information about their connection-status with each other (routing updates), so that every node knows, which path he has to take to reach any other node in the mesh. When a node wants to reach another node that is not directly connected, the traffic flows over other nodes, until the final node is reached (hopping) -each node that the traffic flows through is called a hop.

[edit] Why mesh networking?

Mesh networks differ from other networks in that the component parts can all connect to each other via multiple hops. Mesh networks are self-healing: the network can still operate even when a node goes down or a connection drops. The result is a very reliable network.

[edit] Benefits of mesh networking

  • self organizing
  • self-healing
  • low system maintenance needed
  • robust due dynamic route recalculation

[edit] Disadvantages of mesh networking

  • additional network traffic

The exchange of routing information (routing updates) can produce a lot of traffic-overhead, also every device that takes part of a mesh must have enough cpu/ memory to have an overview of all other routers and how to reach them. (routing table). A full routing table can get very large - as seen in BGP-Routing: a full BGP table needs 2GB of memory (300.000 active routes). There is also a danger of routing-loops that can appear because of weak routing information.

[edit] OLSR

[edit] General

OLSR is a dynamic linkstate Protocol which collects link data and dynamically calculates the best routes within the network.

Links:

http://en.wikipedia.org/wiki/OLSR
http://www.olsr.org

[edit] Parameters

General:

  • IpVersion
  • AllowNoInt
  • Pollrate
  • TcRedundancy
  • MprCoverage
  • LinkQualityFishEye
  • LinkQualityWinSize
  • LinkQualityDijkstraLimit

per Interface:

  • HelloInterval
  • HelloValidityTime
  • TcInterval
  • TcValidityTime
  • MidInterval
  • MidValidityTime
  • HnaInterval
  • HnaValidityTime
  • LinkQualityMult

HNA4

IcpConnect

Plugins:

olsrd 	 	                OLSR (Optimized Link State Routing) daemon
olsrd-mod-dyn-gw-plain 	Dynamic internet gateway plain plugin
olsrd-mod-bmf 	 	        Basic multicast forwarding plugin, dependece: kmod-tun
olsrd-mod-httpinfo 	 	Small informative web server plugin
olsrd-mod-quagga 	 	Quagga plugin
olsrd-mod-dyn-gw 	 	Dynamic internet gateway plugin
olsrd-mod-txtinfo 	 	Small informative web server plugin
olsrd-mod-nameservice 	 	Lightweight hostname resolver plugin
olsrd-mod-dot-draw 	 	Dot topology information plugin
olsrd-mod-mdns 	 	Multicast DNS plugin
olsrd-mod-watchdog 	 	Watchdog plugin
olsrd-mod-arprefresh 	 	Kernel ARP cache refresh plugin
olsrd-mod-p2pd 	 	Peer to Peer Discovery plugin
olsrd-mod-secure 	 	Message signing plugin to secure routing domain
olsrd-mod-pud                  Position update plugin
olsrd-mod-jsoninfo
olsrd-mod-sgwdynspeed          Select dynamic smart gateway based on gw speed

Sample config file:

DebugLevel              0
IpVersion               4
AllowNoInt              yes
Pollrate                0.1
TcRedundancy            2
MprCoverage             7
LinkQualityFishEye      1
LinkQualityWinSize      100
LinkQualityDijkstraLimit 0 7.0
LoadPlugin "olsrd_txtinfo.so.0.1"
{
       PlParam "Accept" "127.0.0.1"
}
Hna4
{
}
IpcConnect
{
       MaxConnections  1
       Host            127.0.0.1
       Net 192.168.1.0 255.255.255.0
}
LinkQualityLevel 2
UseHysteresis no
Interface "eth1"
{
       HelloInterval           5.0
       HelloValidityTime       90.0
       TcInterval              3.0
       TcValidityTime          270.0
       MidInterval             15.0
       MidValidityTime         270.0
       HnaInterval             15.0
       HnaValidityTime         90.0
       LinkQualityMult 10.100.2.5 0.5
}
Interface "vlan1"
{
       HelloInterval           5.0
       HelloValidityTime       90.0
       TcInterval              3.0
       TcValidityTime          270.0
       MidInterval             15.0
       MidValidityTime         270.0
       HnaInterval             15.0
       HnaValidityTime         90.0
       LinkQualityMult 10.100.2.5 0.5
}

[edit] Setup

[edit] DD-WRT > v.23 SP3

You always can check the OLSRD status on the daemons web gui:

http://yourip:8080
  • enable your prefered networking mode. OLSR can run on any interface (lan or wifi).

Try the following steps to get OLSR running:

[edit] OLSR on WiFi

Under Wireless -> Basic Settings

  • connect your devices with the preferred WiFi mode (WDS, adhoc, etc)
  • set your wlan mode (b,g,mixed...)
  • set your SSID
  • set your channel

Before you go on test that the link is working, that the devices are connected and can reach each other.

  • unbridge the wlan on the wireless page
  • set an ip from a different network than the router uses already
  • set the network mask (e.g. to 255.255.255.0 for a /24 network)
  • set your preferred encryption

[edit] setup OLSR

Under Setup -> Advanced Routing

  • set Operating Mode to OLSR
  • keep the basic olsr settings. they are ok for the first tests
  • add the correct wlan interface to olsr dependend on your wifi chip vendor and platform (e.g. on atheros wifi based systems its athX, on broadcom its mostly eth0, on ralink its raX)
  • keep the interface settings for testing

[edit] Enabling NAT routing

In Gateway mode the router performs NAT, while in other modes it doesn't. When you switch the Advanced Routing Operating Mode to OLSR Router, it turns off NAT. Here is how to turn the NAT back on, assuming you followed the instructions on unbridging the wlan. You must change the interfaces according to your system.

Under Administration -> Commands paste the script below into Commands and click "Save Firewall" Do this on each device.

iptables -t nat -A POSTROUTING -o $(nvram get wan_ifname) -j MASQUERADE
iptables -t nat -A POSTROUTING -o $(nvram get wl0_ifname) -s $(nvram get eth1_ipaddr)/$(nvram get eth1_netmask) -d $(nvram get eth1_ipaddr)/$(nvram get eth1_netmask) -j MASQUERADE
iptables -t nat -A POSTROUTING -o $(nvram get lan_ifname) -s $(nvram get lan_ipaddr)/$(nvram get lan_netmask) -d $(nvram get lan_ipaddr)/$(nvram get lan_netmask) -j MASQUERADE

[edit] External Links



--Sash 22:00, 7 June 2008 (CEST)