Closed againwq closed 8 months ago
To my knowledge, the BMv2 software switch does not have such a capability built into it today. One could be added, of course, but it would be a non-trivial effort from someone that already was, or became, at least somewhat knowledgeable of the BMv2 implementation code.
If the rate of packets that you want to regularly send is low enough, you may use P4Runtime API PacketOut messages from a P4Runtime API client to the switch, and have the subset of those packets that you want sent by the switch to some regular port.
If P4Runtime doesn't work for you, you can also add a dedicated port on the switch for packet injection and write a program / script to send raw packets on the corresponding veth interface. The packets injected this way will have their own ingress_port number, and you will be able to treat them differently in your P4 program if you want to.
Thanks for your answers, it was very useful for me
I want to achieve a timer to regularly send packets from the switch. The p4 program does not seem to have an implementation. It is possible to achieve it by in bmv2? And will this packets be processed by p4 program?