...
You can check out OFTest with git with the following command:
Code Block | ||||
---|---|---|---|---|
| ||||
git clone git://github.com/floodlight/oftest |
Quick Start
Longer Start
You need to have Python and Scapy installed on your system.
See 'Pre-requisites
...
' below.
Make sure your switch is running and trying to connect to a
controller on the machine
...
- Build the OpenFlow Python message classes
Important: The OF version used by the controller is based on
the file in <oftest>/tools/pylibopenflow/include/openflow.h
This is currently the 1.0 release file.
make -C <oftest>/tools/munger
This places files in <oftest>/src/python/oftest/src. - Edit configuration if necessary
Local platforms work with veth interface pairs and default to
four ports. You can adjust this a bit with the command line
parameters port_count, base_of_port and base_if_index.
Starting from remote.py as a simple example, you can add your
own <platform>.py file and then have it imported with
--platform=<platform> on the command line. This is meant to
allow you to test remote switches attempting to connect to a
controller on a network accessible to the test host. - Start the switch to test
The switch must be running and actively attempting to
connect to a controller on the test host at the port number
used by oft (6633 by default, or specified as --port=<n> as
an argument to oft).
If you're new to the test environment and want to check its
sanity, you can do the following. This requires that
your host kernel supports virtual ethernet interfaces. This
is best done in a window separate from where you will run oft.
A. Check out openflow (preferably at the same level as oftest):
git clone git://openflowswitch.org/openflow.git
B. cd openflow; ./boot.sh; ./configure; make
C. cd ../oftest
D. Run the switch startup script:
sudo ./run_switch.py; Now you can run oft (see below).
E. Use --help to see command line switches. If you use a port
number other than the default, make sure you use the same
one for the switch as for oft.
F. Use control-C to terminate the switch daemons.
G. To clean up the virtual ethernet interfaces, use
sudo rmmod veth
New tools allow you to run an OVS instance as well. See
oftest/tools/ovs-ctl. You will need to install a version of
openvswitch. See http://openvswitch.org/. - Run oft
See Warning above; requires sudo to control the dataplane
cd <oftest>
sudo ./oft --helpwhere you're running oft (normally port
6633). See below regarding run_switch.py for a script that starts
up a software switch on the test host.
Currently, switches must be running version 1.0 of OpenFlow.
Code Block | ||||
---|---|---|---|---|
| ||||
# git clone git://github.com/floodlight/oftest
# cd oftest
Make sure the switch you want to test is running --
see (4) below for the reference switch example.
# ./oft --list
# sudo ./oft --test-spec=Echo
# sudo ./oft --verbose --log-file=""
# sudo ./oft --test-spec=<mod> --platform=remote --host=...
|