nsg-ethz / p4-utils

Extension to Mininet that makes P4 networks easier to build
GNU General Public License v2.0
175 stars 65 forks source link

Table entry timeout #17

Open machadoatz opened 3 years ago

machadoatz commented 3 years ago

I know that with p4-utils and its runtimeAPI, tables can support timeouts with support_timeout: true. However I can only set the timeouts using the CLI features.

Is there any way to define the timeout period with a python controller and how can I intercept these packets at the controller? I have been working with P4-utils but I think I might have to go with other repos that support P4Runtime.

edgar-costa commented 3 years ago

I am not sure what are you asking.

I honestly never used tables with timeout, and thus I am not sure I will be able to help you with what you need. But lets try.

You have a p4 program with tables that have timeouts enabled right? And you say that they can only be configured with the normal CLI? you mean simple_switch_CLI? I guess that feature could be easily added to the controller if its not working.

What do you mean by intercept those packets? Is there any event being triggered when an entry expires? Or what are those packets you are expecting to intercept.

And last thing, we are actually working on adding P4runtime support to p4-utils, it is currently under junota branch: https://github.com/nsg-ethz/p4-utils/tree/junota

machadoatz commented 3 years ago

Sorry.

Yes, the simple_switch_CLI.

When an entry expires its possible to observe in the switch log warnings like:

- Sending ageing notification for table 'MyIngress.forward' (0)
- Ageing entry 0 in table 'MyIngress.forward'

If I'm not mistaken the timeouts should also trigger some kind of message from the switch to the controller warning about the expired entry, correct? By intercepting packets, I meant to intercept these messages at the controller where I would then proceed to delete the corresponding entries.

I will check the branch features, thank you very much @edgar-costa