Assignment 1 mininet 代写

Assignment:
Given the topology below, you need to build a controller that operates applies quality of service to applications.

The controller should operate according to the following rules:
· The controller needs to be fully reactive, i.e. rules are only installed when a packet first arrives at the switch. In this way, if rules are externally removed, the controller is able to reinstate them as soon as appropriate packets arrive.
· All installed rules should have a hard timeout of 60 seconds.
· The controller should install routes in the switch according to the following rules:
· Data towards H3:
· Data from H1 to H3 should be capped at 50 Mb/s
· Data from H2 to H3 should be capped at 100 Mb/s
· Data from H3 to H1 and from H3 to H2 should not be capped
· Data towards H4:
· Data from H1 to H4 should not be capped
· Data from H2 to H4 should be capped at 200 Mb/s
· Data from H4 to H1 and from H4 to H2 should not be capped
· Data from H1 to H2 and from H2 to H1 needs to be blocked.
· Data from H3 to H4 and from H4 to H3 needs to be blocked.

You should test the data rate and connectivity of the flows using a set of iperf applications. You first start a server iperf on the hosts to listen for connections, then you start client applications to start sending data. You can find more info here: iPerf – iPerf3 and iPerf2 user documentation

To help you coding you will receive two template files:
· topo_assignment1.py: this is the file where you can add code to define the topology above, add the ovs-vsctl QoS rules, and run the iperf commands for test
· controller_assignment1.py: this is the file where you add your code to define the controller behaviour

Additional notes:
· POX does not support meters, this is why we will use ovs-vsctl to install QoS rules (do this in the topo_assignment1.py file).
The POX library is available at: https://github.com/att/pox
These classes will be particularly useful:
https://github.com/att/pox/blob/master/pox/openflow/libopenflow_01.py
https://github.com/att/pox/tree/master/pox/lib/packet