计算机科学 ›› 2026, Vol. 53 ›› Issue (8): 403-412.doi: 10.11896/jsjkx.251100114

• 信息安全 • 上一篇    下一篇

面向可编程数据平面的可逆异常流量检测

舒亚鹏1, 杜扬1, 黄河1, 孙玉娥2   

  1. 1 苏州大学计算机科学与技术学院 江苏 苏州 215008
    2 苏州大学轨道交通学院 江苏 苏州 215100
  • 收稿日期:2025-11-21 修回日期:2026-03-25 发布日期:2026-08-17
  • 通讯作者: 杜扬(duyang@suda.edu.cn)
  • 作者简介:(ypshu@stu.suda.edu.cn)
  • 基金资助:
    国家自然科学基金(62572337,62332013,62202322)

Reversible Anomaly Traffic Detection for Programmable Data Plane

SHU Yapeng1, DU Yang1, HUANG He1, SUN Yu’e2   

  1. 1 School of Computer Science and Technology, Soochow University, Suzhou, Jiangsu 215008, China
    2 School of Rail Transportation, Soochow University, Suzhou, Jiangsu 215100, China
  • Received:2025-11-21 Revised:2026-03-25 Online:2026-08-17
  • About author:SHU Yapeng,born in 2002,postgra-duate.His main research interest is network traffic measurement.
    DU Yang,born in 1992,Ph.D,associate professor,is a member of CCF(No.81294M).His main research interests include large language model inference acceleration,network traffic measurement,and network security.
  • Supported by:
    National Natural Science Foundation of China(62572337,62332013,62202322).

摘要: 面向高速网络环境下的网络管理与安全防护需求,实时的可逆流量测量技术成为支撑异常检测与攻击溯源的关键基础。传统可逆Sketch方法在P4可编程数据平面部署时面临双重挑战:P4指令集缺乏乘除法和取模指令,导致基于中国剩余定理(CRT)的可逆Sketch难以直接实现;同时,CRT方法所需的互素模数与硬件内存分配粒度不匹配,容易引发内存碎片,且多异常流场景下逆向恢复计算量呈指数级增长。针对这些问题,设计了一种高效的异常流量检测机制,通过构建特殊模数集合将取模运算转换为位运算与加减操作,构建寄存器池与互补分配策略来消除内存碎片,支持在交换机运行时进行测量任务的重部署,同时引入双Sketch协同机制将逆向恢复计算量从指数级降至线性级。实验结果表明,在真实P4交换机上实现了微秒级内存分配(45~58 μs)和毫秒级任务切换延迟(8任务约80 ms),处理延迟仅0.4 μs,且不影响正常报文转发,有效验证了其在高速网络中的可行性与高效性。

关键词: 网络流量测量, 异常流量检测, CRT可逆Sketch, 可编程交换机, 运行时重配置

Abstract: Meeting the demands of network management and security protection in high-speed network environments,real-time reversible traffic measurement has become a critical foundation for supporting tasks such as anomaly detection and attack tracing.Traditional reversible Sketch methods face dual challenges when deployed on P4-programmable data planes:the absence of multiplication,division,and modulo instructions in the P4 instruction set prevents the direct implementation of reversible Sketches based on the Chinese Remainder Theorem(CRT).Furthermore,the co-prime moduli required by CRT often conflict with hardware memory allocation granularity,leading to memory fragmentation,while the computational complexity of reverse recovery for multiple anomalous flows grows exponentially.To address these issues,an efficient abnormal traffic detection mechanism is designed.By constructing a special set of co-prime moduli,modulo operations are transformed into bit-shifts and additions/subtractions.A register pool with a complementary allocation strategy is established to eliminate memory fragmentation,supporting the runtime redeployment of measurement tasks.Additionally,a dual-Sketch coordination mechanism is introduced to reduce the computational complexity of reverse recovery from exponential to linear.Experimental results on a P4 switch demonstrate microsecond-level memory allocation(45~58 μs),millisecond-level task switching latency(approximately 80 ms for 8 tasks),and a processing delay of only 0.4 μs.It does not interfere with normal packet forwarding,which effectively validating its feasibility and efficiency in high-speed networks.

Key words: Network traffic measurement, Anomaly traffic detection, CRT reversible Sketch, Programmable switch, Runtime reconfiguration

中图分类号: 

  • TP391
