Implementation method of elephant flow early detector suitable for software defined network

By integrating the elephant flow early detector in the software-defined network, using quintuple and average packet byte count, combined with the random forest algorithm and reward formula, the elephant flow early detection model solves the problem of low accuracy and low accuracy in dynamic networks. It solves the problem of poor stability and achieves high-precision, high-stability and low-bandwidth consumption detection effects, making it suitable for high-speed data center networks.

CN118540280APending Publication Date: 2024-08-23GUILIN UNIV OF AEROSPACE TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410628026.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing elephant flow early detection models have low accuracy and poor stability in dynamic networks, and training data sets and model updates require manual labeling, which cannot meet real-time needs, resulting in reduced detection accuracy and stability, and excessive resource consumption.

Method used

Design an elephant flow early detector suitable for software-defined networks. By integrating it in the SDN controller, it uses quintuple and average packet byte count, combined with random forest algorithm and reward formula, to achieve automatic labeling of data sets. and model updates to dynamically adjust detection accuracy and bandwidth consumption.

Benefits of technology

It achieves high accuracy, high stability and low bandwidth consumption for early detection of elephant flows. It can quickly identify elephant flows, optimize network performance and resource management, and is suitable for high-speed data center networks to ensure service quality and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540280A
    Figure CN118540280A
Patent Text Reader

Abstract

The invention discloses an implementation method of an elephant flow early detector suitable for a software defined network (SDN). According to the implementation method, the early detector is integrated to the SDN controller, the real-time traffic information of the network is obtained through the SDN controller for detection, an additional traffic sampler does not need to be deployed, and the cost is low. According to the implementation method, two elephant flow detection models based on the quintuple and the threshold are jointly used, early detection of the elephant flow is realized, and the elephant flow detection models based on the quintuple are continuously updated and adjusted through real-time evaluation of the precision and network resources of the elephant flow models, so that the detection accuracy of the elephant flow is improved. The method solves the problems of low detection precision, poor real-time performance, large resource consumption and the like caused by characteristic drift of a dynamic software defined network, and is suitable for management and optimization of network performance and resources of data center networks at all levels through rapid and high-precision identification of elephant streams. And the service quality and the user experience of applications with special requirements on time delay and bandwidth are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an early detection technology for elephant flows, and in particular to an implementation method of an early detector for elephant flows suitable for a software defined network (SDN). Background Art

[0002] Packets are the basic unit of information transmission in computer networks. In addition to the user information being transmitted, packets also contain header fields of multiple protocols. In these fields, computer networks define packets with the same five-tuple (source IP address, destination IP address, source port number, destination port number, protocol number) as flows. Therefore, a flow is a time series of packets with the same five-tuple. Flows can be subdivided into elephant flows and mouse flows according to the total number of bytes they contain or the total network bandwidth they occupy. Elephant flows contain a large number of bytes, last for a long time, and consume a high amount of network bandwidth, while mouse flows contain a small number of nodes, last for a short time, and consume a low amount of bandwidth. Multiple elephant flows sharing the same network path will cause congestion of the path, which may deteriorate the performance of the entire network. Detecting elephant flows is to identify elephant flows in real-time network traffic in order to optimize the routing of elephant flows and avoid network congestion. It is a common means of current network performance management and resource optimization.

[0003] A typical elephant flow detector is a software for detecting elephant flows. The accuracy of detection mainly depends on the elephant flow detection model used. Since elephant flows have the characteristics of large flow bytes or occupying a lot of network bandwidth, elephant flow detection models are usually established based on the characteristics of flow bytes. For elephant flow models based on flow bytes, whether they are threshold-type models that directly set thresholds or models trained by machine learning algorithms, it is difficult to achieve both detection accuracy and real-time detection. The reason is that the flow is a time series of packets, and the flow bytes need to accumulate for a certain period of time before the elephant flow detection model can obtain correct detection results. In an actual network, the time consumed by accumulating flow bytes may cause congestion in some busy network links, resulting in the loss of meaning of the detection results and subsequent adjustments to routing or other management policies. Therefore, it is of great practical significance to correctly detect elephant flows in their early stages (i.e., using packets in the early stage of elephant flows).

[0004] It is difficult for early detection devices of elephant flows to obtain sufficiently high detection accuracy when deployed in actual networks, because the early detection model of elephant flows cannot select time-sensitive features such as the number of flow bytes, flow duration, and total bandwidth consumed by the flow, but can train high-precision detection models. Current early detection models of elephant flows usually select five-tuples that are independent of time or time-insensitive packet features to build models, and then use artificial neural networks to build complex nonlinear models to improve the accuracy of the detection model. The biggest drawback of this type of model is that it takes a long time to train and has poor stability. When deployed in a dynamically changing network, the detection accuracy will drop significantly due to the drift of network traffic characteristics, and it lacks practical detection value and significance.

