Examples
The four examples use the bundled L2 P4 program and Go 1.26 or newer. Run their commands from a repository checkout at v2.0.1. Start BMv2 before running them.
| Example | Behavior |
|---|---|
| Connect | Becomes primary, prints pipeline information when present and waits for Ctrl+C. |
| L2 forwarding | Installs the pipeline and writes one fixed destination MAC entry forwarding to port 1. |
| Packet I/O | Receives PacketIn and can send a frame through PacketOut at startup. |
| Counters | Reads the indirect counter indexed by egress port. |
Run the L2 example before the Packet I/O and counter examples. It supplies a fixed entry rather than learning MAC addresses automatically.
CPU Packet I/O loopback uses port 255 and works through gRPC. Ethernet forwarding to data ports needs bound host interfaces. To obtain nonzero counter values, send traffic matching the L2 entry. The L2 fixture guide explains the P4 program, interfaces and packet headers.
For a complete controller that stays connected and receives packets, use the quickstart.
The data-plane evaluation provides 130 archived Mininet/BMv2 cases covering reactive forwarding, counter collection, application recovery and p4ctl. Its captures and records include all 520 PCAP files. The offline verifier checks 27,170 received frames, table state, counters, restart phases and explicit PacketOut ports. These cases use a common application around each controller interface.
The data-plane execution guide provides setup and live runs from the evaluation repository. It offers thirteen smoke cases, four Go race cases and the full 130-case plan. Mininet creates two host namespaces, so execution uses sudo. Two decoders check frames, tables, counters and restart recovery. The runners also verify resource cleanup.