Low-overhead software defined network large flow real-time detection method and system

By determining the storage location of data packet information based on the flow table matching results in SDN, encoding flow size information and hash function processing, the problem of limited SDN flow table entries is solved, and low-overhead, high-precision large flow detection is achieved. , optimized flow measurement performance.

CN118631733APending Publication Date: 2024-09-10STATE GRID ANHUI ELECTRIC POWER CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410753543.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing SDN flow table entries are limited and cannot directly record the flow size information of all flows, which results in high storage and calculation overhead during traffic measurement. It also fails to effectively utilize the flow information recorded in wildcard flow table entries, resulting in low detection accuracy.

Method used

By obtaining data packets and corresponding flows, determining the storage location of statistical information based on the flow table matching results, encoding flow size information, discovering large flows that meet the characteristics in real time, and collecting and estimating information, using hash functions and gradients The descent method optimizes flow size estimation, fully utilizes flow table entries and on-chip storage resources, and reduces redundant measurements.

Benefits of technology

It achieves low-overhead high-precision real-time detection of SDN large flows, reduces storage and computing overhead, improves detection accuracy, and optimizes traffic measurement performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631733A
    Figure CN118631733A
Patent Text Reader

Abstract

The embodiment of the invention provides a low-overhead software defined network large flow real-time detection method and system, and belongs to the field of network flow measurement. The method comprises the following steps: acquiring a data packet needing to be forwarded and a corresponding flow; determining a storage position of statistical information according to a matching result of a flow corresponding to the forwarded data packet under a flow table; performing stream size information coding on the stored information of the data packet, and discovering a large stream meeting detection features in real time; performing information collection on the detected large stream meeting the features; and estimating the collected large flow. According to the method, low-overhead SDN large-flow high-precision real-time detection can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network flow measurement, and in particular to a low-overhead software-defined network large flow real-time detection method and system. Background Art

[0002] Software Defined Networking (SDN) separates the control plane and data plane in traditional routers and implements network control through a centralized control plane. In SDN, the flow table is a key component that controls the forwarding behavior of the data plane and is used to store forwarding rules and guide the forwarding of data packets. The control plane in SDN is composed of an SDN controller, which regularly calculates the optimal flow table rules for each node in the data plane based on the traffic information of the entire network to update or modify the existing forwarding rules of the node. In order to achieve optimization goals such as load balancing, the SDN controller understands the size information of each flow in the network when calculating new flow table rules, that is, how many data packets are contained in each network flow. Generally speaking, the flow size information can be obtained by querying the packet count field in the flow table entry of the data plane node. In order to match the network flow rate, the flow table is usually configured on the ternary content addressable memory (TCAM) of the data plane node. However, due to factors such as process and cost, the size of TCAM is extremely limited, generally only about 4K, which makes the flow table size that can be supported on each data plane node also limited, generally only about 1K, and it is impossible to allocate a flow table entry for each network flow separately. In other words, only some large flows can be individually assigned to a flow table entry and accurate counting of the flow size can be achieved, and the flow size information of the remaining flows needs to be obtained using other technologies.

[0003] In view of the problem that the SDN flow table is limited and cannot directly record the flow size of all flows, some studies have opened up a storage space specifically for the flow measurement function, using a compact data structure to record the flow size information or filter large flows in real time, so as to timely discover new large flows and provide a basis for the next round of flow table updates. However, the existing technology mainly solves how to use compact data structures, namely Sketch technology, to measure network traffic that is not recorded in flow table entries, and how to select appropriate measurement nodes for each flow to reduce redundant measurements. There are still problems such as high storage and computing overhead during measurement. In fact, the main purpose of flow measurement in SDN is to find some large flows that can be potentially allocated to flow table entries individually according to the limitation of flow table size. However, most existing studies do not distinguish whether the current flow is allocated to the flow table entry when measuring flow, and directly record all flows directly into the designed compact data structure, which not only wastes storage space, but also brings additional computing overhead to subsequent measurements. In addition, there are wildcard flow table entries in the SDN flow table, that is, one flow table entry can match multiple flows at the same time. The existing technology uses the traffic information recorded in the Sketch to detect large flows during measurement, and does not consider how to use the traffic information recorded in the wildcard flow table entry to further improve the accuracy of large flow detection, which makes the existing detection technology have problems such as high overhead and low accuracy. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a low-overhead software defined network large flow real-time detection method and system, which can achieve low-overhead SDN large flow high-precision real-time detection.