[1] CHEN X,XIAO Q,LIU H,et al.Eagle:Toward scalable andnear-optimal network-wide sketch deployment in network mea-surement[C]//Proceedings of ACM SIGCOMM.2024:291-310.
[2] GAO G,ZHOU S,SUN Y,et al.Priority-aware Per-flow Size Measurement in High-speed Networks[J].Journal of Electro-nics & Information Technology,2025,47(6):1885-1895.
[3] SUN H,HUANG Q,SUN J,et al.AutoSketch:AutomaticSketch-Oriented compiler for query-driven network telemetry[C]//Proceedings USENIX NSDI.2024:1551-1572.
[4] LU J,ZHANG P,LI Z,et al.An Accurate Flow Size Measurement Framework Based on MachineLearning[C]//2025 International Conference on Sensor-Cloud and Edge Computing System(SCECS).IEEE,2025:297-305.
[5] GU L,TIAN Y,CHEN W,et al.Per-flow network measurement with distributed sketch[J].IEEE/ACM Transactions on Networking,2023,32(1):411-426.
[6] CORMODE G,MUTHUKRISHNAN S.An improved datastream summary:the count-min sketch and its applications[J].Journal of Algorithms,2005,55(1):58-75.
[7] CHEN M,CHEN S,CAI Z.Counter tree:A scalable counter architecture for per-flow traffic measurement[J].IEEE/ACM Transactions on Networking,2016,25(2):1249-1262.
[8] YANG T,ZHOU Y,JIN H,et al.Pyramid sketch:A sketch framework for frequency estimation of data streams[J].Proceedings VLDB Endowment,2017,10(11):1442-1453.
[9] YANG K,LONG S,SHI Q,et al.SketchINT:Empowering INT with TowerSketch for per-flow per-switch measurement[J].IEEE Transactions on Parallel and Distributed Systems,2023,34(11):2876-2894.
[10] GAO G,QIAN Z,HUANG H,et al.Tailoredsketch:A fast and adaptive sketch for efficient per-flow size measurement[J].IEEE Transactions on Network Science and Engineering,2024,12(1):505-517.
[11] HUANG H,LOU C,SUN Y E,et al.Adaptive denoising for network traffic measurement[J].IEEE Transactions on Network Science and Engineering,2025,12(4):2907-2920.
[12] SCHWELLER R,LI Z,CHEN Y,et al.Reversible sketches:enabling monitoring and analysis over high-speed data streams[J].IEEE/ACM Transactions on Networking,2007,15(5):1059-1072.
[13] SCHWELLER R,GUPTA A,PARSONS E,et al.Reversiblesketches for efficient and accurate change detection over network data streams[C]//Proceedings of ACM SIGCOMM.2004:207-212.
[14] JING X,ZHAO J,ZHENG Q,et al.A reversible sketch-based method for detecting and mitigating amplification attacks[J].Journal of Network and Computer Applications,2019,142:15-24.
[15] JING X,YAN Z,JIANG X,et al.Network traffic fusion andanalysis against DDoS flooding attacks with a novel reversible sketch[J].Information Fusion,2019,51:100-113.
[16] JING X,HAN H,YAN Z,et al.SuperSketch:A multi-dimen-sional reversible data structure for super host identification[J].IEEE Transactions on Dependable and Secure Computing,2021,19(4):2741-2754.
[17] JING X,CAO Q,YAN Z,et al.LocalSketch:An Accurate and Efficient Sketch for Range Spread Estimation[J].IEEE Transactions on Dependable and Secure Computing,2025,22(6):6361-6375.
[18] KAUR S,KUMAR K,AGGARWAL N.A review on P4-Programmable data planes:Architecture,research efforts,and future directions[J].Computer Communications,2021,170:109-129.
[19] HAN H,YAN Z,JING X,et al.Applications of sketches in network traffic measurement:A survey[J].Information Fusion,2022,82:58-85.
[20] ZHOU H,GU G.Securing Networks with Programmable Data Planes:Opportunities and Challenges[J].IEEE Security & Privacy,2025,23(6):42-50.
[21] DAS R,SNOEREN A C.Memory management inActiveRMT:Towards runtime-programmable switches[C]//Proceedings of ACM SIGCOMM.2023:1043-1059.
[22] YANG Y,HE L,ZHOU J,et al.P4runpro:Enabling runtimeprogrammability forrmt programmable switches[C]//Procee-dings of ACM SIGCOMM.2024:921-937.
[23] ZHENG H,TIAN C,YANG T,et al.Flymon:enabling on-the-fly task reconfiguration for network measurement[C]//Proceedings of ACM SIGCOMM.2022:486-502.
[24] XI Z,ZHOU Y,ZHANG D,et al.Newton:Intent-driven network traffic monitoring[J].IEEE/ACM Transactions on Networking,2021,30(2):939-952.
[25] GAO Y,WANG Z.A review of P4 programmable data planes for network security[J].Mobile Information Systems,2021,2021(1):1257046.
[26] WANG P,GUAN X,QIN T,et al.A data streaming method for monitoring host connection degrees of high-speed links[J].IEEE Transactions on Information Forensics and Security,2011,6(3):1086-1098.
[27] XU Z,TIAN Y,WU Y,et al.Hidden Sketch:A Space-Efficient Reversible Sketch for Tracking Frequent Items in Data Streams[J].arXiv:2505.12293,2025.
[28] WANG F,TANG Y,GAO L,et al.BC-Sketch:A simple reversi-ble sketch for detecting network anomalies[C]//2020 IEEE International Conference on Smart Data Services(SMDS).IEEE,2020:36-44.
[29] SUN H,WANG X,BUYYA R,et al.CloudEyes:Cloud-based malware detection with reversible sketch for resource-constrained internet of things(IoT) devices[J].Software:Practice and Experience,2017,47(3):421-441.
[30] ZHOU A,QIAN J.Identifying Abnormal Hosts in Data Streams Using Reversible Sketch[J].Engineering Reports,2025,7(5):e70193.
[31] LI Z,GENG Y.Score Sketch:An Efficient and ReversibleSketch for Advanced Persistent Threat Detection[C]//2024 5th International Conference on Computers and Artificial Intelligence Technology(CAIT).IEEE,2024:314-319.
[32] BASAT R B,EINZIGER G,FRIEDMAN R,et al.Optimal elephant flow detection[C]//IEEE Conference on Computer Communications(IEEE INFOCOM).2017:1-9.
[33] ZHENG H,YAN X,LI W,et al.When P4 meets run-to-completion architecture[C]//Proceedings USENIX NSDI.2025:1487-1505.
[34] CAIDA.Anonymized internet traces 2019[EB/OL].[2026-06-06].https://catalog.caida.org/details/dataset/passive_2019_pcap.
[35] MAWI.MAWI Working Group Traffic Archive[EB/OL].[2026-06-06].https://mawi.wide.ad.jp/mawi/samplepoint-F/2024/.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!