[0005] Software Defined Networking (SDN) is a new network architecture that completely decouples control and forwarding functions. The architecture divides the network into a control plane and a data plane. The data plane includes SDN switches, SDN routers, and user terminals such as computers and mobile phones, and the control plane includes SDN controllers. Since SDN switches and SDN routers cannot create forwarding rules by themselves, their forwarding rules need to be created by SDN controllers. The specific method is as follows: SDN switches and SDN routers encapsulate the first packet of each received stream into a packet_in request and forward it to the SDN controller. After receiving the request, the SDN controller decodes it and creates a matching forwarding rule based on the information of the obtained packet. The decoded packet and the created forwarding rule are encapsulated into a corresponding response and sent back to the original SDN switch and SDN router. The switch and router save the received forwarding rule and complete the forwarding of the packet according to the forwarding rule.

[0006] Based on this forwarding feature of the SDN network, the SDN controller will receive the first packet of all flows in the network. In addition, the SDN controller will also receive some subsequent packets of each flow. The number and time point of the subsequent packets that can be received are controlled by the effective time of the forwarding rule. The effective time of the forwarding rule is written by the SDN controller when the rule is created, and the SDN controller can modify the effective time at any time. Therefore, compared with the actual flow in the network, the flow received by the SDN controller has the same total amount of flow and five-tuple, and some time-insensitive packet characteristics do not change much, such as the average size of each flow packet. Therefore, when the elephant flow early detector mainly relies on the five-tuple for modeling and detection, the flow received by the SDN controller can be fully used for the training and detection of the elephant flow early detection model, without the need to deploy additional network flow samplers, which greatly reduces the cost of elephant flow early detection.

[0007] However, directly using the flow information received by the SDN controller for early detection of elephant flows cannot solve the problems of low accuracy and poor stability of the early detection model of elephant flows caused by the drift of dynamic network characteristics. Since each flow in a dynamic network has its life cycle, especially the elephant flow, it will last for a period of time in the network; and the IP address and port number in the network, even if a dynamic IP address and dynamic port number are used, will remain unchanged for a certain period of time. Therefore, the accuracy and stability of the early detection model of elephant flows can be improved by continuously updating the training data set and the detection model. However, the training data set for training the early detection model of elephant flows needs to be labeled in advance (that is, to determine whether it belongs to an elephant flow or a mouse flow), and when the training data set and model are continuously updated, the labeling process needs to be completed automatically online, and the existing, conventional manual offline labeling method cannot meet the requirements.

[0008] If a high-precision elephant flow detection model is used to complete the labeling work, since the high-precision elephant flow detection model is based on time-sensitive flow characteristics such as the number of flow bytes, and the SDN controller can only receive the first packet and some subsequent packets of each flow in the network, the total number of flow bytes counted is smaller than the total number of bytes of the actual flow in the network, which will cause the accuracy of the elephant flow model based on the number of flow bytes to decrease, and the accuracy of the label will also decrease. In order to improve the accuracy of the label, it is necessary to adjust the effective time of each forwarding rule in real time so that each flow can have more subsequent packets forwarded to the SDN controller in the early stage. However, when more packets are forwarded to the SDN controller, a large amount of network bandwidth will be consumed. At the same time, if the received flow is labeled with a certain error rate by the model based on the number of flow bytes, the training and updating of the elephant flow early detection model by completely merging the received flow into the original training data set will not only increase the training time, but also may lead to a decrease in the accuracy of the early detection model. Therefore, while improving the accuracy and stability of the elephant flow early detector, it is necessary to balance its resource consumption in order to take into account the comprehensive performance of the network.

[0009] Therefore, the elephant flow early detector suitable for software-defined networks can be integrated into the SDN controller to reduce costs. When the application continuously updates the training data set and the early detection model to deal with the problem of reduced detection accuracy and stability caused by network characteristic drift, it is necessary to develop additional mechanisms to complete the automatic labeling of the training data, as well as to adjust the proportion of the training data set being updated and the effective time of the forwarding rules, so as to dynamically optimize the detection accuracy, stability and network bandwidth consumption of the early detection model. Summary of the invention

[0010] The purpose of the present invention is to address the deficiencies in the prior art and propose a method for implementing an early elephant flow detector suitable for software-defined networks. This method can ensure high accuracy, high stability and low control bandwidth consumption of detection, and is suitable for high-speed data center networks to manage and optimize network performance and resources by quickly and accurately identifying elephant flows, and can ensure the service quality and user experience of applications with special requirements for latency and bandwidth.

[0011] The technical solution for achieving the purpose of the present invention is:

[0012] A method for implementing an elephant flow early detector suitable for software defined networks comprises the following steps:

