Projecte

General

Perfil

Gateways » Historial » Versió 8

Pau Escrich, 18-02-2014 12:59

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