[0005] In order to achieve the above object, an embodiment of the present invention provides a low-overhead software-defined network large flow real-time detection method, comprising:

[0006] Get the data packets and corresponding flows that need to be forwarded;

[0007] Determine the storage location of the statistical information according to the matching result of the flow corresponding to the forwarded data packet under the flow table;

[0008] Encode the flow size information of the stored data packet information, and find the large flow that meets the detection characteristics in real time:

[0009] Collecting information on the detected large flow that meets the characteristics;

[0010] The collected large flow is estimated.

[0011] Optionally, determining the storage location of the statistical information according to the matching result of the flow corresponding to the forwarded data packet under the flow table includes:

[0012] Get the stream corresponding to the data packet currently to be forwarded;

[0013] Determining whether the flow corresponding to the data packet is managed by a flow table entry;

[0014] When the flow corresponding to the data packet is managed by a flow entry, matching the flow corresponding to the data packet with the corresponding flow entry;

[0015] Determine whether the matching flow table entry has a wildcard;

[0016] When there is no wildcard in the flow table entry, record and update statistical information about the matching flow in the counter field of the flow table entry;

[0017] When a wildcard exists in the flow table entry, encoding and recording is performed in two places: a counter field of the corresponding flow table entry and a data structure deployed in the on-chip storage;

[0018] When the flow corresponding to the data packet is not managed by the flow table entry, the data packet is encoded and recorded through a compact data structure deployed on the chip.

[0019] Optionally, encoding the stored information of the data packet with respect to the flow size information and discovering in real time a large flow satisfying the detection feature comprises:

[0020] To one OK Array of counters for the columns Initialize the value of the counter and initialize the variable r = -1, where r represents the row of the counter array;

[0021] Determine whether a new data packet has arrived;

[0022] When a new data packet arrives, r is updated according to formula (1):

[0023]

[0024] Determine the row where the counter recording the current data packet is located according to the updated value of the variable;

[0025] Taking the flow label of the data packet as input, the value of the counter is updated according to formula (2):

[0026]

[0027] in, is a hash function, which means mapping the data packet to any counter in the rth row of the counter array. is a hash function, Indicates whether the flow to which the data packet belongs is randomly selected and counted positively in the rth row of the array. f is the flow label of the data packet. Represents the value of the rth row of the counter array;

[0028] Determine whether the updated value of the counter has exceeded a preset flow label collection threshold;

[0029] When the updated value of the counter exceeds the preset flow label collection threshold, it indicates that the size of the flow of the corresponding data packet exceeds the preset flow label collection threshold, and the data packet is transmitted to the flow label collection part;

[0030] When the value of the counter obtained after updating does not exceed the preset flow label collection threshold, the counter is initialized and the process returns to the step of determining whether a new data packet has arrived.

[0031] Optionally, collecting information on the detected large flow that meets the characteristics includes:

[0032] Include one Bit register array All bit values ​​in are initialized to 0;

[0033] Acquire the data packet exceeding the preset flow label collection threshold;

[0034] According to the given Hash functions Obtain a mapping relationship with the flow label f ​​of the data packet bits in, Indicates mapping of data packets to arbitrary register arrays bits;

[0035] Judge the Are all bits set to 1?

[0036] In the When all bits are not all set to 1, the flow label corresponding to the data packet is transmitted to the off-chip storage for recording, and all bits with a mapping relationship with the flow label are set to 1.

[0037] Optionally, estimating the collected large flow includes:

[0038] Restore the shared relationship of each flow in the flow table and the hash mapping relationship in the compact data structure through the recorded flow labels stored off-chip;

[0039] The optimization goal of the gradient descent method is to minimize the error between the sum of the flow sizes in the presence of hash conflicts and the counter value in the Sketch / flow table entry to achieve high-precision estimation of the collected large flows.

[0040] Optionally, the restoring the sharing relationship of each flow in the flow table entry and the hash mapping relationship in the compact data structure by using the recorded flow labels stored off-chip includes:

