The course will have around 3 programming assignments to learn about
programming on different SDN controller platforms. These assignments
are informal and ungraded. Students should feel free to collaborate
with each other on the assignments, but each student is expected to
understand all of the material in the assignments.
- Assignment 1 (due 5pm Tuesday September 17, 2013):
In this assignment, you will learn the basics of running Mininet
in a VirtualBox virtual machine.
First, install Virtual Box on your computer. Then, download and
install the custom virtual
machine for the course. (Do not use the VM referenced at
the OpenFlow Tutorial Web site. Our custom VM works on a wider variety
of platforms, and has software installed that you'll need on future
assignments.) See the video
To install the VM, start VirtualBox, and then select File>Import
Appliance and select the downloaded ova file. Then, press the
Then, follow the instructions for parts 1 through 4 of the OpenFlow
You may also
find the MiniNet Sample Workflow
for more details.
- When following the instructions for "Set Up Network
Access" (in Settings>Network>Adapter2) you will create a
host-only interface for accessing your VM by SSH. Make sure
that you select "Cable Connected" under "Advanced", while your machine
is powered off, to ensure that this interface is "plugged in". (If
your attempt to assign the interface an IP address (using dhclient) fails,
check that your host-only interface has the "Cable Connected" --
again, while the VM is powered down.)
- OS X Mountain Lion users: To enable X11 forwarding through OS X native terminal, you must install XQuartz, which isn't shipped with the OS anymore.
- The instructions in Section 4.8 are incorrect, replace
"$ sudo mn --topo single,3 --mac --controller remote --switch user" with
"$ sudo mn --topo single,3 --mac".
You do not need to submit any written materials for this assignment.
- Assignment 2 (due 5pm Tuesday October 1, 2013):
In this assignment, you will learn some basic SDN programming on the
platform. Complete the
Tutorial, using your existing VM from assignment 1 rather than
installing a new VM.
You could support the traffic monitoring in several ways. The most
elegant way is for your program to send the switch a statistics
request to read the counters associated with all rules forwarding
to/from host 1 (e.g., using Ryu's
get_flow_stats method to send a
request, and creating a handler that both processes the response and
triggers another stats call to occur after some time elapses). Note:
simple_switch.py sets both hard and soft timeouts to 0 (meaning the
rule never expires), so you don't need to worry about handling
flow-deletion messages. However, you may use a simpler approach where
you install rules for host 1 with a hard timeout, so that the rules
expire periodically and trigger flow-deletion messages that contain
the counter values for the expired rules. Then, you could set up a
handler to process these flow-deletion messages. Be careful not to
count the traffic multiple times (e.g., at each hop in the path
to/from host 1)!
- Modify the
simple MAC-learning switch to include logic blocking IP traffic between host 2 and host 3.
- Extend this program to count all traffic going to or leaving host 1. Note that it is not sufficient to set up a counter and increment it in _packet_in_handler, because _packet_in_handler is only called when a packet arrives at the controller (i.e., for the first packet of a given flow).
You may find this list of OpenFlow 1.0 messages helpful. Note that some of the
documentation is inconsistent (e.g., using "eth_src" and "eth_dst" for MAC addresses, rather than the "dl_src" and "dl_dst" fields that Ryu actually uses in its API for OpenFlow 1.0).
You can submit your code here.
- Assignment 3 (due 5pm Friday October 11, 2013):
In this assignment, you will learn some basic SDN programming on
platform created here at Princeton, using the same VM from assignment
You can submit your code here.
- Read the Pyretic Documentation (don't worry it's short).
Update your pyretic repo (from inside the VM)
$ cd ~/pyretic
$ git pull
$ git checkout tester
$ sudo pip install ipaddr
Implement a simple mac learning module
Write a simple firewalling module that blocks traffic between hosts 2 and 3
Write a simple monitoring module that counts all packets going to or leaving host 1
Write a module that imports each of the above and does firewalling and then mac learning while at the same time monitoring. Write two versions of this module: (i) monitoring all traffic, whether or not the firewall drops the traffic and (ii) monitor only the traffic that successfully passes through the firewall
Last updated: Thu Oct 10 15:40:40 -0400 2013