CS640 Fall'15 Assignments Webpage
Overview
The first two assignments will use the Switchyard
environment, developed by Joel Sommers from Colgate University.
Switchyard is a Python-based framework for developing and testing network devices such as hubs, switches, routers and firewalls. The objective of these labs is to give you experience with writing the core logic functions for network devices.
Network devices have "ports"/interfaces that have names.
The goal of a Switchyard program is
- receive packet
- process packet
- forward packet
Lab 1
- Read the documentation here
- Install the Switchyard test environment on your computer and run examples to develop an understanding for how to operate Switchyard.
- Your assignment is to do the Learning Switch lab. Proceed to instructions and lab details as follows:
Details
- As noted in the Switchyard overview, development must be done in Python 3. If you don't know Python, you should look at the documentation and tutorials on python.org
- You can develop and test your implementation of the learning switch using the Switchyard test capability on your personal computers (Mac or Linux). See instructions in the overview for setting this up.
- You will need to run your tests in Mininet using a virtual machine (VM) that has been created especially for this purpose. Mininet is a network simulator - details can be found at mininet.org . The VM enables you to emulate a stand alone computer on another computer. It is built using VirtualBox and will only run on Linux systems. Thus, to run your Mininet experiments, if you don't have a Linux system, you will have to use CSL systems. Details on running the Mininet VM will be posted on the FAQ shortly but it's all very simple in Switchyard.
- We will post a number of test files that are similar to what will be used to evaluate your implementation. However, you should be proactive in creating your own test files to ensure that your system is working.
- Grading will be done as follows: 20% code review and 80% demo. The primary aspect of code review is to ensure that all of your code is original (i.e., you wrote it). The demo will exercise your code to ensure that it has all required functions.
- Don't forget that the assignment is due on Tuesday 10/20. Instructions for submitting your learning switch code will be sent prior to the deadline. After the deadline, you will need to sign up for a time slot to demo your code. An announcement on that will sent after 10/20.
Test Cases
Find the learning switch test file (.srpy)
here . Do remember that this is not the set of all test scenarios, so do remember to test your solutions meticulously.
To run, ensure first that you are using Python version 3.4.3. Other versions may give errors. Copy this to the switchyard directory (where srpy.py is) :
$ ./srpy.py -t -s learningswitchtests.srpy [your-learning-switch-implementation]
Switchyard-Virtual-Machine
Find the Ubuntu 14.04 32-bit VM pre-installed with Mininet and Switchyard
here .
VM username : cs640user
password : cs640userpassword
s
Use Virtualbox to execute this VM. Relevant links :
1. Virtualbox :
https://www.virtualbox.org/wiki/Downloads
2. Importing a VM image into Virtualbox :
https://docs.oracle.com/cd/E26217_01/E26796/html/qs-import-vm.html
FAQ
If in doubt, look up this FAQ. If a question you have is not addressed here, contact Kausik at sskausik08@cs.wisc.edu.
- Q: When I am trying to install the required packages for running Switchyard on Ubuntu 14.04 using apt-get, it is unable to locate package freetype-dev ?
A: In such a case, use sudo apt-get install libfreetype6-dev . Or find the correct package for freetype-dev, use this command in your terminal apt-cache search freetype | grep dev . This will give you the name of the package to install.
- Q: In installing switchyard, I am facing problems with pyenv ?
A: In that case, you can install the python dependencies natively without using pyenv.
- Q: When running the examples, it shows some module not found in python?
A: This could happen because you did not install the requirements correctly. The right tool to install python3 libraries is pip3 . Also don't forget to use sudo . So the updated instructions are
$ git clone https://github.com/jsommers/switchyard
... git clone happens
$ cd switchyard
$ sudo pip3 install -r requirements.txt
- Q: Effective use of Virtual Machines with Virtualbox (extrapolate this to your VM)
A: https://docs.google.com/document/d/1jWkMDpC4gB2a3B9tWtcgXrx13PMXqiBxpPkwlRKDpt0/edit (Credits to Joel Sommers)
- Q: When I run
./srpy -t -s examples/hubtests.srpy examples/myhub.py
, I get an error?
A: Seems like there is an issue with the examples/hubtests.srpy file. If you use
./srpy -t -s examples/hubtests.py examples/myhub.py
It will work. To recompile the test case scenario, use the command :
python3 ./srpy.py -c -s examples/hubtests.py
- Q: If you get this error when testing
"
This is the Switchyard equivalent of the blue screen of death.
Here (repeating what's above) is the failure that occurred:
Ethernet frame destined for 30:00:00:00:00:02 should be
flooded out eth1 and eth2
In particular:
AttributeError("'Scenario' object has no attribute
'_timeoutval'",)“
A: 1) Get the current version of the switchyard repository from https://github.com/jsommers/switchyard (git pull)
2) Downloaded the updated test file(.srpy) from the assignment webpage
- Q: Wireshark is not capturing packets when I run the mininet test setup?
A: Steps to solve :
1) After opening wireshark -k, go to menu Capture -> Interfaces
2) It will show you a couple of interfaces. Stop the capture. Then again start the capture from this and selecting “server1-eth0”
3) Voila! You should receive the packets.