[0013] 1) Initialization of the elephant flow early detector: The SDN network includes a centralized SDN controller and a large number of SDN switches and user terminals. The elephant flow early detector is integrated in the SDN controller. The parameters required for the operation of the elephant flow early detector are as follows: detection period, elephant flow model A, elephant flow model B, dataset A, dataset B, the ratio of elephant flow and mouse flow in dataset B injected into dataset A, action set and reward formula. The detection period defines how often elephant flow detection is performed. The initialization of the elephant flow early detector includes initializing the detection period timer, initializing the elephant flow model A, initializing the elephant flow model B, initializing the dataset A, initializing the dataset B, and the ratio of elephant flow injected into dataset A and dataset B. i The ratio of mouse flow i Initialization of , initialization of action set, and initialization of reward formula;

[0014] 2) The elephant flow early detector continuously receives the packet_in request forwarded by the SDN switch to the SDN controller, and stores the flow information contained in the request into data set B;

[0015] 3) When the detection cycle timer is triggered, the elephant flow early detector creates a new thread. The new thread first creates a new data set BB, then copies the data of data set B to data set BB, and clears all data in data set B. The original thread of the elephant flow early detector continues to store the flow information in the packet_in request received by the SDN controller to data set B. The new thread of the elephant flow early detector performs early detection of the elephant flow on the flow contained in data set BB. Therefore, data set BB only contains the information of the flow to be detected in one test cycle, and data set B continues to collect the flow information of the next detection cycle. The elephant flow early detector can use the original thread and the new thread to complete the detection of the elephant flow and the collection of flow information in parallel. The steps for the new thread to perform elephant flow detection are as follows:

[0016] (1) Use elephant flow model A to detect elephant flows and mouse flows in dataset BB;

[0017] (2) Use elephant flow model B to detect elephant flows and mouse flows in dataset BB;

[0018] (3) Perform an OR operation on the detection result of the elephant flow model A and the detection result of the elephant flow model B, and output the detection result;

[0019] (4) Based on the detection results of the elephant flow model B, the flows in the data set BB are marked as elephant flows or mouse flows, and a ratio of a is randomly selected. i The elephant flow and ratio is b i The mouse stream was merged into dataset A;

[0020] (5) Retrain the elephant flow model A on the dataset A using the random forest algorithm. The features used by the random forest algorithm include the average number of bytes and five-tuple of the flow. The five-tuple includes the source IP address, destination IP address, source port number, destination port number, and protocol number of the flow.

[0021] (6) Estimate the precision of the elephant flow model A i ) and recall i ), since the flows contained in data set BB are the real-time network flow information obtained by the elephant flow early detector through the SDN controller, which flows in data set BB are elephant flows is unknown information, but since the flows of data set BB are detected by the elephant flow model B, and the elephant flow model B has a higher accuracy, the elephant flow early detector can use the detection results of the elephant flow model B to estimate the precision and recall of the elephant flow model A. The estimation formula is as follows:

[0022] precision i =|UA ei ∩UB ei | / |UA ei |

[0023] recall i =|UA ei ∩UB ei | / |UB ei |

[0024] Among them, UA ei and UB ei are the sets of flows detected as elephant flows in dataset BB by elephant flow model A and elephant flow model B respectively. The symbol || indicates the number of flows contained in the dataset.

[0025] (7) Calculate the reward value of each action in the action set, select the action with the largest reward value, and adjust ai and b i size;

[0026] (8) This detection is completed, return to step 2).

[0027] The steps of initializing the elephant flow early detector in step 1) are as follows:

[0028] 1.1) Initialization of the detection cycle timer: The elephant flow early detector sets a detection cycle duration T through the detection cycle timer, that is, the elephant flow is detected once every T duration. The duration T can be adjusted and the default is 30 seconds;

[0029] 1.2) Initialization of Dataset A and Elephant Flow Model A: Dataset A needs to be provided in advance. Dataset A contains multiple records. Each record is the information of a flow, which includes the five-tuple of the flow, the average number of bytes of all packets contained in the flow, and the label of the flow. The label value of the flow is 1 or 0. The label 1 indicates that the flow is an elephant flow, and the label 0 indicates that the flow is a mouse flow. In the offline state, the Elephant Flow Model A is initialized by running the random forest algorithm on the dataset A.

[0030] 1.3) Initialization of Dataset B and Elephant Flow Model B: Dataset B is obtained by continuously receiving packet_in requests sent by SDN switches and decoding the packet information contained therein. The method of obtaining is as follows: after obtaining a packet, first take out the five-tuple of the packet and the total byte value contained therein, and then compare the five-tuple of each flow in Dataset B to determine whether the five-tuple already exists. If it does exist, it means that the packet is a packet of an existing flow, and the total number of bytes and the average number of bytes of the flow are updated; if it does not exist, it means that the packet is the first packet of a new flow, and a new record is created in Dataset B, and the five-tuple of the packet is written. The total number of bytes and the average number of bytes of the flow corresponding to the record are updated to the number of bytes of the packet. Elephant Flow Model B is a threshold model, which determines that the flow with a total byte number of not less than 6K bytes is an elephant flow;

