This module works in a proactive mode. It is dependant on discovery module and can work with spanning_tree module in the topology with loops.
The idea behind this module is to assign all switches and hosts topology aware IP addresses. Knowning all IP addresses in advance, routing rules are installed.
Routing is based on the short path calculation. Hosts and switches get IP addresses by DHCP protocol from the controller.
Rules for creating IP addresses look the following way:
- Switch address has a format of 10.<switch_id>.0.1
- Network address has a format of 10.<switch_id>.0.0
- Host address has a format of 10.<switch_id>.<switch_port_id>.<host_id>
- switch_id is generated by controller reflection just the ordering number
- switch_port_id is a switch port number where host is connected to
- host_id is the ordering number of a host
The proactive nature of the module is encapsulated in the send_table method of TopoSwitch class. The logic inside this method populates the following rules to a switch:
- Redirect all DHCP, LLDP, ARP, NDP packets to controller
- Redirect packets with destination IP address from a network owned by known switch to a next hop port calculated by short path algorithm
- Redirect packets with destination IP from a network owned by current switch to a particular port where host with this IP was previously seen
Rules in OVS, retrieved using sudo ovs-ofctl dump-flows s1 command, will look the folllowing way.
Start POX using the following command line.
./pox.py log.level –DEBUG openflow.of_01 forwarding.topo_proactive openflow.discovery
Mininet script (proactive_net.py)
After executing “sudo python proactive_net.py” execute the following commands inside mininet shell.