I am writing a program in P4 to run inside a Mininet topology. It is quite difficult to debug those programs, since the code can only run on BMv2 switches, so I can't use prints or anything of the sort.
I want a way to output data from the switch that is easy to see the impact of my changes (prints, writing to a file, or whatever).
Currently, I am doing so by writing to less relevant fields in the packet, which I'm not currently using on the protocol I'm implementing on. Then, I can sniff the packets going through Mininet by using Wireshark.
I also though about opening up an echo server on a port on the host, which can then write the data received down to a file or print on the terminal, but there's the issue of connecting to something outside of Mininet.
The program I'm developing can be seen on this repo