[0031] 1.4) The proportion of elephant flows in dataset BB injected into dataset A is a i The ratio of mouse flow i Initialization: Set a according to the network situation i and b i , a i and b i The default value of is 60%;

[0032] 1.5) Initialization of action set: Assume an action set that defines the adjustment action of the ratio of the elephant flow and the mouse flow in the dataset BB injected into the dataset A after each detection cycle. Each action is represented by a tuple (x, y), where the x element represents the action of the elephant flow and the y element represents the action of the mouse flow. Since the x and y elements can increase, remain unchanged, and decrease, the action set contains nine actions. The amount of increase or decrease of the x element after each detection cycle is set to δ a , the amount by which y increases or decreases is set to δ b , δ a and δ b The value of can be adjusted according to the network conditions, a and δ b The default value of is 0.1;

[0033] 1.6) Initialization of reward formula: Define a reward formula to evaluate the next detection cycle a i and b i What value should be chosen to optimize the goal? The reward formula is as follows:

[0034] reward i =(0.9-precision i )β i +(0.9-recall i )α i +(1-w i C i / C baseiine )(α i +β i )

[0035] The reward in this formula i Reward value, precision i and recall i They represent the precision and recall of the elephant flow model A estimated by the elephant flow model B, and β i and α i are the changes in the ratio of mouse flow and elephant flow injected into dataset A from dataset BB, and their sizes are δ b and δ a The absolute value of C i is the bandwidth occupied by the flow in the dataset BB, C i The calculation formula is as follows:

[0036]

[0037] Among them, U b represents the data set BB, f is a stream in the data set BB, P fIndicates the total number of bytes of the stream, T is the duration set by the detection cycle timer, C baseline It is the benchmark bandwidth, which can be pre-set according to the network conditions. Its default value is the bandwidth occupied by all packets received by the SDN controller in a test cycle under the default settings of the SDN network.

[0038] Step (7) in step 3): Calculate the reward value of each action in the action set, select the action with the largest reward value, and adjust a i and b i The size of the , steps are as follows:

[0039] (7.1) Select an action from the action set. When all actions in the action set have been calculated, the loop ends.

[0040] (7.2) Calculate the reward value of the action according to the reward formula;

[0041] (7.3) Select the action with the highest reward value and update a i and b i If the action with the highest reward value is (increase, increase), then a i and b i The values ​​of are increased by δ on the basis of the original values. a and δ b ; If the action with the highest reward value is (unchanged, unchanged), then a i and b i The value of remains unchanged; if the action with the highest reward value is (decrease, increase), then a i The value of is reduced by δ from the original value a , b i The values ​​of are increased by δ on the basis of the original values. b .

[0042] In the step 1), the SDN switch needs to forward the first data packet of each new flow it receives to the SDN controller so that the SDN controller can create a forwarding feature of the forwarding rule for it. The early detector of the elephant flow is integrated into the SDN controller, so that the early detector of the elephant flow can directly obtain real-time network flow information through the existing SDN controller, without deploying another network traffic sampler, which reduces the cost. The method of this technical solution only uses the five-tuple and the average number of packet bytes of the flow to detect the elephant flow. Since the information of the five-tuple can be obtained from the header information of the first packet of the flow, and the average number of packet bytes of the elephant flow does not change much during its entire life cycle, the method of this technical solution can only use the early packets of the elephant flow to complete the detection, and the timeliness is high. The method of this technical solution adjusts the intensity of the model update by estimating the precision and recall rate of the elephant flow model and the consumed network bandwidth in real time, while improving the detection accuracy, it avoids excessive consumption of network bandwidth.

[0043] When the step 1) is used in a non-SDN network, an additional network flow sampler is required to sample the network data flow in real time and store the sampling information in data set B so that the elephant flow early detector can obtain data set B to detect the elephant flow and update the elephant flow model A. The elephant flow early detector and the network flow sampler need to be deployed on a dedicated server.

[0044] This technical solution is an early detection software for elephant flows deployed on SDN controllers, which is suitable for early detection of elephant flows in software-defined networks. It is fully compatible with existing SDN controllers, SDN switches, and SDN routers, and does not require an update of the interface protocol. Compared with the prior art, this technical solution has the following advantages and beneficial effects:

[0045] (1) The method of the technical solution utilizes the forwarding feature that the SDN switch needs to forward the first data packet of each new flow it receives to the SDN controller so that the SDN controller can create a forwarding rule for it, and directly integrates the elephant flow early detector into the SDN controller, so that the elephant flow early detector can directly obtain real-time network flow information through the existing SDN controller, without the need to deploy additional network traffic samplers, without the need to modify the existing interface protocol of the software-defined network, and without the need to update the software of the existing SDN switches and SDN routers, with high compatibility and low cost.