[0041] Initialize the values ​​of all related variables to null values;

[0042] Traverse all the acquired flow label information to obtain a flow label set F′={f1,f2,f3,…};

[0043] Determine whether a flow label in the flow label set has a matching domain in the flow table entry;

[0044] When the flow label has a matching domain in the flow table entry, the information of the flow label is updated to the variable F. ε,j In which, the variable F ε,j Indicates that a wildcard flow entry ε is affected w,j All flows managed;

[0045] According to the given Hash functions Determine a compact data structure that maps to a stream In Counters

[0046] Update the flow label information into the corresponding variable middle.

[0047] Optionally, minimizing the error between the sum of the flow sizes in the hash conflict and the counter value in the Sketch / flow table entry as the optimization goal of the gradient descent method to achieve high-precision estimation of the collected large flows includes:

[0048] According to the obtained sharing relationship between the flow and the flow table entry and the hash mapping relationship between the flow and the counter of the compact data structure, the estimated value of the flow size is brought into the flow table entry and the counter of the compact data structure where the relationship exists, and the estimated record value of the counter is obtained, and the estimated record value is or in, is an estimate of the size of the resulting flow, F C,j,k Represents all flows mapped to the counter C[j][k] in Sketch;

[0049] According to formula (3), a model for minimizing the error between the counter estimated value and the actual recorded value is constructed:

[0050]

[0051] in, is the error between the counter estimate and the actual recorded value, is a hash function that determines the value of 1 or -1 based on the flow label, ε w Indicates the total wildcard flow table entries;

[0052] by As the loss function, the gradient of any flow is calculated according to formula (4):

[0053]

[0054] in, represents the gradient of the flow, F ε Indicates all flows managed by the total wildcard flow table entry, and f′ indicates Any flow label recorded in represents the estimated size of the flow corresponding to the flow label f′, Indicates that the flow corresponding to the flow label f′ is in the counter array The counting direction of the jth row, Indicates that the flow corresponding to the flow label f ​​is in the counter array The counter to which the jth row is mapped, Indicates that the flow corresponding to the flow label f ​​is in the counter array The counting direction of the jth row;

[0055] The estimated values ​​of the sizes of all flows are iteratively updated by the stochastic gradient descent method until the value of the loss function converges.

[0056] On the other hand, the present invention also provides a low-overhead software-defined network large flow real-time detection system, the system comprising:

[0057] The flow size information differentiation recording part is used to determine the storage location of the statistical information according to the matching result of the flow corresponding to the forwarded data packet under the flow table;

[0058] A real-time encoding part, used to encode the flow size information of the stored data packet information and to find the large flow that meets the detection characteristics in real time;

[0059] A flow label collection part, used for collecting information of the detected large flow meeting the characteristics;

[0060] The flow size estimation part is used to estimate the collected large flows.

[0061] Through the above technical scheme, the present invention provides a low-overhead software-defined network large flow real-time detection method and system, which obtains the data packet and the corresponding flow that need to be forwarded, and determines the storage location of the statistical information of the data packet according to the matching result of the forwarded data packet and the corresponding flow under the flow table. After storage, the information of the stored data packet can be encoded with flow size information, and large flows that meet the detection characteristics can be discovered in real time. After detecting the flow that meets the characteristics, information can be collected for the detected flow, and then the collected flow can be estimated. This method can achieve low-overhead SDN large flow high-precision real-time detection.

[0062] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0064] Figure 1 is a flow chart of a low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention;

[0065] Figure 2 It is a flow chart of flow size differential recording of a low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention;

[0066] Figure 3 A low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention encodes the flow size information of the stored data packet information and finds the large flow flow chart that meets the detection characteristics in real time;

[0067] Figure 4 It is a flowchart of collecting information on a large flow in a low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention;

[0068] Figure 5 It is a flowchart of estimating collected flows in a low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention;

[0069] Figure 6 It is a flowchart of a restoration relationship of a low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention;

[0070] Figure 7The present invention is a flowchart of estimating the size of a flow in a low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0071] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0072] Figure 1 The flowchart of a low-overhead software-defined network large flow real-time detection method according to an embodiment of the present invention. In the present invention, the process of the detection method may include:

