A method and device for associating tunnel traffic
The cumulative transmission volume, noise reduction and optimized representation distance of the tunnel traffic are calculated through the auto-encoding network and the optimized representation generator, which solves the problem of low correlation accuracy caused by the large size of the ingress node flow set, and achieves higher correlation accuracy and traffic. correlation effect.
Patent Information
- Application Number
- CN202311587718.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-11-24
AI Technical Summary
In the existing technology, when the size of the ingress node flow set is large, the tunnel flow correlation accuracy is low, and it is difficult to effectively identify the ingress node flow related to the egress node flow.
Using an autoencoding network and an optimized representation generator, the target entry node flow corresponding to the exit node flow is screened out by calculating the cumulative transmission volume distance, noise reduction distance and optimized representation distance of the candidate entry node flow, thereby improving the correlation accuracy.
When the size of the entry node flow set is large, the association accuracy is improved through step-by-step filtering, the similarity of related node flows is enhanced, the similarity of non-related node flows is weakened, erroneous association decisions are avoided, and the effect of traffic association is improved.
Smart Images

Figure CN117768343B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network flow measurement and analysis, and in particular to a method and device for associating tunnel flow. Background Art
[0002] In the field of network security, more and more attackers are beginning to use tunneling technology to hide their attack behaviors. For network attackers, whether it is to make the attack payload bypass network security protection systems and security protection devices such as firewalls, or to maintain the communication between the victim host and the C&C server (Command and Control Server) after the invasion to send instructions to the victim host or steal information from the victim host, it is necessary to use tunnel encapsulation, encryption, obfuscation and other methods to "whitewash" abnormal network behaviors into normal network traffic for transmission. These tunnel nodes are often built on public network services such as CDN and public cloud. After tunnel encapsulation, the attacker's abnormal network behavior will be hidden in normal network services and transmitted with the network traffic generated by the same tunnel protocol, which is difficult to identify. Therefore, determining the communication relationship behind the tunnel and implementing tracking and tracing are of great significance to maintaining the security of cyberspace. Tunnel traffic generally takes encryption measures, and we cannot analyze the data source based on content; and hop-by-hop tracking requires analysts to have enough node information, which is also difficult to do in reality. Based on this, at present, only traffic correlation technology can realize traffic correlation under limited conditions, that is, matching a specific tunnel exit node flow to its related entry node flow (belonging to the same communication session). This process uses content-independent features and can be completed only at both ends of the tunnel.
[0003] The current traffic association methods are divided into two categories: one is based on statistical distance, which regards statistical distance as an indicator to measure the correlation between two flows. Common indicators include cosine distance, Pearson coefficient, mutual information, etc. Each data flow is abstracted as a vector describing its morphological characteristics (such as packet direction sequence, packet size sequence, packet interval sequence, etc.), and then the similarity is calculated using the calculation formula of the corresponding indicator. Another type of association method based on learning models inputs the joint vector representation of the inlet and outlet node flows into deep learning models such as convolutional neural networks with stronger nonlinear fitting capabilities. The model gives the correlation probability of the inlet node flow and the outlet node flow, that is, converting traffic association into a binary classification problem of "correlated" and "uncorrelated".
[0004] However, no matter which traffic association method is used, it is still plagued by the following problem: when taking a certain exit node flow as a reference and selecting the entry node flow related to it from the candidate entry node flow set, when the entry node flow set is large, it is inevitable that non-correlated entry node flows with a morphology similar to the target exit node flow will appear, affecting the association accuracy. Summary of the invention
[0005] The present invention provides a method and device for associating tunnel traffic, so as to solve the defect of low association accuracy in the prior art when the scale of inlet node flow set is large.
[0006] The present invention provides a method for associating tunnel traffic, comprising:
[0007] Acquire multiple ingress node flows and multiple egress node flows of a pre-established network tunnel; wherein the network tunnel is used by a client to access a corresponding network;
[0008] Determine the candidate entry node flow corresponding to each exit node flow, and calculate the cumulative transmission distance of multiple candidate entry node flows respectively;
[0009] Input each exit node flow into the autoencoder network, output the corresponding mapping entry node flow, and respectively calculate the denoising distance of the mapping entry node flow and multiple candidate entry node flows;
[0010] Inputting a plurality of candidate entry node flows associated with each exit node flow into an optimized representation generator, and outputting optimized representation distances between the plurality of candidate entry node flows respectively;
[0011] According to the cumulative transmission distance of the plurality of candidate inlet node flows, the noise reduction distance between the plurality of candidate inlet node flows and the mapping inlet node flow, and the optimized representation distance between the plurality of candidate inlet node flows, the candidate inlet node flows are screened to determine the target inlet node flow corresponding to each of the outlet node flows;
[0012] The autoencoder network is used to learn the mapping relationship between the associated sample inlet node flow and the sample outlet node flow, so as to restore the input outlet node flow to the corresponding mapping inlet node flow;
[0013] The optimized representation generator is used to learn the optimized representation of unrelated entry node flows to obtain the optimized representation distances between multiple unrelated candidate entry node flows.
[0014] According to a method for associating tunnel traffic provided by the present invention, a plurality of ingress node flows and a plurality of egress node flows of the network tunnel are obtained, comprising:
[0015] At each ingress node, the data packet size sequence and the corresponding data packet time sequence of the ingress node data flow are counted; a first time window is defined, and a cumulative calculation is performed based on the data packet size sequence corresponding to the data packet time sequence in each first time window to obtain the cumulative transmission volume of the ingress data flow in each first time window, and the cumulative transmission volume sequence of the ingress data flow in multiple first time windows is used as the ingress node flow;
[0016] At each egress node, the data packet size sequence and the corresponding data packet time series of the egress node data flow are counted; a second time window is defined, and a cumulative calculation is performed based on the data packet size sequence corresponding to the data packet time series in each second time window to obtain the cumulative transmission volume of the egress data flow in each second time window, and the cumulative transmission volume sequence of the ingress data flow in multiple second time windows is used as the egress node flow.
[0017] According to a tunnel traffic association method provided by the present invention, the cumulative transmission distances of multiple candidate ingress node flows are calculated respectively, including:
[0018] The Euclidean distance of the cumulative transmission volume of multiple ingress data flows in each candidate ingress node flow is calculated as the cumulative transmission volume distance of each candidate ingress node flow.
[0019] According to a method for associating tunnel traffic provided by the present invention, each egress node flow is input into a self-encoding network, and a corresponding mapped ingress node flow is output, including: inputting the cumulative transmission amount of multiple egress data flows of each egress node flow into the self-encoding network, and outputting the corresponding cumulative transmission amount of the mapped ingress data flow;
[0020] The denoising distances of the mapping entry node flow and multiple candidate entry node flows are calculated respectively, including: calculating the Euclidean distance between the cumulative transmission amounts of multiple mapping entry data flows of the mapping entry node flow and the cumulative transmission amounts of multiple entry data flows of each candidate entry node flow respectively, as the denoising distance between the mapping entry node flow and each of the candidate entry node flows.
[0021] According to a method for associating tunnel traffic provided by the present invention, the autoencoder network is trained in the following manner:
[0022] Inputting the associated sample inlet node flow and sample outlet node flow as training data into the autoencoder network, wherein the sample outlet node flow is used as the input with noise, and the sample inlet node flow is used as the optimization target to be fitted;
[0023] The optimal parameter set of the autoencoder network is determined by minimizing the squared error loss between the autoencoder network output and the optimization target to be fitted.
[0024] According to an association method for tunnel traffic provided by the present invention, the optimization representation generator is trained in the following manner:
[0025] Inputting a sample exit node flow, a sample entry node flow associated with the sample exit node flow, and a sample entry node flow not associated with the sample exit node flow as training data into an optimization representation generator, and training through a ternary loss function to obtain a trained optimization representation generator;
[0026] Among them, the ternary loss function is used to guide the optimized representation generator to generate the following optimized representation: increasing the optimized representation distance between the sample input node flow associated with the sample output node flow and the unassociated sample input node flow until the optimized representation distance exceeds a set threshold.
[0027] According to a method for associating tunnel traffic provided by the present invention, the candidate entry node flows are screened according to the cumulative transmission distance of the plurality of candidate entry node flows, the noise reduction distance between the plurality of candidate entry node flows and the mapped entry node flow, and the optimized representation distance between the plurality of candidate entry node flows, and the target entry node flow corresponding to each of the exit node flows is determined, including:
[0028] Sorting the plurality of candidate ingress node flows according to their cumulative transmission volume distances from small to large, and selecting a preset first proportion of candidate ingress node flows that are ranked top as first candidate ingress node flows;
[0029] sorting the noise reduction distances of the first candidate entry node flow and the mapping entry node flow from small to large, and selecting the first candidate entry node flow with a preset second proportion ranked at the top as the second candidate entry node flow;
[0030] The optimized representation distances of the second candidate inlet node flows are sorted, and the second candidate inlet node flow corresponding to the minimum optimized representation distance is used as the target inlet node flow corresponding to the outlet node flow.
[0031] The present invention also provides a correlation device for tunnel traffic, comprising:
[0032] A node flow acquisition module, used to acquire multiple ingress node flows and multiple egress node flows of a pre-established network tunnel; wherein the network tunnel is used by a client to access a corresponding network;
[0033] The cumulative transmission volume distance determination module is used to determine the candidate entry node flow corresponding to each exit node flow, and calculate the cumulative transmission volume distances of multiple candidate entry node flows respectively;
[0034] A noise reduction distance determination module is used to input each exit node flow into the autoencoder network, output the corresponding mapping entry node flow, and respectively calculate the noise reduction distances of the mapping entry node flow and multiple candidate entry node flows;
[0035] An optimized representation distance determination module, used for inputting a plurality of candidate entry node flows associated with each exit node flow into the optimized representation generator, and outputting optimized representation distances between the plurality of candidate entry node flows respectively;
[0036] An association module, configured to screen the candidate entry node flows according to the cumulative transmission volume distance of the plurality of candidate entry node flows, the noise reduction distance between the plurality of candidate entry node flows and the mapping entry node flow, and the optimized representation distance between the plurality of candidate entry node flows, and determine the target entry node flow corresponding to each of the exit node flows;
[0037] The autoencoder network is used to learn the mapping relationship between the associated sample inlet node flow and the sample outlet node flow, so as to restore the input outlet node flow to the corresponding mapping inlet node flow;
[0038] The optimized representation generator is used to learn the optimized representation of unrelated entry node flows to obtain the optimized representation distances between multiple unrelated candidate entry node flows.
[0039] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described methods for associating tunnel traffic are implemented.
[0040] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for associating tunnel traffic are implemented.
[0041] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned methods for associating tunnel traffic are implemented.
[0042] The method and device for associating tunnel traffic provided by the present invention calculate the cumulative transmission distance of the candidate entry node flow corresponding to each exit node flow, the noise reduction distance of the mapped entry node flow and multiple candidate entry node flows, and the optimized representation distance between multiple candidate entry node flows, and then screen step by step based on the three distances. After testing, it has been found that even when the scale of the entry node flow set is large, refined decision-making can be achieved and the association accuracy can be improved.
[0043] Secondly, the embodiment of the present invention defines the first time window and the second time window as units to respectively count the cumulative transmission volume of the ingress data flow and the cumulative transmission volume of the egress data flow. The granularity is independent of how many data packets are contained in the data flow and the order in which these data packets arrive. Therefore, in the case of packet loss, reassembly, retransmission, etc., its characterization of the cumulative transmission volume of the data flow is more stable than the characterization based on data packets.
[0044] Thirdly, the embodiments of the present invention mine the mapping relationship between associated entry node flows and exit node flows through an auto-encoding network, thereby enhancing the similarity of related node flows and ensuring the association effect in scenarios with complex network noise; by mining non-related node flows, the similarity of non-related node flows can be weakened, thus avoiding erroneous association decisions in the case of a large number of candidate entry node flow sets.
[0045] In addition, in the embodiment of the present invention, when the set of candidate inlet node flows is large, if the target inlet node flow associated with the outlet node flow is to be selected, there will be a large number of candidate inlet node flows that interfere with the association decision. By introducing the optimized representation generator, the optimized representation distance between multiple unrelated candidate inlet node flows can be obtained, thereby increasing the differences between unrelated candidate inlet node flows, which will further improve the effect of flow association. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 This is one of the flow charts of the method for associating tunnel traffic provided by an embodiment of the present invention;
[0048] Figure 2 is a schematic diagram of tunnel traffic provided by an embodiment of the present invention;
[0049] Figure 3 This is a second flow chart of a method for associating tunnel traffic provided by an embodiment of the present invention;
[0050] Figure 4 This is a third flow chart of a method for associating tunnel traffic provided by an embodiment of the present invention;
[0051] Figure 5 This is a fourth flow chart of a method for associating tunnel traffic provided by an embodiment of the present invention;
[0052] Figure 6It is a structural schematic diagram of an association device for tunnel traffic provided by an embodiment of the present invention;
[0053] Figure 7 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Combine the following Figure 1-Figure 6 A method and device for associating tunnel traffic according to an embodiment of the present invention are described.
[0056] The embodiment of the present invention discloses a method for associating tunnel traffic. Figure 1 , including the following steps 101 to 105:
[0057] 101. Acquire multiple ingress node flows and multiple egress node flows of a pre-established network tunnel; wherein the network tunnel is used for a client to access a corresponding network.
[0058] It should be explained that a network tunnel is a method of transmitting data between networks through an internetwork infrastructure. Through a network tunnel, a client can access network services. In this embodiment, a network tunnel can be simply understood as a path from an entry node to an exit node. Correspondingly, there is an entry node flow at the entry node and an exit node flow at the exit node.
[0059] In this embodiment, an automated script is used to generate and capture a network tunnel entry node flow for accessing a specific website on the client side, and a tunnel exit node flow is captured at a rear exit of the network tunnel.
[0060] In a network tunnel, there are multiple ingress node flows and egress node flows. It is possible that one ingress node flow is associated with multiple egress node flows, or it is possible that multiple ingress node flows are associated with one egress node flow. The purpose of the embodiment of the present invention is to find the most relevant one-to-one relationship among the many-to-one relationships.
[0061] Specifically, the embodiment of the present invention takes an example where an egress node flow is associated with multiple ingress node flows. When each egress node flow has multiple candidate ingress node flows with associated relationships, the ingress node flow with the most associated relationship is determined as the target ingress node flow, thereby determining that the ingress node flow and the egress node flow belong to the same communication session. Figure 2 , Figure 2 In the example, a network tunnel is formed between host A, host B, host C and host D, host E, and host F. For host F as an egress node, the ingress nodes associated with it include host A, host B, and host C, namely (A, F), (B, F), and (C, F). Through the method of this embodiment, the ingress node (host A) that is most associated with the egress node (host F) can be determined.
[0062] Of course, the method of this embodiment is also applicable to the case where one inlet node flow is associated with multiple outlet node flows. Since the processing steps are basically the same, this embodiment will not repeat the method of selecting the target outlet node flow most associated with the inlet node flow from multiple outlet node flows.
[0063] 102. Determine a candidate inlet node flow corresponding to each outlet node flow, and calculate the cumulative transmission distances of the plurality of candidate inlet node flows respectively.
[0064] Specifically, each candidate ingress node flow includes multiple cumulative ingress data flow transmission volumes counted in time series. For example, if the time series is in units of 5 seconds, the cumulative ingress data flow transmission volumes are [15, 30, 45, 60], respectively, where each number represents the cumulative data flow transmission volume corresponding to each time series.
[0065] In this embodiment, the Euclidean distance of the cumulative transmission amounts of multiple ingress data flows in each candidate ingress node flow is calculated as the cumulative transmission amount distance of each candidate ingress node flow.
[0066] Specifically, the Euclidean distance of the cumulative transmission volume of any two point inlet data flows can be calculated, and the sum of the Euclidean distances can be used as the cumulative transmission volume distance of the candidate inlet node flow. For example, if the candidate inlet node flow includes the cumulative transmission volume of 100 inlet data flows, the Euclidean distance of each two of the 100 cumulative transmission volumes of the inlet data flows is calculated, and finally summed to obtain the cumulative transmission volume distance of the candidate inlet node flow.
[0067] By calculating the cumulative transmission distance in step 102, it is possible to distinguish the part of the inlet data flow that is obviously not associated with each egress node flow. Such a difference is more obvious and easier to judge.
[0068] 103. Input each exit node flow into the autoencoder network, output the corresponding mapping entry node flow, and respectively calculate the denoising distances of the mapping entry node flow and a plurality of candidate entry node flows.
[0069] The autoencoder network is used to learn the mapping relationship between the associated inlet node flow and the outlet node flow to restore the input outlet node flow to the corresponding mapped inlet node flow. In this embodiment, the autoencoder network is composed of five layers of fully connected neurons, and the number of neurons in each layer is 100, 50, 25, 50, and 100 respectively.
[0070] Specifically, the autoencoder network in this embodiment is trained in the following manner: the associated sample inlet node flow and sample outlet node flow are input into the autoencoder network as training data, wherein the sample outlet node flow is used as the input with noise, and the sample inlet node flow is used as the optimization target to be fitted; the optimal parameter set of the autoencoder network is determined by minimizing the square difference loss between the output of the autoencoder network and the optimization target to be fitted.
[0071] In order to solve the problem that network noise affects the correlation effect, this method regards the sample inlet node flow as a noise-free traffic sample and the sample outlet node flow as a sample inlet node flow mixed with network noise. In the autoencoder network, the sample outlet node flow is used as input and the related sample inlet node flow is used as output, so that the autoencoder network can obtain the mapping relationship from the sample outlet node flow to the sample inlet node flow on the training data. After the autoencoder network is trained, the process of converting from input to output according to the learned mapping relationship is actually the process of denoising the outlet node flow and making it closer to the inlet node flow.
[0072] Specifically, the denoising process of the autoencoder network is shown in formula (1).
[0073] ω a =argmin θ ∑ (α,β)∈NO (α-De(En(β,θ),θ T )) 2 (1)
[0074] Among them, θ represents the parameter set of the model that minimizes the value of the entire formula. That is, when the distance value represented by the formula is optimized to the minimum, θ at this moment is the optimal parameter set ω a θ T It represents the transpose of the parameter matrix θ. Here, it means that the parameters of function De are obtained by transposing the parameters of function En, which means that the encoding and decoding process is symmetric.
[0075] After obtaining the associated sample entry node flow and sample exit node flow, a set of data stream sequence pairs in the form of (α, β) is formed. Use it to train the first layer of the autoencoder network Encoder A During training, the sample output node flow β is regarded as a noisy input, and the sample input node flow cumulative sequence α is used as the optimization target to be fitted. The optimal parameter set ω of the autoencoder network is determined by minimizing the squared difference loss between the encoding network output and the optimization target. a NO represents the set of data stream sequence pairs, and the function De / En represents the decoding / encoding process of the autoencoder network. A The output node flow can be restored to the form of the input node flow as much as possible, which plays a role in noise reduction. In the test phase, the output node flow can be input into the autoencoder network to obtain its denoised mapped input node flow, and then the similarity between the node flows is calculated, that is, the noise reduction distance is calculated.
[0076] The embodiment of the present invention mines the mapping relationship between associated entry node flows and exit node flows through an autoencoding network, thereby enhancing the similarity of related node flows and ensuring the association effect in scenarios with complex network noise; by mining non-related node flows, the similarity of non-related node flows can be weakened, thereby avoiding erroneous association decisions in the case of a large number of candidate entry node flow sets.
[0077] 104. Input multiple candidate entry node flows associated with each exit node flow into an optimized representation generator, and output optimized representation distances between the multiple candidate entry node flows respectively.
[0078] In this embodiment, not only the distance information between related flows is used, but also the optimized representation generator can be further used to identify the optimized representation distance information between unrelated flows to improve the effect of flow association.
[0079] Specifically, the optimized representation generator is used to learn the optimized representations of unrelated entry node flows to obtain the optimized representation distances between multiple unrelated candidate entry node flows.
[0080] Among them, the optimized representation generator is trained in the following way: the sample exit node flow, the sample entry node flow associated with the sample exit node flow, and the sample entry node flow not associated with the sample exit node flow are input into the optimized representation generator as training data, and trained through a ternary loss function to obtain a trained optimized representation generator.
[0081] For each sample exit node flow to be associated in the training set, its corresponding sample entry node flow is selected as the positive sample, and the sample entry node flow with the smallest Euclidean distance to the sample exit node flow is selected from other sequence pairs as the difficult negative sample. According to the ternary relationship, the optimized representation generator based on the convolutional neural network is optimized.
[0082] Under the condition of introducing irrelevant sample knowledge, the flow association problem can be solved with the help of the ternary loss function commonly used in contrastive learning methods, that is, firstly construct an optimized representation generator based on a convolutional neural network, and then use the ternary loss function shown in the following formula (2) to guide the optimized representation generator to generate the following optimized representation: increase the optimized representation distance between the sample inlet node flow associated with the sample outlet node flow and the unassociated sample inlet node flow until the optimized representation distance exceeds the set threshold α.
[0083] Loss=max(Dist(A,P)-Dist(A,N)+α,0) (2)
[0084] Among them, A represents the sample exit node flow, P represents the entry node flow associated with the sample exit node flow, and N represents the sample entry node flow not associated with the sample exit node flow. As a "difficult sample", setting a threshold α is responsible for controlling the specificity of the representation. After setting a suitable specificity value, the optimized representation generator will optimize the loss and try to pull the representations of P and N to a distance of α, making the pseudo-correlated flow samples more distinguishable.
[0085] Here, the threshold α is set to 200.
[0086] In the embodiment of the present invention, when the set of candidate inlet node flows is large, if a target inlet node flow associated with an outlet node flow is to be selected, there will be a large number of candidate inlet node flows that interfere with the association decision. By introducing an optimized representation generator, the optimized representation distance between multiple unrelated candidate inlet node flows can be obtained, thereby increasing the differences between unrelated candidate inlet node flows, which will further improve the effect of flow association.
[0087] 105. Screen the candidate entry node flows according to the cumulative transmission distance of the multiple candidate entry node flows, the noise reduction distance between the multiple candidate entry node flows and the mapped entry node flow, and the optimized representation distance between the multiple candidate entry node flows, and determine the target entry node flow corresponding to each of the exit node flows.
[0088] In this embodiment, the candidate ingress node flows are screened step by step in three dimensions: the cumulative transmission volume distance of the ingress node flow, the noise reduction distance between the associated egress node flow and the ingress node flow, and the optimized representation distance between the unrelated candidate ingress node flows, and the final relevant ingress node flows are determined step by step from simple to difficult.
[0089] The correlation method for tunnel traffic provided by the embodiment of the present invention calculates the cumulative transmission volume distance of the candidate ingress node flow corresponding to each egress node flow, the noise reduction distance between the mapped ingress node flow and multiple candidate ingress node flows, and the optimized representation distance between multiple candidate ingress node flows, and then screens step by step based on the three distances respectively. After testing, even when the scale of the ingress node flow set is large, refined decision-making can be achieved, and the correlation accuracy can be improved.
[0090] Further, referring to Figure 3 , step 101 includes:
[0091] 301. At each ingress node, count the data packet size sequence and the corresponding data packet time sequence of the ingress node data stream; define a first time window, and perform cumulative calculation according to the data packet size sequence corresponding to the data packet time sequence within each first time window to obtain the cumulative transmission volume of the ingress data stream within each first time window, and use the cumulative transmission volume sequence of the ingress data stream within multiple first time windows as the ingress node flow.
[0092] Specifically, assume that the packet size sequence of a certain ingress node data stream is pkt_size and the data packet time sequence is pkt_interval. Cumulative calculation is performed on the two sequences respectively, that is, each element value is added to its previous element value in sequence to obtain new sequences pkt_size′ and pkt_interval′. There is such a correlation between the two new sequences: at the moment pkt_interval′[i], this data stream has transmitted pkt_size′[i] bytes.
[0093] Then, define a fixed first time window win_size, and at the end of each first time window, count the total number of bytes that this data stream has transmitted. Assume that the data stream has transmitted f(x*win_size) bytes at the moment x*win_size, then f(x*win_size) = pkt_size′[i], pkt_interval′[i] ≤ x*win_size < pkt_interval′[i + 1], and so on until the cumulative transmission volume sequence reaches a predetermined length.
[0094] For example, if the number of bytes transmitted every 5 ms is 10, the resulting entry node flow can be [10, 20, 30, 40, 50…, 200].
[0095] Furthermore, after obtaining the cumulative transmission volume sequence of the inlet data flow, the cumulative transmission volume sequence of the inlet data flow is normalized, and each sequence value in the sequence is replaced by the percentage of the data transmission volume at a certain moment in the total volume, which can better fit the data volume burst during the transmission process. In general, the former focuses more on the absolute growth trend of the data volume change, while the latter focuses on the relative growth trend, that is, the change of the data growth rate.
[0096] 302. At each egress node, count the packet size sequence and the corresponding packet time sequence of the egress node data flow; define a second time window, and perform cumulative calculation based on the packet size sequence corresponding to the packet time sequence in each second time window to obtain the cumulative transmission volume of the egress data flow in each second time window, and use the cumulative transmission volume sequence of the ingress data flow in multiple second time windows as the egress node flow.
[0097] The specific method for obtaining the egress node flow is substantially the same as the specific method for obtaining the ingress node flow, and will not be described in detail in this embodiment.
[0098] Through steps 301 to 302, the embodiment of the present invention defines the first time window and the second time window as units to respectively count the cumulative transmission volume of the ingress data flow and the cumulative transmission volume of the egress data flow. The granularity is independent of how many data packets are contained in the data flow and the order in which these data packets arrive. Therefore, in the case of packet loss, reassembly, retransmission, etc., its characterization of the cumulative transmission volume of the data flow is more stable than the characterization based on data packets.
[0099] Further, see Figure 4 , step 103 comprises:
[0100] 401. Input the cumulative transmission amount of multiple export data flows of each export node flow into the autoencoding network, and output the corresponding cumulative transmission amount of the mapped import data flow.
[0101] In this embodiment, by converting the egress node flow into a mapped ingress node flow, it is actually a process of reducing the noise of the egress node flow to make it closer to the ingress node flow form.
[0102] 402. Calculate the Euclidean distance between the cumulative transmission amount of multiple mapping inlet data flows of the mapping inlet node flow and the cumulative transmission amount of multiple inlet data flows of each candidate inlet node flow respectively as the denoising distance between the mapping inlet node flow and each of the candidate inlet node flows.
[0103] The embodiment of the present invention mines the mapping relationship between associated entry node flows and exit node flows through an autoencoding network, thereby enhancing the similarity of related node flows and ensuring the association effect in scenarios with complex network noise; by mining non-related node flows, the similarity of non-related node flows can be weakened, thereby avoiding erroneous association decisions in the case of a large number of candidate entry node flow sets.
[0104] Specifically, see Figure 5 , step 105 comprises:
[0105] 501. Sort the plurality of candidate ingress node flows according to their cumulative transmission volume distances from small to large, and select a preset first proportion of candidate ingress node flows that are ranked high as first candidate ingress node flows.
[0106] 502. Sort the noise reduction distances of the first candidate entry node flow and the mapping entry node flow from small to large, and select the first candidate entry node flow with a preset second ratio that is ranked higher as the second candidate entry node flow.
[0107] 503. Sort the optimized representation distances of the second candidate inlet node flows, and use the second candidate inlet node flow corresponding to the minimum optimized representation distance as the target inlet node flow corresponding to the outlet node flow.
[0108] Among them, the first ratio and the second ratio can both be set to 50%. Of course, it should be noted that if the number of candidate entry node flows in the first ratio is not an integer, a candidate entry node flow smaller than the first ratio can be selected as the first candidate entry node flow; similarly, if the number of first candidate entry node flows in the second ratio is not an integer, a first candidate entry node flow smaller than the second ratio can be selected as the second candidate entry node flow.
[0109] In a specific example, for a specific exit node flow, there are 9 candidate entry node flows. Then, the 9 candidate entry node flows are sorted from small to large according to the cumulative transmission distance, and the top 4 of them are selected as the first candidate entry node flows; secondly, the denoising distances of the 4 first candidate entry node flows and the mapping entry node flow are sorted from small to large, and the top 2 first candidate entry node flows are selected as the second candidate entry node flows; then, the optimized representation distances of the 2 second candidate entry node flows are sorted, and the second candidate entry node flow corresponding to the smallest optimized representation distance is selected as the target entry node flow corresponding to the exit node flow.
[0110] Through experimental testing, the method of this embodiment has achieved higher association accuracy than the two existing methods of statistical distance and learning model on both publicly available and self-built traffic association data sets, and the effect of the model remains stable as the size of the candidate entry node flow set increases from 9 to 199. At the same time, the ablation experiment also shows that the three types of association levels designed by the method of this embodiment: cumulative transmission volume association, low-noise representation association, and optimized representation association all play a key role, and can further refine the decision and improve the association effect on the candidate set selected by the former.
[0111] In addition, parameter sensitivity analysis experiments show that the model is less affected by the value of the specificity degree α in the ternary loss function and exhibits good generalization, allowing analysts to flexibly determine this parameter in actual flow association scenarios without worrying about affecting the model effect.
[0112] The following is a description of the association device for tunnel traffic provided by the present invention. The association device for tunnel traffic described below and the association method for tunnel traffic described above can be referred to each other.
[0113] The embodiment of the present invention provides a device for associating tunnel traffic. Figure 6 ,include:
[0114] The node flow acquisition module 601 is used to acquire multiple ingress node flows and multiple egress node flows of a pre-established network tunnel; wherein the network tunnel is used by the client to access the corresponding network;
[0115] The cumulative transmission volume distance determination module 602 is used to determine the candidate entry node flow corresponding to each exit node flow, and calculate the cumulative transmission volume distances of multiple candidate entry node flows respectively;
[0116] A noise reduction distance determination module 603 is used to input each exit node flow into the autoencoder network, output the corresponding mapping entry node flow, and respectively calculate the noise reduction distances of the mapping entry node flow and multiple candidate entry node flows;
[0117] The optimized representation distance determination module 604 is used to input multiple candidate entry node flows associated with each exit node flow into the optimized representation generator, and output the optimized representation distances between the multiple candidate entry node flows respectively;
[0118] An association module 605 is used to screen the candidate entry node flows according to the cumulative transmission distance of the multiple candidate entry node flows, the noise reduction distance between the multiple candidate entry node flows and the mapped entry node flow, and the optimized representation distance between the multiple candidate entry node flows, and determine the target entry node flow corresponding to each of the exit node flows;
[0119] The autoencoder network is used to learn the mapping relationship between the associated sample inlet node flow and the sample outlet node flow, so as to restore the input outlet node flow to the corresponding mapping inlet node flow;
[0120] The optimized representation generator is used to learn the optimized representation of unrelated entry node flows to obtain the optimized representation distances between multiple unrelated candidate entry node flows.
[0121] Optionally, the node flow acquisition module 601 is specifically used to:
[0122] At each ingress node, the data packet size sequence and the corresponding data packet time sequence of the ingress node data flow are counted; a first time window is defined, and a cumulative calculation is performed based on the data packet size sequence corresponding to the data packet time sequence in each first time window to obtain the cumulative transmission volume of the ingress data flow in each first time window, and the cumulative transmission volume sequence of the ingress data flow in multiple first time windows is used as the ingress node flow;
[0123] At each egress node, the data packet size sequence and the corresponding data packet time series of the egress node data flow are counted; a second time window is defined, and a cumulative calculation is performed based on the data packet size sequence corresponding to the data packet time series in each second time window to obtain the cumulative transmission volume of the egress data flow in each second time window, and the cumulative transmission volume sequence of the ingress data flow in multiple second time windows is used as the egress node flow.
[0124] Optionally, the cumulative transmission distance determination module 602 is specifically configured to:
[0125] The Euclidean distance of the cumulative transmission volume of multiple ingress data flows in each candidate ingress node flow is calculated as the cumulative transmission volume distance of each candidate ingress node flow.
[0126] Optionally, the noise reduction distance determination module 603 is specifically configured to:
[0127] Input the cumulative transmission amount of multiple export data flows of each export node flow into the autoencoder network, and output the corresponding cumulative transmission amount of the mapped import data flow;
[0128] The Euclidean distances between the cumulative transmission amounts of multiple mapping inlet data flows of the mapping inlet node flow and the cumulative transmission amounts of multiple inlet data flows of each candidate inlet node flow are calculated respectively as the denoising distances between the mapping inlet node flow and each of the candidate inlet node flows.
[0129] Optionally, the association module 605 is specifically configured to:
[0130] Sorting the plurality of candidate ingress node flows according to their cumulative transmission volume distances from small to large, and selecting a preset first proportion of candidate ingress node flows that are ranked top as first candidate ingress node flows;
[0131] sorting the noise reduction distances of the first candidate entry node flow and the mapping entry node flow from small to large, and selecting the first candidate entry node flow with a preset second proportion ranked at the top as the second candidate entry node flow;
[0132] The optimized representation distances of the second candidate inlet node flows are sorted, and the second candidate inlet node flow corresponding to the minimum optimized representation distance is used as the target inlet node flow corresponding to the outlet node flow.
[0133] The association device for tunnel traffic provided by an embodiment of the present invention calculates the cumulative transmission distance of the candidate entry node flow corresponding to each exit node flow, the noise reduction distance of the mapped entry node flow and multiple candidate entry node flows, and the optimized representation distance between multiple candidate entry node flows, and then screens step by step based on the three distances. After testing, it has been found that even when the scale of the entry node flow set is large, refined decision-making can be achieved and the association accuracy can be improved.
[0134] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor (processor) 710, a communication interface (Communications Interface) 720, a memory (memory) 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call the logic instructions in the memory 730 to execute an association method for tunnel traffic, including: in the process of the client accessing the network, establishing a network tunnel, and obtaining multiple entry node flows and multiple exit node flows of the network tunnel; determining the candidate entry node flows corresponding to each exit node flow, and calculating the cumulative transmission distances of the multiple candidate entry node flows respectively; inputting each exit node flow into the autoencoding network, outputting the corresponding mapping entry node flow, and calculating the noise reduction distances of the mapping entry node flow and the multiple candidate entry node flows respectively; inputting the multiple candidate entry node flows associated with each exit node flow into the optimized representation generator, and outputting the optimized representation distances between the multiple candidate entry node flows respectively; screening the candidate entry node flows according to the cumulative transmission distances of the multiple candidate entry node flows, the noise reduction distances between the multiple candidate entry node flows and the mapping entry node flow, and the optimized representation distances between the multiple candidate entry node flows, and determining the target entry node flow corresponding to each of the exit node flows.
[0135] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0136] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the association method for tunnel traffic provided by the above methods, including: in the process of a client accessing a network, establishing a network tunnel, and obtaining multiple entry node flows and multiple exit node flows of the network tunnel; determining a candidate entry node flow corresponding to each exit node flow, and calculating the cumulative transmission volume distance of the multiple candidate entry node flows respectively; inputting each exit node flow into an autoencoding network, outputting the corresponding mapping entry node flow, and calculating the noise reduction distance of the mapping entry node flow and the multiple candidate entry node flows respectively; inputting the multiple candidate entry node flows associated with each exit node flow into an optimized representation generator, and outputting the optimized representation distance between the multiple candidate entry node flows respectively; according to the cumulative transmission volume distance of the multiple candidate entry node flows, the noise reduction distance between the multiple candidate entry node flows and the mapping entry node flow, and the optimized representation distance between the multiple candidate entry node flows, the candidate entry node flows are screened to determine the target entry node flow corresponding to each of the exit node flows.
[0137] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the association method for tunnel traffic provided by the above-mentioned methods, including: in the process of a client accessing a network, establishing a network tunnel, and obtaining multiple entry node flows and multiple exit node flows of the network tunnel; determining a candidate entry node flow corresponding to each exit node flow, and calculating the cumulative transmission volume distance of the multiple candidate entry node flows respectively; inputting each exit node flow into an autoencoding network, outputting the corresponding mapping entry node flow, and calculating the noise reduction distance of the mapping entry node flow and the multiple candidate entry node flows respectively; inputting the multiple candidate entry node flows associated with each exit node flow into an optimized representation generator, and outputting the optimized representation distances between the multiple candidate entry node flows respectively; screening the candidate entry node flows according to the cumulative transmission volume distances of the multiple candidate entry node flows, the noise reduction distances between the multiple candidate entry node flows and the mapping entry node flow, and the optimized representation distances between the multiple candidate entry node flows, and determining the target entry node flow corresponding to each of the exit node flows.
[0138] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for associating tunnel traffic, characterized in that: include: Acquire multiple ingress node flows and multiple egress node flows of a pre-established network tunnel; wherein the network tunnel is used by a client to access a corresponding network; Determine the candidate entry node flow corresponding to each exit node flow, and calculate the cumulative transmission distance of multiple candidate entry node flows respectively; Input each exit node flow into the autoencoder network, output the corresponding mapping entry node flow, and respectively calculate the denoising distance of the mapping entry node flow and multiple candidate entry node flows; Inputting a plurality of candidate entry node flows associated with each exit node flow into an optimized representation generator, and outputting optimized representation distances between the plurality of candidate entry node flows respectively; According to the cumulative transmission distance of the plurality of candidate inlet node flows, the noise reduction distance between the plurality of candidate inlet node flows and the mapping inlet node flow, and the optimized representation distance between the plurality of candidate inlet node flows, the candidate inlet node flows are screened to determine the target inlet node flow corresponding to each of the outlet node flows; The autoencoder network is used to learn the mapping relationship between the associated sample inlet node flow and the sample outlet node flow, so as to restore the input outlet node flow to the corresponding mapping inlet node flow; The optimized representation generator is used to learn the optimized representation of unrelated entry node flows to obtain the optimized representation distances between multiple unrelated candidate entry node flows.
2. The method for associating tunnel traffic according to claim 1, characterized in that: Acquiring a plurality of ingress node flows and a plurality of egress node flows of the network tunnel, including: At each ingress node, the data packet size sequence and the corresponding data packet time sequence of the ingress node data flow are counted; a first time window is defined, and a cumulative calculation is performed based on the data packet size sequence corresponding to the data packet time sequence in each first time window to obtain the cumulative transmission volume of the ingress data flow in each first time window, and the cumulative transmission volume sequence of the ingress data flow in multiple first time windows is used as the ingress node flow; At each egress node, the data packet size sequence and the corresponding data packet time series of the egress node data flow are counted; a second time window is defined, and a cumulative calculation is performed based on the data packet size sequence corresponding to the data packet time series in each second time window to obtain the cumulative transmission volume of the egress data flow in each second time window, and the cumulative transmission volume sequence of the ingress data flow in multiple second time windows is used as the egress node flow.
3. The method for associating tunnel traffic according to claim 2, characterized in that: Calculate the cumulative transmission distance of multiple candidate entry node flows respectively, including: The Euclidean distance of the cumulative transmission volume of multiple ingress data flows in each candidate ingress node flow is calculated as the cumulative transmission volume distance of each candidate ingress node flow.
4. The method for associating tunnel traffic according to claim 2, characterized in that: Input each exit node flow into the autoencoder network and output the corresponding mapping entry node flow, including: Input the cumulative transmission amount of multiple export data flows of each export node flow into the autoencoder network, and output the corresponding cumulative transmission amount of the mapped import data flow; Calculating the noise reduction distances of the mapping entry node flow and a plurality of candidate entry node flows respectively, including: The Euclidean distances between the cumulative transmission amounts of multiple mapping inlet data flows of the mapping inlet node flow and the cumulative transmission amounts of multiple inlet data flows of each candidate inlet node flow are calculated respectively as the denoising distances between the mapping inlet node flow and each of the candidate inlet node flows.
5. The method for associating tunnel traffic according to claim 1, characterized in that: The autoencoder network is trained in the following way: Inputting the associated sample inlet node flow and sample outlet node flow as training data into the autoencoder network, wherein the sample outlet node flow is used as the input with noise, and the sample inlet node flow is used as the optimization target to be fitted; The optimal parameter set of the autoencoder network is determined by minimizing the squared error loss between the autoencoder network output and the optimization target to be fitted.
6. The method for associating tunnel traffic according to claim 1, characterized in that: The optimized representation generator is trained in the following way: Inputting a sample exit node flow, a sample entry node flow associated with the sample exit node flow, and a sample entry node flow not associated with the sample exit node flow as training data into an optimization representation generator, and training through a ternary loss function to obtain a trained optimization representation generator; Among them, the ternary loss function is used to guide the optimized representation generator to generate the following optimized representation: increasing the optimized representation distance between the sample input node flow associated with the sample output node flow and the unassociated sample input node flow until the optimized representation distance exceeds a set threshold.
7. The method for associating tunnel traffic according to claim 1, characterized in that: According to the cumulative transmission distances of the plurality of candidate inlet node flows, the noise reduction distances between the plurality of candidate inlet node flows and the mapping inlet node flow, and the optimized representation distances between the plurality of candidate inlet node flows, the candidate inlet node flows are screened to determine the target inlet node flow corresponding to each of the inlet node flows, including: Sorting the plurality of candidate ingress node flows according to their cumulative transmission volume distances from small to large, and selecting a preset first proportion of candidate ingress node flows that are ranked top as first candidate ingress node flows; sorting the noise reduction distances of the first candidate entry node flow and the mapping entry node flow from small to large, and selecting the first candidate entry node flow with a preset second proportion ranked at the top as the second candidate entry node flow; The optimized representation distances of the second candidate inlet node flows are sorted, and the second candidate inlet node flow corresponding to the minimum optimized representation distance is used as the target inlet node flow corresponding to the outlet node flow.
8. A device for associating tunnel traffic, characterized in that: include: A node flow acquisition module, used to acquire multiple ingress node flows and multiple egress node flows of a pre-established network tunnel, wherein the network tunnel is used for a client to access a corresponding network; The cumulative transmission volume distance determination module is used to determine the candidate entry node flow corresponding to each exit node flow, and calculate the cumulative transmission volume distances of multiple candidate entry node flows respectively; A noise reduction distance determination module is used to input each exit node flow into the autoencoder network, output the corresponding mapping entry node flow, and respectively calculate the noise reduction distances of the mapping entry node flow and multiple candidate entry node flows; An optimized representation distance determination module, used for inputting a plurality of candidate entry node flows associated with each exit node flow into the optimized representation generator, and outputting optimized representation distances between the plurality of candidate entry node flows respectively; An association module, configured to screen the candidate entry node flows according to the cumulative transmission volume distance of the plurality of candidate entry node flows, the noise reduction distance between the plurality of candidate entry node flows and the mapping entry node flow, and the optimized representation distance between the plurality of candidate entry node flows, and determine the target entry node flow corresponding to each of the exit node flows; The autoencoder network is used to learn the mapping relationship between the associated sample inlet node flow and the sample outlet node flow, so as to restore the input outlet node flow to the corresponding mapping inlet node flow; The optimized representation generator is used to learn the optimized representation of unrelated entry node flows to obtain the optimized representation distances between multiple unrelated candidate entry node flows.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for associating tunnel traffic as described in any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for associating tunnel traffic as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data denoising based on machine learning
CN113412491A
Tunnel network anomaly identification method based on cloud edge collaboration
CN116055413A
Data acquisition method and device based on DPI platform
CN116708219A
Technologies for annotating process and user information for network flows
US20160357587A1
