This shows you the differences between two versions of the page.
|
software:notebook [2010/07/13 12:54] roberto.riggio |
software:notebook [2010/08/25 15:03] (current) roberto.riggio |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Wing for x86 desktop machines ====== | + | ====== Wing for Linux machines ====== |
| - | This page describes how to build and run Wing on a generic x86 machine (e.g. your laptop). You will need a set a PCs each of them equipped with a WiFi card based on the Atheros chipset (you can find a list of supported devices [[http://madwifi-project.org/wiki/Compatibility|here]]. | + | This page describes how to build and run Wing on a generic x86 machine (e.g. your laptop). You will need a set a PCs each of them equipped with a WiFi card and supported by either the [[http://madwifi-project.org/wiki/Compatibility|madwifi]] driver or the [[http://linuxwireless.org/|mac80211]] driver. |
| - | ===== Setting up the development environment ===== | + | |
| - | The Wing implementation for Click is made available via [[http://github.com/create-net/click-wing|GitHub]] and can be fetched into a local directory called using the following command: | + | ===== Downloading the sources ===== |
| - | git clone git@github.com:create-net/click-wing.git | + | The Wing implementation for the [[http://www.read.cs.ucla.edu/click/|Click]] modular router is made available via [[http://github.com/create-net/click-wing|GitHub]] and can be fetched into a local directory called using the following command: |
| + | |||
| + | git clone git://github.com/create-net/click-wing.git | ||
| ===== Building the sources ===== | ===== Building the sources ===== | ||
| Line 15: | Line 16: | ||
| ./configure --enable-wifi --enable-wing --disable-linuxmodule --enable-userlevel | ./configure --enable-wifi --enable-wing --disable-linuxmodule --enable-userlevel | ||
| - | Finally run make: | + | Compile and install (as root) the source code: |
| make | make | ||
| - | make install | + | sudo make install |
| + | |||
| + | ===== Copying scripts and configuration files ===== | ||
| + | |||
| + | As a root user, run the following commands: | ||
| + | |||
| + | sudo cp conf/wing/click_config /usr/bin/ | ||
| + | sudo cp conf/wing/read_handler /usr/bin/ | ||
| + | sudo cp conf/wing/write_handler /usr/bin/ | ||
| + | sudo mkdir -p /etc/wing/ | ||
| + | sudo cp conf/wing/*click /etc/wing/ | ||
| + | sudo cp conf/wing/clickd /etc/init.d/ | ||
| ===== Running Wing ===== | ===== Running Wing ===== | ||
| Line 24: | Line 36: | ||
| Run the Wing configuration script (as root): | Run the Wing configuration script (as root): | ||
| - | sudo su | + | sudo /etc/init.d/clickd start |
| - | cd conf/wing/ | + | |
| - | ./clickd start | + | At this point running ''/sbin/ifconfig'' should show a new tap interfaces called ''wing-mesh'', which is configured as 6.X.X.X and uses multi-hop routing. |
| + | |||
| + | ===== Handlers ===== | ||
| + | |||
| + | Being implemented using the Click modular router, the routing daemon exports a number of handlers that can be used to interact with the router, here follows a short list of some of the supported handlers: | ||
| + | |||
| + | ^ Handler ^ Access ^ Comments ^ | ||
| + | | lt.routes | Read-only | Lists the routes currently known to the mesh router. For each destination, the list of hops and the corresponding link metrics are provided. | | ||
| + | | wr.set_routes.routes | Read-only | Lists the currently defined static routes. Static routes are always used in place of the Route Request/Response mechanism. | | ||
| + | | wr.set_routes.set_route | Write-only | Creates a new static route. | | ||
| + | | lt.hosts | Read-only | Lists the hosts currently known to the router. For each host, the list of supported wireless interfaces is provided. | | ||
| + | | lt.links | Read-only | Lists the links currently known to the router. | | ||
| + | | arp.table | Read-only | Prints the ARP Table. | | ||
| + | | wr/set_gateway.gateway | Read/Write | Prints/Sets the current gateway. Specifying and ''0.0.0.0'' as IP Address activates the gateway auto-discovery feature. Default is ''0.0.0.0''.| | ||
| + | | wr/gw.gateway_stats | Read-only | Lists the gateways currently available on the network. | | ||
| + | | wr/gw.hna | Read-only | List the HNAs (Host-Network Associations) currently broadcasted by the router. | | ||
| + | | wr/gw.hna_add | Write-only | Creates a new HNA entry. Format is 'IPADDRESS/NETMASK'. The current node is the gateway associated to the newly created route. | | ||
| + | | wr/gw.hna_del | Write-only | Deletes a previously defined HNA. | | ||
| + | | wr/gw.hna_clear | Write-only | Deletes all the HNA entries. | | ||
| + | | wr/es/es_$1.bcast_stats | Read-only | Prints the link probing statistics for interface ''$1''. Replace $1 with the id of the interface from which you want to print the probing statistics. | | ||
| + | |||
| + | Read-only handlers can be queried using the //read_handler// shell script using the following syntax: | ||
| + | |||
| + | read_handler <handler> | ||
| + | |||
| + | Writable handlers can be polled using the //write_handler// shell script using the following syntax: | ||
| + | |||
| + | write_handler <handler> <value> | ||
| + | |||
| + | |||
| + | ===== Adding more nodes ===== | ||
| + | |||
| + | Repeat the above procedure for every other host in your mesh network. In order to list the hosts currently available on the network you can use the following command: | ||
| + | |||
| + | read_handler lt.hosts | ||
| + | |||
| + | which produces something like this: | ||
| + | |||
| + | 6.35.170.123 interfaces: 1 2 | ||
| + | 6.35.170.154 interfaces: 1 2 | ||
| + | |||
| + | ===== Setting up a gateway ===== | ||
| + | |||
| + | A gateway is a node equipped with a connection (e.g. Ethernet) to a larger network (e.g. the Internet) as well as one or more wireless interfaces running the Wing protocol. A node participating the WMN can inject external routing information by periodically broadcasting Host and Network Association (HNA) messages. Each HNA specifies that a certain Host/Network can be reached trough a particular mesh router. | ||
| + | |||
| + | A typical example is a mesh router that wants to act as default gateway for the entire WMN. In this case the HNA will contain the default route and the current node (''6.35.17.111'' in the example) as gateway: | ||
| + | |||
| + | ^ Destination ^ Netmask ^ Gateway ^ | ||
| + | | 0.0.0.0 | 0.0.0.0 | 6.35.170.111 | | ||
| + | |||
| + | Additional HNAs can be added using the following command: | ||
| + | |||
| + | write_handler wr/gw.hna_add IPADDRESS/NETMASK | ||
| + | |||
| + | as for example, the following command configure the router as default gateway for the network: | ||
| + | |||
| + | write_handler wr/gw.hna_add 0.0.0.0/0 | ||
| + | |||
| + | An HNA can be remove using: | ||
| + | |||
| + | write_handler wr/gw.hna_del IPADDRESS/NETMASK | ||
| + | |||
| + | Finally the entire HNA table can be cleared using: | ||
| + | |||
| + | write_handler wr/gw.hna_clear true | ||
| + | |||
| + | Currently defined HNAs can be listed using: | ||
| + | |||
| + | read_handler wr/gw.hna | ||
| - | At this point running ''/sbin/ifconfig'' (on another terminal) should show a new tap interfaces called ''wing-mesh'', which is configured as 6.X.X.X and uses multi-hop routing. | + | It is allowed to have multiple nodes in a network to act as gateways (sending out HNA messages). Each node will then use the nearest gateway. |