Projecte

General

Perfil

Gateways » Historial » Revisió 8

Revisió 7 (Pau Escrich, 29-12-2012 18:31) → Revisió 8/9 (Pau Escrich, 18-02-2014 12:59)

h1. Gateways in bmx6 

 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. 

 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.  

 The list of tunnels can be seen from the web interface (Mesh -> Tunnels) or from the terminal using the command "bmx6 -c --tunnels". 

 A node (not gateway) should look for some specific network, as shown in the next */etc/config/bmx6* configuration example: 

 <pre> 
 config 'tunOut' 
	 option 'tunOut' 'ipv6' 
	 option 'network' '::/0' 

 config 'tunOut' 
	 option 'tunOut' 'inet' 
	 option 'network' '0.0.0.0/0' 
	 option 'maxPrefixLen' '0' 
	
 config 'tunOut'   
	 option 'tunOut' 'guifi'     
	 option 'network' '10.0.0.0/8' 
	 option 'maxPrefixLen' '8' 
	
 config 'tunOut' 
	 option 'tunOut' 'cloud' 
	 option 'network' '10.0.0.0/8' 
	 option 'minPrefixLen' '16' 
 </pre> 


 # *ipv6* Look for all IPv6 announcements 
 # *inet* Look only for v4 internet 0.0.0.0/0 (and not smaller) 
 # *guifi* Look for the big announcements to other networks, inside the subnetwork 10.0.0.0/8 not smaller than /8 
 # *cloud* Lookg for all (small) announcements from /16 to /32 inside the subnetwork 10.0.0.0/8 


 In the mesh network there might be several gateways publishing the same network, in such case the node will choose his best path. 
 There are many options which can be used to modify the path decision, for instance one quite useful is the "gwName". 

 <pre> 
 config 'tunOut'   
           
	 option 'tunOut' 'guifi'     
             
	 option 'network' '10.0.0.0/8' 
         
	 option 'maxPrefixLen' '8' 
         
	 option 'gwName' 'GSmVictoria-RK71' 
 </pre> 

 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. 

 h1. Gateways in qMp 

 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): 

 <pre> 
 config gateway 'inet6' 
 	 option type 'search' 
	 option network '::/0' 
 	 option maxPrefixLen '0' 
	 option tableRule '32767/253' 
	 option ignore '0' 

 config gateway 'inet6_offer' 
	 option type 'offer' 
	 option network '::/0' 
	 option ignore '1' 

 config gateway 'inet4' 
	 option type 'search' 
	 option network '0.0.0.0/0' 
 	 option maxPrefixLen '0' 
	 option tableRule '32767/253' 
 	 option ignore '0' 

 config gateway 'inet4_offer' 
	 option type 'offer' 
	 option network '0.0.0.0/0' 
 	 option ignore '1' 

 config gateway 'cloud' 
	  option type 'search' 
	  option network '10.0.0.0/8' 
	  option minPrefixLen '24' 

 config gateway 'cloud6' 
	 option type 'search' 
	 option network '::/0' 
 	 option minPrefixLen '48' 

 config gateway 'community' 
	  option type 'search' 
	  option network '10.0.0.0/8' 
	  option maxPrefixLen '8' 
	  option gwName 'UPCc6-65ab' 

 config gateway 'community6' 
	  option type 'search' 
	  option network '::/0' 
	  option minPrefixLen '32' 
	  option maxPrefixLen '48' 

 config gateway 'community_offer' 
	 option type 'offer' 
	 option network '10.0.0.0/8' 
	 option ignore '1' 

 config gateway 'example' 
	 option ignore '1' 
	 option type 'search' 
	 option gwName 'qMp-example' 
	 option network '10.1.0.0/16' 
	 option address '10.2.2.2/32' 
	 option minPrefixLen '16' 
	 option maxPrefixLen '24' 
	 option hysteresis '20' 
	 option bonus '10' 
	 option minBandwidth '10000' 
	 option exportDistance '10' 

 config gateway 'inet4_upc' 
	 option type 'search' 
	 option network '0.0.0.0/0' 
	 option gwName 'UPCc6-alix1c' 
	 option maxPrefixLen '0' 
	 option bonus '20' 
 <pre> 

 h2. More info about qMp gateways (copy&pasted from mailing list) 

 To choose the best GW bmx6 consider several things: 

 - PathMetric (based on packet losses of the e2e path) 
 - Bandwidth announced 
 - Bonus/Hysteresis/etc... 

 If you go to one node via web interface, under Mesh->Tunnels you will 
 find this information. The final calculation is the row named "Tun Metric". 

 The Hysteresis defines how good has to be an alternative GW to select it 
 (by default it is 20%). So you can consider this scenario: 

 - GW A is the best (TunMetric=100) 
 - GW B is not so good (TunMetric=85) 
 - Node C is looking for a gateway 

 So Node C will select GW A because it is better. However in some moment 
 node A reboots because of an electricity problem. Then node C will 
 select GW B because it is the only remaining choice. After 5 minuts GW A 
 comes back, but as the Hysteresis is set tun 20% it won't be selected 
 again until B or C reboot. 

 So, this could be your scenario, I don't know. To solve this bmx6 will 
 implement a window time before the hysteresis is taken into account. 

 Another typical problem is that two GW are announcing different 
 bandwidth. The bandwidth has a big impact in the TunMetric calculation. 
 In old versions of qMp the default announced BW was 1Mbit/s. But in 
 newer versions it has changed to the bmx6 default which is 100Kbit/s. 
 So it could happen that a node is announcing 1Mbit/s and the other 
 100Kbit/s, so all nods will select the first one. 

 To solve this (actually it was a treated in a long mailing list thread) 
 the best option would be to remove all the bandwidth announcements and 
 leave bmx6 use the default bandwidth announcement (which is 100Kbit/s). 
 So if all GW are announcing the same, bmx6 will take into account only 
 the PathMetric. 
 Enter into the gateways, look into the file /etc/config/gateways and 
 remove all the lines which configures the "bandwidth". 

 There is also another solution which consists in setting minBW=0 in the 
 non-GW nodes. This will do that the nodes do not look in the bandwidth 
 announcements of the GW but only in the PathMetric. I'll add this by 
 default in future versions of qMp.