[0073] In step S1, a data packet to be forwarded and a corresponding flow are obtained.

[0074] In step S2, the storage location of the statistical information is determined according to the matching result of the flow corresponding to the forwarded data packet under the flow table.

[0075] In step S3, the flow size information of the stored data packets is encoded, and large flows that meet the detection characteristics are discovered in real time.

[0076] In step S4, information is collected on the detected large flows that meet the characteristics.

[0077] In step S5, the collected large flows are estimated.

[0078] In the present invention, a method for real-time detection of large flows in a low-overhead software-defined network may include four parts: differential recording of flow size information, real-time encoding, flow label collection, and flow size estimation. The differential recording part of the flow size information can determine the storage location of the statistical information based on factors such as whether the flow corresponding to the forwarded data packet is managed by the flow table entry and whether there are multiple flows shared in the flow table entry, so as to make full use of various storage resources under the data plane node to obtain better flow measurement performance. The real-time encoding part can encode the flow size information based on the hash function according to the network data packet information transmitted to the module, and find the large flow that meets the detection characteristics in real time. The flow label collection part can collect information on the detected large flow that meets the characteristics, and avoid the repeated collection of the flow label information that has been transmitted to the off-chip storage through a Bloom filter. The flow size estimation part can convert the flow size estimation problem into an optimization problem based on the flow-counter mapping relationship to minimize the error between the estimated value and the actual value, and realize a high-precision detection and measurement mechanism for the collected network large flows.

[0079] In one embodiment of the present invention, Figure 2 As shown, the process of recording the flow size difference may include:

[0080] In step S6, the flow corresponding to the data packet currently to be forwarded is obtained.

[0081] In step S7, it is determined whether the flow corresponding to the data packet is managed by the flow table entry.

[0082] In step S8, when the flow corresponding to the data packet is managed by the flow entry, the flow corresponding to the data packet is matched with the corresponding flow entry.

[0083] In step S9, it is determined whether the matching flow table entry contains a wildcard.

[0084] In step S10, when there is no wildcard in the flow entry, the statistical information about the matching flow is updated in the counter field of the flow entry;

[0085] In step S11, when a wildcard exists in a flow table entry, encoding and recording is performed in both the counter field of the corresponding flow table entry and the data structure deployed in the on-chip storage.

[0086] In step S12, when the flow corresponding to the data packet is not managed by the flow table entry, the data packet is encoded and recorded through a compact data structure deployed in the on-chip storage.

[0087] In the present invention, when the storage location of the statistical information is determined according to the matching result of the flow corresponding to the forwarded data packet under the flow table, within the measurement period, for the data packet of the flow to be currently forwarded and recorded, when the flow corresponding to the data packet to be currently forwarded is obtained, the storage form of the corresponding flow statistical information is determined according to the matching result of the data packet at the TCAM. For the flow that is not managed by the flow table entry, the statistical information of the flow can be recorded by a compact data structure deployed on the chip. When the flow corresponding to the data packet is managed by the flow table entry, it can be determined whether the flow table entry matched by the flow corresponding to the data packet has a wildcard. When the flow table entry does not have a wildcard, it can be indicated that the flow can be a flow managed by a certain flow table entry alone, and therefore, the statistical information can be recorded only by matching the counter field where the flow table entry is located. When the flow table entry corresponding to the flow has a wildcard, it can be indicated that the flow can be a flow managed by a certain flow table entry together with other flows, and can be recorded simultaneously in the counter field of the corresponding flow table entry and the compact data structure deployed on the chip. The compact data structure can be composed of two parts: real-time encoding and flow label collection.

[0088] In one embodiment of the present invention, Figure 3 As shown, encoding the flow size information of the stored data packet information and finding the large flow process that meets the detection characteristics in real time may include:

[0089] In step S13, a OK Array of counters for the columns The value of the counter is initialized and the variable r is initialized to -1, where r represents the row of the counter array.

[0090] In step S14, it is determined whether a new data packet has arrived.

[0091] In step S15, when a new data packet arrives, r is updated according to formula (1):

[0092]

[0093] In step S16, the row where the counter recording the current data packet is located is determined according to the value of the updated variable.

[0094] In step S17, the flow label of the data packet is used as input and the value of the counter is updated according to formula (2):

