Views
OpenRoads:SNMP
From OpenFlow Wiki
Contents |
Installation and Setup
Development Machine
Install SNMP and its development libraries
sudo apt-get install snmp snmpd libsnmp-dev
Get the source code for SNMP support for OpenRoads
git clone git://gitosis.stanford.edu/openroads-wifi-snmp.git
Get the OpenFlow source code
git clone git://gitosis.stanford.edu/openflow.git
Compile the OpenFlow source to generate the OpenFlow library.
Get the OpenRoads NOX source code
git clone git://gitosis.stanford.edu/openroads.git noxcore
Make sure your snmp-wifi, openflow, noxcore are under the same directory, as shown below:
-./ ---./snmp-wifi ---./openflow ---./noxcore
Compile the source code in each of the sub-directories - snmp-wifi/server and snmp-wifi/ap-subagents - to get the binaries needed to run SNMP.
cd snmp-wifi/server; make cd snmp-wifi/ap-subagents; make
Note that you need a 32-bit x86 machine (or an appropriate machine compatible with your AP) to compile the sources, so that the binaries can be copied over directly.
WiFi APs
The instructions in this section are to be carried out in the WiFi access point.
Install SNMP
apt-get install snmpd snmp
In /etc/default/snmpd, change
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
to
SNMPDOPTS='-x /var/agentx/master -Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid'
Copy configuration files and scripts from the development machine over to AP using the script snmp-wifi/copy-all2ap.sh
copy-all2ap.sh <username>@<ap's ip>
or do this manually as follows:
From snmp-wifi/config-files in the source (from git),
- Copy POMI-MOBILITY-MIB.txt to /usr/share/snmp/mibs/
- Add the following line to /usr/share/snmp/mibs/.index
POMI-MOBILITY-MIB POMI-MOBILITY-MIB.txt
- Copy snmpd.conf to /etc/snmp
- This sample file assumes the SNMP manager runs in the host openroads.controller defined in /etc/hosts (described below).
- Copy openroads to /etc/init.d
- Link it to /etc/rc2.d/ as S99 after noxbox
From snmp-wifi/ap-subagents in the source (from git),
- Copy wifi_subagent, trap_subagent and keepalive_subagent to /etc/snmp
Define the IP address of the controller as openroads.controller in /etc/hosts, e.g.,
127.0.0.1 openroads.controller
Restart SNMP daemon
/etc/init.d/snmpd restart
Make sure OpenFlow (of the appropriate version, i.e., the version the subagents are compiled with) is installed and running.
Now you can (re)start the subagents by executing
/etc/init.d/openroads [re]start
or manually by executing
/etc/snmp/trap_subagent -x /var/agentx/master /etc/snmp/wifi_subagent -x /var/agentx/master /etc/snmp/keepalive_subagent -x /var/agentx/master
Note: The source code assumes the OpenFlow WiFi interface name is ath0. If the interface name is different, change the definition of INTERFACE in snmp-wifi/ap-subagents/util.h appropriately
Server
The instructions in this section are to be carried out in the SNMP manager (typically, the OpenRoads controller)
Install SNMP
apt-get install snmpd
In /etc/default/snmpd, change
TRAPDRUN=no
to
TRAPDRUN=yes
From snmp-wifi/config-files in the source (from git),
- Copy POMI-MOBILITY-MIB.txt to /usr/share/snmp/mibs/
- Add filename POMI-MOBILITY-MIB.txt to /usr/share/snmp/mibs/.index
- Copy snmpd.conf, snmptrapd.conf and controllers.conf to /etc/snmp
From snmp-wifi/servers in the source (from git),
- Copy traphandler and keepalivehandler to /etc/snmp
Define the IP address of the controller as openroads.controller in /etc/hosts, e.g.,
127.0.0.1 openroads.controller
Specify NOX's SNMP-messenger's port in /etc/snmp/controllers.conf, e.g.,
127.0.0.1 2603
Restart SNMP daemon
/etc/init.d/snmpd restart
Run snmp-wifi/snmp_executor
./snmp_executor
Nikhil Handigol is the lead on the SNMP component for OpenRoads. Please contact him for any further questions.
