wikiroute

networking recipes

User Tools

Site Tools


wireless_mesh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
wireless_mesh [2014/10/18 12:19] – created samerwireless_mesh [2014/10/19 22:01] – [4- Configuring the Wireless Nodes with B.A.T.M.A.N] samer
Line 5: Line 5:
  
 ===== -- Hardware Requirements =====  ===== -- Hardware Requirements ===== 
 +Mesh networking performance is directly related to the number of available radio channels. Particularly, a mesh node with one wireless LAN chipset is able to transmit and receive on a single channel. As a result, a wireless mesh network rarely can fully exploit the aggregate bandwidth available in the radio spectrum provisioned by the standards. For a scientific explanation of this problem, please refer to this [[http://www.ecsl.cs.sunysb.edu/multichannel/ | research team page]].  
 +
 +In order to overcome this problem, we implement in this project low cost multi-channel mesh devices consisting of a wireless router with an additional WLAN adapter. A typical equipment list that can be used for implementing the project is presented in the following:
   * TP-Link [[http://www.tp-link.com/en/products/details/?model=TL-MR3020#spec | MR3020]] wireless router.   * TP-Link [[http://www.tp-link.com/en/products/details/?model=TL-MR3020#spec | MR3020]] wireless router.
   * USB WLAN adapter based on the [[http://www.amazon.com/niceEshop-Wireless-802-11-Adapter-Antenna/dp/B008IZQCGK/ref=pd_bxgy_pc_img_y | Ralink RT5370]] chipset.    * USB WLAN adapter based on the [[http://www.amazon.com/niceEshop-Wireless-802-11-Adapter-Antenna/dp/B008IZQCGK/ref=pd_bxgy_pc_img_y | Ralink RT5370]] chipset. 
   * Raspberry Pi [[http://www.element14.com/community/community/raspberry-pi | Model B]].    * Raspberry Pi [[http://www.element14.com/community/community/raspberry-pi | Model B]]. 
  
-===== -- Software Requirements ===== +===== -- Installing the Wireless Nodes =====  
 + 
 +Make sure you have the [[http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin | attitude adjustment]] release of OpenWRT on your TP-LINK MR3020. For more information on how to flash the firmware on your router and take basic control, please refer to [[makerfaire | this article]]. 
 + 
 +Start by updating the package list and installing the necessary packages for the USB WLAN adapter. 
 + 
 +<code bash>  
 +root@MeshNode:~# opkg update 
 +root@MeshNode:~# opkg install kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb 
 +</code>
  
-http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin +[{{ :mr3020-wifi-adapter.jpg?nolink&300 | Figure 1. MR3020 with WLAN adapter }}]
-opkg update +
-opkg install kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb+
  
-root@OpenWrt:/# wifi detect+Plug the WLAN adapter on the USB port of your routeur and verify that is detected: 
 +<code bash>  
 +root@MeshNode:~# wifi detect
 config wifi-device  radio2 config wifi-device  radio2
         option type     mac80211         option type     mac80211
Line 35: Line 47:
         option ssid     OpenWrt         option ssid     OpenWrt
         option encryption none         option encryption none
-  +</code
-wifi detect /etc/config/wireless     +
-root@OpenWrt:/# vi /etc/config/wireless +
  
 +Now, copy the detected WiFi modules into the wireless configuration of your MR3020.
 +<code bash> 
 +root@MeshNode:~# wifi detect > /etc/config/wireless    
 +</code> 
 +
 +Your wireless configuration file should be similar to the following:
 +
 +<file autoconf /etc/config/wireless> 
 config wifi-device  radio0 config wifi-device  radio0
         option type     mac80211         option type     mac80211
Line 74: Line 92:
         option ssid     OpenWrt2         option ssid     OpenWrt2
         option encryption none          option encryption none 
 +</file>
  
-root@OpenWrt:/# wifi up+Check that both antennas are working: 
 +<code bash>  
 +root@MeshNode:~# wifi up
 Configuration file: /var/run/hostapd-phy0.conf Configuration file: /var/run/hostapd-phy0.conf
 Using interface wlan0 with hwaddr f8:d1:11:bd:62:ce and ssid "OpenWrt1" Using interface wlan0 with hwaddr f8:d1:11:bd:62:ce and ssid "OpenWrt1"
 Configuration file: /var/run/hostapd-phy1.conf Configuration file: /var/run/hostapd-phy1.conf
 Using interface wlan1 with hwaddr 00:e0:4c:81:88:8a and ssid "OpenWrt2" Using interface wlan1 with hwaddr 00:e0:4c:81:88:8a and ssid "OpenWrt2"
 +</code>
 +
 +<WRAP info>
 +The USB WLAN adapter does not seem to be supported in the latest Barrier Breaker relaease of OpenWRT. Additional packages are installed correctly but the adapter is not detected as a WLAN module.
 +</WRAP>
 +
 +===== -- Configuring the Wireless Nodes with B.A.T.M.A.N===== 
 +Start by installing the B.A.T.M.A.N package on your router:
 +<code bash>
 +root@MeshNode:~# opkg install kmod-batman-adv
 +</code>
 +
 +Modify your wireless configuration to activate a mesh interface in ad-hoc mode on radio0, an interface in AP mode on radio1, as in the following:
 +
 +<file autoconf /etc/config/wireless>
 +config wifi-device 'radio0'
 +      option type 'mac80211'
 +      option macaddr 'f8:d1:11:bd:62:ce'
 +      option hwmode '11ng'
 +      option htmode 'HT20'
 +      list ht_capab 'SHORT-GI-20'
 +      list ht_capab 'SHORT-GI-40'
 +      list ht_capab 'RX-STBC1'
 +      list ht_capab 'DSSS_CCK-40'
 +      option txpower '27'
 +      option country 'US'
 +      option channel '9'
 +
 +config wifi-iface 'wmesh'
 +      option device 'radio0'  
 +        option mode 'adhoc'     
 +        option ssid 'mesh'                   
 +        option encryption 'none'                        
 +        option network 'mesh'                                 
 +        option ifname 'adhoc0'  
 +        option bssid 'f8:d1:11:bd:62:ce'
 +                                                
 +config wifi-device 'radio1'
 +      option type 'mac80211'
 +      option channel '5'
 +      option macaddr '00:e0:4c:81:88:8a'
 +      option hwmode '11ng'
 +      option htmode 'HT20'
 +      list ht_capab 'GF'
 +      list ht_capab 'SHORT-GI-20'
 +      list ht_capab 'SHORT-GI-40'
 +      list ht_capab 'RX-STBC1'
 +
 +config wifi-iface
 +        option device 'radio1'
 +        option mode 'ap'      
 +        option ssid 'tinode1'
 +        option encryption 'none'
 +        option network 'tinet'
 +</file>
 +
 +<WRAP info>
 +Very few USB WLAN adapters work in ad-hoc mode, thus it is preferable to configure the corresponding radio interface in AP mode and the internal chipset of the MR3020 router in ad-hoc mode.  
 +</WARP>
 +Use the following network configuration:
 +
 +<file autoconf /etc/config/network>
 +config interface 'loopback'
 +      option ifname 'lo'
 +      option proto 'static'
 +      option ipaddr '127.0.0.1'
 +      option netmask '255.0.0.0'
 +
 +config interface 'lan'
 +      option type 'bridge'
 +      option proto 'static'
 +      option ipaddr '192.168.1.66'
 +      option netmask '255.255.255.0'
 +      option gateway '192.168.1.1'
 +      list dns '192.168.1.1'
 +      list dns '8.8.8.8'
 +      option _orig_ifname 'eth0 wlan0 wlan1'
 +      option _orig_bridge 'true'
 +      option ifname 'eth0'
 +
 +config interface 'mesh'
 +      option ifname 'adhoc0'
 +      option mtu '1528'
 +      option proto 'batadv'
 +      option mesh 'bat0'
 +
 +config interface tinet
 +      option ifname   bat0
 +      option type     bridge
 +      option proto    static
 +      option ipaddr   11.11.11.1
 +      option netmask  255.255.255.0
 +</file>
 +
 +Make sure that ''bat0'' interface is declared in ''/etc/config/batman-adv'' as in the following:
 +<file autoconf /etc/config/batman-adv>
 +config 'mesh' 'bat0'
 +      option 'interfaces' 'mesh'
 +      option 'aggregated_ogms'
 +      option 'ap_isolation'
 +      option 'bonding'
 +      option 'fragmentation'
 +      option 'gw_bandwidth'
 +      option 'gw_mode'
 +      option 'gw_sel_class'
 +      option 'log_level'
 +      option 'orig_interval'
 +      option 'vis_mode'
 +      option 'bridge_loop_avoidance'
 +</file>
 +
 +Activate the DHCP server on you acces point interface ''tinet'':
 +<code bash>
 +config dhcp
 +      option start '100'
 +      option leasetime '12h'
 +      option limit '150'
 +      option interface 'tinet'
 +</code>
 +Reboot your router, ...
 +
wireless_mesh.txt · Last modified: 2014/10/19 22:03 by samer