REP4: Automated Testing and Repairing Programmable Data Planes
Wen J. Li, Fuliang Li, Chunyuan Liu, Xingwei Wang · 2025
While the P4-based programmable data plane supports flexible configuration regardless of specific hardware or protocols, potential software and hardware failures threaten its performance. However, existing tools fail to efficiently test and automatically repair faults, relying on time-consuming and error-prone manual manipulation. To address these challenges, we propose REP4, a system that automatically detects, localizes, and repairs bugs in programmable data planes. First, it specifies high-level intents to express comprehensive data plane functions and eliminate invalid paths in the control flow graph, thereby accelerating testing. Second, faulty P4 code and table rules are automatically located by employing taint tracking. Finally, REP4 updates the erroneous fragments through constraint-based repair and performs regression testing for validation. We deploy REP4 on real switches, and extensive experiments on open-source P4_16 programs show that REP4 saves nearly half of the test packets than existing approaches with 100 % function coverage and localizes different types of root causes in 55s in the switch.p4 without false positives, and automatically updates$\mathbf{P 4}$code and table rules in 1.5s, with all updates successfully passing regression testing.