Projecte

General

Perfil

Wiki » Historial » Versió 8

Axel Neumann, 26-08-2012 13:11

1 6 Axel Neumann
{{>toc}}
2 1 Pau Escrich
3
4 8 Axel Neumann
h1. BMX6
5 6 Axel Neumann
6
Bmx6 is a routing protocol for Linux based operating systems.
7 1 Pau Escrich
The following intro provides kind of tutorial to get started.
8
9 8 Axel Neumann
h2. Installation
10 6 Axel Neumann
11 8 Axel Neumann
h3. Requirements
12 7 Axel Neumann
13 6 Axel Neumann
The following tools are needed to obtain, compile, and install bmx6
14
* git (debian package: git-core)
15
* gcc
16
* make
17
18
19 8 Axel Neumann
h3. Downloading
20 6 Axel Neumann
21
Latest development sources are available from bmx6 git repository
22
<pre>
23
git clone git://qmp.cat/bmx6.git
24
cd bmx6
25
</pre>
26
27 8 Axel Neumann
h3. Compile and Install
28 6 Axel Neumann
29 7 Axel Neumann
To only compile the main bmx6 daemon (no bmx6 plugins)
30 6 Axel Neumann
<pre>
31
make
32
sudo make install
33
</pre>
34
35
36 8 Axel Neumann
h2. Usage (hello mesh)
37 6 Axel Neumann
38 3 Axel Neumann
39
In its most simple configuration, the only required parameter are the interfaces names that should be used for meshing.
40
The following example starts bmx6 on interface wlan0:
41
<pre>
42 5 Axel Neumann
root@mlc1001:~# bmx6 dev=wlan0
43 3 Axel Neumann
</pre>
44
45
However, to let this simple command work as expected also check the following basic requirements:
46
47
* 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 @ ).
48
49
* 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.
50
51
* 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 @)
52
53 4 Axel Neumann
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. 
54
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.
55
In the following, a few example will be discussed:
56
<pre>
57 5 Axel Neumann
root@mlc1001:~# bmx6 -c status
58 4 Axel Neumann
version        compatibility codeVersion globalId                     primaryIp                       myLocalId uptime     cpu nodes 
59 1 Pau Escrich
BMX6-0.1-alpha 16            9           mlc1001.E0F9E33CD42EF2980443 fd66:66:66:0:a2cd:efff:fe10:101 24100101  0:00:56:37 0.3 3
60
</pre>
61
62 5 Axel Neumann
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).
63
64 1 Pau Escrich
Typical types of information are: status, interfaces, links, originators, descriptions, tunnels
65 5 Axel Neumann
These required types can be combined, so a more informative case would be:
66
<pre>
67 1 Pau Escrich
root@mlc1001:~# bmx6 -c status interfaces links originators
68 5 Axel Neumann
status:
69 1 Pau Escrich
version        compatibility codeVersion globalId                     primaryIp                       myLocalId uptime     cpu nodes 
70
BMX6-0.1-alpha 16            9           mlc1001.6480B336E87B8F8DA8D7 fd66:66:66:0:a2cd:efff:fe10:102 8C100101  0:04:14:15 0.7 3    
71
interfaces:
72
devName state type     rateMin rateMax llocalIp                    globalIp                           multicastIp primary 
73
wlan0   UP    wireless 6222K   56000K  fe80::a2cd:efff:fe10:101/64 fd66:66:66:0:a2cd:efff:fe10:101/64 ff02::2     1       
74
links:
75
globalId                     llocalIp                 viaDev  rxRate txRate bestTxLink routes wantsOgms nbLocalId 
76
mlc1002.4CA9926CF823599148DF fe80::a2cd:efff:fe10:201 wlan0   100    100    1          1      1         3D100201  
77
mlc1000.2C4BA11B70E50B889B90 fe80::a2cd:efff:fe10:1   wlan0   100    100    1          1      1         DA100001  
78 5 Axel Neumann
originators:
79 1 Pau Escrich
globalId                     blocked primaryIp                       routes viaIp                    viaDev  metric lastDesc lastRef 
80
mlc1000.2C4BA11B70E50B889B90 0       fd66:66:66:0:a2cd:efff:fe10:1   1      fe80::a2cd:efff:fe10:1   eth1.12 999M   14925    2      
81
mlc1001.6480B336E87B8F8DA8D7 0       fd66:66:66:0:a2cd:efff:fe10:101 0      ::                       ---     128G   14928    0      
82
mlc1002.4CA9926CF823599148DF 0       fd66:66:66:0:a2cd:efff:fe10:201 1      fe80::a2cd:efff:fe10:201 eth1.12 999M   14928    2      
83
</pre>
84
85
86
87
88
89
90
91
92
93 8 Axel Neumann
h2. Bmx6 Plugins
94 1 Pau Escrich
95
96 8 Axel Neumann
h3. Config Plugin
97 1 Pau Escrich
98
99 8 Axel Neumann
h4. Requirements
100 1 Pau Escrich
101 8 Axel Neumann
uci libs are needed for the bmx6-config plugin.
102
To install it do:
103
<pre>
104
wget http://downloads.openwrt.org/sources/uci-0.7.5.tar.gz
105
tar xzvf uci-0.7.5.tar.gz
106
cd uci-0.7.5
107
make
108
sudo make install
109
</pre>
110 1 Pau Escrich
111 8 Axel Neumann
Depending on your system there happens to be an error during compilation.
112
Then edit cli.c and change line 465 to: @ char *argv[MAX_ARGS+2]; @
113
114
h4. Compile and Install
115
116
To compile the bmx6 daemon and bmx6 plugins
117
<pre>
118
make build_all
119
sudo make install_all
120
</pre>
121
122
123
h4. Usage
124
125
126
127
h3. Json Plugin
128
129
130
h4. Requirements
131
132
* json-c for bmx6_json plugin (debian package: libjson0 libjson0-dev)
133
134
135
json-c developer libs are needed!
136
For further reading check: http://json.org/ or https://github.com/jehiah/json-c
137
138
Note for debian sid:
139
The debian package libjson0-dev 0.10-1 seems to miss the file /usr/include/json/json_object_iterator.h
140
Manually copying it from the below mentioned json-c_0.10.orig.tar.gz archive helps.
141
142
143
To install manually (only if NOT installed via debian or other package management system):
144
<pre>
145
wget http://ftp.de.debian.org/debian/pool/main/j/json-c/json-c_0.10.orig.tar.gz
146
tar xzvf json-c_0.10.orig.tar.gz
147
cd json-c..
148
./configure ; make ; make install; ldconfig
149
</pre>
150
151
152
h4. Compile and Install
153
154
To compile the bmx6 daemon and bmx6 plugins
155
<pre>
156
make build_all
157
sudo make install_all
158
</pre>
159
160
161
h4. Usage
162
163
164
165
h3. SMS Plugin
166
167
168
169
h3. Quagga Plugin
170
171
172 3 Axel Neumann
173
174
*Misc*
175
176
177 2 Pau Escrich
[[Tunnel]]