The switchapi library exposes a higher level API on top of lower level resource management API auto-generated from the switch.p4 program in p4factory repository. Refer to p4factory/targets/switch/README.md for more details on switch.p4 program.
+-----+ +-----+ +-----+ +-----+
|App 1| |App j| |App n| |App q|
| |... | |...| |..| |
+-----+ +-----+ +-----+ +-----+
| | | | |
+-----------------------+ | |
| Switch API | | |
| | | |
+-----------------------+---------+
| Resource Mgmt. API |
| (auto-gen. from switch.p4) |
+---------------------------------+
| Soft Switch |
| (compiled from switch.p4) |
+---------------------------------+
- Basic L2 switching: Flooding, learning and STP
- L2 Multicast (IGMP/MLD snooping)
- Basic L3 Routing: IPv4, IPv6 and VRF
- L3 Multicast (Sparse mode, SSM and Bidir)
- LAG
- ECMP
- Tunneling: VXLAN and NVGRE (including L2/L3 Gateway), Geneve, GRE and IPinIP
- Basic ACL: MAC and IP ACLs
- Unicast RPF check
- MPLS: LER, LSR, IPVPN
- Host interface
- Mirroring: Ingress and egress mirroring with ERSPAN
- Counters/Statistics
- Ingress Policers
- Lookup bypass in Cpu Tx path
- Netfilter Rx/Tx support
- QoS (Quality of Service) - Buffers, Queues
- Nat
- CoPP (Control Plance Policing)
- VPLS
To generate doxygen documentation for switchapi (from switch directory)
make doxygen-doc
or view a hosted version at http://p4lang.github.io/switch/