Test wireless connectivity using click modular router software

Click is a software architecture for building flexible and configurable routers. More info can be found on the Click home page.

In this tutorial, we will use click to inject packets in the wireless interface and extract RSSI values at the receiving side.

To start, swap in some nodes with the default UBUNTU14-64-wilab image (this image will be auto-selected if you don’t specify an OS yourself). Make sure these nodes can reach eachother over the wireless.

Execute the following commands on both nodes :

# setup a monitor interface called wlan0mon
iw dev wlan0 interface add wlan0mon type monitor
# bring up the interface
ifconfig wlan0mon up
# choose a channel
iw dev wlan0mon set channel 40

Log in to the sender node and create a file called generatepackets.click containing the following lines :

AddressInfo(myether eth0:eth)

packetgenerator :: FlexiSource(\<aabbccddeeff>, 10, 9000, DATASIZE 100);
packetgenerator
        -> EtherEncap(0x0900, myether, FF:FF:FF:FF:FF:FF)
        -> WifiEncap(0x00, 0:0:0:0:0:0)
        -> Queue(10)
        -> rate :: SetTXRate(2)
        -> seq :: WifiSeq()
        -> encap :: RadiotapEncap()
        -> Print("Sending This",92)
        -> to_dev :: ToDevice (wlan0mon);

This script will send broadcast packets at 1Mbit/sec over the wlan0mon interface. Run the following command to start the sender:

click generatepackets.click

Log in to the receiver node and create a file called printinfo.click containing the following lines :

FromDevice(wlan0mon)
        -> RadiotapDecap()
        -> txfilter :: FilterTX()
        -> WifiDecap()
        -> filterTestPackets :: Classifier(12/0900,-)
        -> PhyInfoPrint()
        -> Discard ();

txfilter[1] -> Print("Feedack Packet")
        -> Discard ();

// Interfering packets from other setup
filterTestPackets[1]->Discard();

Execute the following commands on the receiver node :

click printinfo.click

You should now see some output on the receiving node, in the following CSV format:

Timestamp;Sequence number;SenderMAC;Rate;Signal