[0095]

[0096] in, is a hash function, which means mapping the data packet to any counter in the rth row of the counter array. is a hash function, Indicates whether the flow to which the data packet belongs is randomly selected in the rth row of the array and counted positively. f is the flow label of the data packet. The flow label f ​​is used as the input of the hash function and is put into the brackets to indicate the value of the rth row of the counter array.

[0097] In step S18, it is determined whether the updated counter value has exceeded the preset flow label collection threshold.

[0098] In step S19, when the updated counter value exceeds the preset flow label collection threshold, it indicates that the size of the corresponding data packet flow exceeds the preset flow label collection threshold, and the data packet is transmitted to the flow label collection part.

[0099] In step S20, when the value of the counter obtained after updating does not exceed the preset flow label collection threshold, the process returns to the step of determining whether a new data packet has arrived.

[0100] In the present invention, at the beginning of each measurement cycle, the values ​​of all counters in the compact data structure are initialized to 0. Counter Array Each row of has a unique hash function that is uniformly distributed Map the packet to any counter in the i-th row of the array and a hash function Randomly select whether the flow to which the data packet belongs is counting forward in the i-th row of the array. When a data packet arrives, the variable can be updated according to formula (1), and the row where the counter recording the current number of data packets is located can be determined according to the value of the updated variable. This form of recording newly arrived data packets row by row can ensure that all data packets of the flow can be evenly distributed to each row of the counter array. Then, the flow label of the data packet can be used as input and the hash function can be used to calculate the counter. Calculate counter array The index of the counter of the current data packet is recorded in the rth row, and the value of the counter is updated by the hash function Determine, that is, update the value of the counter through formula (2). f is the flow label of the data packet. The flow label f ​​is used as the input of the hash function and is substituted into the brackets to obtain the value of the counter. After the value of the counter is updated, it can be determined whether the value of the updated counter has exceeded the preset flow label collection threshold. When the value of the updated counter exceeds the preset flow label collection threshold, it can be indicated that the size of the flow of the corresponding data packet exceeds the preset label collection threshold, and the corresponding data packet can be transmitted to the flow label collection part. When the value of the updated counter does not exceed the preset flow label collection threshold, it can be indicated that the corresponding flow is not a large flow, and it does not need to be transmitted to the flow label collection part, so it can return to step S14.

[0101] In one embodiment of the present invention, Figure 4 As shown, the process of collecting information about a large flow may include:

[0102] In step S21, a Bit register array All bits in the array are initialized to 0.

[0103] In step S22, data packets exceeding a preset flow label collection threshold are obtained.

[0104] In step S23, according to the given Hash functions Get the mapping relationship between the flow label f ​​and the data packet bits in, Indicates mapping of data packets to arbitrary register arrays bits.

[0105] In step S24, it is determined Whether all bits are set to 1.

[0106] In step S25, When all bits are not all set to 1, the flow label corresponding to the data packet is transmitted to the off-chip storage for recording, and all bits with a mapping relationship with the flow label are set to 1.

[0107] In the present invention, when collecting information about a flow that meets the characteristics, a Bit register array All bit values ​​in are initialized to 0, and then the data packets exceeding the preset flow label collection threshold can be obtained. After obtaining the data packet, there can be Uniformly distributed independent hash functions Mapping packets to arbitrary register arrays bits, and the stream corresponding to the data packet is brought into the hash function to obtain bits This can be used to determine whether the flow label corresponding to the data packet has been downloaded to the off-chip storage. A hash function randomly maps flow labels to register arrays on bits, and checks the mapped Whether all bits have been marked as 1 is used to determine whether the off-chip storage has recorded the flow label f. If all bits are 1, it can be indicated that the off-chip storage has recorded the flow label, so there is no need to transfer the current flow label to the off-chip storage for recording. If any bit is 0, it can be indicated that the off-chip storage has not recorded the flow label. At this time, the flow label needs to be transferred to the off-chip storage for recording, and all bits that have a mapping relationship with the flow label are marked as 1.

[0108] In one embodiment of the present invention, Figure 5 As shown, the process of estimating the collected flows may include:

[0109] In step S26, the shared relationship of each flow in the flow table entry and the hash mapping relationship in the compact data structure are restored through the recorded flow labels stored off-chip.

