What are the solutions if congestion occurs in P4?

Hello everyone,

I’m working on a P4 load balancer project, and I’m using Multi-Hop Route Inspection to obtain the current queue size of switches. I intend to use the queue size for congestion control. I’m wondering if there are any methods in P4 to address congestion issues at runtime through controller.py?

Any clarification or helpful information is greatly appreciated.
Thank you very much!

What kind of congestion control do you intend to use? Some targets have different scheduling capabilities that could be used to some extend for congestion control and can be configured by the control plane.
What is your target?

I’ve considered many approaches, but none seem very feasible. Is it possible for P4 to change bandwidth or control flow rate at runtime? Or are there better alternatives? Any suggestions would be greatly appreciated. Thank you very much.

You can reconfigure e.g. a meter at runtime from the controller, you could implement some kind of bandwidth limitation in the data plane directly, you can (depending on your target) reconfigure the traffic manager (eg queue scheduling) etc. however most of this can only be done from the control plane and hence is not completely „real time“ capable.

Thank you very much for your help and response. I’ll give the methods mentioned above a try!

Note that P4 the language does not require that devices on which it runs have capabilities like “change bandwidth” or “control flow rate”. Particular target devices that run P4 programs might have those capabilities, but there is no uniform answer to these questions you ask that apply across all of them.

Are you in particular curious about the BMv2 software switch target device? In some other target devices?