Lab 3
Lab 3
M2 CSN – SDN
For this, we will use the POX controller, developed in Python and oriented towards research and the rapid
development of prototypes.
POX offers several “components” that can be used directly and it is relatively easy to design a custom one.
You should normally see the line appear at the end of the output:
You must then keep this process running in the foreground throughout the experiment.
It is possible to load several components simultaneously in the same command line, but some are
incompatible with each other.
In another window, launch Mininet in its default topology with the POX controller:
How are you making sure that the network starts correctly, that the output of POX indicates connecting a
new switch, and that switch seems to behave in the expected way?.
You will now start both Mininet and POX from a single Python script. In this configuration, we will use two
different SDN controllers in the same network (native mininet controller and POX controller), in order to
have switches exhibiting different behaviors.
For this purpose, you will find in the annex the python script named passerelle.py to put in the
/home/mininet directory. It is made up of two different parts:
1/12
Read these two part and explain what are the purpose of the first part and the second part ?
Run the script with the following command and respond to the question.
https://openflow. stanford.edu/display/ONL/POX+Wiki.html#POXWiki-forwarding.l3_learning;
Modify the passerelle.py script to make POX, which drives c1, allow it act as a gateway between IPv4
networks;
You are now going to tackle a classic problem in datacenters networks, multipath routing. POX does not
offer a component directly usable to solve this problem and the objective here is to develop this custom
component.
— You need to use the script diamond.py provided in the annex (launched with $ sudo python
diamond.py), reuse the previously introduced CustomPOX and CustomSwitch classes and defining a
particular network topology (in which you have fixed MAC addresses, IP addresses and port numbers on
the switches).
Two controllers are started here, c which is an Open vSwitch controller (comparable to the OpenFlow
reference controller) and cm, which is a POX controller loading the misc.tp custom component. In the
2/12
considered topology, two switches, one refers to c and two to cm. The diamond.py script should not be
modified;
— You need to put the tp.py script (in annex) in the directory /home/mininet/pox/pox/misc/tp.py defines
the misc.tp component. In his initial state, it configures the connected switches to function as hubs, i.e.
to repeat frames on all ports except the input port.
The script to modify is the tp.py script that you will need to modify, and in particular its
act_less_stupidly method.
How the tp.py script works is described in the source code comments. Read the comments and
understand the general logic of each of the following function:
— launch()
To complete this exercise, you will need technical information on a few classes defined by POX. Available
at https://openflow.stanford.edu/display/ONL/POX+Wiki.html (or at https://noxrepo.github.io/pox-
doc/html/),
— ofp_packet_out
— ofp_flow_mod
— ofp_match
— ofp_packet_in
Make sure you understand which switches are driven by which SDN controller;
In a separate (console) window, start a packet capture on the interface s1-eth1 from switch s1, with:
3/12
$ sudo tcpdump -XX -n -i s1-eth1
In the command line of Mininet, launch a ping with a single exchange between h1 and h2, with
h1 ping -c 1 h2
What happened?
Does the behavior of the network seem appropriate?
Given the network topology and the specified switch behavior in the tp.py script, what is the
problem?
In an office-type network (where performance requirements are not necessarily critical), this type of
problem is frequently solved by using the Spanning Tree Protocol (STP), which will block certain links
between switches to transform a graph into a tree and "open" all loops.
In a datacenter type network, we cannot afford it: if we have redundant links, with several possible paths
between two points, it is to increase the bandwidth of the flows horizontal. We therefore rely on other
mechanisms, by introducing multi-path routing. This is typically done using IEEE 802.1aq (Shortest Path
Bridging) protocols or IETF TRILL (Transparent Interconnect of Lots of Links).
Without reproducing exactly the mechanisms of these protocols, you will try to modify the behavior of
switches s3 and s4 to resolve this problem, while still benefiting from the additional bandwidth provided
by the redundant links.
By modifying the act_less_stupidly method of the tp.py script, design a new mode of operation for
switches s3 and s4.
The problem can be approached in an iterative way, by first proposing a solution solving the identified
problem but without benefiting from multiple paths.
o Each of the hosts must be able to communicate with each of the others;
o Packets must not be duplicated in an uncontrolled manner or circulated indefinitely in the
network;
o Overall, all the links between switches must be exploited (not necessarily in a balanced way) when
all the hosts communicate between themselves.
There are many ways, more or less subtle and more or less complex, to reach the final solution. Each
student may propose a different solution from the basic one to the advanced one.
4/12
Some hints: a basic solution will be to statically assign links to some hosts, to certain flows, to some
protocols. A more advanced solution will be to design a behavior that is capable to evolve over time with
variations in flows. A more advanced solution will be to design a behavior of switches that is capable to
change with network topology.
5/12