0% found this document useful (0 votes)
2 views6 pages

Assignment (JAVA)

The project involves implementing Dijkstra's algorithm in a Software-Defined Networking (SDN) environment using Mininet and Floodlight. Students will set up Mininet and Floodlight, modify the routing module to process IP packets, and calculate paths based on network topology. The final submission requires the MyRouting.java file with member details and will be graded on various implementation aspects.

Uploaded by

Omair Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Assignment (JAVA)

The project involves implementing Dijkstra's algorithm in a Software-Defined Networking (SDN) environment using Mininet and Floodlight. Students will set up Mininet and Floodlight, modify the routing module to process IP packets, and calculate paths based on network topology. The final submission requires the MyRouting.java file with member details and will be graded on various implementation aspects.

Uploaded by

Omair Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CNT4713 – Project 3

Overview:
The goal of this project is to practice Layer 3 routing in a Software-Defined Networking
(SDN) environment, and develop the skills to read and modify open-source software.
You will implement Dijkstra’s algorithm in an open-source SDN environment consisting
of: 1) Mininet, a virtual machine (VM) based network simulator; 2) FloodLight, an SDN
controller in Java.

Background:
Software-Defined Networking (SDN) is an emerging architecture that uses a software-
based, centralized approach to control network traffic. SDN decouples the network
control and forwarding functions enabling the network control to become directly
programmable via the OpenFlow [1] protocol. Floodlight [2] is a Java-based
implementation of the SDN controller, and the Javadoc of Floodlight is available at
http://floodlight.github.io/floodlight/javadoc/floodlight/index.html.

Mininet [3] is a virtual testbed enabling the development and testing of network tools
and protocols. Mininet works by creating a virtual network on your desktop or laptop.
By incorporating the Open vSwitch, a software virtual SDN switch, Mininet supports the
OpenFlow protocol and can talk to an SDN controller such as Floodlight.

Instructions:

Step 1: Set up Mininet.


a. Download Virtualbox at https://www.virtualbox.org/wiki/Downloads.
b. Download the Mininet 2.3.0 VM image (Ubuntu 18.04.5 version) from
https://github.com/mininet/mininet/releases/download/2.3.0/mininet-2.3.0-
210211-ubuntu-18.04.5-server-amd64-ovf.zip.
c. In VirtualBox, click “File > Import Appliance…” to import the Mininet VM.
d. The Mininet VM runs as a guest system with a NAT based private IP address in
the hypervisor, port forwarding must be enabled to access Mininet from the host
system. To enable port forwarding in Virtualbox, select the Mininet VM, click
“Settings -> Network -> Adapter 1 Tab -> Advanced -> Port Forwarding”, and add
a rule as follows:

1
e. Start the Mininet VM in Virtualbox.
f. Use SSH to connect to the Mininet VM at mininet@localhost:2222, and login
with the password “mininet”.

Step 2: Set up Floodlight.


a. Download Eclipse, a Java IDE, from https://eclipse.org. Note that you will need
the Java JRE to run Eclipse. If Java is not currently installed, download and install
it first.
b. Download the zipped Floodlight repo from Canvas.
c. Import the pre-compiled Floodlight project into Eclipse as follows:
• Click “File -> Import -> General -> Existing Projects into Workspace”, then
click “Next”.
• From “Select root directory” click “Browse…”, and select the Floodlight
directory.
• Check the box for “floodlight”. No other Projects should be present and none
should be selected.
• Click “Finish”.
d. In Eclipse, create the FloodlightLaunch target and run it as follows:
• Click “Run -> Run Configurations”.
• Right-click “Java Application” and select “New Configuration”.
• For Name, use “FloodlightLaunch”.
• For Project, use “floodlight”.
• For Main, use “net.floodlightcontroller.core.Main”.
2
• Click “Apply”.
• Click “Run”.
• Ignore the following Python error in Floodlight if you see one.
Exception in thread "debugserver" Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named debugserver
e. Optional: The pre-compiled Floodlight should work out of the box. If it does not,
compile it using Apache Ant as follows.
• Download the Ant binary from http://ant.apache.org/bindownload.cgi. No
installation is necessary.
• Enter the Floodlight root directory, and type “<directory-of-downloaded-
ant>/bin/ant eclipse”.

Step 3: Implement Dijkstra’s algorithm in Floodlight.


