Projecte

General

Perfil

Actions

Wiki » Historial » Revisió 8

« Anterior | Revisió 8/68 (diferencies) | Següent »
Axel Neumann, 26-08-2012 13:11


BMX6

Bmx6 is a routing protocol for Linux based operating systems.
The following intro provides kind of tutorial to get started.

Installation

Requirements

The following tools are needed to obtain, compile, and install bmx6
  • git (debian package: git-core)
  • gcc
  • make

Downloading

Latest development sources are available from bmx6 git repository

git clone git://qmp.cat/bmx6.git
cd bmx6

Compile and Install

To only compile the main bmx6 daemon (no bmx6 plugins)

make
sudo make install

Usage (hello mesh)

In its most simple configuration, the only required parameter are the interfaces names that should be used for meshing.
The following example starts bmx6 on interface wlan0:

root@mlc1001:~# bmx6 dev=wlan0

However, to let this simple command work as expected also check the following basic requirements:

  • bmx6 must be executed in root context (with super user permissions). If you are not already root prepend all commands with sudo (eg: sudo bmx6 dev=wlan0 ).
  • NO IP address needs to be configured. By default bmx6 assumes IPv6 and autoconfigures an ULA based IPv6 address for each interface. But the interfaces must be UP. The linux ip command can do this for you (eg: ip link set wlan0 up ). Also, if you are using a wireless interface, the wireless interface settings must be set correctly so that link-layer connectivity is given with bmx6 daemons running on other nodes (computers). The good old iwconfig command may help to achieve that. For example iwconfig wlan0 mode ad-hoc ap 02:ca:ff:ee:ba:be channel 11 essid my-mesh-network is a typical configuration for a wireless mesh setup.
  • Bmx6 (by default) works in daemon mode, thus continues to work in background. To let it run in foreground specify a debug level with the startup command like: bmx6 debug=0 dev=bmx6 . Of course you may need to kill a previously started bmx6 daemon beforehand ( killall bmx6 )

If everything went fine bmx6 is running now, searching for neighboring bmx6 daemons via the configured link and coordinates with them to learn about existence-of and routes-to all other bmx6 nodes in the network.
To access status information of the bmx6 daemon which has just been started, a second bmx6 process can be launched in client mode (with the --connect or -c parameter) to connect to the main bmx6 daemon and retrieve the desired information.
In the following, a few example will be discussed:

root@mlc1001:~# bmx6 -c status
version        compatibility codeVersion globalId                     primaryIp                       myLocalId uptime     cpu nodes 
BMX6-0.1-alpha 16            9           mlc1001.E0F9E33CD42EF2980443 fd66:66:66:0:a2cd:efff:fe10:101 24100101  0:00:56:37 0.3 3

So apart from version, compatibility number, and code, the status reveals the daemon's global and local ID, its primary (self-configured) IPv6 address, the time since when it is running (56 minutes), its current cpu consumption (0.3%) and the total number of learned nodes in the network (including itself).

Typical types of information are: status, interfaces, links, originators, descriptions, tunnels
These required types can be combined, so a more informative case would be:

root@mlc1001:~# bmx6 -c status interfaces links originators
status:
version        compatibility codeVersion globalId                     primaryIp                       myLocalId uptime     cpu nodes 
BMX6-0.1-alpha 16            9           mlc1001.6480B336E87B8F8DA8D7 fd66:66:66:0:a2cd:efff:fe10:102 8C100101  0:04:14:15 0.7 3    
interfaces:
devName state type     rateMin rateMax llocalIp                    globalIp                           multicastIp primary 
wlan0   UP    wireless 6222K   56000K  fe80::a2cd:efff:fe10:101/64 fd66:66:66:0:a2cd:efff:fe10:101/64 ff02::2     1       
links:
globalId                     llocalIp                 viaDev  rxRate txRate bestTxLink routes wantsOgms nbLocalId 
mlc1002.4CA9926CF823599148DF fe80::a2cd:efff:fe10:201 wlan0   100    100    1          1      1         3D100201  
mlc1000.2C4BA11B70E50B889B90 fe80::a2cd:efff:fe10:1   wlan0   100    100    1          1      1         DA100001  
originators:
globalId                     blocked primaryIp                       routes viaIp                    viaDev  metric lastDesc lastRef 
mlc1000.2C4BA11B70E50B889B90 0       fd66:66:66:0:a2cd:efff:fe10:1   1      fe80::a2cd:efff:fe10:1   eth1.12 999M   14925    2      
mlc1001.6480B336E87B8F8DA8D7 0       fd66:66:66:0:a2cd:efff:fe10:101 0      ::                       ---     128G   14928    0      
mlc1002.4CA9926CF823599148DF 0       fd66:66:66:0:a2cd:efff:fe10:201 1      fe80::a2cd:efff:fe10:201 eth1.12 999M   14928    2      

Bmx6 Plugins

Config Plugin

Requirements

uci libs are needed for the bmx6-config plugin.
To install it do:

wget http://downloads.openwrt.org/sources/uci-0.7.5.tar.gz
tar xzvf uci-0.7.5.tar.gz
cd uci-0.7.5
make
sudo make install

Depending on your system there happens to be an error during compilation.
Then edit cli.c and change line 465 to: char *argv[MAX_ARGS+2];

Compile and Install

To compile the bmx6 daemon and bmx6 plugins

make build_all
sudo make install_all

Usage

Json Plugin

Requirements

  • json-c for bmx6_json plugin (debian package: libjson0 libjson0-dev)

json-c developer libs are needed!
For further reading check: http://json.org/ or https://github.com/jehiah/json-c

Note for debian sid:
The debian package libjson0-dev 0.10-1 seems to miss the file /usr/include/json/json_object_iterator.h
Manually copying it from the below mentioned json-c_0.10.orig.tar.gz archive helps.

To install manually (only if NOT installed via debian or other package management system):

wget http://ftp.de.debian.org/debian/pool/main/j/json-c/json-c_0.10.orig.tar.gz
tar xzvf json-c_0.10.orig.tar.gz
cd json-c..
./configure ; make ; make install; ldconfig

Compile and Install

To compile the bmx6 daemon and bmx6 plugins

make build_all
sudo make install_all

Usage

SMS Plugin

Quagga Plugin

Misc

Tunnel

Actualitzat per Axel Neumann fa més de 12 anys · 8 revisions