In this lab, you will utilize the OpenFlow protocol and the Ryu controller to implement the learning switch protocol.
Right click on the link and click on Save link as
.
Import the .ova file into VirtualBox and start the VM.
Download the sample code archive.
controller.py
dataplane.py
disable_ipv6.sh
Makefile
set_arp.sh
In this lab, you will construct a hierarchical tree topology as illustrated below:
The IP and MAC addresses of each host are listed as follows:
After setting up your VM, open two consoles and navigate to the location where you placed the sample code. Run the following commands:
Once you see the hint *** Starting CLI: mininet>
in the second shell, you can run:
This command tests ping reachability between all hosts, equivalent to individual pings between hosts (e.g., h1 ping h2, h1 ping h3, …).
You will see the result in the second shell:
You can use ctrl+c
to terminate the ping, and exit
to stop the mininet.
Additionally, some messages should appear in the first console (controller):
This is because there are currently no hosts and switches in the topology, and thus the controller is not performing any actions. Later on, you need to build the topology as depicted in the provided picture.
Your task is to construct the topology and enable the switch to learn the destination MAC address for each port and forward packets accordingly.
The overall logic for the learning switch implementation involves the following steps:
When receiving a packet:
If the destination MAC address is in the mapping:
If the destination MAC address is not in the mapping:
Forward the packet:
dataplane.py
, follow the TODO section to create the correct topology.controller.py
, follow the TODO section to ensure that the controller can remember the port and install rules if needed.disable_ipv6.sh
and set_arp.sh
).self.add_flow
to install flow. The actions
parameter is created bymake clean
.{student_id}_lab1.zip
controller.py
dataplane.py