Programmable switch-oriented self-adaptive heavy hitter detection method
By combining state detection and stream-level measurement on a programmable switch, adaptively selecting the processing mode, the problem of high-quality hitter detection resource usage and low accuracy in the prior art is solved, and high accuracy and high throughput detection are achieved Effect.
Patent Information
- Application Number
- PCT/CN2023/095963
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-16
- Filing Date
- 2023-05-24
- Publication Date
- 2024-11-21
AI Technical Summary
When detecting heavy hitters in the network, the prior art uses huge resources and low accuracy, and cannot adapt to environments where multiple attacks and large-scale traffic interleaving, and the state measurement-based method cannot directly locate the heavy hitter.
Adaptive heavy hitter detection method for programmable switches is adopted, combining state measurement and flow measurement methods, through the state detection module and the flow-level measurement module, the processing mode is adaptively selected to reduce resource overhead and improve measurement accuracy.
It achieves improved the accuracy and throughput of heavy hitter measurements while reducing resource overhead, enables accurate detection of heavy hitters in a variety of attacks and large-scale traffic environments, and provides accurate statistics for defense decision analysis.
Smart Images

Figure CN2023095963_21112024_PF_FP_ABST
Abstract
Description
An adaptive heavy hitter detection method for programmable switches Technical Field
[0001] The present invention belongs to the intersection field of network security and network measurement, and in particular relates to an adaptive heavy hitter detection method for programmable switches. Background Art
[0002] With the rapid development of computer science, the Internet is becoming increasingly fast, large-scale, and flexible. In this environment, various network applications are placing higher demands on network service quality. Heavy hitters (HHs) refer to network entities where the cumulative number of packets, bytes, or connections exceeds a certain threshold within a certain period of time. This is one of the most significant causes of network service quality issues. Currently, the industry's methods for measuring heavy hitters are mainly divided into two categories: state-based and flow-based.
[0003] State-based measurement methods analyze network behavior by detecting changes in the characteristics of network devices affected by the network. The measured objects are typically packet rate, packet latency, packet number, device bandwidth, and so on. By collecting behavioral information about the devices, the network operating status and related heavy hitter types are inferred. Representative methods include Flowsense, In-situ OAM, and INT (Inband Network Telemetry). However, such methods often require the deployment of information push mechanisms on the devices, including real-time packaging of measurement information or transmitting it to the server by carrying it in service packets, which puts a lot of pressure on bandwidth and packet load. Moreover, this method of collecting behavioral information cannot directly locate specific heavy hitters and basically serves as a discovery of abnormal nodes rather than an analysis of abnormal content.
[0004] Traffic measurement methods measure the characteristics of some or all traffic in a network. They can often pinpoint specific traffic with heavy hitter properties, helping network administrators gain a deeper and more granular understanding of network characteristics. Representative methods include the Count-Min sketch, BeauCoup, and the elastic sketch. However, these methods are logically complex and can easily affect device throughput, especially under heavy traffic loads. Furthermore, most current methods exhibit a conflict between accuracy and task coverage. Highly accurate methods often target only a single heavy hitter task and are unable to adapt to current network environments where various attacks and large-scale traffic are intertwined. Methods with broad coverage often have lower accuracy and consume significant resources.
[0005] Summary of the Invention
[0006] To address the above problems, the present invention proposes an adaptive heavy hitter detection method for programmable switches. This method combines a state measurement-based method with a flow measurement-based method. While obtaining a complete network status view, it can adaptively select a processing mode based on the current network status, thereby reducing resource overhead, ensuring node throughput, and increasing the system's measurement accuracy for heavy hitters.
[0007] After a packet enters the switch's network interface, it first passes through the state detection module deployed in the programmable switch to obtain status characteristics and determine the current measurement status. If the measurement status is normal, the packet is forwarded directly. If the measurement status is abnormal, the measurement status is stored in metadata (used to store intermediate information required by the module) before being processed by the flow-level measurement module. After entering the flow-level measurement module, the packet is first matched against the precise statistical flow table. Based on the match result, the packet is selected to enter the sketch processing pipeline to complete the detection of suspicious heavy hitters and update the precise statistical flow table.
[0008] To achieve the purpose of the present invention, the detailed technical solution of the present invention is as follows: an adaptive heavy hitter detection method for a programmable switch, the method comprising the following steps:
[0009] (1) In each state statistics period E state The state detection module in the programmable switch collects statistics on multi-dimensional state features based on the received messages, and determines the current switch measurement state based on the statistical results (the measurement state includes three state types: normal state, large flow detection state, and attack detection state).
[0010] (2) During the duration T of each measurement state, according to the current switch measurement state type, the reconfigurable sketch belonging to the flow-level measurement module in the programmable switch will adaptively select the corresponding processing logic to complete the corresponding measurement task.
[0011] (3) In each attack detection state duration T a In the flow level measurement module, the reconfigurable sketch will be based on each flow detection cycle E flow The measurement resource allocation is adaptively adjusted based on the results, thereby improving the measurement accuracy of attack traffic during the entire measurement state.
[0012] (4) In each flow detection cycle E flowThe reconfigurable sketch in the flow-level measurement module will mark the measured suspicious heavy hitter traffic and store it in the precise statistical flow table in the flow-level measurement module for further refined detection. Finally, the iterative update of the precise statistical flow table in each measurement state is completed to obtain the measurement results.
[0013] As an improvement of the present invention, the specific method of step (1) is as follows:
[0014] (1.1) Four registers are deployed in the programmable switch with a time length E state Periodically record basic data related to the message, including each E state The number of packets, total packet length, number of TCP packets, and number of UDP packets.
[0015] (1.2) Using the four basic data of register statistics, the time length E state Periodically calculate multi-dimensional status features. Based on the high traffic volume of heavy hitters, which often triggers a large number of IP connection pairs and short packets, we select four status features for statistical analysis: bandwidth utilization, TCP packet ratio, UDP packet ratio, and average packet length.
[0016] (1.3) Set the threshold conditions for the transition between the three measurement modes in the measurement mode state machine. After calculating the multi-dimensional state characteristics, the switch will calculate the state machine according to the measurement mode and the previous time period E. state The four status features obtained by calculation complete the transition of the measurement state and store the measurement state type ID (0: normal state, 1: high flow detection state, 2: attack detection state) in metadata.
[0017] It should be noted that there is a priority relationship between measurement states. Considering that network attacks often affect network quality faster and more severely, and short-term attack detection will hardly affect the long-lasting large flow, we default to the attack detection state with the highest priority. If the duration of the large flow detection is T h In a certain E state If an attack detection is found, the system will state Jump immediately to the attack detection state.
[0018] Through this step, the measurement process of the programmable switch is given different measurement targets and tasks according to the network status characteristics at different time nodes.
[0019] As an improvement of the present invention, the specific method of step (2) is as follows:
[0020] (2.1) After the message passes the status statistics action in step (1), the current switch measurement status type is determined based on the measurement status type ID inserted in the metadata.
[0021] (2.2) If the measurement status is normal, the flow-level measurement module in the switch is bypassed and the message is forwarded directly.
[0022] (2.3) If the measurement status is abnormal, according to the sketch processing process, the sketch processing pipeline deployed in the flow-level measurement module consists of three modules, representing the three major stages of sketch processing: hash feature extraction, message attribute calculation, and hash conflict reduction. Each stage contains multiple parallel sub-modules to choose from to form a complete sketch processing pipeline. Different measurement states correspond to different sets of processing sub-modules.
[0023] A table lookup is performed based on the measurement state ID in the metadata (the table entry is the state ID-sketch processing submodule ID correspondence table). The table lookup result (the ID sequence number of the subsequent processing submodule set) is carried in the metadata. The flow-level measurement module in the switch selects the corresponding submodule based on the table lookup result in the metadata to form a specific sketch processing pipeline to complete the detection of large flows / attack target flows.
[0024] Through this step, the subsequent action processing of the message (bypass flow level measurement module, sketch large flow detection, sketch attack detection) is determined according to the current measurement status of the switch.
[0025] As an improvement of the present invention, the specific method of the path planning algorithm in step (3) is as follows:
[0026] (3.1) According to the measurement status type ID in the metadata, determine whether the current switch measurement status is the attack detection status. According to the method in step (2), select the submodules serving the attack detection task to form the sketch processing pipeline.
[0027] (3.2) In the first flow detection cycle E flow In order to simultaneously detect different types of attackers with heavy hitter attributes, for the two heavy hitter types of DDoS and superspreader attacks, the sketch measurement resources in the flow-level measurement module are divided into two sub-tables S1 and S2, which are responsible for DDoS attack detection and superspreader detection respectively.
[0028] (3.3) Each subsequent flow detection cycle E flow According to the previous Eflow The detection result of the flow-level measurement module selects the main task in the current detection cycle from the two detection tasks of DDoS and superspreader, and the subtable to which the task belongs is in the next E flow The number of rows in the sub-table is increased by 1, and the number of rows in the other sub-table is reduced by 1. In order to ensure that a You can always capture multiple heavy hitter attacks. During the iterative process of the above operation, any E flow It is necessary to ensure that the number of rows in the sub-table responsible for non-main tasks is not less than 1.
[0029] Through this step, the measurement in the attack detection state can simultaneously take into account attacks with multiple heavy hitter attributes, adaptively distinguish attack types, and allocate appropriate measurement resources to improve measurement efficiency.
[0030] As an improvement of the present invention, the specific method of step (4) is as follows:
[0031] (4.1) In each flow detection cycle E flow In the flow-level measurement module, the sketch identifies the detected suspicious heavy hitters (including large flows / DDoS / superspreader) (large flows are identified by IP pairs, DDoS attacks are identified by DstIP, and superspreader attacks are identified by SrcIP) and stores them in the precise statistical flow table.
[0032] (4.2) In each flow detection cycle E flow In the switch, the packets entering the flow level measurement module first need to be matched in the precise statistical flow table. The packets that fail to match are sent to the sketch processing pipeline. The packets that successfully match only need to complete the precise statistics in the flow table before being forwarded. The flow identifiers that do not meet the heavy hitter condition obtained by the precise statistics will be deleted from the flow table. flow The traffic identifiers that meet the heavy hitter condition and are accurately counted will be retained in the flow table until the end of the entire measurement state period T.
[0033] (4.3) Accurate Statistics Flow Table While accurately counting, it also records auxiliary items for each flow identifier in the table entry, which is used to further analyze the persistent characteristics of the heavy hitter captured in the table. The auxiliary items are mainly used to record the number of times E the identifier item in the accurate statistics flow table that has met the retention conditions exists in the entire measurement period T. flow The statistics during this period still meet the heavy hitter standard.
[0034] This step combines precise statistical flow tables with the multi-level heavy hitter detection and verification mechanism designed using Sketch to obtain more accurate and intuitive heavy hitter measurement results. It also provides additional statistical data for subsequent defense decision analysis.
[0035] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0036] (1) This invention addresses the current inability of programmable switches to adaptively detect multiple heavy hitters by designing a heavy hitter detection method with adaptive measurement capabilities. By combining state-level and flow-level measurement methods, this invention provides a universal measurement framework for heavy hitter detection, overcoming the measurement limitations of previous programmable switches and possessing significant practical significance.
[0037] (2) This paper proposes a dynamically reconfigurable sketch design method for flexible flow-level measurement. By combining multiple flexibly selectable sketch fine-grained basic processing units, the dynamic reconfiguration capability of the sketch in a programmable switch is realized. Sketch resources can be rationally allocated based on the system's adaptability, achieving higher measurement accuracy with fewer measurement resources.
[0038] (3) The present invention proposes a measurement result optimization method based on an accurate statistical flow table. By deploying an accurate statistical flow table to store and verify suspicious heavy hitters detected from the sketch and analyzing the characteristics of heavy hitters, the flow-level measurement module can eliminate misclassification results caused by hash collisions and bypass a large amount of traffic that would otherwise be detected by the sketch, achieving higher throughput and reducing the impact on normal packet forwarding during deployment. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flowchart of adaptive heavy hitter detection;
[0040] Figure 2 is a schematic diagram of the measurement mode state machine;
[0041] FIG3 is a schematic diagram of a reconfigurable sketch processing pipeline working method;
[0042] FIG4 is a schematic diagram of a method for detecting and processing a sketch attack;
[0043] Figure 5 is a schematic diagram of adaptive allocation of sketch resources;
[0044] Figure 6 is a schematic diagram of the accurate statistical flow;
[0045] Figure 7 is a schematic diagram of the experimental topology. DETAILED DESCRIPTION
[0046] In order to deepen the knowledge and understanding of the present invention, the technical solution is described in detail below with reference to the accompanying drawings.
[0047] Figure 1 shows a schematic flow diagram of the present invention. After a message enters the switch network interface, it first passes through the state detection module deployed in the programmable switch to obtain status characteristics and determine the current measurement status. If the measurement status is normal, the message is forwarded directly; if the measurement status is abnormal, the measurement status is stored in metadata and then processed by the flow-level measurement module. After entering the flow-level measurement module, the message is first matched against the precise statistical flow table. Based on the match result, the message is selected to enter the sketch processing pipeline to complete the detection of suspicious heavy hitters and update the precise statistical flow table.
[0048] To achieve the purpose of the present invention, the detailed technical solution of the present invention is as follows: an adaptive heavy hitter detection method for a programmable switch, the method comprising the following steps:
[0049] (1) In each state statistics period E state The state detection module in the programmable switch collects statistics on multi-dimensional state features based on the received messages, and determines the current switch measurement state based on the statistical results (the measurement state includes three state types: normal state, large flow detection state, and attack detection state).
[0050] (2) During the duration T of each measurement state, according to the current switch measurement state type, the reconfigurable sketch belonging to the flow-level measurement module in the programmable switch will adaptively select the corresponding processing logic to complete the corresponding measurement task.
[0051] (3) In each attack detection state duration T a In the flow level measurement module, the reconfigurable sketch will be based on each flow detection cycle E flow The measurement resource allocation is adaptively adjusted based on the results, thereby improving the measurement accuracy of attack traffic during the entire measurement state.
[0052] (4) In each flow detection cycle E flow The reconfigurable sketch in the flow-level measurement module will mark the measured suspicious heavy hitter traffic and store it in the precise statistical flow table in the flow-level measurement module for further refined detection. Finally, the iterative update of the precise statistical flow table in each measurement state is completed to obtain the measurement results.
[0053] The specific method of step (1) is as follows:
[0054] (1.1) Four registers are deployed in the programmable switch with a time length E state Periodically record basic data related to the message, including each E state The number of packets, total packet length, number of TCP packets, and number of UDP packets.
[0055] (1.2) Using the four basic data of register statistics, the time length E state Periodically calculate multi-dimensional state features. Due to the high traffic volume of heavy hitters, which often triggers a large number of IP connection pairs and short messages, four state features are selected for calculation: bandwidth utilization, TCP message ratio, UDP message ratio, and average message length. The calculation method is shown in the formula:
[0056] -Bandwidth utilization f1: Considering that the traffic caused by heavy hitters is very large compared to normal traffic, the packet arrival rate of the node is very high in this case, causing a surge in bandwidth usage.
[0057] TCP packet ratio f2: TCP flood or superspreader scanning, which are DDoS attacks, trigger a large number of IP connections, causing service loss and generating a large number of TCP packets.
[0058] UDP packet proportion f3: UDP flood attacks, a type of DDoS attack, exhaust network bandwidth resources by sending a large number of short UDP packets in a short period of time.
[0059] - Average message length f4: A network attack with heavy hitter properties constructs a large number of short messages with no payload in a short period of time, triggering a large number of connections or exhausting network bandwidth resources, resulting in service loss.
[0060] (1.3) Set the threshold conditions for the transition between the three measurement modes in the measurement mode state machine. After calculating the multi-dimensional state characteristics, the switch will calculate the state machine according to the measurement mode and the previous time period E. stateThe four state features obtained by calculation complete the transition of the measurement state, and store the type ID of the measurement state (0: normal state, 1: high flow detection state, 2: attack detection state) in the metadata. As shown in Figure 2, θ1, θ2, and θ3 are the three transition thresholds of the measurement mode state machine that need to be set in this step. θ1 represents the abnormal threshold of bandwidth utilization, θ2 represents the abnormal threshold of the proportion of UDP packets and TCP packets, and θ3 represents the abnormal threshold of the average length of the packet. Among them, θ1 and θ2 are preset according to the specific experimental environment. Considering that network attacks generally use 64-byte short packets, the average packet length in a normal network environment is RegLen. According to the formula, the preset θ3 can be obtained: θ3=RegLen*(1-θ2)+64*θ2
[0061] It should be noted that, as shown in Figure 2, there is a priority relationship between measurement states. Considering that network attacks often affect network quality faster and more severely, and short-term attack detection will hardly affect the long-lasting large flow, we default to the attack detection state with the highest priority. If the duration of the large flow detection is T h In a certain E state If an attack detection is found, the system will state Jump immediately to the attack detection state.
[0062] Through this step, the measurement process of the programmable switch is given different measurement targets and tasks according to the network status characteristics at different time nodes.
[0063] The specific method of step (2) is as follows:
[0064] (2.1) After the message passes the status statistics action in step (1), the current switch measurement status type is determined based on the measurement status type ID inserted in the metadata.
[0065] (2.2) If the measurement status is normal, the flow-level measurement module in the switch is bypassed and the message is forwarded directly.
[0066] (2.3) If the measurement status is abnormal, according to the sketch processing process, the sketch processing pipeline deployed in the flow-level measurement module consists of three modules, representing the three major stages of sketch processing: hash feature extraction, message attribute calculation, and hash conflict reduction. Each stage contains multiple parallel sub-modules to choose from to form a complete sketch processing pipeline. Different measurement states correspond to different sets of processing sub-modules.
[0067] A table lookup is performed based on the measurement status ID in the metadata, as shown in Figure 3. The lookup result (the ID sequence of the subsequent processing submodule set) is carried in the metadata. Based on the lookup result in the metadata, the flow-level measurement module in the switch selects appropriate submodules to form a specific sketch processing pipeline to complete the detection of large flows / attack target flows. Based on the sketch processing process, the sketch processing pipeline deployed within the flow-level measurement module consists of three modules, representing the three stages of sketch processing: hash feature extraction, packet attribute calculation, and hash conflict reduction. Each stage contains multiple parallel submodules to select from to form a complete sketch processing pipeline.
[0068] For (2.3), there are four specific sub-steps:
[0069] First, the message is matched with a submodule. When a message enters any stage of the pipeline, the ID number in the metadata must be matched with the ID number of the submodule in that stage. The submodule that successfully matches can receive and process the message, while the submodule that fails to match will not process the message.
[0070] Second, the packet enters the hash feature extraction module for sketch processing. As shown in Figure 3, if the matching submodule ID is 1, the submodule selects n appropriate hash functions to perform hash operations on the packet's source IP (SrcIP) and destination IP (DstIP) pairs, with HASH1(SrcIP, DstIP) representing the submodule's action processing, serving the high-volume flow detection task. If the matching submodule ID is 2, the submodule selects n appropriate hash functions to perform hash operations on the packet's SrcIP and DstIP pairs, respectively, with HASH2(SrcIP) and HASH2(DstIP) representing the submodule's action processing, serving the attack detection task.
[0071] Third, the message enters the message attribute calculation module for sketch processing. As shown in Figure 3, if the matched submodule ID is 1, the submodule will accumulate the index results calculated by n HASH1 (SrcIP, DstIP) in the previous stage at the corresponding register of the sketch table entry to serve the large flow detection task; if the matched submodule ID is 2, the submodule will perform bit filling at the corresponding register of the sketch table entry based on the index results calculated by n HASH2 (SrcIP) and HASH2 (DstIP) in the previous stage. The specific operation is that the submodule calls a specific random hash function h rPerform hash calculation on the attribute attr(i) of message i (if the index calculation input is SrcIP, the attribute is DstIP; if the index calculation input is DstIP, the attribute is SrcIP), satisfying As shown in Figure 4, m is the bit length of the sketch table entry storage unit. The interval [0,1) is divided into m equal parts, [0,1 / m), [1 / m,2 / m), …, [m-1 / m,1). Each interval corresponds to a bit in the sketch table entry storage unit. According to h r The interval that the result of (attr(i)) falls into will have the corresponding bit position set to 1, serving the attack detection task.
[0072] Fourth, the message enters the hash collision reduction module for sketch processing. As shown in Figure 3, if the matching submodule ID is 1, the submodule will calculate the n cumulative results V1, V2, V3...V obtained in the first two stages. n Take the minimum value as the statistical result, that is, r1=MIN(V1,V2,V3……V n ), serving the large flow detection task; if the matched submodule ID is 2, as shown in Figure 3, the submodule will fill the n-bit results V1, V2, V3...V obtained in the first two stages. n Perform bitwise AND as the statistical result, i.e. r2=V1&V2&V3……&V n , serving the attack detection task.
[0073] Through this step, the subsequent action processing of the message (bypass flow level measurement module, sketch large flow detection, sketch attack detection) is determined according to the current measurement status of the switch.
[0074] The specific method of the path planning algorithm in step (3) is as follows:
[0075] (3.1) According to the measurement status type ID in the metadata, determine whether the current switch measurement status is the attack detection status. According to the method in step (2), select the submodules serving the attack detection task to form the sketch processing pipeline.
[0076] (3.2) In the first flow detection cycle E flowIn order to simultaneously detect different types of attackers with heavy hitter attributes, for the two heavy hitter types of DDoS and superspreader attacks, the sketch measurement resources in the flow-level measurement module are divided into two sub-tables S1 and S2, which are responsible for DDoS attack detection and superspreader detection respectively. As shown in Figure 5, considering the size of the sketch table items: number of rows d, number of columns w, unit width m, the size of S1 and S2 is obtained: number of rows d / 2, number of columns w, unit width m. For S1, the hash feature extraction module in step (2) uses d / 2 H2 (DstIP), and the message attribute calculation module uses h r (SrcIP); for S2, the hash feature extraction module in step (2) uses d / 2 H2(SrcIP), and the message attribute calculation module uses h r (DstIP).
[0077] (3.3) Each subsequent flow detection cycle E flow According to the previous E flow The flow-level measurement module selects the main task in the current detection cycle from the two detection tasks of DDoS and superspreader. flow The existing message is calculated and counted by two sub-tables S1 and S2 to obtain V1&V2&V3...&V d / 2 =2 m -1, as shown in Figure 5, the task type represented by the sub-table is the main task in the current detection cycle. flow The number of rows in the sub-table is increased by 1, and the number of rows in the other sub-table is reduced by 1. In order to ensure that a You can always capture multiple heavy hitter attacks. During the iterative process of the above operation, any E flow It is necessary to ensure that the number of rows in the sub-table responsible for non-main tasks is not less than 1.
[0078] Through this step, the measurement in the attack detection state can simultaneously take into account attacks with multiple heavy hitter attributes, adaptively distinguish attack types, and allocate appropriate measurement resources to improve measurement efficiency.
[0079] The specific method of step (4) is as follows:
[0080] (4.1) In each flow detection cycle E flowThe sketch in the flow-level measurement module identifies the detected suspicious heavy hitters (including large flows / DDoS / superspreaders) (large flows are identified by IP pairs, DDoS attacks are identified by DstIP, and superspreader attacks are identified by SrcIP) and stores them in the precise statistical flow table. The definition of a suspicious heavy hitter is:
[0081] For the large flow detection task: the IP pair (SrcIP, DstIP) that makes the statistical result r1≥ε, ε is the preset large flow statistical threshold.
[0082] For attack detection tasks (DDoS): make the statistical result r1=2 m -1 for DstIP.
[0083] For the attack detection task (superspreader): make the statistical result r1=2 m -1 of SrcIP.
[0084] (4.2) In each flow detection cycle E flow In the switch flow level measurement module, the packets entering the switch flow level measurement module first need to be matched in the precise statistics flow table. The packets that fail to match need to be sent to the sketch processing pipeline. The packets that successfully match only need to complete the precise statistics in the flow table before being forwarded. The flow identifiers that do not meet the heavy hitter conditions obtained by the precise statistics will be deleted from the flow table. As shown in Figure 6, the precise statistics flow table also uses the m-bits wide register Cnt for precise statistics for each suspicious heavy hitter. In the same E flow The criteria used by the precise flow table to determine whether a suspected heavy hitter is a real heavy hitter are:
[0085] For large flow detection tasks (identified as (SrcIP, DstIP)): Cnt is accumulated when the message matches successfully. flow The flow that completes Cnt≥ε within a certain period can be retained in the precise statistics flow table. The RF flag representing the successful verification in the table entry is set to 1.
[0086] For attack detection tasks (identified as DstIP): the message matching is successful using h r (SrcIP) performs bit filling of Cnt, and flow Internal completion Cnt=2 m The -1 value can be retained in the precise statistics flow table. The RF bit representing the verification success flag in the table entry is set to 1.
[0087] For attack detection task (identified as SrcIP): the message matching is successful using hr (SstIP) performs bit filling of Cnt, in E flow Internal completion Cnt=2 m The -1 value can be retained in the precise statistics flow table. The RF bit representing the verification success flag in the table entry is set to 1.
[0088] In any E flow The traffic identifiers that meet the heavy hitter condition and are accurately counted will be retained in the flow table until the end of the entire measurement state period T.
[0089] (4.3) Accurate Statistics While accurately counting the flow table, the auxiliary items are recorded for each flow identifier in the table entry to further analyze the heavy hitter characteristics captured in the table. As shown in Figure 6, the auxiliary item (Ainf) is mainly used to count the number of times E exists in the identification item where RF has been set to 1 in the entire measurement period T. flow The statistics during this period always meet the heavy hitter criteria in (4.2):
[0090] For large flow detection tasks (identified as (SrcIP, DstIP)): Cnt is accumulated when the message matches successfully. flow If Cnt≥ε and RF=1, Ainf=Ainf+1 can be performed.
[0091] For attack detection tasks (identified as DstIP): the message matching is successful using h r (SrcIP) performs bit filling of Cnt, and flow Internal completion Cnt=2 m -1, and RF=1, Ainf=Ainf+1 can be performed.
[0092] For attack detection task (identified as SrcIP): the message matching is successful using h r (DstIP) performs bit filling of Cnt, in E flow Internal completion Cnt=2 m -1, and RF=1, Ainf=Ainf+1 can be performed.
[0093] After the entire measurement period T, the Ainf value can be used to determine the continuity of the measured heavy hitter, including verifying the burstiness of large flows and the persistence of DDoS attacks. The heavy hitter flags retained in the accurate statistics flow table are the measurement results.
[0094] This step combines precise statistical flow tables with the multi-level heavy hitter detection and verification mechanism designed using Sketch to obtain more accurate and intuitive heavy hitter measurement results. It also provides additional statistical data for subsequent defense decision analysis.
[0095] Specific embodiment 1:
[0096] If the programmable switch interface rate to which the heavy hitter detection method logic for the programmable switch needs to be applied is 10G, the workflow is as follows.
[0097] (1) Set the detection time parameter: Status statistics period E state 1ms; attack detection state duration T a is 5s, the corresponding flow detection period is E flow 100ms; the duration of the high flow detection state is T h is 60s, the corresponding flow detection period is E flow 1s.
[0098] (2) Set the detection threshold parameters: the bandwidth utilization abnormal threshold θ1 is 65%, the UDP packet and TCP packet ratio abnormal threshold θ2 is 80%, the average packet length abnormal threshold θ3 is 330 bytes; the large flow statistics threshold ε is 230.
[0099] (3) Set the detection resource parameters: 600KB for the sketch table and 100KB for the precise statistics flow table.
[0100] (4) Burn the heavy hitter detection logic into the programmable switch and place it in the experimental environment.
[0101] Experiment 1: Single Task Detection Accuracy Test
[0102] Purpose of the experiment:
[0103] Verify the effectiveness of the system for heavy hitter detection.
[0104] Experimental steps:
[0105] 1. Start the established network topology. As shown in Figure 7, the network interface of the programmable switch is connected to four servers. A virtual host group is established in the servers to send background traffic to each other.
[0106] 2. Randomly select one of three types of heavy hitter traffic (including large flow traffic such as elephant flow, attack traffic such as DDoS attack, and attack traffic such as superspreader attack), mix it with normal background traffic, divide it into different subsets according to the same time slice length, and replay it crosswise on four servers.
[0107] 3. Check the heavy hitter identification reserved items in the system's accurate statistics flow table and compare them with the actual heavy hitter situation in the background traffic.
[0108] 4. Select the heavy hitter traffic type without repetition and conduct multiple experiments.
[0109] Experiment 2: Multiple Task Detection Adaptability Test
[0110] Purpose of the experiment:
[0111] Verify the accuracy and reconfigurability of the system in heavy hitter detection in a real complex network environment.
[0112] Experimental steps:
[0113] 1. Start the established network topology as shown in Figure 7.
[0114] 2. The CAIDA real network dataset is divided into different subsets according to the same time slice length, and four servers replay them crosswise.
[0115] 3. Check the heavy hitter identification reserved items in the system's accurate statistics flow table and compare them with the actual heavy hitter situation in the background traffic.
[0116] 4. Check the auxiliary item (Ainf) corresponding to the heavy hitter indicator in the system's accurate statistics flow table and compare it with the actual heavy hitter situation in the background traffic.
[0117] Experiment 3: Deployment of Adaptive Heavy Hitter Detection System Throughput Test
[0118] Purpose of the experiment:
[0119] Test the impact of deploying adaptive heavy hitter detection logic in programmable switches on packet forwarding capabilities.
[0120] Experimental steps:
[0121] 1. Prepare two sets of programmable switches of the same model, one with adaptive heavy hitter detection logic deployed and the other without. Build the same network topology for each, as shown in Figure 7.
[0122] 2. The CAIDA real network dataset was replayed for each of the two devices in a loop, with a time period of 1 hour. The average packet forwarding rate of the two devices was periodically tested using a network tester.
[0123] 3. Compare the packet forwarding rate of programmable switches that deploy adaptive heavy hitter detection logic with that of programmable switches that do not deploy it.
[0124] It should be noted that the above embodiments are not intended to limit the scope of protection of the present invention, and equivalent changes or substitutions made on the basis of the above technical solutions fall within the scope of protection of the claims of the present invention.
Claims
1. An adaptive heavy hitter detection method for programmable switches, characterized in that: The method comprises the following steps: (1) In each state statistics period E state The state detection module in the programmable switch counts the multi-dimensional state characteristics according to the received messages, and determines the current switch measurement state according to the statistical results. The measurement state includes three types of states: normal state, large flow detection state, and attack detection state. (2) During the duration T of each measurement state, according to the current switch measurement state type, the reconfigurable sketch belonging to the flow-level measurement module in the programmable switch will adaptively select the corresponding processing logic to complete the corresponding measurement task. (3) In each attack detection state duration T a In the flow level measurement module, the reconfigurable sketch will be based on each flow detection cycle E flow The measurement resource allocation is adaptively adjusted based on the results, thereby improving the measurement accuracy of attack traffic during the entire measurement state. (4) In each flow detection cycle E flow The reconfigurable sketch in the flow-level measurement module will mark the measured suspicious heavy hitter traffic and store it in the precise statistical flow table in the flow-level measurement module for further refined detection, and finally complete the iterative update of the precise statistical flow table in each measurement state to obtain the measurement result.
2. The adaptive heavy hitter detection method for a programmable switch according to claim 1, characterized in that: The specific method of step (1) is as follows: (1.1) Deploy multiple registers in a programmable switch to a time length E state Periodically record basic data related to the message, (1.2) Using the basic data of register statistics, the time length E state Periodicity Calculate multi-dimensional state characteristics, (1.3) After calculating the multi-dimensional state characteristics, the measurement state type that the switch is about to jump to is determined according to the measurement mode state machine. The measurement state includes three state types: normal state, large flow detection state, and attack detection state.
3. The adaptive heavy hitter detection method for a programmable switch according to claim 1, characterized in that: The specific method of step (2) is as follows: (2.1) Determine the current switch measurement status type, (2.2) If the measurement status is normal, bypass the flow level measurement module in the switch. (2.3) If the measurement status is abnormal, based on whether the queried measurement status is a large flow detection status or an attack detection status, the flow-level measurement module in the switch selects appropriate submodules to form a specific sketch processing pipeline to complete the detection of large flows / attack target flows.
4. The adaptive heavy hitter detection method for a programmable switch according to claim 1, characterized in that: The specific method of step (3) is as follows: (3.1) Determine whether the current switch measurement state is an attack detection state, (3.2) In the first flow detection cycle E flow In the flow-level measurement module, the sketch measurement resources in the flow-level measurement module are evenly distributed for two types of heavy hitter attacks, DDoS and superspreader. (3.3) Each subsequent flow detection cycle E flow According to the previous E flow According to the detection situation, the flow-level measurement module adaptively adjusts the size of sketch measurement resources allocated to DDoS and superspreader attack detection.
5. The in-band telemetry path planning algorithm based on segment routing according to claim 1, characterized in that: The specific method of the overlapping path elimination algorithm in step (4) is as follows: (4.1) In each flow detection cycle E flow In the flow-level measurement module, the sketch identifies the detected suspicious heavy hitters (including large flows / DDoS / superspreaders) and stores them in the precise statistical flow table. (4.2) In each flow detection cycle E flow In the flow level measurement module of the switch, the packets entering the switch need to be matched in the precise statistical flow table first. The packets that fail to match need to be sent to the sketch processing pipeline. The packets that successfully match only need to complete the precise statistics in the flow table before forwarding. The flow identifiers that do not meet the heavy hitter condition obtained by the precise statistics will be deleted from the flow table. (4.3) Accurate Statistics While accurately counting, the flow table also completes the recording of auxiliary items for each flow identifier in the table entry, which is used to further analyze the heavy hitter features captured in the table.
Citation Information
Patent Citations
Two-stage large-flow measurement method for software defined network
CN106603410A
Network large flow detection method and system based on adaptive sampling threshold
CN115102716A
Accurate active large flow identification method and system based on small flow filtering
CN115102907A
Fine-grained network flow measurement method based on terminal node cooperation
CN116032804A
Detection method and detection device for heavy flow data stream
WO2021190111A1