[0110] In step S27, minimizing the error between the sum of the flow sizes in the hash conflict and the counter value in the Sketch / flow table entry is used as the optimization goal of the gradient descent method to achieve high-precision estimation of the collected large flows.

[0111] In the present invention, when estimating the size of the flow, the sharing relationship of each flow in the flow table entry and the hash mapping relationship in the compact data structure can be restored through the recorded flow labels stored off-chip, and then the error between the sum of the flow sizes with hash conflicts and the counter value in the Sketch / flow table entry can be minimized as the optimization goal of the gradient descent method, thereby achieving high-precision measurement of large network flows.

[0112] In one embodiment of the present invention, Figure 6 As shown, the process of restoring a relationship may include:

[0113] In step S28, the values ​​of all relevant variables are initialized to null values.

[0114] In step S29, all acquired flow label information is traversed to obtain a flow label set F′={f1, f2, f3, ...}.

[0115] In step S30, it is determined whether a flow label in the flow label set has a matching domain in the flow table entry that can match it.

[0116] In step S31, when the flow label has a matching domain in the flow table entry, the flow label information is updated to the variable F ε,j In which, the variable F ε,j Indicates that a wildcard flow entry ε is affected w,j All flows managed.

[0117] In step S32, according to the given Hash functions Determine a compact data structure that maps to a stream In Counters

[0118] In step S33, the flow label information is updated into the corresponding variable middle.

[0119] In one embodiment of the present invention, the symbol F ε,j Indicates that a wildcard flow entry ε is affected w,j All flows managed can be represented by symbols Represents a counter mapped to Sketch All flows. The values ​​of all related variables can be initialized to null values. All flow label sets F′={f1,f2,f3,…} downloaded by the flow label collection module in the current measurement period can be traversed, and the above-mentioned related variables can be updated. For any flow label in the flow label set F′, first determine whether there is a matching domain in the flow table that can match the flow. If there is a corresponding flow table entry εw,j , that is, if there is a matching domain that can be matched, the flow label information f is updated into the variable F ε,j In order to complete the flow label restoration flow sharing relationship in the flow table entry. After that, you can use the encoding part of the d C A hash function H C,i (·) Determine the d of the record stream C counter and update the flow label information f into the corresponding variable In this way, the hash mapping relationship of the flow label restoration flow in the compact data structure can be completed. In this way, the recorded flow can be restored to the sharing relationship of each flow in the flow table entry and the hash mapping relationship in the compact data structure. It can be regarded as a collection variable, which can record which streams in all downloaded stream labels are mapped to the corresponding counters.

[0120] In one embodiment of the present invention, Figure 7 As shown, the process of estimating the size of a flow may include:

[0121] In step S34, according to the obtained sharing relationship between the flow and the flow table entry and the hash mapping relationship between the flow and the counter of the compact data structure, the estimated value of the flow size is brought into the flow table entry and the counter of the compact data structure where the relationship exists, and the estimated record value of the counter is obtained. The estimated record value is or in, is an estimate of the size of the resulting stream.

[0122] In step S35, a model for minimizing the error between the counter estimated value and the actual recorded value is constructed according to formula (3):

[0123]

[0124] in, is the error between the counter estimate and the actual recorded value, is a hash function that determines the value of 1 or -1 based on the flow label, ε w Indicates the total wildcard flow entries.

[0125] In step S36, the optimization target As the loss function, the gradient of any flow is calculated according to formula (4):

[0126]

[0127] in, represents the gradient of the flow, F ε Indicates all flows managed by the total wildcard flow table entry, and f′ indicates Any flow label recorded in represents the estimated size of the flow corresponding to the flow label f′, Indicates that the flow corresponding to the flow label f′ is in the counter array The counting direction of the jth row, Indicates that the flow corresponding to the flow label f ​​is in the counter array The counter to which the jth row is mapped, Indicates that the flow corresponding to the flow label f ​​is in the counter array The counting direction of the j-th row.

[0128] In step S37, the estimated values ​​of the sizes of all flows are iteratively updated by the stochastic gradient descent method until the value of the loss function converges.