[0046] (2) The method of the technical solution only uses the five-tuple and average packet byte number of the flow to train the elephant flow detection model through the random forest algorithm, with fast training speed and high model accuracy. Since the five-tuple information can be obtained from the packet header information of the first packet of the flow, and the average packet byte number of the elephant flow does not change much during its entire life cycle, the method of the technical solution can complete the detection using only the early packets of the elephant flow, and has high timeliness.

[0047] (3) The method of the technical solution is deployed in a dynamic software-defined network. It can use the threshold-type elephant flow detection model to make real-time estimates of the precision and recall of the early detection model of the elephant flow, as well as the consumed network bandwidth. It can also adjust the intensity of the model update in real time through the reward formula to cope with the characteristic drift of the network traffic. This improves the detection accuracy and stability while avoiding excessive consumption of network bandwidth.

[0048] (4) When the method of the technical solution is used in a non-SDN network, an additional network flow sampler is required to sample the data flow of the network in real time and store the sampling information in data set B, so that the elephant flow early detector of the present invention can obtain data set B to detect the elephant flow and update the elephant flow model A. The elephant flow early detector and the network flow sampler need to be deployed on a dedicated server. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of an elephant flow early detector integrated into an SDN controller in an embodiment;

[0050] Figure 2 This is a working principle diagram of the main thread of the elephant flow early detector in the embodiment;

[0051] Figure 3 It is a working principle diagram of the detection thread of the elephant flow early detector in the embodiment;

[0052] Figure 4 A schematic diagram for describing the generation principle of data set B in an embodiment;

[0053] Figure 5 A schematic diagram for describing an action set in an embodiment;

[0054] Figure 6 The following is a diagram describing the working principle of parameter updating in the embodiment. DETAILED DESCRIPTION

[0055] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, but the present invention is not limited thereto.

[0056] Example:

[0057] A method for implementing an elephant flow early detector suitable for software defined networks comprises the following steps:

[0058] 1) Initialization of the elephant flow early detector: The SDN network consists of a centralized SDN controller and a large number of SDN switches and user terminals. The elephant flow early detector is integrated in the SDN controller, such as Figure 1 As shown, the parameters required for the operation of the elephant flow early detector are as follows: detection cycle, elephant flow model A, elephant flow model B, data set A, data set B, the ratio of elephant flow and mouse flow in data set B injected into data set A, action set and reward formula. The detection cycle defines how often the elephant flow detection is performed. The initialization of the elephant flow early detector includes initializing the detection cycle by the detection cycle timer, initializing the elephant flow model A, initializing the elephant flow model B, initializing the data set A, initializing the data set B, and the ratio of elephant flow injected into data set A and data set B. i The ratio of mouse flow i Initialization of , initialization of action set, and initialization of reward formula;

[0059] 2) The elephant flow early detector continuously receives the packet_in request forwarded by the SDN switch to the SDN controller, and stores the flow information contained in the request in data set B, such as Figure 2 As shown;

[0060] 3) When the detection cycle timer is triggered, the elephant flow early detector creates a new thread. The new thread first creates a new data set BB, then copies the data of data set B to data set BB, and clears all data in data set B. The original thread of the elephant flow early detector continues to store the flow information in the packet_in request received by the SDN controller to data set B. The new thread of the elephant flow early detector performs early detection of the elephant flow on the flow contained in data set BB. Therefore, data set BB only contains the information of the flow to be detected within a test cycle, and data set B continues to collect the flow information of the next detection cycle. The elephant flow early detector can use the original thread and the new thread to complete the detection of the elephant flow and the collection of flow information in parallel. Figure 3 As shown, the steps for the new thread to detect elephant flow are as follows:

[0061] (1) Use elephant flow model A to detect elephant flows and mouse flows in dataset BB;

[0062] (2) Use elephant flow model B to detect elephant flows and mouse flows in dataset BB;

[0063] (3) Perform an OR operation on the detection result of the elephant flow model A and the detection result of the elephant flow model B, and output the detection result;

[0064] (4) Based on the detection results of the elephant flow model B, the flows in the data set BB are marked as elephant flows or mouse flows, and a ratio of a is randomly selected. i The elephant flow and ratio is b i The mouse stream was merged into dataset A;

[0065] (5) Retrain the elephant flow model A on the dataset A using the random forest algorithm. The features used by the random forest algorithm include the average number of bytes and five-tuple of the flow. The five-tuple includes the source IP address, destination IP address, source port number, destination port number, and protocol number of the flow.

[0066] (6) Estimate the precision of the elephant flow model A i ) and recall i ), since the flows contained in data set BB are the real-time network flow information obtained by the elephant flow early detector through the SDN controller, which flows in data set BB are elephant flows is unknown information, but since the flows of data set BB are detected by the elephant flow model B, and the elephant flow model B has a higher accuracy, the elephant flow early detector can use the detection results of the elephant flow model B to estimate the precision and recall of the elephant flow model A. The estimation formula is as follows:

[0067] precision i =|UA ei ∩UB ei | / |UA ei |

