P4R: Scaling Stateful Network Testing and Trace Replay with Nanosecond-level Accuracy

  • Francisco Germano Vogt UNICAMP
  • Zhiheng Yang Telefonica Research
  • Leonardo Henrique Guimarães UNICAMP
  • Fabricio Eduardo Rodriguez Cesen Telefonica Research
  • Sergio Rossi Brito da Silva UNICAMP
  • Marcelo Caggiani Luizelli UNIPAMPA
  • Chrysa Papagianni UvA
  • Christian Esteve Rothenberg UNICAMP

Resumo


As network speeds transition to 100 Gbps and beyond, traditional software-based traffic generators face significant performance and accuracy bottlenecks due to CPU and PCIe limitations. While programmable switch-based testers have emerged to provide line-rate throughput, most current solutions are either limited to stateless traffic generation or rely on simplified stateful models, such as “stop-and-wait” mechanisms with static one-packet windows. This paper presents an evolved version of P4R (P4 Replay), an open-source framework designed for high-fidelity stateful network testing on programmable ASICs. P4R overcomes previous design constraints by introducing a dynamic window management system for TCP connections, enabling more realistic flow emulation compared to fixed-window architectures. Furthermore, P4R implements a dual-mode trace replay engine capable of reproducing pre-captured PCAP files with nanosecond-level timing accuracy or user-defined throughput. Supporting client, server, and a unique internal self-testing mode, P4R allows for the evaluation of complex P4 applications and external network functions at line-rate. We demonstrate that P4R bridges the gap between synthetic traffic and realistic network experimentation, providing the community with a versatile and precise tool for modern networking research.

Referências

Bosshart, P., Daly, D., Gibb, G., Izzard, M., McKeown, N., Rexford, J., Schlesinger, C., Talayco, D., Vahdat, A., Varghese, G., and Walker, D. (2014). P4: programming protocol-independent packet processors. SIGCOMM Comput. Commun. Rev., 44(3):87–95.

Chen, Y., Tian, B., Tian, C., Dai, L., Zhou, Y., Ma, M., Tang, M., Zheng, H., Yang, Z., Chen, G., et al. (2023). Norma: Towards practical network load testing. In 20th USENIX Symposium on Networked Systems Design and Implementation (NSDI 23), pages 1733–1749.

Costa, F. G., Vogt, F. G., Cesen, F. R., de Castro, A. G., Luizelli, M. C., and Rothenberg, C. E. (2024). Pipo-tg: Parameterizable high-performance traffic generation. In NOMS 2024-2024 IEEE Network Operations and Management Symposium, pages 1–9. IEEE.

Emmerich, P., Gallenmüller, S., Raumer, D., Wohlfart, F., and Carle, G. (2015). Moongen: A scriptable high-speed packet generator. In Proceedings of the 2015 Internet Measurement Conference, pages 275–287.

Lindner, S., Häberle, M., and Menth, M. (2023). P4tg: 1 tb/s traffic generation for ethernet/ip networks. IEEE Access, 11:17525–17535.

Rodriguez, F., Vogt, F. G., De Castro, A. G., Schwarz, M. F., and Rothenberg, C. (2022). P4 programmable patch panel (p7): an instant 100g emulated network on your tofino-based pizza box. In Proceedings of the SIGCOMM ’22 Poster and Demo Sessions, SIGCOMM ’22, page 4–6.

TRex. Cisco TRex Traffic Generator. [link]. Online; accessed February 2026.

Vogt, F. G., Da Silva, S. R. B., Cesen, F. E. R., Costa, F. G., Luizelli, M. C., and Rothenberg, C. E. (2025). Tftg: Time fidelity traffic generation through p4/tofino programmable hardware. IEEE Network.

Vogt, F. G., Rodriguez, F., Costa, F. G., Luielli, M. C., Rotenberg, C. E., Patra, G., and Pongracz, G. (2024). P4 replay (p4r): Reproducing packet traces and stateful connections at line-rate on your p4-capable hardware. In Proceedings of the ACM SIGCOMM 2024 Conference: Posters and Demos, pages 122–124.

Zhou, Y., Xi, Z., Zhang, D., Wang, Y., Wang, J., Xu, M., and Wu, J. (2019). Hypertester: high-performance network testing driven by programmable switches. In Proceedings of the 15th International Conference on Emerging Networking Experiments And Technologies, pages 30–43.
Publicado
25/05/2026
VOGT, Francisco Germano; YANG, Zhiheng; GUIMARÃES, Leonardo Henrique; CESEN, Fabricio Eduardo Rodriguez; SILVA, Sergio Rossi Brito da; LUIZELLI, Marcelo Caggiani; PAPAGIANNI, Chrysa; ROTHENBERG, Christian Esteve. P4R: Scaling Stateful Network Testing and Trace Replay with Nanosecond-level Accuracy. In: SALÃO DE FERRAMENTAS - SIMPÓSIO BRASILEIRO DE REDES DE COMPUTADORES E SISTEMAS DISTRIBUÍDOS (SBRC), 44. , 2026, Praia do Forte/BA. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 126-134. ISSN 2177-9384. DOI: https://doi.org/10.5753/sbrc_estendido.2026.22843.