[0129] In the present invention, the estimated value of the flow size can be brought into the flow table entry and the counter of the compact data structure where the relationship exists, according to the obtained sharing relationship between the flow and the flow table entry and the hash mapping relationship between the flow and the counter of the compact data structure, to obtain the estimated record value of the counter. After obtaining the estimated record value of the counter, an optimization model with the goal of minimizing the error between the estimated record value and the actual record value of the counter can be constructed, as described in formula (3). After the model is constructed, the optimization target can be used as the loss function, and its gradient with respect to any flow can be derived by formula (4), and then the estimated value of the flow size of all flows can be iteratively updated by the stochastic gradient descent method until the value of the loss function converges, thereby obtaining a high-precision estimate of the flow size. In order to avoid falling into the local optimum as much as possible during the parameter learning process, an adaptive learning rate algorithm (AdamOptimizer) can be used for optimization during each round of iterative update of the stochastic gradient descent.

[0130] On the other hand, the present invention also provides a low-overhead software-defined network large flow real-time detection system, the system includes: a flow size information differential recording part, a real-time encoding part, a flow label collection part, and a flow size estimation part. The flow size information differential recording part can be used to determine the storage location of statistical information according to the matching result of the flow corresponding to the forwarded data packet under the flow table. The real-time encoding part can be used to encode the flow size information of the stored data packet information and discover the large flow that meets the detection characteristics in real time. The flow label collection part can be used to collect information on the detected large flow that meets the characteristics. The flow size estimation part can be used to estimate the collected large flow.

[0131] Through the above technical scheme, the present invention provides a low-overhead software-defined network large flow real-time detection method and system, which obtains the data packet and the corresponding flow that need to be forwarded, and determines the storage location of the statistical information of the data packet according to the matching result of the forwarded data packet and the corresponding flow under the flow table. After storage, the information of the stored data packet can be encoded with flow size information, and large flows that meet the detection characteristics can be discovered in real time. After detecting the flow that meets the characteristics, information can be collected for the detected flow, and then the collected flow can be estimated. This method can achieve low-overhead SDN large flow high-precision real-time detection.

[0132] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0133] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0136] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0137] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0138] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0139] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0140] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A low-overhead method for real-time detection of large flows in software-defined networks. It is characterized in that include: Get the data packets and corresponding flows that need to be forwarded; Determine the storage location of the statistical information according to the matching result of the flow corresponding to the forwarded data packet under the flow table; Encode the flow size information of the stored data packet information, and find the large flow that meets the detection characteristics in real time: Collecting information on the detected large flow that meets the characteristics; The collected large flow is estimated.

2. The method according to claim 1, It is characterized in that The determining the storage location of the statistical information according to the matching result of the flow corresponding to the forwarded data packet under the flow table comprises: Get the stream corresponding to the data packet currently to be forwarded; Determining whether the flow corresponding to the data packet is managed by a flow table entry; When the flow corresponding to the data packet is managed by a flow entry, matching the flow corresponding to the data packet with the corresponding flow entry; Determine whether the matching flow table entry has a wildcard; When there is no wildcard in the flow table entry, record and update statistical information about the matching flow in the counter field of the flow table entry; When a wildcard exists in the flow table entry, encoding and recording is performed in two places: a counter field of the corresponding flow table entry and a data structure deployed in the on-chip storage; When the flow corresponding to the data packet is not managed by the flow table entry, the data packet is encoded and recorded through a compact data structure deployed on the chip.

3. The method according to claim 1, It is characterized in that The step of encoding the stored information of the data packet with respect to the flow size information and discovering in real time a large flow that meets the detection characteristics comprises: To one OK Array of counters for the columns Initialize the value of the counter and initialize the variable r = -1, where r represents the row of the counter array; Determine whether a new data packet has arrived; When a new data packet arrives, r is updated according to formula (1): Determine the row where the counter recording the current data packet is located according to the updated value of the variable; Taking the flow label of the data packet as input, the value of the counter is updated according to formula (2): in, is a hash function, which means mapping the data packet to any counter in the rth row of the counter array. is a hash function, Indicates whether the flow to which the data packet belongs is randomly selected and counted positively in the rth row of the array. f is the flow label of the data packet. Represents the value of the rth row of the counter array; Determine whether the updated value of the counter has exceeded a preset flow label collection threshold; When the updated value of the counter exceeds the preset flow label collection threshold, it indicates that the size of the flow of the corresponding data packet exceeds the preset flow label collection threshold, and the data packet is transmitted to the flow label collection part; When the value of the counter obtained after updating does not exceed the preset flow label collection threshold, the counter is initialized and the process returns to the step of determining whether a new data packet has arrived.

