-
Notifications
You must be signed in to change notification settings - Fork 0
wing for desktop
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 supporting monitor mode and frame injection, see http://linuxwireless.org/en/users/Devices.
The Wing implementation for the Click modular router is made available via GitHub and can be fetched into a local directory called using the following command:
git clone https://github.com/wing-project/wing-click.git
Switch to the Click directory and run the configure script:
cd wing-click
./configure --enable-wifi --enable-wing --disable-linuxmodule --enable-userlevel --enable-diffserv
Compile and install (as root) the source code:
make
sudo make install
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/
Run the Wing configuration script (as root):
sudo /etc/init.d/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.
Each mesh router (except the gateway) must use the mesh interface as its default route:
route add default dev wing-mesh
The default route for the gateway is generally set by the DHCP client as part of the network initialization procedure. Please note that, in order for the entire mesh to exploit it as default route to the Internet, the mesh gateway must advertise its presence over the network using an HNA advertisement. See below for more information about how to configure the HNA at the mesh 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.
Wing should be able to automatically detect if the router is a gateway. In this case running the command:
read_handler wr/gw.hnas
should produce an output similar to:
0.0.0.0 0.0.0.0 6.35.170.123
Where ''6.35.170.123'' is the IP address of the router's mesh interface.
It is worth remembering that, in order to act as router/gateway, a Linux PC must have IP Forwarding enabled. This can be done in several ways:
sysctl -w net.ipv4.ip_forward=1
or
echo 1 > /proc/sys/net/ipv4/ip_forward
the setting is applied instantly; however the result will not be preserved after rebooting the system.
In order to make this configuration change permanent, the following line must be appended to the ''/etc/sysctl.conf'' file:
net.ipv4.ip_forward = 1
If you already have an entry net.ipv4.ip_forward with the value 0 you will have to change that 1. The setting will be applied after rebooting the PC.
You will also need to enable masquerading in order to effectively share the Internet connection with the rest of the mesh:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
where ''eth0'' is the interface through which the Internet can be reached.
If the router did not configure itself as a gateway, or if you want to manually configure the Host-Network Association table, you must first disable the dynamic gateway discovery feature by running:
write_handler dyn.enabled false
Then you must use the following command to configure the router as the default gateway for the network:
write_handler wr/gw.hna_add 0.0.0.0/0
Additional HNAs can be added using the following command:
write_handler wr/gw.hna_add IPADDRESS/NETMASK
An HNA can be remove using:
write_handler wr/gw.hna_del IPADDRESS/NETMASK
Currently defined HNAs can be listed using:
read_handler wr/gw.hnas
Finally the entire HNA table can be cleared using:
write_handler wr/gw.hna_clear true
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.
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
Project information
Using WING
Research Directions