a. When a switch receives a new packet that does not match any existing rule, it
will forward the packet to Floodlight using the OpenFlow protocol, and
Floodlight will tell the switch how to process the packet also using OpenFlow.
Your routing module will process only IP packets, and leave other packets such
as ARP to the existing Floodlight modules. When a new IP packet is received, the
receive() method of your module will be called, in which you should use
Dijkstra’s algorithm to calculate the path, and install the routing rules on the
switches of the calculated path.
b. In Eclipse Package Explorer, navigate to “Floodlight -> src/main/java ->
net.floodlightconroller.myrouting -> MyRouting.java”, where a module skeleton
has been provided.
c. Use vi or nano to copy the “test.py” script from the Floodlight root directory to
the Mininet VM. Type “sudo python test.py” in Mininet to run the script. It will
create the following topology, which is visualized at
http://192.168.56.1:8080/topology.

H1 9M S1 S4 9M H4

H2 9M S2 5M S3 9M H3

d. As the first step of Dijkstra’s algorithm, collect the network topology in your
module. Print all the switches and links. A sample output is attached.

3
e. When an IP packet is received, print the source and destination IP addresses. A
sample output is attached.
f. Implement Dijkstra’s algorithm. The cost of each link is assigned as follows:

Link type Cost


Both associated switches have odd IDs, e.g., (S1, S3) 1
Both associated switches have even IDs, e.g., (S2, S4) 100
Otherwise, e.g., (S1, S2) 10

g. Calculate the path from the source to the destination, and print the switch IDs
on the path. A sample output is attached.
h. Install the path from the source to the destination to the corresponding switches.
Since the iperf testing tool uses TCP to measure bandwidth, you will need to
install another path from the destination back to the source to deliver the
acknowledgements.
i. Press enter in the Mininet console to clean up and exit the Python testing script.

Sample output.
With proper implementation, the Mininet console should print an output like below:
mininet@mininet-vm:~$ sudo python test.py
*** Adding controller
*** Adding switches
*** Adding hosts
*** Adding links
(9.00Mbit) (9.00Mbit) (9.00Mbit) (9.00Mbit) (9.00Mbit) (9.00Mbit)
(9.00Mbit) (9.00Mbit) (9.00Mbit) (9.00Mbit) (7.00Mbit) (7.00Mbit)
(5.00Mbit) (5.00Mbit) (3.00Mbit) (3.00Mbit) (1.00Mbit) (1.00Mbit)
*** Starting network
*** Configuring hosts
h1 h2 h3 h4
*** Starting controller
*** Starting switches
(9.00Mbit) (9.00Mbit) (7.00Mbit) (9.00Mbit) (9.00Mbit) (5.00Mbit)
(3.00Mbit) (9.00Mbit) (7.00Mbit) (5.00Mbit) (1.00Mbit) (9.00Mbit)
(3.00Mbit) (1.00Mbit)
*** Testing
*** Iperf: testing TCP bandwidth between h1 and h2
*** Results: ['8.61 Mbits/sec', '9.07 Mbits/sec']
*** Iperf: testing TCP bandwidth between h1 and h3
*** Results: ['6.70 Mbits/sec', '7.97 Mbits/sec']
*** Iperf: testing TCP bandwidth between h1 and h4
*** Results: ['957 Kbits/sec', '1.27 Mbits/sec']
!!! Press return to exit

4
The Floodlight console should print an output like below:
*** Print topology
switch 1 neighbors: 2, 3
switch 2 neighbors: 1, 3, 4
switch 3 neighbors: 1, 2, 4
switch 4 neighbors: 2, 3
*** New flow packet
srcIP: 10.0.1.1
dstIP: 10.0.2.2
route: 1 2
*** New flow packet
srcIP: 10.0.1.1
dstIP: 10.0.3.3
route: 1 3
*** New flow packet
srcIP: 10.0.1.1
dstIP: 10.0.4.4
route: 1 3 4

References:
[1] OpenFlow Protocol specification, https://opennetworking.org/wp-
wontent/uploads/2014/10/openflow-spec-v1.3.0.pdf
[2] Floodlight,
https://floodlight.atlassian.net/wiki/spaces/floodlightcontroller/overview
[3] Mininet, http://mininet.org/
[4] Dijkstra’s algorithm, Chapter 5.2.1 of textbook

Group:
You may work in a group of up to three. Only one submission is necessary for a group.

Submission:
Submit a copy of your MyRouting.java file to Canvas, with the following information
at the top of the file:
1. Member names and IDs

Grading:
Item Percentage
Print all switches 20%
Print all links 20%
Print source and destination IP addresses 20%
Print the correct path 20%
Successfully install the path (i.e. packets are routed in 20%
the correct path as seen by iperf output)
5
Code plagiarism will be reported for academic dishonesty.

You might also like