Gateways » History » Version 8
Pau Escrich, 02/18/2014 12:59 PM
1 | 8 | Pau Escrich | h1. Gateways in bmx6 |
---|---|---|---|
2 | 1 | Pau Escrich | |
3 | 3 | Pau Escrich | The gateways of the mesh are those nodes who are able to reach some other networks, such as the Internet or another wireless community,and are used as a door for the nodes of the mesh who cannot reach these networks directly. |
4 | 1 | Pau Escrich | |
5 | 4 | Pau Escrich | In bmx6 these gateways are reached using IP tunnels between the node who offer the network and the node who wants to fetch the network. |
6 | 1 | Pau Escrich | |
7 | 7 | Pau Escrich | The list of tunnels can be seen from the web interface (Mesh -> Tunnels) or from the terminal using the command "bmx6 -c --tunnels". |
8 | 6 | Pau Escrich | |
9 | 2 | Pau Escrich | A node (not gateway) should look for some specific network, as shown in the next */etc/config/bmx6* configuration example: |
10 | 1 | Pau Escrich | |
11 | 2 | Pau Escrich | <pre> |
12 | 1 | Pau Escrich | config 'tunOut' |
13 | 1 | Pau Escrich | option 'tunOut' 'ipv6' |
14 | 1 | Pau Escrich | option 'network' '::/0' |
15 | 1 | Pau Escrich | |
16 | 1 | Pau Escrich | config 'tunOut' |
17 | 1 | Pau Escrich | option 'tunOut' 'inet' |
18 | 1 | Pau Escrich | option 'network' '0.0.0.0/0' |
19 | 1 | Pau Escrich | option 'maxPrefixLen' '0' |
20 | 1 | Pau Escrich | |
21 | 1 | Pau Escrich | config 'tunOut' |
22 | 1 | Pau Escrich | option 'tunOut' 'guifi' |
23 | 1 | Pau Escrich | option 'network' '10.0.0.0/8' |
24 | 1 | Pau Escrich | option 'maxPrefixLen' '8' |
25 | 1 | Pau Escrich | |
26 | 1 | Pau Escrich | config 'tunOut' |
27 | 1 | Pau Escrich | option 'tunOut' 'cloud' |
28 | 1 | Pau Escrich | option 'network' '10.0.0.0/8' |
29 | 1 | Pau Escrich | option 'minPrefixLen' '16' |
30 | 2 | Pau Escrich | </pre> |
31 | 1 | Pau Escrich | |
32 | 5 | Pau Escrich | |
33 | 2 | Pau Escrich | # *ipv6* Look for all IPv6 announcements |
34 | 2 | Pau Escrich | # *inet* Look only for v4 internet 0.0.0.0/0 (and not smaller) |
35 | 2 | Pau Escrich | # *guifi* Look for the big announcements to other networks, inside the subnetwork 10.0.0.0/8 not smaller than /8 |
36 | 2 | Pau Escrich | # *cloud* Lookg for all (small) announcements from /16 to /32 inside the subnetwork 10.0.0.0/8 |
37 | 5 | Pau Escrich | |
38 | 5 | Pau Escrich | |
39 | 5 | Pau Escrich | In the mesh network there might be several gateways publishing the same network, in such case the node will choose his best path. |
40 | 5 | Pau Escrich | There are many options which can be used to modify the path decision, for instance one quite useful is the "gwName". |
41 | 5 | Pau Escrich | |
42 | 5 | Pau Escrich | <pre> |
43 | 5 | Pau Escrich | config 'tunOut' |
44 | 8 | Pau Escrich | option 'tunOut' 'guifi' |
45 | 8 | Pau Escrich | option 'network' '10.0.0.0/8' |
46 | 8 | Pau Escrich | option 'maxPrefixLen' '8' |
47 | 8 | Pau Escrich | option 'gwName' 'GSmVictoria-RK71' |
48 | 1 | Pau Escrich | </pre> |
49 | 1 | Pau Escrich | |
50 | 1 | Pau Escrich | In this example, if exist a node named "GSmVictoria-RK71" publishing the network 10.0.0.0/8 it will be selected and not the another ones. |
51 | 8 | Pau Escrich | |
52 | 8 | Pau Escrich | h1. Gateways in qMp |
53 | 8 | Pau Escrich | |
54 | 8 | Pau Escrich | QMP implements an abstraction layer of the bmx6 gateways. It is configured in the file /etc/config/gateways which can look like this (there is also a nice web interface under Configuration->Gateways to manage them): |
55 | 8 | Pau Escrich | |
56 | 8 | Pau Escrich | <pre> |
57 | 8 | Pau Escrich | config gateway 'inet6' |
58 | 8 | Pau Escrich | option type 'search' |
59 | 8 | Pau Escrich | option network '::/0' |
60 | 8 | Pau Escrich | option maxPrefixLen '0' |
61 | 8 | Pau Escrich | option tableRule '32767/253' |
62 | 8 | Pau Escrich | option ignore '0' |
63 | 8 | Pau Escrich | |
64 | 8 | Pau Escrich | config gateway 'inet6_offer' |
65 | 8 | Pau Escrich | option type 'offer' |
66 | 8 | Pau Escrich | option network '::/0' |
67 | 8 | Pau Escrich | option ignore '1' |
68 | 8 | Pau Escrich | |
69 | 8 | Pau Escrich | config gateway 'inet4' |
70 | 8 | Pau Escrich | option type 'search' |
71 | 8 | Pau Escrich | option network '0.0.0.0/0' |
72 | 8 | Pau Escrich | option maxPrefixLen '0' |
73 | 8 | Pau Escrich | option tableRule '32767/253' |
74 | 8 | Pau Escrich | option ignore '0' |
75 | 8 | Pau Escrich | |
76 | 8 | Pau Escrich | config gateway 'inet4_offer' |
77 | 8 | Pau Escrich | option type 'offer' |
78 | 8 | Pau Escrich | option network '0.0.0.0/0' |
79 | 8 | Pau Escrich | option ignore '1' |
80 | 8 | Pau Escrich | |
81 | 8 | Pau Escrich | config gateway 'cloud' |
82 | 8 | Pau Escrich | option type 'search' |
83 | 8 | Pau Escrich | option network '10.0.0.0/8' |
84 | 8 | Pau Escrich | option minPrefixLen '24' |
85 | 8 | Pau Escrich | |
86 | 8 | Pau Escrich | config gateway 'cloud6' |
87 | 8 | Pau Escrich | option type 'search' |
88 | 8 | Pau Escrich | option network '::/0' |
89 | 8 | Pau Escrich | option minPrefixLen '48' |
90 | 8 | Pau Escrich | |
91 | 8 | Pau Escrich | config gateway 'community' |
92 | 8 | Pau Escrich | option type 'search' |
93 | 8 | Pau Escrich | option network '10.0.0.0/8' |
94 | 8 | Pau Escrich | option maxPrefixLen '8' |
95 | 8 | Pau Escrich | option gwName 'UPCc6-65ab' |
96 | 8 | Pau Escrich | |
97 | 8 | Pau Escrich | config gateway 'community6' |
98 | 8 | Pau Escrich | option type 'search' |
99 | 8 | Pau Escrich | option network '::/0' |
100 | 8 | Pau Escrich | option minPrefixLen '32' |
101 | 8 | Pau Escrich | option maxPrefixLen '48' |
102 | 8 | Pau Escrich | |
103 | 8 | Pau Escrich | config gateway 'community_offer' |
104 | 8 | Pau Escrich | option type 'offer' |
105 | 8 | Pau Escrich | option network '10.0.0.0/8' |
106 | 8 | Pau Escrich | option ignore '1' |
107 | 8 | Pau Escrich | |
108 | 8 | Pau Escrich | config gateway 'example' |
109 | 8 | Pau Escrich | option ignore '1' |
110 | 8 | Pau Escrich | option type 'search' |
111 | 8 | Pau Escrich | option gwName 'qMp-example' |
112 | 8 | Pau Escrich | option network '10.1.0.0/16' |
113 | 8 | Pau Escrich | option address '10.2.2.2/32' |
114 | 8 | Pau Escrich | option minPrefixLen '16' |
115 | 8 | Pau Escrich | option maxPrefixLen '24' |
116 | 8 | Pau Escrich | option hysteresis '20' |
117 | 8 | Pau Escrich | option bonus '10' |
118 | 8 | Pau Escrich | option minBandwidth '10000' |
119 | 8 | Pau Escrich | option exportDistance '10' |
120 | 8 | Pau Escrich | |
121 | 8 | Pau Escrich | config gateway 'inet4_upc' |
122 | 8 | Pau Escrich | option type 'search' |
123 | 8 | Pau Escrich | option network '0.0.0.0/0' |
124 | 8 | Pau Escrich | option gwName 'UPCc6-alix1c' |
125 | 8 | Pau Escrich | option maxPrefixLen '0' |
126 | 8 | Pau Escrich | option bonus '20' |
127 | 8 | Pau Escrich | <pre> |
128 | 8 | Pau Escrich | |
129 | 8 | Pau Escrich | h2. More info about qMp gateways (copy&pasted from mailing list) |
130 | 8 | Pau Escrich | |
131 | 8 | Pau Escrich | To choose the best GW bmx6 consider several things: |
132 | 8 | Pau Escrich | |
133 | 8 | Pau Escrich | - PathMetric (based on packet losses of the e2e path) |
134 | 8 | Pau Escrich | - Bandwidth announced |
135 | 8 | Pau Escrich | - Bonus/Hysteresis/etc... |
136 | 8 | Pau Escrich | |
137 | 8 | Pau Escrich | If you go to one node via web interface, under Mesh->Tunnels you will |
138 | 8 | Pau Escrich | find this information. The final calculation is the row named "Tun Metric". |
139 | 8 | Pau Escrich | |
140 | 8 | Pau Escrich | The Hysteresis defines how good has to be an alternative GW to select it |
141 | 8 | Pau Escrich | (by default it is 20%). So you can consider this scenario: |
142 | 8 | Pau Escrich | |
143 | 8 | Pau Escrich | - GW A is the best (TunMetric=100) |
144 | 8 | Pau Escrich | - GW B is not so good (TunMetric=85) |
145 | 8 | Pau Escrich | - Node C is looking for a gateway |
146 | 8 | Pau Escrich | |
147 | 8 | Pau Escrich | So Node C will select GW A because it is better. However in some moment |
148 | 8 | Pau Escrich | node A reboots because of an electricity problem. Then node C will |
149 | 8 | Pau Escrich | select GW B because it is the only remaining choice. After 5 minuts GW A |
150 | 8 | Pau Escrich | comes back, but as the Hysteresis is set tun 20% it won't be selected |
151 | 8 | Pau Escrich | again until B or C reboot. |
152 | 8 | Pau Escrich | |
153 | 8 | Pau Escrich | So, this could be your scenario, I don't know. To solve this bmx6 will |
154 | 8 | Pau Escrich | implement a window time before the hysteresis is taken into account. |
155 | 8 | Pau Escrich | |
156 | 8 | Pau Escrich | Another typical problem is that two GW are announcing different |
157 | 8 | Pau Escrich | bandwidth. The bandwidth has a big impact in the TunMetric calculation. |
158 | 8 | Pau Escrich | In old versions of qMp the default announced BW was 1Mbit/s. But in |
159 | 8 | Pau Escrich | newer versions it has changed to the bmx6 default which is 100Kbit/s. |
160 | 8 | Pau Escrich | So it could happen that a node is announcing 1Mbit/s and the other |
161 | 8 | Pau Escrich | 100Kbit/s, so all nods will select the first one. |
162 | 8 | Pau Escrich | |
163 | 8 | Pau Escrich | To solve this (actually it was a treated in a long mailing list thread) |
164 | 8 | Pau Escrich | the best option would be to remove all the bandwidth announcements and |
165 | 8 | Pau Escrich | leave bmx6 use the default bandwidth announcement (which is 100Kbit/s). |
166 | 8 | Pau Escrich | So if all GW are announcing the same, bmx6 will take into account only |
167 | 8 | Pau Escrich | the PathMetric. |
168 | 8 | Pau Escrich | Enter into the gateways, look into the file /etc/config/gateways and |
169 | 8 | Pau Escrich | remove all the lines which configures the "bandwidth". |
170 | 8 | Pau Escrich | |
171 | 8 | Pau Escrich | There is also another solution which consists in setting minBW=0 in the |
172 | 8 | Pau Escrich | non-GW nodes. This will do that the nodes do not look in the bandwidth |
173 | 8 | Pau Escrich | announcements of the GW but only in the PathMetric. I'll add this by |
174 | 8 | Pau Escrich | default in future versions of qMp. |