Good afternoon everybody,
I am trying to develop a network with P4 switches where I install the forwarding rules in runtime. My goal is to have switches that contain a primary set of forwarding rules and, at the same time, a secondary backup set of forwarding rules.
Hence, when there are modifications in the network topology the new rules for packet forwarding are already in the switch. The Controller has just to communicate to the switch to change the primary set of rules with the backup one. The process is smoother and faster in this way.
What I cannot do is actually understand how to implement it. My ideas are:
- Create two tables to insert in every switch.
forward
for the primary set of rules andbackup
for the secondary one. Then, change the name of the tables through p4runtime-shell when needed in a way like this:
temp = forward
forward = backup
backup = forward
but I think it is not possible to change table names, isn’t it?
- Assign a priority to each table, so that in the P4 program the
apply
would be something like:
if (hdr.ipv4.isValid() && priority ==1){ MyIngress.forward.apply();}
else if (hdr.ipv4.isValid() && priority == 2 {MyIngress.backup.apply();}
In this case, I have the problem that I don’t know how to attach the attribute “priority” to a table and how to declare a variable “priority” in the P4 program that can be effectively usable by the JSON file that I use to initialize the switches and by the p4runtime-shell when I will need the runtime approach.
Thank you for the time you will dedicate to my doubts.
Cheers,
JB