Note that: Communication between real IP address is blocked & allows only communication on virtual IP addresses.
pseudo_ran_num
from 0 - 32, where 32 is the number of available virtual IP addresses.pseudo_ran_num
to pseudo_ran_num + 3
In the future: we can predefine a set of real-virtual IP addresses mapping. We can introduce an probabilistic transition system, where each state of the transition system represents a predefined real-virtual IP addresses mapping.
Build topology
Use the MiniEdit to build the topology of the network. To run MiniEdit, execute the command:
$ sudo ~/mininet/examples/miniedit.py
Note that: controller c0 needs to be configured as remote controller, which you can modify in its property.
Dump flow rules to show no flow rules.
$ sudo ovs-ofctl dump-flows s1
The output of above command is:
cookie=0x0, duration=2.345s, table=0, n_packets=0, n_bytes=0, priority=0 actions=CONTROLLER:65535
Start the controller, this will install the table miss entry to all the switches.
$ ryu-manager yourapp.py
Observe the initial real to virtual Mappings. For instance
('**********', {'10.0.0.4': '10.0.0.24', '10.0.0.1': '10.0.0.25', '10.0.0.3': '10.0.0.26', '10.0.0.2': '10.0.0.27'}, '***********')
This means the current h1 is at IP address 10.0.0.25, h2 is at 10.0.0.27, etc..
Check Flow rules.
mininet> h1 ping 10.0.0.14
Note that IP address 10.0.0.14 is the virtual IP address for the h3.
Time out event initiates an update of the real-virtual IP mappings
('**********', {'10.0.0.4': '10.0.0.28', '10.0.0.1': '10.0.0.29', '10.0.0.3': '10.0.0.30', '10.0.0.2': '10.0.0.31'}, '***********')
Removes the initial flow rules from all the switches.
Check flow rules.
$ sudo ovs-ofctl dump-flows s1
The output should be the following:
cookie=0x0, duration=1.831s, table=0, n_packets=0, n_bytes=0, priority=0 actions=CONTROLLER:65535
This means that the flow rule is emptied.
Initiate a ping from h1 to h3 using its updated virtual IP address
mininet> h1 ping 10.0.0.30
Note that current IP address for h3 is 10.0.0.30.
Check flow rules.
Time out event initiates an update of the real-virtual IP mappings
('**********', {'10.0.0.4': '10.0.0.28', '10.0.0.1': '10.0.0.29', '10.0.0.3': '10.0.0.30', '10.0.0.2': '10.0.0.31'}, '***********')
Removes the initial flow rules from all the switches.
Check flow rules.
$ sudo ovs-ofctl dump-flows s1
The output should be the following:
cookie=0x0, duration=449.148s, table=0, n_packets=8, n_bytes=560, priority=0 actions=CONTROLLER:65535
Initiate a ping from h1 to h3 using its real IP address
mininet> h1 ping 10.0.0.3
See the packet being dropped.
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
From 10.0.0.1 icmp_seq=5 Destination Host Unreachable
From 10.0.0.1 icmp_seq=6 Destination Host Unreachable
Check flow rules.
Packet will be dropped at the first switch itself.