[0068] recall i =|UA ei ∩UB ei | / |UB ei |

[0069] Among them, UA ei and UB ei are the sets of flows detected as elephant flows in dataset BB by elephant flow model A and elephant flow model B respectively. The symbol || indicates the number of flows contained in the dataset.

[0070] (7) Calculate the reward value of each action in the action set, select the action with the largest reward value, and adjust a i and b i The size of Figure 6 As shown;

[0071] (8) This detection is completed, return to step 2).

[0072] The steps of initializing the elephant flow early detector in step 1) are as follows:

[0073] 1.1) Initialization of the detection cycle timer: The elephant flow early detector sets a detection cycle duration T through the detection cycle timer, that is, the elephant flow is detected once every T duration. The duration T can be adjusted and the default is 30 seconds;

[0074] 1.2) Initialization of Dataset A and Elephant Flow Model A: Dataset A needs to be provided in advance. Dataset A contains multiple records. Each record is the information of a flow, which includes the five-tuple of the flow, the average number of bytes of all packets contained in the flow, and the label of the flow. The label value of the flow is 1 or 0. The label 1 indicates that the flow is an elephant flow, and the label 0 indicates that the flow is a mouse flow. In the offline state, the Elephant Flow Model A is initialized by running the random forest algorithm on the dataset A.

[0075] 1.3) Initialization of Dataset B and Elephant Flow Model B: Dataset B is obtained by continuously receiving packet_in requests sent by SDN switches and decoding the packet information contained therein. The method of obtaining is as follows: after obtaining a packet, first take out the five-tuple of the packet and the total byte value contained therein, and then compare the five-tuple of each flow in Dataset B to determine whether the five-tuple already exists. If it does exist, it means that the packet is a packet of an existing flow, and the total number of bytes and the average number of bytes of the flow are updated; if it does not exist, it means that the packet is the first packet of a new flow, and a new record is created in Dataset B, and the five-tuple of the packet is written. The total number of bytes and the average number of bytes of the flow corresponding to the record are updated to the number of bytes of the packet. Elephant Flow Model B is a threshold model, which determines that the flow with a total byte number of not less than 6K bytes is an elephant flow;

[0076] 1.4) The proportion of elephant flows in dataset BB injected into dataset A is a i The ratio of mouse flow i Initialization: Set a according to the network situation i and b i , a i and b i The default value of is 60%;

[0077] 1.5) Initialization of action set: Assume an action set that defines the adjustment action of the ratio of elephant flow and mouse flow in dataset BB injected into dataset A after each detection cycle, such as Figure 4 As shown in Figure 2, each action is represented by a tuple (x, y), where the x element represents the action of the elephant flow and the y element represents the action of the mouse flow. Since the x and y elements can increase, remain unchanged, and decrease, the action set contains nine actions. The amount of increase or decrease of the x element after each detection cycle is set to δ a , the amount by which y increases or decreases is set to δ b , δ a and δ b The value of can be adjusted according to the network conditions, a and δ b The default value of is 0.1;

[0078] 1.6) Initialization of reward formula: Define a reward formula to evaluate the next detection cycle a i and b i What value should be chosen to optimize the goal? The reward formula is as follows:

[0079] reward i =(0.9-precision i )β i +(0.9-recall i )αi +(1-w i C i / C baseline )(α i +β i )

[0080] The reward in this formula i Represents the reward value, precision i and recall i They represent the precision and recall of the elephant flow model A estimated by the elephant flow model B, and β i and α i are the changes in the ratio of mouse flow and elephant flow injected into dataset A from dataset BB, and their sizes are δ b and δ a The absolute value of C i is the bandwidth occupied by the flow in the dataset BB, C i The calculation formula is as follows:

[0081]

[0082] Among them, U b represents the data set BB, f is a stream in the data set BB, P f Indicates the total number of bytes of the stream, T is the duration set by the detection cycle timer, C baseline It is the benchmark bandwidth, which can be pre-set according to the network conditions. Its default value is the bandwidth occupied by all packets received by the SDN controller in a test cycle under the default settings of the SDN network.

[0083] Step (7) in step 3): Calculate the reward value of each action in the action set, select the action with the largest reward value, and adjust a i and b i The size of Figure 5 As shown, the steps are as follows:

[0084] (7.1) Select an action from the action set. When all actions in the action set have been calculated, the loop ends.

[0085] (7.2) Calculate the reward value of the action according to the reward formula;

[0086] (7.3) Select the action with the highest reward value and update a i and b i If the action with the highest reward value is (increase, increase), then a i and b i The values ​​of are increased by δ on the basis of the original values. a and δ b; If the action with the highest reward value is (unchanged, unchanged), then a i and b i The value of remains unchanged; if the action with the highest reward value is (decrease, increase), then a i The value of is reduced by δ from the original value a , b i The values ​​of b .

