Optimized DFA-Based URL Filtering for P4 Programmable Switches
摘要
With the widespread use of programmable switches in network security and traffic monitoring, efficiently handling rule matching in large-scale datasets has become a significant challenge. In this paper, we propose an optimized FSM construction method that combines incremental state expansion, suffix sharing, and demand-driven dynamic state allocation. This method reduces DFA rule numbers, decreases FSM storage, and improves domain matching efficiency. Additionally, we implement content-level domain filtering on programmable switches and design a malicious flow management table. By marking flows matching dangerous domains, we avoid redundant matching and improve network efficiency. Experimental results show that the OFAD algorithm reduces rule count by 12%, with generation times of \(8.5 \pm 0.3,\mu s\) and accuracy above 99.98%, outperforming existing algorithms. Our approach improves domain filtering efficiency and optimizes DFA generation, offering a scalable solution for large-scale datasets on programmable switches.