Wiki » History » Version 45
Axel Neumann, 08/30/2012 04:08 PM
1 | 20 | Axel Neumann | {{toc}} |
---|---|---|---|
2 | 1 | Pau Escrich | |
3 | 1 | Pau Escrich | |
4 | 8 | Axel Neumann | h1. BMX6 |
5 | 6 | Axel Neumann | |
6 | 6 | Axel Neumann | 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 | 1 | Pau Escrich | |
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 | 6 | Axel Neumann | * git (debian package: git-core) |
15 | 6 | Axel Neumann | * gcc |
16 | 6 | Axel Neumann | * make |
17 | 6 | Axel Neumann | |
18 | 6 | Axel Neumann | |
19 | 8 | Axel Neumann | h3. Downloading |
20 | 6 | Axel Neumann | |
21 | 6 | Axel Neumann | Latest development sources are available from bmx6 git repository |
22 | 6 | Axel Neumann | <pre> |
23 | 6 | Axel Neumann | git clone git://qmp.cat/bmx6.git |
24 | 6 | Axel Neumann | cd bmx6 |
25 | 6 | Axel Neumann | </pre> |
26 | 6 | Axel Neumann | |
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 | 6 | Axel Neumann | make |
32 | 6 | Axel Neumann | sudo make install |
33 | 6 | Axel Neumann | </pre> |
34 | 6 | Axel Neumann | |
35 | 6 | Axel Neumann | |
36 | 8 | Axel Neumann | h2. Usage (hello mesh) |
37 | 6 | Axel Neumann | |
38 | 19 | Axel Neumann | h3. Starting |
39 | 3 | Axel Neumann | |
40 | 3 | Axel Neumann | In its most simple configuration, the only required parameter are the interfaces names that should be used for meshing. |
41 | 3 | Axel Neumann | The following example starts bmx6 on interface wlan0: |
42 | 3 | Axel Neumann | <pre> |
43 | 15 | Axel Neumann | root@mlc1001:~# bmx6 dev=eth1 |
44 | 3 | Axel Neumann | </pre> |
45 | 3 | Axel Neumann | |
46 | 3 | Axel Neumann | However, to let this simple command work as expected also check the following basic requirements: |
47 | 3 | Axel Neumann | |
48 | 15 | Axel Neumann | * 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=eth1 @ ). |
49 | 3 | Axel Neumann | |
50 | 9 | Axel Neumann | * NO IP address needs to be configured. By default bmx6 assumes IPv6 and autoconfigures an ULA based IPv6 address for each interface based on the MAC address of the device. Just, 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. |
51 | 3 | Axel Neumann | |
52 | 15 | Axel Neumann | * Bmx6 (by default) works in daemon mode, thus sends itself to background and gives back a prompt. To let it run in foreground specify a debug level with the startup command like: @ bmx6 debug=0 dev=eth1 @ . Of course you may need to kill a previously started bmx6 daemon beforehand (@ killall bmx6 @) |
53 | 1 | Pau Escrich | |
54 | 19 | Axel Neumann | If everything went fine bmx6 is running now, searching for neighboring bmx6 daemons via the configured interface (link), and coordinates with them to learn about existence-of and routes-to all other bmx6 nodes in the network. |
55 | 1 | Pau Escrich | |
56 | 19 | Axel Neumann | |
57 | 19 | Axel Neumann | |
58 | 19 | Axel Neumann | |
59 | 19 | Axel Neumann | |
60 | 19 | Axel Neumann | h3. Accessing Protocol Events, Status, and Network Information |
61 | 19 | Axel Neumann | |
62 | 19 | Axel Neumann | To access debug and 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. |
63 | 19 | Axel Neumann | |
64 | 19 | Axel Neumann | In the following, a few example will be discussed |
65 | 19 | Axel Neumann | |
66 | 19 | Axel Neumann | Continuous debug levels with different verbosity and scope are accessible with the --debug or -d parameter. |
67 | 19 | Axel Neumann | * Debug level 0 only reports critical events |
68 | 19 | Axel Neumann | * Debug level 3 reports relevant changes and |
69 | 19 | Axel Neumann | * Debug level 4 reports everything. |
70 | 19 | Axel Neumann | * Debug level 12 dump in and outgoing protocol traffic |
71 | 19 | Axel Neumann | Eg.: @ bmx6 -cd3 @ connects a bmx6 client process to debug-level 3 of the main daemon and logs the output stdout until terminated with ctrl-c |
72 | 19 | Axel Neumann | |
73 | 19 | Axel Neumann | |
74 | 19 | Axel Neumann | |
75 | 19 | Axel Neumann | Status, network, and statistic information are accessible with dedicated parameters: |
76 | 19 | Axel Neumann | * status |
77 | 19 | Axel Neumann | * interfaces |
78 | 19 | Axel Neumann | * links |
79 | 19 | Axel Neumann | * originators |
80 | 21 | Axel Neumann | * descriptions, plus optional sub-parameters for filtering |
81 | 19 | Axel Neumann | * tunnels |
82 | 19 | Axel Neumann | * traffic=DEV where DEV:= all or eth1, .... |
83 | 19 | Axel Neumann | |
84 | 19 | Axel Neumann | |
85 | 18 | Axel Neumann | <pre> |
86 | 1 | Pau Escrich | root@mlc1001:~# bmx6 -c status |
87 | 1 | Pau Escrich | version compatibility codeVersion globalId primaryIp myLocalId uptime cpu nodes |
88 | 1 | Pau Escrich | BMX6-0.1-alpha 16 9 mlc1001.7A7422752001EC4AC4C8 fd66:66:66:0:a2cd:efff:fe10:101 24100101 0:00:40:37 0.1 4 |
89 | 1 | Pau Escrich | </pre> |
90 | 18 | Axel Neumann | |
91 | 5 | Axel Neumann | So apart from version, compatibility number, and code, the status reveals the daemon's global (see: [[Wiki#Global-ID]] ) and local ID, its primary (self-configured) IPv6 address, the time since when it is running (40 minutes), its current cpu consumption (0.1%) and the total number of 4 learned nodes in the network (including itself). |
92 | 9 | Axel Neumann | |
93 | 19 | Axel Neumann | These desired types can be combined. Also the above given example shows kind of shortcut. The long argument would be |
94 | 19 | Axel Neumann | @ bmx6 connect show=status @. A more informative case using the long form would be: |
95 | 1 | Pau Escrich | <pre> |
96 | 9 | Axel Neumann | root@mlc1001:~# bmx6 connect show=status show=interfaces show=links show=originators show=tunnels |
97 | 1 | Pau Escrich | status: |
98 | 18 | Axel Neumann | version compatibility codeVersion globalId primaryIp myLocalId uptime cpu nodes |
99 | 18 | Axel Neumann | BMX6-0.1-alpha 16 9 mlc1001.7A7422752001EC4AC4C8 fd66:66:66:0:a2cd:efff:fe10:101 06100101 0:00:53:19 0.3 4 |
100 | 15 | Axel Neumann | interfaces: |
101 | 18 | Axel Neumann | devName state type rateMin rateMax llocalIp globalIp multicastIp primary |
102 | 18 | Axel Neumann | eth1 UP ethernet 1000M 1000M fe80::a2cd:efff:fe10:101/64 fd66:66:66:0:a2cd:efff:fe10:101/64 ff02::2 1 |
103 | 15 | Axel Neumann | links: |
104 | 18 | Axel Neumann | globalId llocalIp viaDev rxRate txRate bestTxLink routes wantsOgms nbLocalId |
105 | 18 | Axel Neumann | mlc1000.0AE58311046412F248CD fe80::a2cd:efff:fe10:1 eth1 100 100 1 1 1 9B100001 |
106 | 18 | Axel Neumann | mlc1002.91DCF042934B5913BB00 fe80::a2cd:efff:fe10:201 eth1 100 100 1 2 1 BB100201 |
107 | 15 | Axel Neumann | originators: |
108 | 18 | Axel Neumann | globalId blocked primaryIp routes viaIp viaDev metric lastDesc lastRef |
109 | 18 | Axel Neumann | mlc1000.0AE58311046412F248CD 0 fd66:66:66:0:a2cd:efff:fe10:1 1 fe80::a2cd:efff:fe10:1 eth1 999M 3193 3 |
110 | 18 | Axel Neumann | mlc1001.7A7422752001EC4AC4C8 0 fd66:66:66:0:a2cd:efff:fe10:101 0 :: --- 128G 3197 0 |
111 | 18 | Axel Neumann | mlc1002.91DCF042934B5913BB00 0 fd66:66:66:0:a2cd:efff:fe10:201 1 fe80::a2cd:efff:fe10:201 eth1 999M 3196 3 |
112 | 18 | Axel Neumann | mlc1003.09E796BC491D386248C3 0 fd66:66:66:0:a2cd:efff:fe10:301 1 fe80::a2cd:efff:fe10:201 eth1 576M 22 3 |
113 | 1 | Pau Escrich | </pre> |
114 | 1 | Pau Escrich | |
115 | 9 | Axel Neumann | Only if relevant information for a requested type is available it will be shown. |
116 | 9 | Axel Neumann | In this example no tunnels are configured nor offered by other nodes and therefore no tunnel information is shown. |
117 | 1 | Pau Escrich | |
118 | 9 | Axel Neumann | The loop argument can be prepended to the connect argument to continuously show the requested information. |
119 | 9 | Axel Neumann | Many of the long arguments are usable via a short notation, like l for loop, c for connect, s for show, d for debug. |
120 | 9 | Axel Neumann | And there is another shortcut summarizing my current favorite information types via debug level 8 |
121 | 9 | Axel Neumann | The following commands do the same as above: @ bmx6 -lc status interfaces links originators tunnels @ or just @ bmx6 -lcd8 @. |
122 | 1 | Pau Escrich | |
123 | 18 | Axel Neumann | Description of the provided info: |
124 | 14 | Axel Neumann | * interfaces: Followed by one line per configured interface |
125 | 14 | Axel Neumann | ** dev: Interface name |
126 | 14 | Axel Neumann | ** state and type: Whether the interface is UP or DOWN and its assumed link-layer type. |
127 | 14 | Axel Neumann | ** rateMin and rateMax: Min- and maximum transmit rates assumed for this interface. |
128 | 14 | Axel Neumann | ** llocalIp: IPv6 link-local address (used as source address for all outgoing protocol data). |
129 | 14 | Axel Neumann | ** globalIp: Autoconfigured address used for sending network traffic via this interface and which is propagated to other nodes. |
130 | 14 | Axel Neumann | ** multicastIp: Multicast IP (used as destination address for all bmx6 protocol traffic send via this interface). |
131 | 14 | Axel Neumann | ** primary: Indicates whether the global ip of this interface is used as primary ip for this daemon. |
132 | 14 | Axel Neumann | * links: Followed by one line per detected neighboring bmx6 node. |
133 | 16 | Axel Neumann | ** globalId: GlobalId of that neighbor (see: [[Wiki#Global-ID]] ). |
134 | 14 | Axel Neumann | ** llocalIp: Link-local IP of the neighbor's interface building the other side of the link. |
135 | 14 | Axel Neumann | ** viaDev: Interface of this node for the link. |
136 | 14 | Axel Neumann | ** rxRate: Measured receive rate in percent for the link. |
137 | 14 | Axel Neumann | ** txRate: Measured transmit rate in percent for the link. |
138 | 14 | Axel Neumann | ** bestTxLink: Indicates whether this link is the best link to a neighboring nodes. |
139 | 1 | Pau Escrich | ** routes: Indicates for how much routes to other nodes this link is used. |
140 | 1 | Pau Escrich | ** wantsOgms: Indicates whether the neighboring node has requested (this node) to propagate originator messsages (OGMs) via this link. |
141 | 1 | Pau Escrich | ** nbLocalId: Neighbors local ID. |
142 | 1 | Pau Escrich | * originators: Followed by one line per aware originator in the network (including itself). |
143 | 1 | Pau Escrich | ** globalId: Global Id of that node (see: [[Wiki#Global-ID]] ). |
144 | 30 | Axel Neumann | ** blocked: Indicates whether this node is currently blocked (see: [[Wiki#Blocked-Nodes]] ). |
145 | 1 | Pau Escrich | ** primaryIp: The primary IP of that node. |
146 | 1 | Pau Escrich | ** routes: Number of potential routes towards this node. |
147 | 1 | Pau Escrich | ** viaIp: Next hops link-local IP of the best route towards this node. |
148 | 1 | Pau Escrich | ** viaDev: Outgoing interface of the best route towards this node. |
149 | 1 | Pau Escrich | ** metric: The end to end path metric to this node |
150 | 1 | Pau Escrich | ** lastDesc: Seconds since the last description update was received (see: [[Widi#Description]] ) |
151 | 18 | Axel Neumann | ** lastRef: Seconds since this node was referenced by any neighboring node (like last sign of life) |
152 | 18 | Axel Neumann | |
153 | 18 | Axel Neumann | |
154 | 18 | Axel Neumann | Quick summary of provided info: |
155 | 18 | Axel Neumann | * Node mlc1001 uses one wired interface (eth1) which is up and actively used for meshing. |
156 | 18 | Axel Neumann | * Node mlc1001 got aware of 2 neighbors and 4 nodes (originators) including itself. |
157 | 18 | Axel Neumann | * The link qualities (rx and tx rate) to its neighbors are perfect (100%) and actively used (bestTxLink) |
158 | 1 | Pau Escrich | * Routes to nodes mlc1000 and mlc1002 are via interface eth1 and directly to the neighbor's link-local address with a metric of 999M (nearly maximum tx/rx rate of the configured interface) |
159 | 1 | Pau Escrich | * Route to node mlc1003 is setup via interface eth1 and via the link-local address of neighbor mlc1002 (at least two hops to the destination node). |
160 | 1 | Pau Escrich | |
161 | 21 | Axel Neumann | The following links of the total network topology can be guessed from this information (further links may exist): |
162 | 1 | Pau Escrich | @ mlc1000 --- mlc1001 --- mlc1002 - - - mlc1003 @ |
163 | 1 | Pau Escrich | |
164 | 21 | Axel Neumann | |
165 | 21 | Axel Neumann | |
166 | 21 | Axel Neumann | |
167 | 19 | Axel Neumann | h3. Simple Ping Test |
168 | 19 | Axel Neumann | |
169 | 1 | Pau Escrich | This could be verified using traceroute6 towards the primary IP of the other nodes. |
170 | 18 | Axel Neumann | |
171 | 19 | Axel Neumann | To mlc1000's primary IP fd66:66:66:0:a2cd:efff:fe10:1 shows one hop: |
172 | 18 | Axel Neumann | <pre> |
173 | 18 | Axel Neumann | root@mlc1001:~# traceroute6 -n -q 1 fd66:66:66:0:a2cd:efff:fe10:1 |
174 | 18 | Axel Neumann | traceroute to fd66:66:66:0:a2cd:efff:fe10:1 (fd66:66:66:0:a2cd:efff:fe10:1), 30 hops max, 80 byte packets |
175 | 1 | Pau Escrich | 1 fd66:66:66:0:a2cd:efff:fe10:1 0.324 ms |
176 | 18 | Axel Neumann | </pre> |
177 | 18 | Axel Neumann | |
178 | 19 | Axel Neumann | To mlc1002's primary IP fd66:66:66:0:a2cd:efff:fe10:201 shows one hop: |
179 | 18 | Axel Neumann | <pre> |
180 | 18 | Axel Neumann | root@mlc1001:~# traceroute6 -n -q 1 fd66:66:66:0:a2cd:efff:fe10:201 |
181 | 18 | Axel Neumann | traceroute to fd66:66:66:0:a2cd:efff:fe10:201 (fd66:66:66:0:a2cd:efff:fe10:201), 30 hops max, 80 byte packets |
182 | 18 | Axel Neumann | 1 fd66:66:66:0:a2cd:efff:fe10:201 0.302 ms |
183 | 1 | Pau Escrich | </pre> |
184 | 1 | Pau Escrich | |
185 | 19 | Axel Neumann | To mlc1003's primary IP fd66:66:66:0:a2cd:efff:fe10:301 shows two hops: |
186 | 1 | Pau Escrich | <pre> |
187 | 1 | Pau Escrich | root@mlc1001:~# traceroute6 -n -q 1 fd66:66:66:0:a2cd:efff:fe10:301 |
188 | 18 | Axel Neumann | traceroute to fd66:66:66:0:a2cd:efff:fe10:301 (fd66:66:66:0:a2cd:efff:fe10:301), 30 hops max, 80 byte packets |
189 | 18 | Axel Neumann | 1 fd66:66:66:0:a2cd:efff:fe10:201 0.313 ms |
190 | 18 | Axel Neumann | 2 fd66:66:66:0:a2cd:efff:fe10:301 0.429 ms |
191 | 18 | Axel Neumann | </pre> |
192 | 19 | Axel Neumann | |
193 | 1 | Pau Escrich | |
194 | 1 | Pau Escrich | h3. Dynamic Reconfiguration |
195 | 1 | Pau Escrich | |
196 | 1 | Pau Escrich | Most bmx6 parameters can be applied not only at startup, but also dynamically to an already running main daemon, using the --connect command. |
197 | 21 | Axel Neumann | For example interfaces can be added, removed, or specified with more details: |
198 | 21 | Axel Neumann | The following example removes interface eth1 and adds eth2 with a max rate of 100 Mbits (overwriting the default assumption of 1000Mbits for ethernet interfaces). |
199 | 21 | Axel Neumann | <pre> |
200 | 21 | Axel Neumann | bmx6 -c dev=-eth1 dev=eth2 /rateMax=100000 |
201 | 21 | Axel Neumann | bmx6 -cd8 |
202 | 21 | Axel Neumann | </pre> |
203 | 1 | Pau Escrich | |
204 | 21 | Axel Neumann | Checking new status of interfaces, links, and originator: |
205 | 21 | Axel Neumann | <pre> |
206 | 21 | Axel Neumann | root@mlc1001:~# bmx6 -cd8 |
207 | 21 | Axel Neumann | status: |
208 | 21 | Axel Neumann | version compatibility codeVersion globalId primaryIp myLocalId uptime cpu nodes |
209 | 21 | Axel Neumann | BMX6-0.1-alpha 16 9 mlc1001.7A7422752001EC4AC4C8 fd66:66:66:0:a2cd:efff:fe10:102 06100101 0:02:26:00 0.1 4 |
210 | 21 | Axel Neumann | interfaces: |
211 | 21 | Axel Neumann | devName state type rateMin rateMax llocalIp globalIp multicastIp primary |
212 | 21 | Axel Neumann | eth2 UP ethernet 100M 100M fe80::a2cd:efff:fe10:102/64 fd66:66:66:0:a2cd:efff:fe10:102/64 ff02::2 1 |
213 | 21 | Axel Neumann | links: |
214 | 21 | Axel Neumann | globalId llocalIp viaDev rxRate txRate bestTxLink routes wantsOgms nbLocalId |
215 | 21 | Axel Neumann | mlc1000.0AE58311046412F248CD fe80::a2cd:efff:fe10:2 eth2 89 88 1 3 1 9B100001 |
216 | 21 | Axel Neumann | originators: |
217 | 21 | Axel Neumann | globalId blocked primaryIp routes viaIp viaDev metric lastDesc lastRef |
218 | 21 | Axel Neumann | mlc1000.0AE58311046412F248CD 0 fd66:66:66:0:a2cd:efff:fe10:1 1 fe80::a2cd:efff:fe10:2 eth2 81757K 18 0 |
219 | 21 | Axel Neumann | mlc1001.7A7422752001EC4AC4C8 0 fd66:66:66:0:a2cd:efff:fe10:102 0 :: --- 128G 80 0 |
220 | 21 | Axel Neumann | mlc1002.91DCF042934B5913BB00 0 fd66:66:66:0:a2cd:efff:fe10:201 1 fe80::a2cd:efff:fe10:2 eth2 83620K 14 4 |
221 | 21 | Axel Neumann | mlc1003.09E796BC491D386248C3 0 fd66:66:66:0:a2cd:efff:fe10:301 1 fe80::a2cd:efff:fe10:2 eth2 81488K 9 0 |
222 | 21 | Axel Neumann | </pre> |
223 | 1 | Pau Escrich | |
224 | 21 | Axel Neumann | It can be seen that: |
225 | 21 | Axel Neumann | * Interface eth1 has been replaced by eth2 with a lower rate. |
226 | 21 | Axel Neumann | * The primary IP of the node has changed (using the autoconfigured IP from eth2. |
227 | 21 | Axel Neumann | * The old links (via eth1) are removed and a single new link via eth2 to mlc1000 has been detected |
228 | 21 | Axel Neumann | * All routes are now going via eth2 and mlc1000's link-local IP fe80::a2cd:efff:fe10:2 |
229 | 1 | Pau Escrich | |
230 | 21 | Axel Neumann | |
231 | 21 | Axel Neumann | |
232 | 21 | Axel Neumann | |
233 | 21 | Axel Neumann | |
234 | 1 | Pau Escrich | h2. Concepts |
235 | 17 | Axel Neumann | |
236 | 17 | Axel Neumann | h3. Global ID |
237 | 17 | Axel Neumann | |
238 | 17 | Axel Neumann | Each bmx6 node creates during its initialization (booting) a global ID for itself. |
239 | 17 | Axel Neumann | This ID is created as a concatenation of the node's hostname and a random value. |
240 | 17 | Axel Neumann | In the above given example with node hostname: "mlc1001" the globalID is: mlc1001.7A7422752001EC4AC4C8 |
241 | 1 | Pau Escrich | When the bmx6 daemon restarts the hostname will remain. But the rand part will change. |
242 | 1 | Pau Escrich | As a consequence, the restarted node will appear as a new node to other nodes in the mesh while the old Global ID is still present in their node table. |
243 | 1 | Pau Escrich | Since both node IDs are announcing the same resources (eg the same primary IP), the ID that appears later will be blocked until the state maintained for the first ID expires. |
244 | 1 | Pau Escrich | |
245 | 26 | Axel Neumann | |
246 | 26 | Axel Neumann | |
247 | 21 | Axel Neumann | h3. Descriptions |
248 | 21 | Axel Neumann | |
249 | 22 | Axel Neumann | Instead of propagating individual routing updates for each announced network and interface address, each bmx6 daemon summarizes this and other node specific attributes into a single node-specific description. A specific description is propagated only once to all other nodes. Subsequent routing updates are referencing to the corresponding description with it's hash. |
250 | 23 | Axel Neumann | If a node is reconfigured, for example because its interfaces change or a new network shall be announced, than also the node's description changes. |
251 | 23 | Axel Neumann | Other nodes are becoming aware of the changed attributes of a reconfigured node by receiving a corresponding description update. |
252 | 23 | Axel Neumann | Subsequent references to this node will use the hash of the new description. |
253 | 23 | Axel Neumann | |
254 | 23 | Axel Neumann | Because the description is designed very generic it can be easily used to piggyback other non-routing specific data. For example the bmx6-sms plugin is taking advantage of this option by adding arbitrary short messages data to the node's description. |
255 | 23 | Axel Neumann | |
256 | 25 | Axel Neumann | Currently there is a limit for the total size of a description of 1400 bytes. While this is more than sufficient for quite a number of interfaces and announced networks per node, it is critical few when considering a gateway node with BGP route exchange that is announcing 100eds of networks. |
257 | 23 | Axel Neumann | |
258 | 30 | Axel Neumann | h3. Blocked Nodes |
259 | 26 | Axel Neumann | |
260 | 29 | Axel Neumann | Nodes may be blocked by other nodes. |
261 | 29 | Axel Neumann | When a node is blocked no routing updates (OGMs) of the blocked node are propagated by the blocking node. |
262 | 29 | Axel Neumann | The decision for blocking another node is done locally based on the detection of more than one node announcing the same unique resource. |
263 | 29 | Axel Neumann | This happens if two nodes are declaring themselves as the owner of a unique resource. Then one of those two nodes (usually the latter) is blocked to avoid the propagation of conflicting state. Duplicate address usage is the most common reason for such events which happens if two nodes are using (and announcing) the same primary IPs. Another typical scenario leading to such events is the rebooting of a node. Once a bmx6 daemon restarts it appears as a new node (with a new global ID) to the network but announcing the same address as the previous process. Since the resources allocated by the previous resources are still in the database of other nodes in the mesh they will block the new process until this information expires (by default after 100 seconds). |
264 | 26 | Axel Neumann | |
265 | 1 | Pau Escrich | |
266 | 29 | Axel Neumann | |
267 | 29 | Axel Neumann | |
268 | 29 | Axel Neumann | h2. Unicast Host Network Announcements (UHNA) |
269 | 29 | Axel Neumann | |
270 | 26 | Axel Neumann | A Host Network Announcements (HNA) describes the advertisement of IP addresses and networks by a node to other nodes in the mesh. |
271 | 29 | Axel Neumann | Typically (but not with BMX6), several nodes can announce the same or overlapping HNAs at the same time. |
272 | 29 | Axel Neumann | Announced networks do overlap if they are equal or one being a subset of another (eg. 10.1.1.0/24 is a subset and overlapped by 10.1.0.0/16). |
273 | 26 | Axel Neumann | Packets with a destination address matching an announced networks will be routed toward any node that originated a corresponding HNA. |
274 | 26 | Axel Neumann | Therefore these HNA types may also be called anycast HNA. |
275 | 26 | Axel Neumann | |
276 | 30 | Axel Neumann | In bmx6, HNAs have an unicast nature (UHNAs) because each network can only be announced once and announced networks MUST NOT overlap (See also [[Wiki#Blocked-Nodes]]). |
277 | 26 | Axel Neumann | This way it can be ensured that the destination of an UHNA routed packet is exactly known. |
278 | 26 | Axel Neumann | |
279 | 26 | Axel Neumann | In a sense the origination and propagation (by intermediate nodes) of UHNA announcements can be thought of a promise that guarantees: |
280 | 26 | Axel Neumann | 1. All packets with a destination address matching an announced UHNA network will be routed exactly to the node (with the global ID) that originated the UHNA and |
281 | 26 | Axel Neumann | 2. each node on the forwarding path towards the originator of the UHNA is supporting this promise. |
282 | 26 | Axel Neumann | |
283 | 26 | Axel Neumann | By default, Bmx6 only announces primary and non-primary interface addresses via UHNAs. |
284 | 1 | Pau Escrich | The auto address configuration ensures that interface addresses are unique. |
285 | 26 | Axel Neumann | |
286 | 1 | Pau Escrich | Using UHNAs for the announcements of networks requires a strict coordination to ensure that no network is announced twice. |
287 | 1 | Pau Escrich | |
288 | 1 | Pau Escrich | Technically, multiple UHNAs, each wrapped into a single message, are aggregated into a UHNA frame and attached to the description of a node. |
289 | 1 | Pau Escrich | |
290 | 32 | Axel Neumann | If Bmx6 is configured in IPv6 mode only IPv6 UHNAs can be announced and in IPv4 mode only IPv4 UHNAs |
291 | 32 | Axel Neumann | |
292 | 32 | Axel Neumann | |
293 | 31 | Axel Neumann | h3. UHNA Configuration |
294 | 30 | Axel Neumann | |
295 | 30 | Axel Neumann | The announcement of UHNAs can be configured with the --unicastHna or -u parameter followed by a network specification in ip/prefixlen notation. |
296 | 30 | Axel Neumann | By default all interface addresses are announced via UHNAs. However, this can be disabled by setting the --dev subparameter /announce or /a to 0. |
297 | 30 | Axel Neumann | |
298 | 30 | Axel Neumann | The following example reconfigures an already running bmx6 daemon (in IPv6 mode) to UHNA announce the network fd00:ffff:ffff:ffff::/64 and fd01:ffff:ffff::/48. |
299 | 30 | Axel Neumann | By omitting the --connect / -c parameter, the same could be configured as startup parameter for bmx6. |
300 | 30 | Axel Neumann | <pre> |
301 | 30 | Axel Neumann | bmx6 -c u=fd00:ffff:ffff:ffff::/64 u=fd01:ffff:ffff::/48 |
302 | 30 | Axel Neumann | </pre> |
303 | 30 | Axel Neumann | |
304 | 30 | Axel Neumann | An already active announcement can be removed by preceeding the network with the '-' char: |
305 | 30 | Axel Neumann | <pre> |
306 | 30 | Axel Neumann | bmx6 -c u=-fd00:ffff:ffff:ffff::/64 |
307 | 30 | Axel Neumann | </pre> |
308 | 30 | Axel Neumann | |
309 | 30 | Axel Neumann | Before bmx6 accepts a dynamically configured UHNA announcement it checks if this UHNA is not overlapping with an already existing UHNA announcement form another node. |
310 | 30 | Axel Neumann | If this is the case the configuration will fail. |
311 | 30 | Axel Neumann | To check if a chain of dynamic commands would be accepted by a bmx6 daemon without actually applying it, the --test command may follow the --connect /-c command. |
312 | 30 | Axel Neumann | |
313 | 30 | Axel Neumann | |
314 | 26 | Axel Neumann | |
315 | 29 | Axel Neumann | h2. Tunnel Announcements |
316 | 26 | Axel Neumann | |
317 | 27 | Axel Neumann | |
318 | 27 | Axel Neumann | Tunnel announcements offer an alternative mechanism to propagate routes. |
319 | 32 | Axel Neumann | Tunnel announcements are currently only implemented for Bmx6-IPv6 mode. However, in IPv6 mode IPv6 and IPv4 networks can be announced. |
320 | 1 | Pau Escrich | In contrast to UHNAs, using tunnel announcements, the same or overlapping networks can be announced from different nodes. |
321 | 27 | Axel Neumann | Tunnel announcements are an offer from the originating node to other nodes. Other nodes can take the offer or not. |
322 | 29 | Axel Neumann | For example several nodes in a network may offer to share their DSL connection by doing a default-route (0.0.0.0/0 or ::/0) tunnel announcement. |
323 | 1 | Pau Escrich | Other nodes looking for a route to the internet (a default route) can choose between the multiple offers by establishing a tunnel to one specific of the offering nodes. |
324 | 1 | Pau Escrich | Therefore an unidirectional (onw-way) tunnel is established from the searching to the offering node. |
325 | 1 | Pau Escrich | At the searching node, the remote tunnel address is configured with an UHNA address (usually the primary address) of the offering node. |
326 | 31 | Axel Neumann | and the networks advertised with the tunnel announcements are configured as routes via the unidirectional tunnel. |
327 | 1 | Pau Escrich | |
328 | 1 | Pau Escrich | This way, each node can make an individual choice between networks offered via tunnel announcements. |
329 | 1 | Pau Escrich | The automatic selection can be specified via a policy description that considers parameters such as advertised bandwidth, path metric, trust in specific GW nodes, hysteresis, ... . |
330 | 29 | Axel Neumann | Since an UHNA address is used as the outer (remote) tunnel address, the client end of the tunnel can be sure that all packets routed into the tunnel will indeed end up at the intended GW node (see [[Wiki#Unicast-Host-Network-Announcements-UHNA]]). |
331 | 1 | Pau Escrich | |
332 | 26 | Axel Neumann | Using tunnel announcements for offering GW services to networks requires NO coordination with other nodes since its up to the client node to select an appropriate GW. |
333 | 29 | Axel Neumann | |
334 | 1 | Pau Escrich | Technically, multiple tunnel announcements, each wrapped into a single tun6in6-net message, are aggregated into a tun4in6 or tun6in6-net frame and attached to the description of a node. |
335 | 1 | Pau Escrich | |
336 | 32 | Axel Neumann | Tunnel announcements are also used for redistributing routes from other routing protocols (see [[Wiki#Quagga-Plugin]]) into a bmx6 zone. |
337 | 1 | Pau Escrich | Therefore, each announcements message is decorated with a route-type field indicating the routing protocol that exported the route for being redistributed. |
338 | 31 | Axel Neumann | |
339 | 31 | Axel Neumann | |
340 | 33 | Axel Neumann | h3. Tunnel Configuration and Debugging |
341 | 31 | Axel Neumann | |
342 | 34 | Axel Neumann | In general, a specific tunnel configuration is described from two perspectives: |
343 | 32 | Axel Neumann | * Gateway (GW) nodes or just GWs are offering GW services to networks via the advertizement of tunnel announcements and the provisioning of tunnel-end-points. |
344 | 31 | Axel Neumann | * GW-client nodes (or just GW-clients) that are searching for GWs with tunnel endpoints and routing services to networks. |
345 | 1 | Pau Escrich | |
346 | 34 | Axel Neumann | A node can (and usually is) operating in both modes (as GW and as GW-client). |
347 | 34 | Axel Neumann | But regarding a specific network each node is operating either in GW or in GW-client mode! |
348 | 1 | Pau Escrich | |
349 | 34 | Axel Neumann | |
350 | 1 | Pau Escrich | h4. Gateway Nodes |
351 | 1 | Pau Escrich | |
352 | 33 | Axel Neumann | Similar to the configuration of UHNAs the advertisement of a tunnel endpoint to a network can be configured with the --tunInNet parameter + network argument and a bandwidth specification (given as bits per second) using the /bandwidth or /b sub parameter. |
353 | 32 | Axel Neumann | Announcement can be removed by preceeding the network argument with a '-' char. |
354 | 32 | Axel Neumann | The configuration can be done during daemon startup or dynamically (using --connect / -c parameter). |
355 | 1 | Pau Escrich | |
356 | 32 | Axel Neumann | The following command dynamically configures the advertisement of the following routes: |
357 | 33 | Axel Neumann | * An IPv4 default route 0.0.0.0/0 with a bandwidth of 32 Mbps. |
358 | 33 | Axel Neumann | * A more specific route to 10.10.0.0/16 with a bandwidth of 10 Mbps. |
359 | 33 | Axel Neumann | * An IPv6 route to the [RFC 4291] designated 2000::/3 global unicast address space with a bandwidth of 16 Mbps. |
360 | 33 | Axel Neumann | * A more specific route to the 2012:1234::/32 IPv6 space at 10 Mbps. |
361 | 32 | Axel Neumann | |
362 | 1 | Pau Escrich | <pre> |
363 | 33 | Axel Neumann | bmx6 -c tunInNet=0.0.0.0/0 /b=32000000 tunInNet=10.10.0.0/16 /b=10000000 tunInNet=2000::/3 /b=16000000 tunInNet=2012:1234::/32 /b=10000000 |
364 | 1 | Pau Escrich | </pre> |
365 | 1 | Pau Escrich | |
366 | 34 | Axel Neumann | One aspect that must be considered when configuring GW nodes is that tunnels are unidirectional from the GW client to the GW. |
367 | 34 | Axel Neumann | But clients usually also need a route back from the GW to the client to allow a bidirectional communication. |
368 | 1 | Pau Escrich | |
369 | 34 | Axel Neumann | One (however not recommended) option would be that GW clients are using their primary address as source address for all packets routed into the GW tunnel because a route from the GW to the GW-client via the client's primary address already exist. However, by default, the client's primary address is an autoconfigured ULA address which is not routable outside the bmx6 network. Also the primary address is either an IPv4 or an IPv6 address and can only be used to route to a corresponding destination network. |
370 | 1 | Pau Escrich | |
371 | 34 | Axel Neumann | The recommended procedure to let clients use addresses that are routable outside of the bmx6 cloud is that also GW client nodes advertize a host-address via UHNA or tunnel announcements. In the latter (recommended) case, the client node also appears as a GW node to its private address space used for communication with other remote networks. To support this recommended case, the GW node must also be configured as a GW client searching for tunnel announcements from it's potential GW-client nodes to their (rather small) private (but outside routable) address space. The details for such configuration are described in the following section. |
372 | 34 | Axel Neumann | However, for completeness a simple configuration for the GW-node to search for back routes to clients is given here. The following commands essentially configures a GW node to: |
373 | 45 | Axel Neumann | * use the IP addresses 10.254.10.1 and 2012:1234:5678:90ab::1 for tunnel traffic |
374 | 45 | Axel Neumann | * search and automatically configure back-wards tunnel to nodes that advertise an IPv4 prefix with a minimum length of 32 and are within the range of 10.254.0.0/16 |
375 | 45 | Axel Neumann | * search and automatically configure back-wards tunnel to nodes that advertise an IPv6 prefix with a minimum length of 64 and are within the range of 2012:1234:5678::/48 |
376 | 1 | Pau Escrich | |
377 | 34 | Axel Neumann | <pre> |
378 | 45 | Axel Neumann | bmx6 -c tun4Address=10.254.10.1/32 tun6Address=2012:1234:5678:90ab::1/64 |
379 | 45 | Axel Neumann | bmx6 -c tunOut=privV4Nets /network=10.254.0.0/16 /minPrefixLen=32 |
380 | 45 | Axel Neumann | bmx6 -c tunOut=privV6Nets /network=2012:1234:5678::/48 /minPrefixLen=64 |
381 | 34 | Axel Neumann | </pre> |
382 | 34 | Axel Neumann | |
383 | 34 | Axel Neumann | For more information please see [[Wiki#Gateway-Client-Node]]. |
384 | 34 | Axel Neumann | |
385 | 34 | Axel Neumann | |
386 | 34 | Axel Neumann | |
387 | 1 | Pau Escrich | h4. Gateway-Client Nodes |
388 | 33 | Axel Neumann | |
389 | 34 | Axel Neumann | The configuration of GW clients can be simple but also, depending on the preferences of a desired GW-selection policy, very complex. |
390 | 1 | Pau Escrich | |
391 | 1 | Pau Escrich | A general requirement for GW clients is the configuration of source addresses for all outgoing tunnels. |
392 | 1 | Pau Escrich | At least one network address must be configured for IPv6 and/or IPv4 tunnels using the the --tun4Address and/or --tun6Address parameters. |
393 | 34 | Axel Neumann | The specified networkaddress will automatically be advertized as tunnel announcements, allowing the GW client to be reachable via the given addresses. |
394 | 34 | Axel Neumann | Thereby, each GW client node is also a GW node to its own (usually small) tunnel address space. |
395 | 34 | Axel Neumann | The selection of this address should be coordinated with GW administrators since (depending on the GW connection to other networks) only specific addresses are routable and considered to be originated from the bmx6 cloud. |
396 | 34 | Axel Neumann | |
397 | 34 | Axel Neumann | |
398 | 33 | Axel Neumann | Starting with the simple case, |
399 | 1 | Pau Escrich | |
400 | 33 | Axel Neumann | |
401 | 33 | Axel Neumann | h4. Tunnel Status Information |
402 | 33 | Axel Neumann | |
403 | 36 | Axel Neumann | Tunnel status information can be accessed with the --tunnels parameters. |
404 | 29 | Axel Neumann | |
405 | 10 | Axel Neumann | |
406 | 1 | Pau Escrich | |
407 | 1 | Pau Escrich | |
408 | 1 | Pau Escrich | h2. Bmx6 Plugins |
409 | 1 | Pau Escrich | |
410 | 36 | Axel Neumann | h3. Compile and Install |
411 | 1 | Pau Escrich | |
412 | 36 | Axel Neumann | To compile and install bmx6 daemon and all bmx6 plugins simply do: |
413 | 36 | Axel Neumann | <pre> |
414 | 36 | Axel Neumann | make build_all |
415 | 36 | Axel Neumann | sudo make install_all |
416 | 36 | Axel Neumann | </pre> |
417 | 1 | Pau Escrich | |
418 | 36 | Axel Neumann | However. specific requirements may need to be fulfilled for some plugins in order to compile correctly. |
419 | 36 | Axel Neumann | These requirements are described in the corresponding plugin section. |
420 | 32 | Axel Neumann | |
421 | 32 | Axel Neumann | |
422 | 1 | Pau Escrich | |
423 | 36 | Axel Neumann | h2. Config Plugin |
424 | 1 | Pau Escrich | |
425 | 8 | Axel Neumann | |
426 | 36 | Axel Neumann | h3. Requirements |
427 | 1 | Pau Escrich | |
428 | 8 | Axel Neumann | uci libs are needed for the bmx6-config plugin. |
429 | 8 | Axel Neumann | To install it do: |
430 | 1 | Pau Escrich | <pre> |
431 | 8 | Axel Neumann | wget http://downloads.openwrt.org/sources/uci-0.7.5.tar.gz |
432 | 8 | Axel Neumann | tar xzvf uci-0.7.5.tar.gz |
433 | 8 | Axel Neumann | cd uci-0.7.5 |
434 | 1 | Pau Escrich | make |
435 | 8 | Axel Neumann | sudo make install |
436 | 8 | Axel Neumann | </pre> |
437 | 1 | Pau Escrich | |
438 | 8 | Axel Neumann | Depending on your system there happens to be an error during compilation. |
439 | 8 | Axel Neumann | Then edit cli.c and change line 465 to: @ char *argv[MAX_ARGS+2]; @ |
440 | 8 | Axel Neumann | |
441 | 36 | Axel Neumann | h3. Compile and Install |
442 | 8 | Axel Neumann | |
443 | 8 | Axel Neumann | <pre> |
444 | 36 | Axel Neumann | make -C lib/bmx6_uci_config/ |
445 | 36 | Axel Neumann | sudo make -C lib/bmx6_uci_config/ install |
446 | 8 | Axel Neumann | </pre> |
447 | 8 | Axel Neumann | |
448 | 8 | Axel Neumann | |
449 | 36 | Axel Neumann | h3. Usage |
450 | 8 | Axel Neumann | |
451 | 8 | Axel Neumann | |
452 | 8 | Axel Neumann | |
453 | 36 | Axel Neumann | h2. Json Plugin |
454 | 8 | Axel Neumann | |
455 | 8 | Axel Neumann | |
456 | 36 | Axel Neumann | h3. Requirements |
457 | 1 | Pau Escrich | |
458 | 8 | Axel Neumann | * json-c for bmx6_json plugin (debian package: libjson0 libjson0-dev) |
459 | 1 | Pau Escrich | |
460 | 8 | Axel Neumann | |
461 | 1 | Pau Escrich | json-c developer libs are needed! |
462 | 8 | Axel Neumann | For further reading check: http://json.org/ or https://github.com/jehiah/json-c |
463 | 8 | Axel Neumann | |
464 | 8 | Axel Neumann | Note for debian sid: |
465 | 8 | Axel Neumann | The debian package libjson0-dev 0.10-1 seems to miss the file /usr/include/json/json_object_iterator.h |
466 | 8 | Axel Neumann | Manually copying it from the below mentioned json-c_0.10.orig.tar.gz archive helps. |
467 | 8 | Axel Neumann | |
468 | 8 | Axel Neumann | |
469 | 8 | Axel Neumann | To install manually (only if NOT installed via debian or other package management system): |
470 | 8 | Axel Neumann | <pre> |
471 | 8 | Axel Neumann | wget http://ftp.de.debian.org/debian/pool/main/j/json-c/json-c_0.10.orig.tar.gz |
472 | 8 | Axel Neumann | tar xzvf json-c_0.10.orig.tar.gz |
473 | 1 | Pau Escrich | cd json-c.. |
474 | 8 | Axel Neumann | ./configure ; make ; make install; ldconfig |
475 | 8 | Axel Neumann | </pre> |
476 | 8 | Axel Neumann | |
477 | 8 | Axel Neumann | |
478 | 36 | Axel Neumann | h3. Compile and Install |
479 | 8 | Axel Neumann | |
480 | 36 | Axel Neumann | To compile and install only the bmx6 json plugins: |
481 | 1 | Pau Escrich | <pre> |
482 | 36 | Axel Neumann | make -C lib/bmx6_json/ |
483 | 36 | Axel Neumann | sudo make -C lib/bmx6_json/ install |
484 | 8 | Axel Neumann | </pre> |
485 | 8 | Axel Neumann | |
486 | 8 | Axel Neumann | |
487 | 36 | Axel Neumann | h3. Usage |
488 | 3 | Axel Neumann | |
489 | 35 | Axel Neumann | |
490 | 35 | Axel Neumann | |
491 | 36 | Axel Neumann | h2. SMS Plugin |
492 | 35 | Axel Neumann | |
493 | 35 | Axel Neumann | |
494 | 35 | Axel Neumann | |
495 | 36 | Axel Neumann | h2. Quagga Plugin |
496 | 35 | Axel Neumann | |
497 | 35 | Axel Neumann | The bmx6 quagga plugin can be used to exchange routes with a quagga/zebra daemon. |
498 | 35 | Axel Neumann | Both, export and redistribution of routes is supported. |
499 | 35 | Axel Neumann | |
500 | 35 | Axel Neumann | |
501 | 36 | Axel Neumann | h3. Requirements, Compile, and Install |
502 | 35 | Axel Neumann | |
503 | 41 | Axel Neumann | h4. Quagga |
504 | 1 | Pau Escrich | |
505 | 41 | Axel Neumann | Quagga version 0.99.21 must be patched for bmx6 support. |
506 | 41 | Axel Neumann | |
507 | 41 | Axel Neumann | The bmx6 directory lib/bmx6_quagga/patches/ contains patches to enable quagga for bmx6 support. |
508 | 41 | Axel Neumann | The following example provides instructions for obtaining, patching, compiling, and installing quagga: |
509 | 41 | Axel Neumann | |
510 | 41 | Axel Neumann | <pre> |
511 | 41 | Axel Neumann | wget http://download.savannah.gnu.org/releases/quagga/quagga-0.99.21.tar.gz |
512 | 41 | Axel Neumann | tar xzvf quagga-0.99.21.tar.gz |
513 | 41 | Axel Neumann | cd quagga-0.99.21 |
514 | 41 | Axel Neumann | patch -p1 < ../bmx6/lib/bmx6_quagga/patches/quagga-0.99.21.tar.diff |
515 | 41 | Axel Neumann | ./configure |
516 | 41 | Axel Neumann | make |
517 | 41 | Axel Neumann | sudo make install |
518 | 41 | Axel Neumann | </pre> |
519 | 41 | Axel Neumann | |
520 | 41 | Axel Neumann | For further instructions to obtain, patch, compile, and install quagga please have a look at: |
521 | 1 | Pau Escrich | the file lib/bmx6_quagga/patches/README in the bmx6 sources. |
522 | 1 | Pau Escrich | |
523 | 41 | Axel Neumann | h4. Bmx6 |
524 | 41 | Axel Neumann | |
525 | 35 | Axel Neumann | To compile and install the bmx6 part of the quagga plugin simply do: |
526 | 35 | Axel Neumann | <pre> |
527 | 36 | Axel Neumann | make -C lib/bmx6_quagga/ |
528 | 36 | Axel Neumann | sudo make -C lib/bmx6_quagga/ install |
529 | 2 | Pau Escrich | </pre> |
530 | 1 | Pau Escrich | |
531 | 36 | Axel Neumann | |
532 | 37 | Axel Neumann | h3. Usage |
533 | 38 | Axel Neumann | |
534 | 38 | Axel Neumann | To use the bmx6 quagga plugin it must be loaded during bmx6 daemon startup with the @ plugin=bmx6_quagga.so @ argument. |
535 | 38 | Axel Neumann | Alternatively a plugin section can be defined in the bmx6 config file like this: |
536 | 38 | Axel Neumann | <pre> |
537 | 38 | Axel Neumann | config 'plugin' |
538 | 38 | Axel Neumann | option 'plugin' 'bmx6_quagga.so' |
539 | 38 | Axel Neumann | </pre> |
540 | 38 | Axel Neumann | |
541 | 38 | Axel Neumann | Once the plugin is successfully loaded, the bmx6 daemon will try to connect with the zebra process (via the ZAPI socket) |
542 | 38 | Axel Neumann | and new parameters for exchanging routes with quagga/zebra daemon are enabled. |
543 | 38 | Axel Neumann | |
544 | 38 | Axel Neumann | A quick documentation of the quagga-related parameters is available via the --help and --verboseHelp option. |
545 | 38 | Axel Neumann | If the quagga-enabled daemon is already running @ bmc6 -c verboseHelp /r=1 @ will print all currently supported parameters. |
546 | 1 | Pau Escrich | |
547 | 1 | Pau Escrich | |
548 | 39 | Axel Neumann | |
549 | 39 | Axel Neumann | |
550 | 41 | Axel Neumann | h3. Redistributing routes (from quagga/zebra to bmx6) |
551 | 39 | Axel Neumann | |
552 | 39 | Axel Neumann | Redistribution of routes is configurable with the --redistribute parameter. |
553 | 38 | Axel Neumann | Similar to the --tunOutNet parameter, --redistribute must be given with an arbitrary name for referencing to a specific redistribution directive and further sub-criterias. |
554 | 38 | Axel Neumann | |
555 | 38 | Axel Neumann | Further mandatory sub-parameters are /bandwidth and at least one (to-be redistributed route type). |
556 | 38 | Axel Neumann | The following route types exist: |
557 | 38 | Axel Neumann | <pre> |
558 | 38 | Axel Neumann | /system <VAL> def: 0 range: [ 0 , 1 ] |
559 | 38 | Axel Neumann | /kernel <VAL> def: 0 range: [ 0 , 1 ] |
560 | 38 | Axel Neumann | /connect <VAL> def: 0 range: [ 0 , 1 ] |
561 | 38 | Axel Neumann | /rip <VAL> def: 0 range: [ 0 , 1 ] |
562 | 38 | Axel Neumann | /ripng <VAL> def: 0 range: [ 0 , 1 ] |
563 | 38 | Axel Neumann | /ospf <VAL> def: 0 range: [ 0 , 1 ] |
564 | 38 | Axel Neumann | /ospf6 <VAL> def: 0 range: [ 0 , 1 ] |
565 | 38 | Axel Neumann | /isis <VAL> def: 0 range: [ 0 , 1 ] |
566 | 38 | Axel Neumann | /bgp <VAL> def: 0 range: [ 0 , 1 ] |
567 | 38 | Axel Neumann | /babel <VAL> def: 0 range: [ 0 , 1 ] |
568 | 38 | Axel Neumann | /hsls <VAL> def: 0 range: [ 0 , 1 ] |
569 | 38 | Axel Neumann | /olsr <VAL> def: 0 range: [ 0 , 1 ] |
570 | 38 | Axel Neumann | /batman <VAL> def: 0 range: [ 0 , 1 ] |
571 | 38 | Axel Neumann | </pre> |
572 | 38 | Axel Neumann | |
573 | 1 | Pau Escrich | Only quagga/zebra routes types that are explicitly specified will be redistributed to the bmx6 network. |
574 | 38 | Axel Neumann | In addition, one usually wants to filter out networks from being redistributed based on their prefix. |
575 | 38 | Axel Neumann | Therefore the sub parameters /network, /minPrefixLen, and /maxPrefixLen can be used in the same way as for the --tunOutNet parameter. |
576 | 38 | Axel Neumann | |
577 | 41 | Axel Neumann | h4. Route Aggregation |
578 | 40 | Axel Neumann | |
579 | 1 | Pau Escrich | By default, maximum aggregation of to-be redistributed routes is enabled. |
580 | 40 | Axel Neumann | This means that to-be redistributed neighboring and overlapping networks with the same route type and bandwidth are aggregated if possible. |
581 | 40 | Axel Neumann | The extend of aggregation can be controlled with the /aggregatePrefixLen sub-parameter. |
582 | 40 | Axel Neumann | The given value limits the aggregation to a minimum prefix length. |
583 | 40 | Axel Neumann | The default of 0 defines maximum aggregation whenever possible which may not be wanted. |
584 | 40 | Axel Neumann | |
585 | 45 | Axel Neumann | For example the GW node may be configured to redistribute the following routes: |
586 | 40 | Axel Neumann | |
587 | 45 | Axel Neumann | * 10.254.20.1/32 |
588 | 45 | Axel Neumann | * 10.254.20.0/24 |
589 | 45 | Axel Neumann | * 10.254.21.0/24 |
590 | 45 | Axel Neumann | * 10.254.22.0/24 |
591 | 40 | Axel Neumann | * 0.0.0.0/0 |
592 | 40 | Axel Neumann | |
593 | 40 | Axel Neumann | The following bmx6 configuration would aggregate all 5 routes into a single 0.0.0.0/0 tunnel announcement since 0.0.0.0/0 is overlapping any other more-specific route: |
594 | 40 | Axel Neumann | <pre> |
595 | 40 | Axel Neumann | redistribute=ipv4 /bandwidth=10000000 /kernel=1 /aggregatePrefixLen=0 |
596 | 40 | Axel Neumann | </pre> |
597 | 40 | Axel Neumann | |
598 | 40 | Axel Neumann | This aggregation may be too generic since GW-client nodes are usually looking for more specific routes to specific destination. |
599 | 40 | Axel Neumann | The following configuration would aggregate only routes with a prefix-len larger than 16: |
600 | 40 | Axel Neumann | |
601 | 40 | Axel Neumann | <pre> |
602 | 40 | Axel Neumann | redistribute=ipv4 /bandwidth=10000000 /kernel=1 /aggregatePrefixLen=16 |
603 | 40 | Axel Neumann | </pre> |
604 | 40 | Axel Neumann | |
605 | 40 | Axel Neumann | Resulting in the following aggregations: |
606 | 45 | Axel Neumann | * 10.254.20.1/32: Aggregated (sub-network of 10.254.20.0/24)! NOT announced! |
607 | 45 | Axel Neumann | * 10.254.20.0/24: Aggregated with 10.254.21.0/24! Announced as 10.254.20.0/23 |
608 | 45 | Axel Neumann | * 10.254.21.0/24: Aggregated with 10.254.20.0/24! Announced as 10.254.20.0/23 |
609 | 45 | Axel Neumann | * 10.254.22.0/24: Not aggregatable into larger network! Announced as is! |
610 | 40 | Axel Neumann | * 0.0.0.0/0: Not aggregated (prefix-len smaller than /aggregatePrefixLen=16)! Announced as is! |
611 | 40 | Axel Neumann | |
612 | 38 | Axel Neumann | |
613 | 38 | Axel Neumann | |
614 | 41 | Axel Neumann | h3. Exporting routes (from bmx6 to quagga/zebra) |
615 | 42 | Axel Neumann | |
616 | 42 | Axel Neumann | |
617 | 42 | Axel Neumann | For exporting routes received as bmx6 tunnel announcements, the /exportDistance can be used as a subparameter of the --tunOut parameter. |
618 | 42 | Axel Neumann | The default value of /exportDistance is 256 which is considered as infinit or disabled. |
619 | 42 | Axel Neumann | Any lower configured value will export the corresponding outgoing tunnel (once it becomes active) with the given distance to quagga/zebra. |
620 | 42 | Axel Neumann | |
621 | 42 | Axel Neumann | A GW node usually only wants to export bmx6 routes that were announced by other (non-GW) bmx6 nodes in the mesh. |
622 | 42 | Axel Neumann | |
623 | 43 | Axel Neumann | In the following example there are 3 other bmx6 nodes, each tunnel announcing a private /32 network. |
624 | 1 | Pau Escrich | |
625 | 43 | Axel Neumann | The given parametrization configures a GW node to search, establish related tunnels, and export all tunnel announcements for other bmx6 daemons that have a prefix-length smaller that /27 and fall into the network range of 10.254.0.0/16: |
626 | 43 | Axel Neumann | |
627 | 1 | Pau Escrich | <pre> |
628 | 43 | Axel Neumann | plugin=bmx6_quagga.so tunOut=privV4Nets /network=10.254.0.0/16 /minPrefixLen=27 /exportDistance=0 |
629 | 43 | Axel Neumann | </pre> |
630 | 43 | Axel Neumann | |
631 | 43 | Axel Neumann | Checking the export from the quagga perspective show the following: |
632 | 43 | Axel Neumann | <pre> |
633 | 43 | Axel Neumann | root@mlc1001:~# telnet localhost zebra |
634 | 43 | Axel Neumann | Trying ::1... |
635 | 43 | Axel Neumann | Trying 127.0.0.1... |
636 | 43 | Axel Neumann | Connected to localhost. |
637 | 43 | Axel Neumann | Escape character is '^]'. |
638 | 43 | Axel Neumann | |
639 | 43 | Axel Neumann | Hello, this is Quagga (version 0.99.21). |
640 | 43 | Axel Neumann | Copyright 1996-2005 Kunihiro Ishiguro, et al. |
641 | 43 | Axel Neumann | |
642 | 43 | Axel Neumann | User Access Verification |
643 | 43 | Axel Neumann | Password: |
644 | 43 | Axel Neumann | |
645 | 43 | Axel Neumann | Router> show ip route |
646 | 43 | Axel Neumann | Codes: K - kernel route, C - connected, S - static, R - RIP, |
647 | 43 | Axel Neumann | O - OSPF, I - IS-IS, B - BGP, H - HSLS, o - OLSR, |
648 | 43 | Axel Neumann | b - BATMAN, x - BMX6, A - Babel, |
649 | 43 | Axel Neumann | > - selected route, * - FIB route |
650 | 43 | Axel Neumann | |
651 | 43 | Axel Neumann | K>* 0.0.0.0/0 via 10.0.0.1, eth0 |
652 | 43 | Axel Neumann | C>* 10.0.0.0/11 is directly connected, eth0 |
653 | 43 | Axel Neumann | x>* 10.254.10.0/32 [0/1024] is directly connected, bmx6_out0000, 00:03:24 |
654 | 43 | Axel Neumann | C * 10.254.10.1/32 is directly connected, bmx6_out0003 |
655 | 43 | Axel Neumann | C * 10.254.10.1/32 is directly connected, bmx6_out0002 |
656 | 43 | Axel Neumann | C * 10.254.10.1/32 is directly connected, bmx6_out0001 |
657 | 43 | Axel Neumann | C * 10.254.10.1/32 is directly connected, bmx6_out0000 |
658 | 43 | Axel Neumann | C>* 10.254.10.1/32 is directly connected, bmx6_in0000 |
659 | 43 | Axel Neumann | x>* 10.254.10.2/32 [0/1024] is directly connected, bmx6_out0001, 00:03:24 |
660 | 43 | Axel Neumann | x>* 10.254.10.3/32 [0/1024] is directly connected, bmx6_out0002, 00:03:24 |
661 | 43 | Axel Neumann | x>* 10.254.10.4/32 [0/1024] is directly connected, bmx6_out0003, 00:03:24 |
662 | 43 | Axel Neumann | C>* 127.0.0.0/8 is directly connected, lo |
663 | 42 | Axel Neumann | </pre> |