[0087] In the step 1), the SDN switch needs to forward the first data packet of each new flow it receives to the SDN controller so that the SDN controller can create the forwarding features of the forwarding rules for it. The early detector of the elephant flow is integrated into the SDN controller, so that the early detector of the elephant flow can directly obtain real-time network flow information through the existing SDN controller, without deploying other network traffic samplers, reducing costs. The method of this example only uses the five-tuple and average packet byte number of the flow to detect the elephant flow. Since the information of the five-tuple can be obtained from the header information of the first packet of the flow, and the average packet byte number of the elephant flow does not change much during its entire life cycle, the method of this example can only use the early packets of the elephant flow to complete the detection, and the timeliness is high. The method of this example adjusts the intensity of the model update by estimating the precision and recall rate of the elephant flow model and the consumed network bandwidth in real time, while improving the detection accuracy, it avoids excessive consumption of network bandwidth.

[0088] When the step 1) is used in a non-SDN network, an additional network flow sampler is required to sample the network data flow in real time and store the sampling information in data set B so that the elephant flow early detector can obtain data set B to detect the elephant flow and update the elephant flow model A. The elephant flow early detector and the network flow sampler need to be deployed on a dedicated server.

Claims

1. A method for implementing an elephant flow early detector suitable for software defined networks, characterized in that: The steps include: 1) Initialization of the elephant flow early detector: The SDN network includes a centralized SDN controller and a large number of SDN switches and user terminals. The elephant flow early detector is integrated in the SDN controller. The parameters required for the operation of the elephant flow early detector are as follows: detection period, elephant flow model A, elephant flow model B, dataset A, dataset B, the ratio of elephant flow and mouse flow in dataset B injected into dataset A, action set and reward formula. The detection period defines how often elephant flow detection is performed. The initialization of the elephant flow early detector includes initializing the detection period timer, initializing the elephant flow model A, initializing the elephant flow model B, initializing the dataset A, initializing the dataset B, and the ratio of elephant flow injected into dataset A and dataset B. i The ratio of mouse flow i Initialization of , initialization of action set, and initialization of reward formula; 2) The elephant flow early detector continuously receives the packet_in request forwarded by the SDN switch to the SDN controller, and stores the flow information contained in the request into data set B; 3) When the detection cycle timer is triggered, the elephant flow early detector creates a new thread. The new thread first creates a new data set BB, then copies the data of data set B to data set BB, and clears all data in data set B. The original thread of the elephant flow early detector continues to store the flow information in the packet_in request received by the SDN controller to data set B. The new thread of the elephant flow early detector performs early detection of the elephant flow on the flow contained in data set BB. Therefore, data set BB only contains the information of the flow to be detected in one test cycle, and data set B continues to collect the flow information of the next detection cycle. The elephant flow early detector can use the original thread and the new thread to complete the detection of the elephant flow and the collection of flow information in parallel. The steps for the new thread to perform elephant flow detection are as follows: (1) Use elephant flow model A to detect elephant flows and mouse flows in dataset BB; (2) Use elephant flow model B to detect elephant flows and mouse flows in dataset BB; (3) Perform an OR operation on the detection result of the elephant flow model A and the detection result of the elephant flow model B, and output the detection result; (4) According to the detection results of the elephant flow model B, the flows in the data set BB are marked as elephant flows or mouse flows, and elephant flows with a ratio of ai and mouse flows with a ratio of bi are randomly selected and incorporated into the data set A; (5) Retrain the elephant flow model A on the dataset A using the random forest algorithm. The features used by the random forest algorithm include the average number of bytes and five-tuple of the flow. The five-tuple includes the source IP address, destination IP address, source port number, destination port number, and protocol number of the flow. (6) Estimate the precision and recall of the elephant flow model A. Since the flows contained in the data set BB are the real-time network flow information obtained by the elephant flow early detector through the SDN controller, it is unknown which flows are elephant flows in the data set BB. However, since the flows in the data set BB are detected by the elephant flow model B, and the elephant flow model B has a higher accuracy, the elephant flow early detector can use the detection results of the elephant flow model B to estimate the precision and recall of the elephant flow model A. The estimation formula is as follows: precision i =|UA ei ∩UB ei | / |UA ei | recall i =|UA ei ∩UB ei | / |UB ei | Among them, UA ei and UB ei are the sets of flows detected as elephant flows in dataset BB by elephant flow model A and elephant flow model B respectively. The symbol || indicates the number of flows contained in the dataset. (7) Calculate the reward value of each action in the action set, select the action with the largest reward value, and adjust a i and b i size; (8) This detection is completed, return to step 2).