4. The method according to claim 3, It is characterized in that The collecting information of the detected large flow meeting the characteristics includes: Include one Bit register array All bit values ​​in are initialized to 0; Acquire the data packet exceeding the preset flow label collection threshold; According to the given Hash functions Obtain a mapping relationship with the flow label f ​​of the data packet bits in, Indicates mapping of data packets to arbitrary register arrays bits; Judge the Are all bits set to 1? In the When all bits are not all set to 1, the flow label corresponding to the data packet is transmitted to the off-chip storage for recording, and all bits with a mapping relationship with the flow label are set to 1.

5. The method according to claim 4, It is characterized in that The estimating the collected large flow includes: Restore the shared relationship of each flow in the flow table and the hash mapping relationship in the compact data structure through the recorded flow labels stored off-chip; The optimization goal of the gradient descent method is to minimize the error between the sum of the flow sizes in the presence of hash conflicts and the counter value in the Sketch / flow table entry to achieve high-precision estimation of the collected large flows.

6. The method according to claim 5, It is characterized in that The method of restoring the sharing relationship of each flow in the flow table entry and the hash mapping relationship in the compact data structure through the recorded flow labels stored off-chip includes: Initialize the values ​​of all related variables to null values; Traverse all the acquired flow label information to obtain the flow label set F′={f 1 ,f 2 ,f 3 ,…}; Determine whether a flow label in the flow label set has a matching domain in the flow table entry; When the flow label has a matching domain in the flow table entry, the information of the flow label is updated to the variable F. ε,j In which, the variable F ε,j Indicates that a wildcard flow entry ε is affected w,j All flows managed; According to the given Hash functions Determine a compact data structure that maps to a stream In Counters Update the flow label information into the corresponding variable middle.

7. The method according to claim 6, It is characterized in that The optimization goal of the gradient descent method is to minimize the error between the sum of the flow sizes in the hash conflict and the counter value in the Sketch / flow table entry to achieve high-precision estimation of the collected large flows, including: According to the obtained sharing relationship between the flow and the flow table entry and the hash mapping relationship between the flow and the counter of the compact data structure, the estimated value of the flow size is brought into the flow table entry and the counter of the compact data structure where the relationship exists, and the estimated record value of the counter is obtained, and the estimated record value is or in, is an estimate of the size of the resulting flow, F C,j, Represents all flows mapped to the counter C[j][k] in Sketch; According to formula (3), a model for minimizing the error between the counter estimated value and the actual recorded value is constructed: Formula (3); in, is the error between the counter estimate and the actual recorded value, is a hash function that determines the value of 1 or -1 based on the flow label, ε w Indicates the total wildcard flow table entries; by As the loss function, the gradient of any flow is calculated according to formula (4): Formula (4); in, represents the gradient of the flow, F ε Indicates all flows managed by the total wildcard flow table entry, and f′ indicates Any flow label recorded in represents the estimated size of the flow corresponding to the flow label f′, Indicates that the flow corresponding to the flow label f′ is in the counter array The counting direction of the jth row, Indicates that the flow corresponding to the flow label f ​​is in the counter array The counter to which the jth row is mapped, Indicates that the flow corresponding to the flow label f ​​is in the counter array The counting direction of the jth row; The estimated values ​​of the sizes of all flows are iteratively updated by the stochastic gradient descent method until the value of the loss function converges.

8. A low-overhead software-defined network large flow real-time detection system, It is characterized in that The system comprises: The flow size information differentiation recording part is used to determine the storage location of the statistical information according to the matching result of the flow corresponding to the forwarded data packet under the flow table; A real-time encoding part, used to encode the flow size information of the stored data packet information and to find the large flow that meets the detection characteristics in real time; A flow label collection part, used for collecting information of the detected large flow meeting the characteristics; The flow size estimation part is used to estimate the collected large flows.