Hi all,
At the RSTI group (Universidad Politécnica de Madrid) we have released on GitHub two open-source tools for Tofino: virtual switches to work without hardware, and a library to configure both virtual and hardware switches.
vswitch-op4s runs tofino-model + bf_switchd from open-p4studio in Docker containers. A prebuilt image is available, so there is nothing to compile. You can run several switches, load your own P4 programs and connect them to each other and to hosts.
bash
git clone https://github.com/mgaflip/vswitch-op4s.git && cd vswitch-op4s
./start-vswitch-op4s-container.sh
p4-bfrt-manager is an easy-to-use Python library over BF Runtime gRPC for Tofino switches, hardware or virtual: table entries as plain JSON, IPs and MACs as strings, ports and multicast in one line.
tofino-model is a functional simulator, so the virtual switches are meant for testing P4 programs and control planes, not performance. Feedback is very welcome!