2. The method for implementing an elephant flow early detector suitable for software defined network according to claim 1 is characterized in that: The steps of initializing the elephant flow early detector in step 1) are as follows: 1.1) Initialization of the detection cycle timer: The elephant flow early detector sets a detection cycle duration T through the detection cycle timer, that is, the elephant flow is detected once every T duration. The duration T can be adjusted and the default is 30 seconds; 1.2) Initialization of Dataset A and Elephant Flow Model A: Dataset A needs to be provided in advance. Dataset A contains multiple records. Each record is the information of a flow, which includes the five-tuple of the flow, the average number of bytes of all packets contained in the flow, and the label of the flow. The label value of the flow is 1 or 0. The label 1 indicates that the flow is an elephant flow, and the label 0 indicates that the flow is a mouse flow. In the offline state, the Elephant Flow Model A is initialized by running the random forest algorithm on the dataset A. 1.3) Initialization of Dataset B and Elephant Flow Model B: Dataset B is obtained by continuously receiving packet_in requests sent by the SDN switch and decoding the packet information contained therein. The method of obtaining the data set is as follows: after obtaining a packet, first take out the five-tuple of the packet and the total byte value contained therein, and then compare the five-tuple of each flow in Dataset B to determine whether the five-tuple already exists. If it does exist, it means that the packet is a packet of an existing flow, and the total byte count of the flow and the average byte count of the packet are updated; If it does not exist, it means that the packet is the first packet of the new flow. A new record is created in data set B, and the five-tuple of the packet is written. The total number of bytes of the flow and the average number of bytes of the packet corresponding to the record are updated to the number of bytes of the packet. The elephant flow model B is a threshold model. The model determines the flow with a total byte number of not less than 6K bytes as an elephant flow; 1.4) The proportion of elephant flows in dataset BB injected into dataset A is a i The ratio of mouse flow i Initialization: Set a according to the network situation i and b i , a i and b i The default value of is 60%; 1.5) Initialization of action set: Assume an action set that defines the adjustment action of the ratio of the elephant flow and the mouse flow in the dataset BB injected into the dataset A after each detection cycle. Each action is represented by a tuple (x, y), where the x element represents the action of the elephant flow and the y element represents the action of the mouse flow. Since the x and y elements can increase, remain unchanged, and decrease, the action set contains nine actions. The amount of increase or decrease of the x element after each detection cycle is set to δ a , the amount by which y increases or decreases is set to δ b , δ a and δ b The value of can be adjusted according to the network conditions, a and δ b The default value of is 0.1; 1.6) Initialization of reward formula: Define a reward formula to evaluate the next detection cycle a i and b i What value should be chosen to optimize the goal? The reward formula is as follows: reward i =(0.9-precision i )b i +(0.9-recall i )a i +(1-w i C i / C baseline )(a i +b i ) The reward in this formula i Represents the reward value, precision i and recall i They represent the precision and recall of the elephant flow model A estimated by the elephant flow model B, and β i and α i are the changes in the ratio of mouse flow and elephant flow injected into dataset A from dataset BB, and their sizes are δ b and δ a The absolute value of C i is the bandwidth occupied by the flow in the dataset BB, C i The calculation formula is as follows: Among them, U b represents the data set BB, f is a stream in the data set BB, P f Indicates the total number of bytes of the stream, T is the duration set by the detection cycle timer, C baseline It is the benchmark bandwidth, which can be pre-set according to the network conditions. Its default value is the bandwidth occupied by all packets received by the SDN controller in a test cycle under the default settings of the SDN network.

3. The method for implementing an elephant flow early detector suitable for software defined network according to claim 1, characterized in that: Step (7) in step 3): Calculate the reward value of each action in the action set, select the action with the largest reward value, and adjust a i and b i The size of the , steps are as follows: (7.1) Select an action from the action set. When all actions in the action set have been calculated, the loop ends. (7.2) Calculate the reward value of the action according to the reward formula; (7.3) Select the action with the highest reward value and update a i and b i If the action with the highest reward value is (increase, increase), then a i and b i The values ​​of are increased by δ on the basis of the original values. a and δ b ; If the action with the highest reward value is (unchanged, unchanged), then a i and b i The value of remains unchanged; if the action with the highest reward value is (decrease, increase), then a i The value of is reduced by δ from the original value a , b i The values ​​of are increased by δ on the basis of the original values. b .

4. The method for implementing an elephant flow early detector suitable for software defined networks according to claim 1, characterized in that: In the step 1), the SDN switch needs to forward the first data packet of each new flow it receives to the SDN controller so that the SDN controller can create forwarding features for the forwarding rules for it. Integrating the elephant flow early detector into the SDN controller enables the elephant flow early detector to directly obtain real-time network flow information through the existing SDN controller without deploying additional network traffic samplers.

5. The method for implementing an elephant flow early detector suitable for software defined network according to claim 1, characterized in that: When the step 1) is used in a non-SDN network, an additional network flow sampler is required to sample the network data flow in real time and store the sampling information in data set B so that the elephant flow early detector can obtain data set B to detect the elephant flow and update the elephant flow model A. The elephant flow early detector and the network flow sampler need to be deployed on a dedicated server.

Citation Information

Cited By

  • Method and system for optimizing large-scale network traffic

    CN120856654A