Open QuinnRutherford opened 2 years ago
Hi!
There is ways to change the delay during runtime, but there is not a direct API in mininet or p4-utils. You will have to write the code yourself. I will give you some pointers: Here you can find how network conditions are added to links: https://github.com/mininet/mininet/blob/master/mininet/link.py#L231. If you inspect this class you will see how mininet/p4-utils modify the interface delay. Basically it uses linux tc netem
qdisc. You will need to find way to modify the interface netem memory on your own.
Yes also provide a runtime controller to add rules dynamically. You can find many examples at the p4-learning repository, for example this one shows how to fill routing tables from a python controller: https://github.com/nsg-ethz/p4-learning/tree/master/exercises/08-Simple_Routing/thrift
I am using P4Utils to create a network topology where there are multiple (3) paths between 2 hosts. I would like to send packets to compute the fastest path and update the forwarding tables given to each switch during runtime.
The network topology is made using the p4utils.mininetlib.network_API module.
To do this I am struggling to figure out how to perform two functions:
Change link delay between two switches during runtime: I am setting the link delay using the
setDelay()
function when creating the network. Is there a way to change the delay of a link during runtime?Update routing tables during runtime: The original routing table rules for each switch are defined in a
sN-commands.txt
file which I am feeding to each switch withnet.setP4CliInput('sN', 'sN-commands.txt')
. Is it possible to either, alter the text file during runtime to change the rules, or give the switch a new set of command for a different file during runtime?Edit: A previous version asked about updating link bandwidth, this has been changed to ask about link delay.