Problems faced part 2 - Kushagram/wireless-testbed GitHub Wiki
Setting up the network
Load the wifi-experiment.ndz
image onto the 8 nodes that you will use in your experiment-in my case:
omf load -i wifi-experiment.ndz -t node1-1.outdoor.orbit-lab.org,node1-2.outdoor.orbit-lab.org,node1-3.outdoor.orbit-lab.org,node1-4.outdoor.orbit-lab.org
After this process is finished, turn your nodes on:
omf tell -a on -t node1-1.outdoor.orbit-lab.org,node1-2.outdoor.orbit-lab.org,node1-3.outdoor.orbit-lab.org,node1-4.outdoor.orbit-lab.org
In this experiment we have reserved 2 terminals for each of the client nodes hence in all 6 terminals are there plus 3 terminals for the Access Point. Then open eight terminals, SSH into the outdoor testbed console with your GENI wireless username and keys, and SSH from there into each of the four nodes (using the username "root").
Next ssh into each of the nodes on two terminals each. For example to ssh into node 1-3 run the following commands in each of the two terminals that you want to assign as node1-3
ssh root@node1-1
Similarly repeat for node1-2,node1-3,node1-4 as well.
Note: We would be making node1-1 the Access Point and node1-2,node1-3 and node1-4 the clients.
Configure the wireless access points
SH into one node from outdoor console and set it as a AP .We take that node as node1-1.On this node bring up the wifi interface with the following command:
ifconfig wlan0 up
Then, run the following command to set up a WiFi AP with ESSID "wireless1" and password "secretpassword" and the IP address that you want to assign to the AP(here we have assigned it 10.10.10.1):
create_ap -c 1 -n -g 10.10.10.1 wlan0 wireless1 secretpassword
In the output you should see :
ap0: AP-ENABLED
After you are done with setting up the Access Point on node1-1 and assigning the IP address to the gateway you need not separately use ifconfig
command to assign the IP address to the AP on its other terminal.
The IP address that has been assigned using the -g flag would set it on the ap0 interface.
Now let us connect each of the clients to this Access Point.
On each of the clients' terminal run the following commands:
First set up a Wifi configuration file :
wpa_passphrase wireless1 secretpassword > wpa.conf
The wpa_passphrase
utility turns your human-readable password ("secretpassword") into a preshared key (psk) format, and the results are redirected to a file. (You can see this file with cat wpa.conf
.)
Finally connect to the network from each of the two stations with:
wpa_supplicant -iwlan0 -cwpa.conf -B
Thereafter in order to ensure that you are connected to the Access Point run the following command:
iwconfig wlan0
Thereafter in order to assign the IP address to this node run :
ifconfig wlan0 10.10.10.X
where X is the number to the right of the hyphen in node1-X. e.g.: for node1-4 it would X would be 4
In order to check that all the client node have indeed got connected to the Access Point run the following command(say we run for 10.10.10.2 i.e. node1-2's sending terminal):
ping -c 1 10.10.10.1
One ideally expects that the node would successfully send the data packets to the destination( here the AP).
However one might get the output as follows:
PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
From 10.10.10.2 icmp_seq=1 Destination Host Unreachable
Debugging Steps
- First of all run the
iwconfig
command on node1-2's sending terminal to check for the connectivity between the host and the destination.
In the output that I ran both the pairs(i.e. the AP and node1-2) were connected since under the wlan0
heading against the Access Point subheading it showed the MAC address of the AP(layer 2 address) to which I was expecting to be connected.Hence I concluded that the node1-2 was indeed connected to the AP.
However in some cases it might as well show against the Access Point subheading: Not-Associated
- Next run
ifconfig
command on both the AP terminal and node1-2's sending terminal to verify that the IP address and the subnet are what we actually think they are.
On running the above command it displayed the list of all the interfaces that were there on that particular node along with their IP addresses(level 3 address denoted by inet addr) and MAC addresses(link layer address denoted by HWaddr). One thing to note is that although wlan0
interface is seen on running the command on AP terminal but its IP address is not given.Rather the address that we had explicitly assigned to the AP is seen on the ap0 interface.
Hence we conclude that there was no alteration in the IP addresses (due to multiple background processes) that we had assigned to the nodes.
- Next comes tracing the data packets concept.Get the list of all the interfaces on the AP and say node1-2's sending terminal using
route -n
. Next usetcpdump
for each of the interfaces separately on the AP terminal while trying to ping from the node1-2's sending terminal. Analyze at which interface the packet gets lost.
In my case the observations have been recorded in the transcripts. But I am still not very sure whether the manner in which I have run the last debugging step is correct or not and hence the conclusions derived from it.