Is P4 capable of port mirroring

hi,

I’m wondering if p4 is capable of port mirroring. Any resource or hands-on example is of great help. Thank you very much!

Hi Svenchen,

You have can find more information about mirroring here https://p4.org/p4-spec/p4-14/v1.1.0/tex/p4.pdf (page 79), does it also apply to P4_16.

You can looking forward P4 mirroring example on github, but this could be a good start Port Mirroring Exercise by khooi8913 · Pull Request #335 · p4lang/tutorials · GitHub, here you can see the code Port Mirroring Exercise by khooi8913 · Pull Request #335 · p4lang/tutorials · GitHub. This PR Is still under review but I believe that is a good.

Best
Davide

Hi,

I would only like to add that I think it is more about if the target supports that being a core functionality of P4. Cloning seems to be an extern in v1model. The process would be to (1) investigate if your target supports mirroring, and then, (2) investigate the syntax to make this happen (see @DavideS 's links).

Cheers,