Performance Evaluation of Python Tools to Capture Packets in Resource-Constrained Devices
Resumo
Real-time traffic classifiers, such as Intrusion Detection Systems based on Online Learning, must be constantly fed with packets to classify the traffic by a specific deadline. When considering Python, there are several options for capturing packets. This paper evaluates the performance of three tools to capture packets in Python running on a Raspberry Pi 3 Model B. Exhaustive experiments conclude that Pypcap + dpkt is the best option over Pyshark and Scapy. For instance, in terms of average CPU usage, when capturing TCP traffic over cable, Pypcap + dpkt consumed 75.73% less than Pyshark and 4.24% less than Scapy. All the code used to run the experiments is shared as free and open-source software for reproducibility.Referências
Afifi, H., Pochaba, S., Boltres, A., Laniewski, D., Haberer, J., Paeleke, L., Poorzare, R., Stolpmann, D., Wehner, N., Redder, A., Samikwa, E., and Seufert, M. (2024). Machine Learning With Computer Networks: Techniques, Datasets, and Models. IEEE Access, 12:54673–54720.
Dsouza, A., Lanjewar, V., Mahakal, A., and Khachane, S. (2022). Real Time Network Intrusion Detection using Machine Learning Technique. In Proc. of the IEEE PuneCon, pages 1–5.
Kostas, K., Just, M., and Lones, M. A. (2025). Individual Packet Features are a Risk to Model Generalization in ML-Based Intrusion Detection. IEEE Networking Letters, 7(1):66–70.
Nazarov, N. and Arslan, E. (2022). In-Network Caching Assisted Error Recovery For File Transfers. In Proc. of the IEEE/ACM INDIS, pages 20–24.
Oliveira, R., Pedrosa, T., Rufino, J., and Lopes, R. P. (2024). Parameterization and Performance Analysis of a Scalable, near Real-Time Packet Capturing Platform. Systems, 12(4).
Sambath, S, B. B., Mario, C., Maheswari, G., and Gunasekar (2024). Network Traffic Analyzer Using Python. In Proc. of the 1st ICSCAI, pages 1–7.
Sivanathan, A., Sherratt, D., Gharakheili, H. H., Radford, A., Wijenayake, C., Vishwanath, A., and Sivaraman, V. (2017). Characterizing and Classifying IoT Traffic in Smart Cities and Campuses. In Proc. of the IEEE INFOCOM WKSHPS, pages 559–564.
Dsouza, A., Lanjewar, V., Mahakal, A., and Khachane, S. (2022). Real Time Network Intrusion Detection using Machine Learning Technique. In Proc. of the IEEE PuneCon, pages 1–5.
Kostas, K., Just, M., and Lones, M. A. (2025). Individual Packet Features are a Risk to Model Generalization in ML-Based Intrusion Detection. IEEE Networking Letters, 7(1):66–70.
Nazarov, N. and Arslan, E. (2022). In-Network Caching Assisted Error Recovery For File Transfers. In Proc. of the IEEE/ACM INDIS, pages 20–24.
Oliveira, R., Pedrosa, T., Rufino, J., and Lopes, R. P. (2024). Parameterization and Performance Analysis of a Scalable, near Real-Time Packet Capturing Platform. Systems, 12(4).
Sambath, S, B. B., Mario, C., Maheswari, G., and Gunasekar (2024). Network Traffic Analyzer Using Python. In Proc. of the 1st ICSCAI, pages 1–7.
Sivanathan, A., Sherratt, D., Gharakheili, H. H., Radford, A., Wijenayake, C., Vishwanath, A., and Sivaraman, V. (2017). Characterizing and Classifying IoT Traffic in Smart Cities and Campuses. In Proc. of the IEEE INFOCOM WKSHPS, pages 559–564.
Publicado
20/07/2025
Como Citar
SILVA, Otávio O.; BATISTA, Daniel M..
Performance Evaluation of Python Tools to Capture Packets in Resource-Constrained Devices. In: WORKSHOP EM DESEMPENHO DE SISTEMAS COMPUTACIONAIS E DE COMUNICAÇÃO (WPERFORMANCE), 24. , 2025, Maceió/AL.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2025
.
p. 85-96.
ISSN 2595-6167.
DOI: https://doi.org/10.5753/wperformance.2025.8983.
