Network measurement method and device
By introducing measurement level mechanisms and corresponding measurement strategies in the transmission network, the problem of difficulty in measuring data flows according to actual needs in the existing technology is solved, and flexible and efficient data flow measurement is achieved, supporting functions such as abnormal detection, load balancing and traffic engineering.
Patent Information
- Application Number
- CN202311587840.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
The prior art is difficult to measure data flows in the transmission network according to actual needs, and it is impossible to effectively realize abnormal detection, load balancing and traffic engineering.
By introducing a measurement level mechanism into the transmission network, the corresponding measurement level is determined according to the different needs of the data flow, and the corresponding measurement strategy is determined based on the measurement level. For example, high-precision measurement strategies are used for data streams that require precise measurements, while low-precision measurement strategies are used for data streams that do not require high-precision measurements.
It realizes measurement of data flows according to actual needs, improves measurement flexibility and efficiency, and can effectively support functions such as abnormal detection, load balancing and flow engineering.
Smart Images

Figure CN120034472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications and in particular to a network measurement method and device. Background Art
[0002] At present, in the transmission network, the purpose of anomaly detection, load balancing, and traffic engineering can be achieved by measuring the data flow. For example, in the actual application process, the transmission node on the transmission path of the data flow can measure the data flow, so as to obtain the measurement results such as the flow size, the interval time of the arrival of the data packet, and the packet loss rate. With these measurement results, the purpose of anomaly detection, load balancing, and traffic engineering can be achieved.
[0003] Among them, how to measure the data flow in the transmission network according to actual needs is a problem that needs to be solved at present. Summary of the invention
[0004] The present application provides a network measurement method and device for measuring data flows in a transmission network according to actual needs.
[0005] In a first aspect, a network measurement method is provided, the method being applied to a first node in a transmission network, the method comprising: the first node determining a first measurement level corresponding to a first data flow. The first data flow is a data flow passing through the first node. The first node determines a measurement strategy according to the first measurement level.
[0006] In the above method, when measuring a data stream in a transmission network (taking the first data stream as an example), since the measurement strategy is determined according to the first measurement level (i.e., the measurement level corresponding to the first data stream), when measuring different data streams, different measurement strategies can be adopted for data streams of different measurement levels according to the measurement levels corresponding to the data streams. For example, a measurement strategy with higher accuracy is adopted for data streams of some measurement levels, and a measurement strategy with lower accuracy is adopted for data streams of other measurement levels. In this way, the purpose of measuring data streams according to actual needs can be achieved.
[0007] In one implementation, the measurement strategy includes: when the first measurement level is the first preset level among multiple preset levels, recording the measurement result of the first data stream. Different measurement levels among the multiple preset levels correspond to different measurement strategies. Alternatively, the measurement strategy includes: when the first measurement level is a level other than the first preset level among multiple preset levels, determining the measurement node corresponding to the first data stream from the transmission path of the first data stream. When the measurement node corresponding to the first data stream is the first node, recording the measurement result of the first data stream. The transmission path includes at least one transmission node, and the measurement node is included in the at least one transmission node.
[0008] In the above implementation, considering that in the actual application process, for different data streams in the same transmission network, for some data streams, it is necessary to obtain the full network task of the data stream (for example, the packet loss rate of each hop, etc.), so it is necessary to measure the data stream at each transmission node on the transmission path; while for other data streams, it is only necessary to obtain the single-point task of the data stream (for example, the flow size, the packet arrival interval time, etc.), so it is only necessary to select some transmission nodes in the transmission path to measure the data stream. Based on the above considerations, the first preset level is set in the above implementation among multiple preset levels. In this way, on the one hand, when it is necessary for each transmission node on the transmission path to measure the first data stream, the measurement level of the first data stream is set to the above first preset level, so that the transmission node (i.e., the first node) in the transmission network can directly record the measurement result of the first data stream without determining whether the node is a measurement node after determining that the first data stream is the first preset level. On the other hand, when it is only necessary to select some transmission nodes in the transmission path to measure the first data stream, the measurement level of the first data stream can be set to a level other than the first preset level. Therefore, after determining that the first data flow is not the first preset level, the first node first determines the measurement node corresponding to the first data flow, and then records the measurement result of the first data flow after determining that the measurement node corresponding to the first data flow is the current node. In this way, the purpose of measuring the data flow according to actual needs can be achieved.
[0009] In one implementation, when the first measurement level is the first preset level among multiple preset levels, recording the measurement result of the first data flow includes: when the first measurement level is the first preset level among multiple preset levels, using the flow table of the first data flow to record the measurement result of the first data flow.
[0010] In the above implementation, for the first data flow of the first preset level, a flow table is used to record the measurement result. Since the flow table and the data flow are in a one-to-one correspondence, the measurement result of the first data flow can be accurately recorded on the first node, and the problem of the measurement result affecting the measurement result of other data flows can be avoided.
[0011] In one implementation, when the measurement node corresponding to the first data stream is the first node, recording the measurement result of the first data stream includes: when the measurement node corresponding to the first data stream is the first node and the first measurement level is the second preset level among multiple preset levels, using the flow table of the first data stream to record the measurement result of the first data stream. The second preset level is a level other than the first preset level among the multiple preset levels. Alternatively, when the measurement node corresponding to the first data stream is the first node and the first measurement level is the third preset level among the multiple preset levels, using the sketching technology to measure the first data stream. The third preset level is a level other than the first preset level and the second preset level among the multiple preset levels.
[0012] In the above implementation, considering that for data streams that need to select a transmission node in the transmission path for measurement, on the one hand, for data streams that need to be measured relatively accurately, the flow table can be used on the measurement node corresponding to the data stream to record the measurement result of the data stream; on the other hand, for data streams that need to be measured relatively roughly, the sketch technology can be used to perform approximate measurement on the first data stream, so as to achieve the purpose of measuring the data stream according to actual needs. Therefore, in the above implementation, on the one hand, when the measurement node corresponding to the first data stream is the current node and the first measurement level of the first data stream is the second preset level among multiple preset levels, the flow table is used to record the measurement result of the first data stream; on the other hand, when the measurement node corresponding to the first data stream is the current node and the first measurement level of the first data stream is the third preset level among multiple preset levels, the sketch technology is used to perform approximate measurement on the first data stream, so as to achieve the purpose of measuring the data stream according to actual needs.
[0013] In one implementation, when the first measurement level is a level other than the first preset level among multiple preset levels, determining a measurement node corresponding to the first data stream from a transmission path of the first data stream includes: when the first measurement level is a level other than the first preset level among multiple preset levels, obtaining a consistent hash algorithm corresponding to the transmission path. The first node determines the measurement node corresponding to the first data stream according to the consistent hash algorithm.
[0014] In the above implementation, a consistent hash algorithm is constructed for the transmission path so that the first node can use the consistent hash algorithm to determine the measurement node corresponding to the first data stream. Since the consistent hash algorithm adopts a virtual node mechanism, the measurement task can be more reasonably allocated to each transmission node on the transmission path during the process of the first node using the consistent hash algorithm to determine the measurement node corresponding to the data stream, thereby achieving load balancing and avoiding data skew problems.
[0015] In one implementation, the virtual node mechanism of the above-mentioned consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path. The number of virtual nodes corresponding to one transmission node is positively correlated with the memory size of the transmission node. The consistent hashing algorithm is used to determine the virtual node corresponding to the data flow and determine the transmission node corresponding to the virtual node as the measurement node of the data flow.
[0016] In the above implementation, the number of virtual nodes corresponding to a transmission node is positively correlated with the memory size of the transmission node in the virtual node mechanism of the consistent hashing algorithm. In this way, the probability of a transmission node with a large memory being selected as a measurement node is high, and the probability of a transmission node with a small memory being selected as a measurement node is low, thereby achieving load balancing among the transmission nodes. In addition, through the above implementation, when the memory of the transmission node on the transmission path changes, since "the number of virtual nodes corresponding to the transmission node is positively correlated with the memory size of the transmission node" in the virtual node mechanism of the consistent hashing algorithm, the number of virtual nodes corresponding to the transmission node can be dynamically adjusted according to the memory changes of the transmission node, thereby dynamically adjusting the measurement tasks undertaken by each transmission node.
[0017] In one implementation, there are multiple branch paths in the transmission path, and the virtual node mechanism of the consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node. The target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0018] In the above implementation, considering that when there are multiple branch paths on the transmission path, the branch path part can be first regarded as a whole (i.e., the target transmission node), so that a virtual node can be allocated to the target transmission node in the virtual node mechanism of the consistent hashing algorithm. In this way, when the first node determines the measurement node of the first data stream using the consistent hashing algorithm, it can determine that the measurement node is a transmission node on the branch path in the transmission path according to the above consistent hashing algorithm, or determine that the measurement node is a transmission node outside the branch path in the transmission path.
[0019] In one implementation, determining the measurement node corresponding to the first data stream according to a consistent hashing algorithm includes: determining the transmission node to which the first summary data is mapped according to the first summary data and the consistent hashing algorithm. The first summary data is summary data obtained by performing a hash operation on an identifier of the first data stream. When the first summary data is mapped to a target transmission node, determining whether the measurement node corresponding to the first data stream is the first node according to a preset strategy. The preset strategy includes: selecting a preset proportion of a portion of the data stream in the data stream passing through the transmission path, and determining the measurement node corresponding to the portion of the data stream as the first node.
[0020] In the above implementation, it is considered that on multiple branch paths of the transmission path, the transmission nodes of different branch paths can use different measurement resources (for example, memory resources, etc.) for network measurement. Therefore, when the measurement node of the data stream is determined by the above consistent hashing algorithm, if the first summary data is determined to be mapped to the target transmission node based on the first summary data, the transmission node on the branch path (i.e., the first node) can select part of the data stream from the passing data stream according to a preset ratio for measurement (i.e., the measurement node corresponding to the part of the data stream is determined as the first node). In this way, the measurement overhead of the first node can be saved.
[0021] In addition, for another part of the data stream that is not measured on the first node, the first node can mark it in the data packet of the data stream, so that the downstream node on the transmission path can measure the data stream after receiving the data packet carrying the mark. Alternatively, the other part of the data stream that is not measured on the first node can also be processed in other ways, and this application may not limit this.
[0022] In one implementation, the first node determines a first measurement level corresponding to a first data flow, including: the first node determines the first measurement level corresponding to the first data flow from a plurality of preset levels according to a flow size of the first data flow.
[0023] In the above implementation, the first measurement level corresponding to the first data flow is determined according to the flow rate of the first data flow. In this way, data flows with large flows and data flows with small flows can be measured according to different measurement strategies, thereby measuring data flows in the transmission network according to actual needs.
[0024] In one implementation, the first node determines a first measurement level corresponding to a first data stream, including: the first node determines the first measurement level corresponding to the first data stream from a plurality of preset levels according to a user operation.
[0025] In the above implementation, the first measurement level corresponding to the first data stream is determined according to user operations. Thus, the user can set the first data stream to different measurement levels through different operations as needed, thereby measuring the first data stream according to the corresponding measurement strategy.
[0026] In one implementation, the transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
[0027] In a second aspect, a network measurement method is provided, which is applied to a controller in a transmission network, the method comprising: the controller determines a first measurement level corresponding to a first data stream from a plurality of preset levels. The controller sends configuration information to a first node in the transmission network, the configuration information including the first measurement level corresponding to the first data stream, the configuration information being used to indicate that a measurement strategy is determined according to the first measurement level; wherein the first node is a transmission node in the transmission network through which the first data stream passes.
[0028] For the specific content of the measurement strategy, reference may be made to the corresponding description of the measurement strategy corresponding to the first measurement level in the first aspect above, and will not be elaborated herein.
[0029] In one implementation, the first node determines a first measurement level corresponding to the first data flow from a plurality of preset levels, including: the first node determines the first measurement level corresponding to the first data flow from a plurality of preset levels according to a flow size of the first data flow.
[0030] In one implementation, the first node determines a first measurement level corresponding to the first data stream from a plurality of preset levels, including: the first node determines the first measurement level corresponding to the first data stream from a plurality of preset levels according to a user operation.
[0031] In one implementation, the configuration information also includes: a consistent hashing algorithm corresponding to the transmission path of the first data stream in the transmission network; the virtual node mechanism of the consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path; and the consistent hashing algorithm is used to determine the measurement node corresponding to the first data stream.
[0032] In one implementation, in the consistent hashing algorithm, the number of virtual nodes corresponding to a transmission node is positively correlated with the memory size of the transmission node.
[0033] In one implementation, when there are multiple branch paths in the transmission path, the virtual node mechanism of the consistent hashing algorithm includes a virtual node corresponding to the target transmission node; the target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0034] In one implementation, the transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
[0035] In a third aspect, a data processing device is provided, which is applied to a first node in a transmission network, and the data processing device includes: a level determination unit, which is used to determine a first measurement level corresponding to a first data flow; the first data flow is a data flow passing through the first node. A strategy determination unit is used to determine a measurement strategy according to the first measurement level.
[0036] In one implementation, the measurement strategy includes: when the first measurement level is the first preset level among multiple preset levels, recording the measurement result of the first data stream. Different measurement levels among the multiple preset levels correspond to different measurement strategies. Alternatively, the measurement strategy includes: when the first measurement level is a level other than the first preset level among multiple preset levels, determining the measurement node corresponding to the first data stream from the transmission path of the first data stream. When the measurement node corresponding to the first data stream is the first node, recording the measurement result of the first data stream. The transmission path includes at least one transmission node, and the measurement node is included in the at least one transmission node.
[0037] In one implementation, when the first measurement level is the first preset level among multiple preset levels, recording the measurement result of the first data flow includes: when the first measurement level is the first preset level among multiple preset levels, using the flow table of the first data flow to record the measurement result of the first data flow.
[0038] In one implementation, when the measurement node corresponding to the first data stream is the first node, recording the measurement result of the first data stream includes: when the measurement node corresponding to the first data stream is the first node and the first measurement level is the second preset level among multiple preset levels, using the flow table of the first data stream to record the measurement result of the first data stream. The second preset level is a level other than the first preset level among the multiple preset levels. Alternatively, when the measurement node corresponding to the first data stream is the first node and the first measurement level is the third preset level among the multiple preset levels, using the sketching technology to measure the first data stream. The third preset level is a level other than the first preset level and the second preset level among the multiple preset levels.
[0039] In one implementation, when the first measurement level is a level other than the first preset level among multiple preset levels, determining a measurement node corresponding to the first data stream from a transmission path of the first data stream includes: when the first measurement level is a level other than the first preset level among multiple preset levels, obtaining a consistent hash algorithm corresponding to the transmission path. The first node determines the measurement node corresponding to the first data stream according to the consistent hash algorithm.
[0040] In one implementation, the virtual node mechanism of the above-mentioned consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path. The number of virtual nodes corresponding to one transmission node is positively correlated with the memory size of the transmission node. The consistent hashing algorithm is used to determine the virtual node corresponding to the data flow and determine the transmission node corresponding to the virtual node as the measurement node of the data flow.
[0041] In one implementation, there are multiple branch paths in the transmission path, and the virtual node mechanism of the consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node. The target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0042] In one implementation, determining the measurement node corresponding to the first data stream according to a consistent hashing algorithm includes: determining the transmission node to which the first summary data is mapped according to the first summary data and the consistent hashing algorithm. The first summary data is summary data obtained by performing a hash operation on an identifier of the first data stream. When the first summary data is mapped to a target transmission node, determining whether the measurement node corresponding to the first data stream is the first node according to a preset strategy. The preset strategy includes: selecting a preset proportion of a portion of the data stream in the data stream passing through the transmission path, and determining the measurement node corresponding to the portion of the data stream as the first node.
[0043] In one implementation, a level determination unit, used to determine a first measurement level corresponding to a first data flow, includes: a level determination unit, used to determine the first measurement level corresponding to the first data flow according to a flow size of the first data flow.
[0044] In one implementation, the level determination unit, used to determine the first measurement level corresponding to the first data stream, includes: the level determination unit, used to determine the first measurement level corresponding to the first data stream according to user indication information.
[0045] In one implementation, the transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
[0046] In a fourth aspect, a data processing device is provided, which is applied to a controller in a transmission network, and the data processing device includes: a determination unit, used to determine a first measurement level corresponding to a first data stream; a communication unit, used for the controller to send configuration information to a first node in the transmission network, the configuration information includes a first measurement level corresponding to the first data stream, and the configuration information is used to indicate that a measurement strategy is determined according to the first measurement level; wherein the first node is a transmission node through which the first data stream passes in the transmission network.
[0047] Among them, for the specific content of the measurement strategy corresponding to the first measurement level, reference may be made to the corresponding description of the measurement strategy corresponding to the first measurement level in the above-mentioned first aspect, and will not be repeated here.
[0048] In one implementation, a determination unit, configured to determine a first measurement level corresponding to a first data flow, includes: a determination unit, configured to determine the first measurement level corresponding to the first data flow according to a flow rate of the first data flow.
[0049] In one implementation, a determining unit, configured to determine a first measurement level corresponding to a first data stream, includes: a determining unit, configured to determine the first measurement level corresponding to the first data stream according to a user operation.
[0050] In one implementation, the configuration information also includes: a consistent hashing algorithm corresponding to the transmission path of the first data stream in the transmission network; the virtual node mechanism of the consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path; and the consistent hashing algorithm is used to determine the measurement node corresponding to the first data stream.
[0051] In one implementation, the virtual node mechanism of the above-mentioned consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path. The number of virtual nodes corresponding to one transmission node is positively correlated with the memory size of the transmission node. The consistent hashing algorithm is used to determine the virtual node corresponding to the data flow and determine the transmission node corresponding to the virtual node as the measurement node of the data flow.
[0052] In one implementation, there are multiple branch paths in the transmission path, and the virtual node mechanism of the above-mentioned consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node, and the target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0053] In one implementation, the transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
[0054] In a fifth aspect, a data processing device is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and execute computer instructions from the memory to implement a method as described in the first aspect or any one of the first aspects, or to implement a method as described in the second aspect or any one of the second aspects.
[0055] In a sixth aspect, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed on a processor, the method as described in the first aspect or any one of the first aspects is implemented, or the method as described in the second aspect or any one of the second aspects is implemented.
[0056] In the seventh aspect, a computer program product is provided, which includes instructions, which, when executed on a processor, implement a method as described in the first aspect or any one of the first aspects, or implement a method as described in the second aspect or any one of the second aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a CM sketch provided in an embodiment of the present application;
[0058] Figure 2 A schematic diagram of an Elastic Sketch provided in an embodiment of the present application;
[0059] Figure 3 One of the structural diagrams of a transmission network provided in an embodiment of the present application;
[0060] Figure 4 One of the flowcharts of a network measurement method provided in an embodiment of the present application;
[0061] Figure 5 A second flowchart of a network measurement method provided in an embodiment of the present application;
[0062] Figure 6 A third flowchart of a network measurement method provided in an embodiment of the present application;
[0063] Figure 7 A second schematic diagram of a transmission network structure provided in an embodiment of the present application;
[0064] Figure 8 A fourth flowchart of a network measurement method provided in an embodiment of the present application;
[0065] Fig. 9 A fifth flowchart of a network measurement method provided in an embodiment of the present application;
[0066] Fig.10 A sixth flowchart of a network measurement method provided in an embodiment of the present application;
[0067] Fig.11 A third structural diagram of a transmission network provided in an embodiment of the present application;
[0068] Fig.12 A flowchart of a network measurement method provided in an embodiment of the present application is shown in FIG7;
[0069] Fig.13 A fourth structural diagram of a transmission network provided in an embodiment of the present application;
[0070] Fig.14 FIG8 is a flow chart of a network measurement method provided in an embodiment of the present application;
[0071] Fig.15 A ninth flowchart of a network measurement method provided in an embodiment of the present application;
[0072] Fig.16 One of the structural schematic diagrams of a data processing method provided in an embodiment of the present application;
[0073] Fig.17 A second structural diagram of a data processing method provided in an embodiment of the present application;
[0074] Fig.18 The third structural diagram of a data processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0075] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0076] To facilitate understanding of the technical solutions provided in the embodiments of the present application, the relevant technologies involved in the embodiments of the present application are first introduced:
[0077] The technical solution provided in the embodiment of the present application is used for network measurement. Among them, network measurement can be understood as measuring the transmission process of data flow in the transmission network. For example, network measurement may include: measuring the flow size of the data flow, detecting the data flow with large flow in the transmission network, measuring the number of flows passing through each transmission node, measuring the distribution of the data flow, measuring the interval time of the data packets in the data flow, and measuring the packet loss of the data flow, etc.
[0078] At present, with the development of programmability of network data plane, sketch-based network measurement solutions are gradually replacing traditional network measurement solutions. Since sketch-based network measurement solutions have the characteristics of low memory overhead, they are more suitable for deployment on transmission nodes in transmission networks. Among them, transmission nodes in transmission networks can include hardware network devices (for example, switches or programmable network cards that support programming protocol-independent packet processors (P4)), and transmission nodes can also include software devices (for example, virtual switches).
[0079] Below, the Count-Min sketch algorithm (hereinafter referred to as the CM sketch algorithm) and the Elastic Sketch algorithm commonly used in sketch are used as examples to introduce the flow size measurement process:
[0080] On the one hand, in the scheme of measuring the flow size using the CM sketch algorithm, the transmission node first creates n arrays, each array includes x counters, and the n arrays correspond to a hash function. After receiving a data packet of a certain data flow (hereinafter referred to as data flow A), the data flow is first mapped to the counters in the n arrays using n hash functions, and the value of the counter is increased by 1.
[0081] For example, Figure 1 As shown, taking data stream e as an example, data stream e is mapped to three counters (it can be understood that the three counters belong to three arrays respectively) through three hash functions (i.e., n is 3), and the values of the three counters are increased by 1 (such as Figure 1 In the example, the three counters are updated from the original "6,6,9" to "7,7,10").
[0082] When the flow size of a data flow needs to be queried, the transmission node first uses the above n hash functions to determine the n counters in the n arrays corresponding to the data flow, and then feeds back the minimum value of the n counters as the measurement result. Figure 1 In the example, when the flow size of data flow e needs to be queried, three hash functions are first used to determine the three counters corresponding to the data flow, and then the minimum value of the three counters (ie, 7) is fed back as the measurement result.
[0083] In the above CM sketch algorithm, different hash functions correspond to different hash values, and conflicting data streams are also different (for example, in hash function h1, data stream a and data stream b conflict, while in hash function h2, data stream a and data stream c conflict). Therefore, the frequency of a certain element in the arrays corresponding to different hash functions is also different. When searching for a certain element, the minimum value of the count value of this element in different arrays is the frequency of the element when the least conflict occurs according to a certain hash function mapping. This method of superimposing multiple hash functions and using multiple pairs of arrays for mutual verification reduces the impact of conflicts and improves the accuracy of counting.
[0084] It can be seen that in the scheme of using the CM sketch algorithm to perform network measurement, the same operation is performed on all recorded data flows. In actual application, some data flows may need to be measured more accurately, while other data flows do not need to be measured accurately. Therefore, in the above scheme of using the CM sketch algorithm to perform network measurement, there is a problem that the data flow cannot be measured according to actual needs.
[0085] On the other hand, in the scheme of measuring flow size using the Elastic Sketch algorithm, the data structure is as follows Figure 2As shown, it consists of two parts: one is the heavy part (i.e., heavy part) recording elephant flows (i.e., data flows with large traffic), and the other is the light part (i.e., light part) recording mouse flows (i.e., data flows with small traffic). Each bucket of the heavy part records the information of the flow: flow ID, vote+, flag, and vote-. Among them, vote+ records the number of data packets belonging to this flow (flow size). vote- records the number of other data packets. The flag is T or F, indicating whether the light part may contain positive votes for this flow.
[0086] The light part is a CM sketch, which consists of d arrays (A1, A2, ... Ad,). Each array is associated with a hash function and consists of w counters. Figure 2 The CM sketch in the example uses 2 arrays, where the 2 arrays are associated with hash functions g1(.) and g2(.). Given an incoming packet, the CM sketch extracts the flow ID, calculates d hash functions to locate the counters in each array, and increases the d counters (d hash counters) by 1. Querying is similar to inserting: after obtaining the d hash counters, the minimum value is sent.
[0087] Insertion: Given an incoming packet with flow ID "f", hash it to the corresponding bucket in the Heavy part. Assume that the bucket stores (fx, vote+,,vote-,flag1), similar to exclusion, if f matches fx, increase vote+, otherwise, increase vote-, and then decide whether to evict f1 based on the two votes. There are four cases:
[0088] Case 1: The bucket is empty. Insert (f, 1, F, 0), where F indicates that no eviction has occurred in the bucket. Insertion ends. For example Figure 2 Insertion process of data stream f5: If the corresponding bucket of data stream f5 in the Heavy part is empty, then (f5, 1, F, 0) is inserted into the bucket.
[0089] Case 2: f = fx, increase vote+ by 1. For example Figure 2 Insertion process of data stream f1: Data stream f5 records f1 in the corresponding bucket in Heavypart, so the vote+ in the bucket is increased by 1.
[0090] Case 3: f≠fx, and exists after vote-increment: Then insert (f, 1) in the CM sketch: that is, add 1 to the counter corresponding to the hash value. For example Figure 2Insertion process of data stream f8: first increase vote- in the bucket by 1 (i.e. "11++"), and insert (f8, 1) in the CM sketch.
[0091] Case 4: f≠fx, and exists after vote-increment: Then, by setting the corresponding bucket in the Heavy part to (f, 1, T, 1), and taking the flow fx out to the CM sketch: the mapped counter is increased by vote+. At this point, the flag is set to T (true), because some votes for flow f can be inserted into the light part before f is selected. For example Figure 2 Insertion process of data stream f9: insert (f9, 1, T, 0) in the bucket and take data stream f4 out to CM sketch.
[0092] When querying the flow size of a data flow using the Elastic Sketch algorithm, for flows that are not in the heavy part, the light part (CM sketch) sends the flow size. For any flow f in the heavy part, there are two cases: 1) the flag of f is false. Its size is the corresponding vote+; 2) the flag of f is true, then the query results of the corresponding vote+ and CM sketch are added.
[0093] It can be seen that in the above-mentioned solution of network measurement using the Elastic Sketch algorithm, although the heavy part and the light part are constructed to separate the large flow and the small flow, thereby improving the measurement accuracy of both the large flow and the small flow, the above-mentioned solution still has the problem of not being able to measure the data flow according to actual needs. Specifically, when some data flows need to be measured more accurately, while other data flows do not need to be measured accurately, the Elastic Sketch solution cannot measure according to the measurement requirements of each data flow.
[0094] In addition, in the related technologies, a full-flow lossless measurement solution based on sketch can also be used, such as OmniMon, NZE sketch, FlowRadar, etc. However, these solutions still have the problem of not being able to measure the data flow according to actual needs.
[0095] In view of the above problems, the technical solution provided in the embodiment of the present application takes into account that: in the process of network measurement, the data streams can be divided into measurement levels, and when measuring a certain data stream (taking the first data stream as an example), the measurement strategy is determined according to the measurement level corresponding to the first data stream. Among them, since the measurement strategy adopted is determined according to the measurement level corresponding to the data stream, when measuring different data streams, different measurement strategies can be adopted for data streams of different measurement levels according to the measurement level corresponding to the data stream. For example, a measurement strategy with higher accuracy is adopted for data streams of some measurement levels, and a measurement strategy with lower accuracy is adopted for data streams of other measurement levels. In this way, the purpose of measuring data streams according to actual needs can be achieved.
[0096] The following describes the network measurement method provided in the embodiment of the present application in conjunction with specific application scenarios.
[0097] Application scenario 1:
[0098] Figure 3 Shown is a schematic diagram of the structure of a transmission network provided in an embodiment of the present application. Figure 3 The transmission network 10 shown includes a server 111 and a server 112. The data stream is transmitted between the server 111 and the server 112 via a single path (i.e., transmission node 121-transmission node 122-transmission node 123). The functions of each transmission node in the transmission network can be implemented by a switch, a router, or a programmable network card.
[0099] In addition, the transmission network 10 further includes a controller 101. The controller 101 may be used to send configuration information to each transmission node in the transmission network, so that each transmission node measures the data flow according to the configuration information.
[0100] It is understandable that, in actual application, the functions of the controller 101 may be implemented by software or hardware devices independent of each transmission node. Figure 3 As shown, the controller 101 can be connected to each transmission node in the transmission network by wire or wireless means, and send configuration information to each transmission node in the transmission network. In addition, the function of the controller 101 can also be implemented by any transmission node in the transmission network. In this case, the controller 101 can be used as a functional module on the transmission node. The specific form of the controller 101 may not be limited in the embodiments of the present application.
[0101] The following takes the measurement process of the data flow between the server 111 and the server 112 as an example to introduce the network measurement method provided by the embodiment of the present application. Figure 4 As shown, the method may include:
[0102] S201. The controller 101 obtains a measurement level corresponding to a data stream x to be measured.
[0103] In one implementation, three preset levels may be divided, which are referred to as measurement level a, measurement level b, and measurement level c below for ease of description.
[0104] Different measurement levels may correspond to different measurement strategies. For example, the measurement strategies corresponding to measurement level a, measurement level b, and measurement level c may be set according to the following content:
[0105] For the data flow corresponding to the measurement level a, each transmission node on the transmission path of the data flow can be measured respectively, and each transmission node records the measurement result of the data flow using the flow table corresponding to the data flow.
[0106] For a data flow corresponding to measurement level b, a transmission node is selected on the transmission path of the data flow for measurement, and the transmission node records the measurement result of the data flow using the flow table corresponding to the data flow.
[0107] For a data stream corresponding to measurement level c, a transmission node is selected on the transmission path of the data stream for measurement, and the transmission node measures the data stream using a sketch technique. For example, for a data stream corresponding to measurement level c, the transmission node performs approximate measurement of the data stream using the above-mentioned CM sketch, Elastic Sketch, or SuMax sketch techniques.
[0108] Among them, on the one hand, for the data flow corresponding to measurement level a, since each transmission node on the transmission path is measured separately, not only the single-point task corresponding to the data flow (for example, flow size, packet arrival interval, etc.) can be measured, but also the global task corresponding to the data flow (for example, packet loss rate on each hop transmission node, etc.) can be measured, thereby achieving accurate measurement of the data flow corresponding to measurement level a. For the data flow corresponding to measurement level b and measurement level c, since a transmission node is selected on the transmission path for measurement, only the single-point task corresponding to the data flow can be measured for the data flow of measurement level b and measurement level c, thereby ensuring the basic measurement function of this part of the data flow while saving the measurement overhead of the transmission node.
[0109] On the other hand, for data flows of measurement level a and measurement level b, since a flow table is used to record the measurement results, and the flow table and the data flow are in a one-to-one correspondence, the measurement results of the data flow can be accurately recorded on the transmission node that performs the measurement task, and the problem of the measurement results affecting the measurement results of other data flows can be avoided. For data flows of measurement level c, since the sketch technology is used to measure the first data flow, the basic measurement function of this part of the data flow is guaranteed, and the measurement overhead of the transmission node is also saved.
[0110] It is understandable that in the above implementation, the measurement strategies corresponding to different preset levels are mainly introduced by examples from two perspectives (one perspective is to measure the data flow at several transmission nodes on the transmission path; the other perspective is to use flow table or sketch technology for measurement). In actual application, technicians can set other measurement strategies besides the above measurement strategies according to application needs.
[0111] For example, for the above three preset levels, the measurement strategies corresponding to the three preset levels may be set according to the following content:
[0112] For the data stream corresponding to the measurement level a, each transmission node on the transmission path of the data stream can be measured respectively, and each transmission node measures the data stream using the sketch technology.
[0113] For the data stream corresponding to measurement level b, a preset number of transmission nodes (for example, 3 transmission nodes, 5 transmission nodes or half of the transmission nodes on the transmission path) are selected on the transmission path of the data stream for measurement, and each transmission node uses sketch technology to measure the data stream.
[0114] For a data stream corresponding to measurement level c, a transmission node is selected on the transmission path of the data stream for measurement, and the transmission node measures the data stream using the sketch technology.
[0115] That is to say, in the above example, the three preset levels are divided based on the standard of "measuring the data flow at several transmission nodes on the transmission path". As for the method of recording the measurement results, the three preset levels all adopt the method of "measuring the data flow using the sketch technology". Of course, in the actual application process, the three preset levels can also adopt the method of "recording the measurement results of the data flow using the flow table corresponding to the data flow" for measurement.
[0116] In addition, the three preset levels can all adopt "selecting a transmission node on the transmission path of the data flow for measurement", and the three preset levels can correspond to different measurement methods. For example, measurement level a corresponds to the measurement method of "using the flow table corresponding to the data flow to record the measurement result of the data flow"; measurement level b corresponds to the measurement method of "using the Elastic sketch technology to measure the data flow"; measurement level c corresponds to the measurement method of "using the CM sketch technology to measure the data flow".
[0117] That is to say, the measurement strategies corresponding to the preset levels may not be limited in the embodiments of the present application.
[0118] In addition, in the embodiment of the present application, three preset levels are mainly used as examples to introduce the measurement levels that may correspond to a data stream. In actual application, more or fewer preset levels can be divided as needed, so that after determining the preset level of the data stream, the data stream can be measured according to the measurement strategy corresponding to the preset level.
[0119] In addition, it should be noted that the "measurement level" referred to in the embodiments of the present application may also be referred to as "measurement priority", "measurement gear", "measurement type" and other names in actual application. For example, the "measurement level a, measurement level b and measurement level c" divided in the above implementation method may also be referred to as "first priority, second priority and third priority", "first gear, second gear and third gear" or "first type, second type and third type", etc. There is no limitation on this in the embodiments of the present application.
[0120] In addition, in actual application, different determination methods can be used according to actual needs to determine the measurement level corresponding to the data stream. The following are two methods for determining the measurement level corresponding to the data stream:
[0121] In the first manner, the measurement level corresponding to the data flow may be determined according to the flow rate of the data flow. Specifically, S201 may include:
[0122] S201a: The controller 101 determines a measurement level corresponding to the data flow x according to the flow rate of the data flow x.
[0123] For example, the controller 101 may check the flow rate p within a preset time after the data stream x starts to be transmitted, and then determine the first measurement level corresponding to the data stream x from multiple preset levels according to the flow rate p within the preset time after the data stream x starts to be transmitted. For example, when "flow rate p>threshold value p1", it is determined that the data stream x corresponds to measurement level a; when "flow rate p<threshold value p2" (wherein, threshold value p2<threshold value p1), it is determined that the data stream x corresponds to measurement level c; when "threshold value p1≥flow rate p≥threshold value p2", it is determined that the data stream x corresponds to measurement level b.
[0124] In the second mode, the user may specify the measurement level corresponding to the data flow. Specifically, S201 may include:
[0125] S201b: The controller 101 determines the measurement level corresponding to the data stream x according to the user operation.
[0126] For example, a technician may input a user operation to the controller 101 through an input device such as a mouse, keyboard or touch screen. After receiving the user operation, the controller 101 determines a measurement level corresponding to the first data stream from a plurality of preset levels according to the user operation.
[0127] It should be noted that, in actual application, other methods other than the above two methods may be used to determine the measurement level corresponding to the data flow. For example, the measurement level corresponding to the data flow may be determined according to the quality of service (QoS) corresponding to the data flow. This may not be limited in the embodiments of the present application.
[0128] The following introduces the process of the method provided in the embodiment of the present application when the data stream x corresponds to measurement level a, measurement level b and measurement level c respectively.
[0129] After determining that the data stream x corresponds to the measurement level a, the method may include the following contents S202-S205:
[0130] S202 . The controller 101 sends configuration information to the transmission node 121 , the transmission node 122 , and the transmission node 123 in the transmission network.
[0131] The configuration information includes the measurement level a corresponding to the data stream x, and the configuration information is used to indicate that a measurement strategy is determined according to the measurement level a.
[0132] Specifically, after receiving the configuration information, transmission node 121, transmission node 122 and transmission node 123 can determine the measurement level a corresponding to data flow x according to the configuration information, and save the correspondence between data flow x and measurement level a (for example, recording measurement level a in the flow table of data flow x), so that after subsequently receiving the data packet of data flow x, the measurement level of data flow x (i.e., measurement level a) can be determined by looking up the table, and the measurement strategy can be determined according to the measurement level a.
[0133] The following takes the transmission node 121 as an example to introduce the operation process after the transmission node receives the configuration information of S202. Specifically, after the transmission node 121 receives the configuration information through S202, after the transmission node 121 receives the data packet of the data stream x, the method may also include:
[0134] S203 : The transmission node 121 determines the measurement level a corresponding to the data flow x.
[0135] For example, after receiving a data packet of data stream x, the transmission node 121 can read the flow identifier of the data stream x corresponding to the data packet according to the message header of the data packet. The flow identifier can be a five-tuple of information (i.e., source address, source port number, destination address, destination port number, and protocol number), or the flow identifier can also be other information. Then, the flow table of data stream x is determined by table lookup using the flow identifier. Then, according to the measurement level a recorded in the flow table, the measurement level corresponding to data stream x (i.e., measurement level a) is determined.
[0136] S204: The transmission node 121 determines a measurement strategy according to the measurement level a.
[0137] As described above, “determine that for a data stream corresponding to measurement level a, each transmission node on the transmission path of the data stream can be measured”, so in one implementation, the measurement strategy determined in S204 may include: when the measurement level corresponding to data stream x is measurement level a, record the measurement result of data stream x. In this case, the method may also include:
[0138] S205 . When the measurement level corresponding to the data flow x is measurement level a, the transmission node 121 records the measurement result of the data flow x.
[0139] That is to say, when the measurement level corresponding to data flow x is measurement level a, the transmission node 121 can measure the data packets of the passing data flow x (for example, measure the flow size of the data flow x, the interval time for the arrival of data packets, and the packet loss rate, etc.) and record the measurement results without determining whether the transmission node 121 needs to measure the data flow x.
[0140] In one possible design, for a data flow corresponding to measurement level a, as described above, "each transmission node uses the flow table corresponding to the data flow to record the measurement result of the data flow". Therefore, the measurement strategy corresponding to measurement level a may specifically include: when the measurement level corresponding to data flow x is measurement level a, the flow table of data flow x is used to record the measurement result of data flow x. In this case, S205 may specifically include:
[0141] S205a: When the measurement level corresponding to the data flow x is measurement level a, the transmission node 121 uses the flow table corresponding to the data flow to record the measurement result of the data flow.
[0142] For example, the measurement content of the data flow x by the transmission node 121 may include: measuring the flow size of the data flow x, detecting whether the data flow x is a data flow with large traffic volume, measuring the interval time of data packets in the data flow x, and measuring the packet loss of the data flow x. After measuring the above one or more items, the transmission node 121 records the measurement result in the flow table corresponding to the data flow x.
[0143] After the transmission node 121 records the measurement result of the data stream x, the method may further include:
[0144] S206 : After the current time window ends, the transmission node 121 sends the measurement results of each data flow recorded by the transmission node 121 to the controller 101 .
[0145] In this way, the controller 101 can query the single-point tasks (including flow size, data packet arrival interval, etc.) and global tasks (including per-hop packet loss rate, etc.) of the data flow x based on the measurement results collected from each transmission node after each time window ends.
[0146] It is understandable that the work flow after other transmission nodes (such as transmission node 122 or transmission node 123) in the transmission network receive the data packet of data stream x can refer to the contents of S203-S206, and the repeated parts are not repeated here.
[0147] The above S202-S206 takes the data flow x corresponding to the measurement level a as an example to introduce the working process of each device in the transmission network 10. The following describes the working process of each device in the transmission network 10 when the controller 101 determines in S201 that the data flow x corresponds to the measurement level b. Specifically, Figure 5 As shown, the method may also include the following contents of S207-S212:
[0148] S207 . The controller 101 sends configuration information to the transmission node 121 , the transmission node 122 , and the transmission node 123 in the transmission network.
[0149] The configuration information includes the measurement level b corresponding to the data stream x, and the configuration information is used to indicate that a measurement strategy is determined according to the measurement level b.
[0150] Similar to S202, after receiving the configuration information, transmission node 121, transmission node 122 and transmission node 123 can determine the measurement level b corresponding to data flow x according to the configuration information, and save the correspondence between data flow x and measurement level b (for example, record measurement level b in the flow table of data flow x) so that after subsequently receiving the data packet of data flow x, the measurement level of data flow x (i.e., measurement level b) can be determined by looking up the table, and the measurement strategy can be determined according to the measurement level b.
[0151] In addition, since the measurement strategy corresponding to measurement level b corresponds to "selecting a transmission node on the transmission path of the data flow for measurement", in order to facilitate the determination of the measurement node corresponding to the data flow (that is, the transmission node for measuring the data flow) from the transmission path of the data flow, the embodiment of the present application considers that a consistent hashing algorithm can be used to determine the measurement node corresponding to the data flow.
[0152] Among them, in the consistent hashing algorithm, a virtual node mechanism can be used to achieve load balancing and avoid data skew problems. Therefore, for a transmission path, a consistent hashing algorithm can be constructed for the transmission path. In the virtual node mechanism of the consistent hashing algorithm, the transmission nodes on the transmission node can be mapped to the corresponding number of virtual nodes. Among them, the more virtual nodes a transmission node maps, the greater the probability of selecting the transmission node as a measurement node. In this way, the measurement tasks can be more reasonably allocated to each transmission node on the transmission path.
[0153] Therefore, in one implementation, the configuration information sent by the controller 101 to each transmission node in S206 may also include: a consistent hashing algorithm corresponding to the transmission path of the data stream x.
[0154] Among them, the virtual node mechanism of the consistent hashing algorithm includes: virtual nodes corresponding to each transmission node on the transmission path.
[0155] In this way, after receiving the configuration information, each transmission node can determine the measurement node corresponding to the data flow x on the transmission path according to the consistent hashing algorithm.
[0156] Furthermore, when using the consistent hashing algorithm to determine the measurement node corresponding to the data flow, it is considered that the measurement node corresponding to the data flow can be determined in combination with the memory size of each transmission node. The larger the memory of the transmission node, the greater the probability that the transmission node is the measurement node corresponding to the data flow. In this way, load balancing of each transmission node can be achieved on the transmission path.
[0157] Therefore, in a possible design, the number of virtual nodes corresponding to a transmission node in the virtual node mechanism of the above consistent hashing algorithm is positively correlated with the memory size of the transmission node.
[0158] For example, on the transmission path of data stream x, the i-th transmission node s i The corresponding number of virtual nodes v i for:
[0159] v i =c*m i Formula (1)
[0160] Among them, c can be a preset value, m i Transmission node s i The memory size.
[0161] When the transmission node s i When the memory of s changes, similarly, the transmission node s after the change i The corresponding number of virtual nodes v' i for:
[0162]
[0163] Among them, m' i Transmit node s after changing i Memory size, m i To change the previous transmission node s i The memory size, v i To change the previous transmission node s i The corresponding number of virtual nodes.
[0164] In this way, on the transmission path of data stream x, the transmission node s i The probability of being the measurement node corresponding to data stream x is p i :
[0165]
[0166] Wherein, S represents all transmission nodes on the transmission path.
[0167] It can be seen that at this time, the transmission node s i The probability of being the measurement node corresponding to data flow x is the same as the transmission node si is proportional to the memory size.
[0168] It can be understood that after the transmission nodes 121, 122 and 123 on the transmission path receive the above-mentioned configuration information including the consistent hash algorithm, the correspondence between the consistent hash algorithm and the transmission path can be saved so that the consistent hash algorithm can be used in subsequent processes to determine the measurement node of the data flow (including data flow x) passing through the above-mentioned transmission path.
[0169] The following takes the transmission node 121 as an example to introduce the operation process after the transmission node receives the configuration information of S206. Specifically, after the transmission node 121 receives the configuration information through S206, after the transmission node 121 receives the data packet of the data stream x, the method may also include:
[0170] S208 : The transmission node 121 determines the measurement level b corresponding to the data flow x.
[0171] The implementation process of S208 may refer to the content of S203 above.
[0172] S209: The transmission node 121 determines a measurement strategy according to the measurement level b.
[0173] The measurement strategy may include: when the measurement level of data stream x is a level other than the measurement level a (such as measurement level b) among multiple preset levels, determining a measurement node corresponding to data stream x from the transmission path of data stream x. When the measurement node corresponding to data stream x is the current node (here, the transmission node 121), recording the measurement result of data stream x.
[0174] Thus, the method further comprises:
[0175] S210 . When the measurement level corresponding to the data flow x is the measurement level b, the transmission node 121 determines the measurement node corresponding to the data flow x from the transmission path of the data flow x.
[0176] Specifically, S210 may include:
[0177] S2101. When the measurement level corresponding to the data stream x is the measurement level b, the transmission node 121 obtains the consistent hashing algorithm corresponding to the transmission path of the data stream x.
[0178] S2102. The transmission node 121 determines the measurement node corresponding to the data stream x according to the consistent hashing algorithm.
[0179] For example, the transmission node 121 can perform a hash operation on the flow ID of the data flow x (wherein the hash function used for the hash operation can be pre-set), thereby mapping the flow ID of the data flow x to the corresponding virtual node according to the consistent hashing algorithm, and using the transmission node corresponding to the virtual node as the measurement node corresponding to the data flow x.
[0180] After determining the measurement node of data stream x, it also includes:
[0181] S211 . When the measurement node of the data flow x is the transmission node 121 , the transmission node 121 records the measurement result of the data flow x.
[0182] That is, when the measurement node of the data stream x is the transmission node 121, the transmission node 121 records the measurement result of the data stream x; otherwise, the measurement result of the data stream x may not be recorded.
[0183] It can be understood that when other transmission nodes on the transmission path determine the measurement node corresponding to the data stream x according to S210, the consistent hashing algorithm used can be the same, so the measurement node corresponding to the data stream x determined by each transmission node can also be the same, so there will be no conflict between the transmission nodes.
[0184] In a possible design, corresponding to the above description “for a data flow corresponding to measurement level b, a transmission node is selected on the transmission path of the data flow for measurement, and the transmission node records the measurement result of the data flow using the flow table corresponding to the data flow”, S211 may specifically include:
[0185] S2111. When the measurement level corresponding to data flow x is measurement level b and the measurement node of data flow x is transmission node 121, the measurement result of data flow x is recorded using the flow table corresponding to data flow x.
[0186] S212 : After the current time window ends, the transmission node 121 sends the measurement results of each data flow recorded by the transmission node 121 to the controller 101 .
[0187] It is understandable that the work flow after other transmission nodes (such as transmission node 122 or transmission node 123) in the transmission network receive the data packet of data stream x can refer to the contents of S208-S212, and the repeated parts are not repeated here.
[0188] The following describes the workflow of each device in the transmission network 10 when the controller 101 determines in S201 that the data stream x corresponds to the measurement level c. Figure 6 As shown, the method may also include the following contents of S213-S218:
[0189] S213. The controller 101 sends configuration information to the transmission node 121, the transmission node 122, and the transmission node 123 in the transmission network.
[0190] The configuration information includes the measurement level c corresponding to the data stream x, and the configuration information is used to indicate that a measurement strategy is determined according to the measurement level c.
[0191] Among them, similar to S207, since the measurement strategy corresponding to the measurement level c corresponds to "selecting a transmission node on the transmission path of the data stream for measurement", therefore, in one implementation method, the configuration information sent by the controller 101 to each transmission node in S210 can also include: the consistent hash algorithm corresponding to the transmission path of the data stream x.
[0192] Among them, the virtual node mechanism of the consistent hashing algorithm includes: virtual nodes corresponding to each transmission node on the transmission path.
[0193] Specifically, the specific content of the consistent hash algorithm included in the configuration information in S213 can refer to the content of the consistent hash algorithm in S207 above, and the repeated parts will not be repeated here.
[0194] The following takes the transmission node 121 as an example to introduce the operation process after the transmission node receives the configuration information of S213. Specifically, after the transmission node 121 receives the configuration information through S213, after the transmission node 121 receives the data packet of the data stream x, the method may also include:
[0195] S214 . The transmission node 121 determines the measurement level c corresponding to the data flow x.
[0196] The implementation process of S214 may refer to the content of S203 above.
[0197] S215 : The transmission node 121 determines a measurement strategy according to the measurement level c.
[0198] The measurement strategy corresponding to the measurement level c may include: when the measurement level of the data stream x is a level other than the measurement level a among multiple preset levels (such as measurement level c), determining the measurement node corresponding to the data stream x from the transmission path of the data stream x. When the measurement node corresponding to the data stream x is the current node (here, the transmission node 121), recording the measurement result of the data stream x.
[0199] Furthermore, the method may also include
[0200] S216 . When the measurement level corresponding to the data flow x is the measurement level c, the transmission node 121 determines the measurement node corresponding to the data flow x from the transmission path of the data flow x.
[0201] Specifically, S216 may include:
[0202] S2161. When the measurement level corresponding to the data stream x is measurement level c, the transmission node 121 obtains the consistent hashing algorithm corresponding to the transmission path of the data stream x.
[0203] S2162. The transmission node 121 determines the measurement node corresponding to the data stream x according to the consistent hashing algorithm.
[0204] Among them, the specific implementation process of S216 and S2161, S2162 can refer to the corresponding description of S2101 and S2101, S2102 above.
[0205] After determining the measurement node of data stream x, it also includes:
[0206] S217 . When the measurement node of the data flow x is the transmission node 121 , the transmission node 121 records the measurement result of the data flow x.
[0207] That is, when the measurement node of the data stream x is the transmission node 121, the transmission node 121 records the measurement result of the data stream x; otherwise, the measurement result of the data stream x may not be recorded.
[0208] It can be understood that when other transmission nodes on the transmission path determine the measurement node corresponding to the data stream x according to S2121, the consistent hashing algorithm used can be the same, so the measurement node corresponding to the data stream x determined by each transmission node is also the same, so there will be no conflict between the transmission nodes.
[0209] In a possible design, corresponding to the above description “for a data flow corresponding to the measurement level c, a transmission node is selected on a transmission path of the data flow for measurement, and the transmission node measures the data flow using a sketch technology”, S217 may specifically include:
[0210] S2171 . When the measurement level corresponding to the data stream x is the measurement level c and the measurement node of the data stream x is the transmission node 121 , the transmission node 121 measures the data stream x by using the sketch technology.
[0211] For example, the transmission node 121 measures the data stream x using the above-mentioned CM sketch, Elastic Sketch, or SuMax sketch.
[0212] S218 . After the current time window ends, the transmission node 121 sends the measurement results of each data flow recorded by the transmission node 121 to the controller 101 .
[0213] It is understandable that the workflow after other transmission nodes (such as transmission node 122 or transmission node 123) in the transmission network receive the data packet of data stream x can refer to the contents of S214-S218, and the repeated parts are not repeated here.
[0214] Application scenario 2:
[0215] like Figure 7 , which is a schematic diagram of the structure of another transmission network provided in an embodiment of the present application. Figure 7 The transmission network 30 shown includes a server 311 and a server 312. The data stream can be transmitted between the server 311 and the server 312 through two transmission paths (i.e., transmission node 321-transmission node 322-transmission node 324, or transmission node 321-transmission node 323-transmission node 324). The functions of each transmission node in the transmission network can be implemented by a switch, a router, or a programmable network card.
[0216] In addition, the transmission network 30 further includes a controller 301. The controller 301 may be used to send configuration information to each transmission node in the transmission network, so that each transmission node measures the data flow according to the configuration information.
[0217] It is understandable that, in actual application, the functions of the controller 301 can be implemented by software or hardware devices independent of each transmission node. In addition, the functions of the controller 301 can also be implemented by any transmission node in the transmission network. In this case, the controller 301 can be used as a functional module on the transmission node. The specific form of the controller 301 may not be limited in the embodiments of the present application.
[0218] The following takes the measurement process of the data flow between the server 311 and the server 312 as an example to introduce the network measurement method provided by the embodiment of the present application. Figure 8 As shown, the method may include:
[0219] S401 : The controller 301 obtains a measurement level of a data stream x to be measured.
[0220] In one implementation, three preset levels may be divided, which are referred to as measurement level a, measurement level b, and measurement level c below for ease of description.
[0221] Similar to S201, the measurement strategies corresponding to the three preset levels can be set according to the following contents:
[0222] For the data flow corresponding to the measurement level a, each transmission node on the transmission path of the data flow can be measured respectively, and each transmission node records the measurement result of the data flow using the flow table corresponding to the data flow.
[0223] For a data flow corresponding to measurement level b, a transmission node is selected on the transmission path of the data flow for measurement, and the transmission node records the measurement result of the data flow using the flow table corresponding to the data flow.
[0224] For a data stream corresponding to measurement level c, a transmission node is selected on the transmission path of the data stream for measurement, and the transmission node measures the data stream using the sketch technology.
[0225] For the effects achieved by the different measurement strategies corresponding to the measurement level a, measurement level b and measurement level c, reference may be made to the corresponding description of S201 above.
[0226] In addition, similar to S201, in S401, different determination methods can be used according to actual needs to determine the measurement level corresponding to the data flow. Two methods for determining the measurement level corresponding to the data flow are provided below:
[0227] In the first manner, the measurement level corresponding to the data flow may be determined according to the flow rate of the data flow. Specifically, S401 may include:
[0228] S401a: The controller 301 determines a measurement level corresponding to the data flow x from a plurality of preset levels according to the flow size of the data flow x.
[0229] In the second mode, the user may specify the measurement level corresponding to the data flow. Specifically, S401 may include:
[0230] S401b: The controller 301 determines a measurement level corresponding to the data stream x from a plurality of preset levels according to a user operation.
[0231] For the specific implementation process of S401a and S401b, reference may be made to the corresponding description of S201a and S201b above.
[0232] The following introduces the process of the method provided in the embodiment of the present application when the data stream x corresponds to measurement level a, measurement level b and measurement level c respectively.
[0233] After determining that the data stream x corresponds to the measurement level a, the method may include:
[0234] S402 . The controller 301 sends configuration information to the transmission node 321 , the transmission node 322 , the transmission node 323 , and the transmission node 324 in the transmission network.
[0235] The configuration information includes the measurement level a corresponding to the data stream x, and the configuration information is used to indicate that a measurement strategy is determined according to the measurement level a.
[0236] For the specific content of S402, please refer to the corresponding description of S202 above.
[0237] In addition, the measurement process of the data stream x by each transmission node after receiving the configuration information in S402 can refer to the contents executed by the transmission node 121 in S203-S206 above. The repetitive parts will not be repeated here.
[0238] The following describes the workflow of each device in the transmission network 30 when the controller 301 determines in S401 that the data stream x corresponds to the measurement level b. Fig. 9 As shown, the method may also include the following contents of S403-S408:
[0239] S403 . The controller 301 sends configuration information to the transmission node 321 , the transmission node 322 , the transmission node 323 , and the transmission node 324 in the transmission network.
[0240] The configuration information includes the measurement level b corresponding to the data stream x, and the configuration information is used to indicate that a measurement strategy is determined according to the measurement level b.
[0241] Among them, after receiving the configuration information, transmission node 321, transmission node 322, transmission node 323 and transmission node 324 can determine the measurement level b corresponding to data flow x according to the configuration information, and save the correspondence between data flow x and measurement level b (for example, record measurement level b in the flow table of data flow x), so that after subsequently receiving the data packet of data flow x, the measurement level of data flow x (i.e., measurement level b) can be determined by looking up the table, and the measurement strategy can be determined according to the measurement level b.
[0242] In addition, similar to S206, since the measurement strategy corresponding to the measurement level b corresponds to "selecting a transmission node on the transmission path of the data flow for measurement", the consistent hashing algorithm can be used in the embodiment of the present application to determine the measurement node corresponding to the data flow.
[0243] Therefore, in one implementation, the configuration information sent by the controller 301 to each transmission node in S403 may also include: a consistent hashing algorithm corresponding to the transmission path of the data stream x.
[0244] Among them, the consistent hashing algorithm includes: the number of virtual nodes corresponding to each transmission node on the transmission path.
[0245] In a possible design, considering that the transmission path of data stream x includes two branch paths (i.e., transmission node 321-transmission node 322-transmission node 324, and transmission node 321-transmission node 323-transmission node 324), the two branch path parts can be merged into one transmission node (hereinafter referred to as the target transmission node), and then the virtual node corresponding to the target transmission node is included in the virtual node mechanism of the consistent hashing algorithm. For example, in Figure 7 In the example shown, the transmission node 322 and the transmission node 323 are regarded as one transmission node (ie, target transmission node).
[0246] In this way, when determining the measurement node corresponding to the data stream, the consistent hashing algorithm can be used to first determine which of the transmission node 321, transmission node 324 and the "target transmission node" is the measurement node corresponding to the data stream. Then, on the one hand, when it is determined that the measurement node corresponding to the data stream is the transmission node 321 or the transmission node 324, the data stream is measured by the transmission node 321 or the transmission node 324 according to the contents of S2081-S2082 above; on the other hand, when it is determined that the measurement node corresponding to the data stream is the "target transmission node", a transmission node is selected from the "target transmission nodes" (i.e., a transmission node is selected from the transmission node 322 and the transmission node 323) to measure the data stream.
[0247] The following describes how to determine the consistent hashing algorithm corresponding to the transmission path of the above data stream x under the two routing strategies of equal-cost multipath routing (ECMP) and weighted multipath routing (WCMP):
[0248] When the ECMP routing strategy is adopted, data flows with the same source and destination addresses can be selected with the same probability. Figure 7 One of the two branch paths in is used as the transmission path of the data flow. The following describes the process of determining the consistent hashing algorithm corresponding to the transmission path of data flow x when the ECMP routing strategy is adopted, taking the two cases where the memory of transmission node 322 and transmission node 323 is equal and the memory of transmission node 322 and transmission node 323 is unequal.
[0249] On the one hand, when the memory of the transmission node 322 is m 2 and the memory of the transmission node 323 is m 3 , and m 2 =m 3 When , the memory m of the target transmission node (i.e., the transmission node formed by merging transmission node 322 and transmission node 323) 2+3Expressed as: m 2+3 =m 2 +m 3 It can be understood that at this time, the transmission path between the server 311 and the server 312 degenerates into a single path (ie, transmission node 321 - target transmission node - transmission node 324).
[0250] Among them, on the single path, the number of virtual nodes corresponding to the transmission node 321 and the transmission node 324 can be expressed as:
[0251] v i =c*m i Formula (4)
[0252] Among them, when v i When m is the number of virtual nodes corresponding to the transmission node 321, i is the memory of the transmission node 321; when v i When m is the number of virtual nodes corresponding to the transmission node 324, i is the memory of the transmission node 324. c is a preset constant.
[0253] That is, on the single path, the probability of using transmission node 321 and transmission node 324 as measurement nodes corresponding to data stream x is:
[0254]
[0255] Among them, when p i When m is the probability corresponding to the transmission node 321, i is the memory of the transmission node 321, It is the sum of the memories of the transmission node 321 , the target transmission node, and the transmission node 324 .
[0256] In addition, the number of virtual nodes corresponding to the target transmission node on this single path can be expressed as:
[0257] v 2+3 =c*(m 2 +m 3 ) Formula (6)
[0258] Among them, when v 2+3 is the number of virtual nodes corresponding to the target transmission node, (m 2 +m 3 ) is the memory of the target transmission node.
[0259] That is to say, on this single path, the probability of using the target transmission node as the measurement node corresponding to the data flow x is:
[0260]
[0261] Among them, when p 2+3 When is the probability corresponding to the target transmission node, (m 2 +m 3 ) is the memory of the target transmission node, It is the sum of the memories of the transmission node 321, the target transmission node, and the transmission node 324.
[0262] On the other hand, when the memory of the transmission node 322 is m 2 and the memory of the transmission node 323 is m 3 , and m 2 <m 3 When , the memory m of the target transmission node (i.e., the transmission node formed by merging transmission node 322 and transmission node 323) 2+3 Expressed as: m 2+3 =2*m 3 It can be understood that at this time, the transmission path between the server 311 and the server 312 degenerates into a single path (ie, transmission node 321 - target transmission node - transmission node 324).
[0263] Among them, the number of virtual nodes corresponding to the transmission node 321 on the single path can be expressed as:
[0264] v 1 =c*m 1 Formula (8)
[0265] Among them, v 1 When m is the number of virtual nodes corresponding to the transmission node 321, 1 is the memory of the transmission node 321. c is a preset constant.
[0266] The number of virtual nodes corresponding to the target transmission node can be expressed as:
[0267] v 2+3 =c*(2*m 3 ) Formula (9)
[0268] Among them, when v 2+3 is the number of virtual nodes corresponding to the target transmission node, 2*m 3 Transfer the node's memory for the destination.
[0269] It can be seen from formula (9) that the number of virtual nodes of the target transmission node is determined based on the memory of the transmission node 323. In this way, it can be ensured that the transmission node 323 can be assigned an appropriate number of measurement tasks, but at this time, there may be too many measurement tasks assigned to the transmission node 322. In order to reduce the measurement tasks on the transmission node 322, for the data stream mapped to the transmission node 322, the transmission node 322 can, according to the preset strategy, delay the data stream to the transmission node 324 for measurement with a certain probability. Specifically, on the transmission node 322, according to the preset ratio, Select a portion of the data stream that passes through the transmission node 322 for measurement (that is, determine that the measurement node corresponding to the portion of the data stream is the transmission node 322). For a data flow, the transmission node 322 may mark the data packets of this data flow so that the transmission node 324 can perform measurement.
[0270] In this case, in order to ensure that the transmission node 324 can be allocated to a suitable number of data streams, the number of virtual nodes corresponding to the transmission node 324 can be expressed as:
[0271] v 4 =c*(m 4 -(m 3 -m 2 )) Formula (10)
[0272] Among them, v 4 When m is the number of virtual nodes corresponding to the transmission node 324, 4 is the memory of the transmission node 324, m 3 is the memory of the transmission node 323, m 2 is the memory of the transmission node 322. c is a preset constant.
[0273] That is, the probability p of using the transmission node 324 as the measurement node corresponding to the data flow x is 4 for:
[0274]
[0275] Among them, m 4 is the memory of the transmission node 324, m 3 is the memory of the transmission node 323, m 2 is the memory of the transmission node 322, It is the sum of the memories of the transmission node 321, the target transmission node, and the transmission node 324.
[0276] In addition, when the WCMP routing strategy is adopted, data flows with the same source and destination addresses can be selected according to the weights corresponding to different branch paths. Figure 7One of the two branch paths in is used as the transmission path of the data stream. Then, the virtual node of each transmission node in the virtual node mechanism of the consistent hashing algorithm can be determined according to the memory of each transmission node and the weight of each branch path.
[0277] Specifically, when the memory of the transmission node 322 is m 2 and the memory of the transmission node 323 is m 3 , the weight of the branch path corresponding to the transmission node 322 is w 2 , the weight of the branch path corresponding to the transmission node 322 is w 3 ,and hour:
[0278] In the consistent hashing algorithm, the number of virtual nodes v corresponding to the target transmission node (i.e., the transmission node obtained by merging transmission nodes 322 and 323) is 2+3 , which can be expressed as:
[0279]
[0280] That is to say, on this single path, the probability p of taking the target transmission node as the measurement node corresponding to the data flow x is 2+3 for:
[0281]
[0282] in, It is the sum of the memories of the transmission node 321 , the target transmission node, and the transmission node 324 .
[0283] In addition, when using formula (13) to determine the probability of using the target transmission node as the measurement node corresponding to the data flow x, on the transmission node 322, the ratio Select a portion of the data stream that passes through the transmission node 322 for measurement (that is, determine that the measurement node corresponding to the portion of the data stream is the transmission node 322). For a data flow, the transmission node 322 may mark the data packets of this data flow so that the transmission node 324 can perform measurement.
[0284] It can be understood that after the controller 301 determines the consistent hash algorithm corresponding to the transmission path of the data stream x according to the corresponding contents in the above formulas (4) to (12), the consistent hash algorithm is sent to each transmission node on the transmission path as part of the configuration information. When each transmission node on the transmission path receives the above configuration information including the consistent hash algorithm, the correspondence between the consistent hash algorithm and the transmission path can be saved, so that the consistent hash algorithm can be used in subsequent processes to determine the measurement node of the data stream (including data stream x) passing through the above transmission path.
[0285] The following takes the transmission node 321 as an example to introduce the operation process after the transmission node receives the configuration information of S403. Specifically, after the transmission node 321 receives the configuration information through S403, after the transmission node 321 receives the data packet of the data stream x, the method may also include:
[0286] S404 : The transmission node 321 determines the measurement level b corresponding to the data flow x.
[0287] S405 : The transmission node 321 determines a measurement strategy according to the measurement level b.
[0288] The implementation process of S404 and S405 may refer to the contents of S208 and S209 above.
[0289] Furthermore, the method may also include:
[0290] S406 . When the measurement level corresponding to the data flow x is the measurement level b, the transmission node 321 determines the measurement node corresponding to the data flow x from the transmission path of the data flow x.
[0291] Specifically, S406 may include:
[0292] S4061. When the measurement level corresponding to the data stream x is measurement level b, the transmission node 321 obtains the consistent hashing algorithm corresponding to the transmission path of the data stream x.
[0293] The consistent hash algorithm includes: the number of virtual nodes corresponding to the transmission node 321, the target transmission node (i.e., the transmission node formed by merging the transmission node 322 and the transmission node 323), and the transmission node 324. The number of virtual nodes corresponding to each transmission node can refer to the corresponding contents of the above formula (4) to formula (12).
[0294] S4062. The transmission node 321 determines the measurement node corresponding to the data stream x according to the consistent hashing algorithm.
[0295] Among them, the specific implementation process of S406 and S4061, S4062 can refer to the corresponding description of S210 and S2101, S2102 above.
[0296] After determining the measurement node of data stream x, it also includes:
[0297] S407 . When the measurement node of the data flow x is the transmission node 321 , the transmission node 321 records the measurement result of the data flow x.
[0298] That is, when the measurement node of the data stream x is the transmission node 321, the transmission node 321 records the measurement result of the data stream x; otherwise, the measurement result of the data stream x may not be recorded.
[0299] In a possible design, corresponding to the above description “for a data flow corresponding to measurement level b, a transmission node is selected on the transmission path of the data flow for measurement, and the transmission node records the measurement result of the data flow using the flow table corresponding to the data flow”, S407 may specifically include:
[0300] S4071. When the measurement level corresponding to the data flow x is the measurement level b and the measurement node of the data flow x is the transmission node 321, the transmission node 321 records the measurement result of the data flow x using the flow table corresponding to the data flow x.
[0301] S408 . After the current time window ends, the transmission node 321 sends the measurement results of each data flow recorded by the transmission node 321 to the controller 101 .
[0302] It is understandable that the workflow after the transmission node 324 in the transmission network receives the data packet of the data stream x can refer to the contents of S404 to S406 above, and the repeated parts are not repeated here.
[0303] Above Fig. 9 S404-S408 in the above mainly introduces the operation process after the transmission node 321 receives the configuration information of S403. Next, the operation process after the transmission node 322 receives the configuration information of S403 is introduced. Fig.10 As shown, the method may further include the following S409-S413:
[0304] S409 , the transmission node 322 determines the measurement level b corresponding to the data flow x.
[0305] S410 : The transmission node 322 determines a measurement strategy according to the measurement level b.
[0306] The implementation process of S409 and S410 may refer to the contents of S208 and S209 above.
[0307] Furthermore, the method may also include:
[0308] S411 . When the measurement level corresponding to the data flow x is the measurement level b, the transmission node 322 determines the measurement node corresponding to the data flow x from the transmission path of the data flow x.
[0309] Specifically, S411 may include:
[0310] S4111. When the measurement level corresponding to the data stream x is measurement level b, the transmission node 322 obtains the consistent hashing algorithm corresponding to the transmission path of the data stream x.
[0311] The consistent hash algorithm includes: the number of virtual nodes corresponding to the transmission node 321, the target transmission node (i.e., the transmission node formed by merging the transmission node 322 and the transmission node 323), and the transmission node 324. The number of virtual nodes corresponding to each transmission node can refer to the corresponding contents of the above formula (4) to formula (12).
[0312] S4112. The transmission node 322 determines the measurement node corresponding to the data stream x according to the consistent hashing algorithm.
[0313] Specifically, S4112 may include:
[0314] S1. The transmission node 322 determines the transmission node to which the first summary data is mapped in the consistent hash algorithm according to the first summary data and the consistent hash algorithm.
[0315] The first summary data is summary data obtained by performing a hash operation on the identifier of the data stream x.
[0316] S2. When the first summary data is mapped to the target transmission node, the transmission node 322 determines whether the measurement node corresponding to the data stream x is the transmission node 322 according to a preset strategy.
[0317] The preset strategy includes: selecting a preset proportion of partial data flows in the data flows passing through the transmission path, and determining the measurement node corresponding to the partial data flows as the transmission node 322 .
[0318] Specifically, when the first summary data is mapped to the target transmission node, the transmission node 322 can determine that there are three possibilities for the measurement node corresponding to the data stream x: 1. The measurement node of data stream x is the transmission node 323. 2. The measurement node of data stream x is the transmission node 322. 3. The measurement node of data stream x is the transmission node 324 (at this time, it can be understood that the measurement task of data stream x is delayed to the transmission node 324).
[0319] Among them, since the transmission node 322 may execute S409-S411 after receiving the data packet of the data flow x, it can be determined whether the data flow x is transmitted through the transmission node 322 or the data flow x does not pass through the transmission node 323. Therefore, the transmission node 322 needs to determine through S2 whether the data flow x is measured by the transmission node 322 or delayed to the next hop transmission node 324 for measurement (that is, the transmission node 322 needs to determine whether the measurement node corresponding to the first data flow is the transmission node 322 or the transmission node 324).
[0320] In one design, when the transmission node 322 determines through S2 that the measurement node corresponding to the data flow x is not the transmission node 322, the transmission node 322 marks the data packet of the data flow x, and the mark is used to instruct the next-hop transmission node 324 to record the measurement result of the data flow x after receiving the data packet of the data flow x.
[0321] After determining the measurement node of the data stream x, the method may further include:
[0322] S412: When the measurement node of the data flow x is the transmission node 322, the transmission node 322 records the measurement result of the data flow x.
[0323] That is, only when the measurement node of the data stream x is the transmission node 322, the transmission node 321 records the measurement result of the data stream x; otherwise, the measurement result of the data stream x may not be recorded.
[0324] In a possible design, corresponding to the above description “for a data flow corresponding to measurement level b, a transmission node is selected on the transmission path of the data flow for measurement, and the transmission node records the measurement result of the data flow using the flow table corresponding to the data flow”, S412 may specifically include:
[0325] S4121. When the measurement level corresponding to the data flow x is the measurement level b and the measurement node of the data flow x is the transmission node 321, the transmission node 321 records the measurement result of the data flow x using the flow table corresponding to the data flow x.
[0326] S413 : After the current time window ends, the transmission node 321 sends the measurement results of each data flow recorded by the transmission node 321 to the controller 101 .
[0327] It is understandable that the work flow after the transmission node 323 in the transmission network receives the data packet of the data stream x can refer to the contents of S409-S413 above, and the repeated parts are not repeated here.
[0328] Above Figure 8 The steps in the figure introduce the working process of each device in the transmission network 30 when the controller 301 determines in S401 that the data flow x corresponds to the measurement level a. Fig. 9 and Fig.10 The steps in the figure introduce the working process of each device in the transmission network 30 when the controller 301 determines in S401 that the data flow x corresponds to the measurement level b.
[0329] In addition, when the controller 301 determines in S401 that the data flow x corresponds to the measurement level c, each transmission node in the transmission network 30 can refer to Fig. 9S404 or Fig.10 The content of S409 determines the measurement level corresponding to the data stream x, and refers to Fig. 9 S405 or Fig.10 The content of S410 determines the measurement strategy corresponding to the data stream x, and refers to Fig. 9 S406 or Fig.10 In S411, the content of S411 determines the measurement node corresponding to the data flow x. In addition, after each transmission node in the transmission network 30 determines that the measurement node of the data flow x is itself, it can also refer to Figure 6 The content of S217 uses the sketch technology to measure the data flow x. The detailed process of the work flow of each transmission node in the transmission network 30 when the controller 301 determines in S401 that the data flow x corresponds to the measurement level c is not repeated here.
[0330] Application scenario three:
[0331] Fig.11 The figure shows a schematic diagram of the structure of another transmission network provided by an embodiment of the present application. The transmission network 50 is a fat-tree structure. Specifically, a 4-element fat-tree is taken as an example in the transmission network 50 (i.e., each switch has 4 ports). The transmission network 50 includes a core layer, a convergence layer, and an access layer, a 3-layer structure.
[0332] Specifically, the core layer includes four switches (ie, switch S_c1, switch S_c2, switch S_c3, and switch S_c4).
[0333] In addition, there are 4 Pods in the transmission network 50. Each Pod is composed of 4 switches, of which the aggregation layer has 2 switches (e.g. Fig.11 In the example, the aggregation layer in Pod1 includes switches S_a1 and S_a2, the aggregation layer in Pod2 includes switches S_a3 and S_a4, the aggregation layer in Pod3 includes switches S_a5 and S_a6, and the aggregation layer in Pod4 includes switches S_a7 and S_a8), and the access layer has two switches (e.g. Fig.11 In the example, the access layer in Pod1 includes switches S_e1 and S_e2, the access layer in Pod2 includes switches S_e3 and S_e4, the access layer in Pod3 includes switches S_e5 and S_e6, and the access layer in Pod4 includes switches S_e7 and S_e8. In addition, each switch in the access layer is connected to 2 servers, so each Pod can accommodate 4 servers (for example Fig.11Pod1 contains servers h1 to h4, Pod2 contains servers h5 to h8, Pod3 contains servers h9 to h12, and Pod4 contains servers h13 to h16).
[0334] In addition, the transmission network 50 further includes a controller 501. The controller 501 may be used to send configuration information to each transmission node in the transmission network, so that each transmission node measures the data flow according to the configuration information.
[0335] It should be noted that Fig.11 In the example, the controller 501 is used as a software or hardware device independent of each switch and server, and the controller 501 is connected to the core layer switch S_c1 to connect the controller 501 to the transmission network 50. In the actual application process, on the one hand, when the function of the controller 501 is realized by a software or hardware device independent of each switch and server, the controller 501 can access the transmission network 50 through any transmission node in the transmission network 50; on the other hand, the function of the controller 501 can also be realized by any transmission node in the transmission network. In this case, the controller 501 can be used as a functional module on the transmission node. There is no limitation on the specific form of the controller 501 in the embodiment of the present application.
[0336] The following takes the measurement process of the data flow between the server h1 and the server h13 as an example to introduce the network measurement method provided by the embodiment of the present application. Fig.12 As shown, the method may include:
[0337] S601 : The controller 101 determines a measurement level of a data stream x to be measured.
[0338] Here, still taking the three preset levels (measurement level a, measurement level b and measurement level c) given in S201 as an example, different measurement levels correspond to different measurement strategies:
[0339] For the data flow corresponding to the measurement level a, each transmission node on the transmission path of the data flow can be measured respectively, and each transmission node records the measurement result of the data flow using the flow table corresponding to the data flow.
[0340] For a data flow corresponding to measurement level b, a transmission node is selected on the transmission path of the data flow for measurement, and the transmission node records the measurement result of the data flow using the flow table corresponding to the data flow.
[0341] For a data stream corresponding to measurement level c, a transmission node is selected on the transmission path of the data stream for measurement, and the transmission node measures the data stream using the sketch technology.
[0342] Referring to the description of S201a and S201b above, in one implementation, S601 may include: the controller 501 determines the measurement level corresponding to the data flow x according to the flow size of the data flow x. In another implementation, S601 may include: the controller 501 determines the measurement level corresponding to the data flow x according to the user operation.
[0343] S602. The controller 501 sends configuration information to each transmission node in the transmission network.
[0344] The configuration information includes a measurement level corresponding to the data stream x, and the configuration information is used to indicate that a measurement strategy is determined according to the measurement level corresponding to the data stream x.
[0345] For example, when data flow x is a data flow from server h1 to server 13, the controller 501 sends the above configuration information to each switch in Pod1 and Pod4 and each switch in the core layer, so that each switch in Pod1 and Pod4 and each switch in the core layer determines the measurement strategy according to the measurement level corresponding to the data flow x after determining that it is the measurement node of the data flow x.
[0346] In addition, the configuration information may also include a consistent hashing algorithm corresponding to the transmission path of the data stream x.
[0347] Specifically, in the transmission network 50, for the data flow between the same pair of Pods, the transmission paths passed are also similar. For example, from any server in Pod1 to any server in Pod4, the 5-hop transmission nodes passed are: {S_e1, S_e2}, {S_a1, S_a2}, {S_c1, S_c2, S_c3, S_c4}, {S_a7, S_a8} and {S_e7, S_e8}. Therefore, you can refer to the above Figure 7In the transmission network 50, the above five-hop transmission nodes can be merged into a single path including five transmission nodes in the way that multiple branch paths are merged into one transmission node. (Take the path from Pod1 to Pod4 as an example. The first transmission node is the transmission node formed by merging S_e1 and S_e2. The second transmission node is the transmission node formed by merging S_a1 and S_a2. The third transmission node is the transmission node formed by merging S_c1, S_c2, S_c3 and S_c4. The fourth transmission node is the transmission node formed by merging S_a7 and S_a8. The fifth transmission node is the transmission node formed by merging S_e7 and S_e8.) At this time, each Pod pair can use the same consistent hashing algorithm. For example, Pod1 and Pod4 use the same consistent hashing algorithm, Pod1 and Pod3 use the same consistent hashing algorithm, Pod1 and Pod2 use the same consistent hashing algorithm, and Pod1 and Pod1 use the same consistent hashing algorithm. At this time, the total number of consistent hashing algorithms is |Pod| 2 , namely |host| 2 / 3 indivual.
[0348] For each Pod pair, the consistent hashing algorithm may be determined by referring to the method in S403 above. The repetitive parts will not be described here.
[0349] In addition, in the transmission network 50, when multiple switches in the same hop have unequal memory, the switch in the hop delays part of the data flow to the next fully connected layer for measurement, rather than the next hop. The "fully connected layer" referred to in the embodiment of the present application refers to a layer in which each switch in the previous layer is connected to each switch in the current layer. In the fat-tree architecture, the second hop and the fifth hop are fully connected layers.
[0350] by Fig.11 For example, sending data from Pod1 to Pod4, assuming that the memory of switch S_a1 is m S_a1 than the memory m of switch S_a2 S_a2 Big, that is, m S_a1 >m S_a2 The number of virtual nodes corresponding to the second-hop transmission node can refer to the algorithm of formula (9) above. In addition, the switch S_a2 is based on the preset ratio Select part of the data flow passing through the transmission node 322 for measurement; The transmission node 322 can mark the data packets of this part of the data flow so that the switch in the next fully connected layer (i.e., the switch in the access layer in Pod4) can measure the data packets of the marked data flow. It can be seen that at this time, the core layer and the aggregation layer in Pod4 do not measure the data packets of the marked data flow.
[0351] In this case, in order to ensure that the switches in the access layer of Pod4 can be allocated an appropriate number of data flows, the number of virtual nodes corresponding to the access layer in Pod4 is v 5 , which can be expressed as:
[0352]
[0353] Among them, M 5 is the sum of the memory of the switches in the access layer of Pod4, M 2 is the sum of the memory of the switches in the aggregation layer of Pod2 (i.e., m S_a1 +m S_a2 ), N 2 The number of virtual nodes corresponding to the aggregation layer in Pod2.
[0354] In addition, when a change in the memory of the switch is detected, the controller 501 can re-determine the consistent hash algorithm corresponding to the corresponding transmission path with reference to the content of the above formula (2). In this way, when the memory of the transmission node on the transmission path changes, since "the number of virtual nodes corresponding to the transmission node is positively correlated with the memory size of the transmission node" in the virtual node mechanism of the consistent hash algorithm, the number of virtual nodes corresponding to the transmission node can be dynamically adjusted according to the memory change of the transmission node, thereby dynamically adjusting the measurement tasks undertaken by each transmission node.
[0355] In addition, when a switch failure is detected, the traffic of the failed switch can be carried by a sibling switch at the same layer in the same Pod.
[0356] Taking the aggregation layer switch failure as an example, the same layer in the same Pod The brother switches carry the traffic of the failed switch ( Fig.11 where k is 4), the amount of traffic allocated to these switches increases At this time, in order to ensure that the switches in the corresponding layer of the failed switch can be allocated with an appropriate number of data flows, the number of virtual nodes in the corresponding layer of the failed switch can be expressed as:
[0357]
[0358] Among them, N i is the number of virtual nodes in the corresponding layer of the failed switch before the failure occurs.
[0359] After the controller 501 sends the configuration information to each transmission node through S602, each transmission node in the transmission network 50 can determine the measurement level of the data flow x by referring to the contents of S203, S208, S214, S404 or S409 above after receiving the data packet of the data flow x, and determine the measurement strategy by referring to the contents of S205, S209, S215, S405 or S410, and record the measurement result of the data flow x according to the corresponding measurement strategy. In addition, when each transmission node performs delay measurement on the data flow, it delays part of the data flow to the next fully connected layer for measurement, instead of the next hop, according to the corresponding description in S602.
[0360] Application scenario 4:
[0361] Fig.12 The structure diagram of another transmission network provided by an embodiment of the present application is shown. The transmission network 70 is a leaf-spine structure. Specifically, the transmission network 70 includes multiple leaf switches (switch S_l1, switch S_l2, switch S_l3, switch S_l4, switch S_l5 and switch S_l6 are taken as examples in the figure) and multiple spine switches (switch S_s1, switch S_s2, switch S_s3 and switch S_s4 are taken as examples in the figure). Among them, each leaf switch is connected to each spine switch respectively. In addition, each leaf switch is also connected to one or more servers (server h1-server h12 is taken as an example in the figure).
[0362] In addition, the transmission network 70 further includes a controller 701. The controller 701 may be used to send configuration information to each transmission node in the transmission network, so that each transmission node measures the data flow according to the configuration information.
[0363] It should be noted that Fig.13 The controller 701 is exemplarily used as a software or hardware device independent of each switch and server, and the controller 701 is exemplarily connected to the spine switch S_s1 to access the controller 701 to the transmission network 70. In actual application, on the one hand, when the function of the controller 701 is implemented by a software or hardware device independent of each switch and server, the controller 701 can access the transmission network 70 through any transmission node in the transmission network 70; on the other hand, the function of the controller 701 can also be implemented by any transmission node in the transmission network. At this time, the controller 701 can be used as a functional module on the transmission node. There is no limitation on the specific form of the controller 701 in the embodiments of the present application.
[0364] In the embodiments of the present application, it is considered that for a data flow in a leaf-spine network, the leaf switch through which the data flow passes can usually be uniquely identified, but it is difficult to identify the spine switch through which the data flow passes (because the data flow usually selects a spine switch in the leaf-spine network for transmission with equal probability). Therefore, a memory change of a leaf switch will affect each path that uses the switch as a source switch or a destination switch, while a memory change of a spine switch will affect all paths.
[0365] Based on the above considerations, when the controller 701 configures the consistent hashing algorithm for each transmission path, on the one hand, when the available memory of the spine switch changes, the controller 701 scans the consistent hashing algorithm corresponding to each transmission path in the transmission network 70, and adjusts each consistent hashing algorithm according to the content of S403 above. On the other hand, when the available memory of the leaf switch changes, the controller 701 only scans the consistent hashing algorithm corresponding to the transmission path passing through the leaf switch in the transmission network 70 and adjusts each consistent hashing algorithm according to the content of S403 above.
[0366] In addition, when the controller 701 assigns a consistent hashing algorithm to each transmission path, the same consistent hashing algorithm can be used for leaf switches with the same memory. Fig.13 If the memory of leaf switch S_l5 and leaf switch S_l6 is the same, the transmission path from another leaf switch to leaf switch S_l5 and leaf switch S_l6 can use the same consistent hashing algorithm. Exemplarily, the transmission path from leaf switch S_l1 to leaf switch S_l5 and leaf switch S_l6 can use the same consistent hashing algorithm; in addition, the transmission path from leaf switch S_l5 or leaf switch S_l6 to another leaf switch can also use the same consistent hashing algorithm. Exemplarily, the transmission path from leaf switch S_l5 or leaf switch S_l6 to leaf switch S_l1 can also use the same consistent hashing algorithm.
[0367] In addition, in one implementation, when the controller 701 assigns a consistent hashing algorithm to each transmission path, it may also first configure the same number of virtual nodes for each hop, and then after obtaining the memory of each transmission node, determine the consistent hashing algorithm of the corresponding transmission path according to the memory of each transmission node.
[0368] In the transmission network 70, the controller 701 can determine the measurement level of each data stream with reference to the contents of S201 or S401 above, and send configuration information to each transmission node with reference to the contents of S202, S206, S210 or S403, wherein the consistent hashing algorithm carried in the configuration information corresponds to the characteristics of the above-mentioned leaf-spine network. In addition, after the controller 701 sends the configuration information to each transmission node, each transmission node in the transmission network 70 can determine the measurement level of data stream x with reference to the contents of S203, S208, S214, S404 or S409 above after receiving the data packet of data stream x, and determine the measurement strategy with reference to the contents of S205, S209, S215, S405 or S410, and record the measurement results of data stream x according to the corresponding measurement strategy. The memory is repeated and will not be elaborated here.
[0369] The following describes the method provided by this embodiment from the perspective of a single communication device in conjunction with the accompanying drawings. Fig.14 As shown, the method includes:
[0370] S801. A first node determines a first measurement level corresponding to a first data flow.
[0371] The first data flow is a data flow passing through the first node.
[0372] The first node can be the above Figure 4 , Figure 5 or Figure 6 The transmission node 121 in the embodiment, or the first node may be the above Figure 8 or Fig. 9 The transmission node 321 in the embodiment, or the first node may be the above Fig.10 The transmission node 322 in the embodiment, or the first node may be the above Fig.12 The transport node in .
[0373] The specific implementation process of S801 can be found in Figure 4 S203 in Figure 5 S208 or Figure 6 The implementation process of S214 in Fig. 9 S404 or Fig.10 The implementation process of S409 in .
[0374] S802: The first node determines a measurement strategy according to a first measurement level.
[0375] The specific implementation process of S802 can be referred to Figure 4 S204 in Figure 5 S209 or Figure 6 The implementation process of S215 in Fig. 9 S405 or Fig.10 The implementation process of S410 in .
[0376] Among them, different measurement levels in the multiple preset levels may correspond to different measurement strategies.
[0377] In an implementation manner, the measurement strategy determined in S802 may include: when the first measurement level is a first preset level among multiple preset levels, recording a measurement result of the first data stream.
[0378] In this case, S802 specifically includes:
[0379] S802a: When the first measurement level is a first preset level among multiple preset levels, the first node records a measurement result of the first data flow.
[0380] The first preset level can be the above Figure 4 or Figure 8 Corresponds to measurement level a in the process.
[0381] The specific implementation process of S802a can be referred to Figure 4 The implementation process of S205a in .
[0382] In addition, the measurement strategy determined in the above S802 may also include: when the first measurement level is a level other than the first preset level among multiple preset levels, determining a measurement node corresponding to the first data stream from a transmission path of the first data stream. When the measurement node corresponding to the first data stream is the first node, recording a measurement result of the first data stream.
[0383] The transmission path includes at least one transmission node, and the measurement node is included in the at least one transmission node.
[0384] In this case, S802 also specifically includes S802b1-S802b2:
[0385] S802b1: When the first measurement level is a level other than the first preset level among multiple preset levels, the first node determines a measurement node corresponding to the first data flow from a transmission path of the first data flow.
[0386] The specific implementation process of S802b1 can be found in Figure 5 The implementation process of S210 in Figure 6 The implementation process of S216 in Fig. 9 The implementation process of S406 in Fig.10 The implementation process of S411 in .
[0387] S802b2: When the measurement node corresponding to the first data flow is the first node, the first node records the measurement result of the first data flow.
[0388] The specific implementation process of S802b2 can be found in Figure 5 The implementation process of S211 in Figure 6 The implementation process of S217 in Fig. 9 The implementation process of S407 in Fig.10 The implementation process of S412 in .
[0389] In one implementation, when the first measurement level is a first preset level among multiple preset levels, the first node records a measurement result of the first data flow (S802a), including:
[0390] S802a1. When the first measurement level is a first preset level among multiple preset levels, the first node records a measurement result of the first data flow by using a flow table of the first data flow.
[0391] The specific implementation process of S802a1 can be found in Figure 4 The implementation process of S205a in .
[0392] In one implementation, when the measurement node corresponding to the first data flow is the first node, the first node records the measurement result of the first data flow (S802b2), including:
[0393] S802b21. When the measurement node corresponding to the first data flow is the first node and the first measurement level is the second preset level among the plurality of preset levels, the first node records the measurement result of the first data flow using the flow table of the first data flow.
[0394] The second preset level may be the measurement level b in the above embodiment.
[0395] The specific implementation process of S802b21 can be referred to Figure 5 The implementation process of S2111 in Fig. 9 The implementation process of S4071 in .
[0396] Alternatively, when the measurement node corresponding to the first data flow is the first node, the first node records the measurement result of the first data flow (S802b2), including:
[0397] S802b22: When the measurement node corresponding to the first data stream is the first node and the first measurement level is the third preset level among the multiple preset levels, the first node measures the first data stream using a sketch technology.
[0398] The third preset level may be the measurement level c in the above embodiment.
[0399] The specific implementation process of S802b22 can be referred to Figure 6 The implementation process of S2171 in .
[0400] In one implementation, when the first measurement level is a level other than the first preset level among multiple preset levels, the first node determines a measurement node corresponding to the first data stream from a transmission path of the first data stream (ie, S802b1), including:
[0401] S802b11. When the first measurement level is a level other than the first preset level among multiple preset levels, the first node obtains a consistent hash algorithm corresponding to the transmission path.
[0402] The specific implementation process of S802b11 can be found in Figure 5 The implementation process of S2101 in Figure 6 The implementation process of S2161 in Fig. 9 The implementation process of S40511 in Fig.10 The implementation process of S40811 in .
[0403] S802b12. The first node determines a measurement node corresponding to the first data stream according to a consistent hashing algorithm.
[0404] The specific implementation process of S802b12 can be referred to Figure 5 The implementation process of S20812 in Figure 6 The implementation process of S21212 in Fig. 9 The implementation process of S4062 in Fig.10 The implementation process of S4111 in .
[0405] In one implementation, the virtual node mechanism of the above-mentioned consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path, and the number of virtual nodes corresponding to a transmission node is positively correlated with the memory size of the transmission node.
[0406] In one implementation, there are multiple branch paths in the transmission path, and the consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node. The target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0407] In one implementation, the first node determines the measurement node corresponding to the first data stream (ie, S802b12) according to the consistent hashing algorithm, including the following S3-S4:
[0408] S3. The first node determines the transmission node to which the first summary data is mapped according to the first summary data and the consistent hashing algorithm. The first summary data is summary data obtained by performing a hash operation on the identifier of the first data flow.
[0409] S4. When the first summary data is mapped to the target transmission node, the first node determines whether the measurement node corresponding to the first data stream is the first node according to a preset strategy. The preset strategy includes: selecting a preset proportion of the data streams passing through the transmission path, and determining the measurement node corresponding to the part of the data streams as the first node.
[0410] Among them, the specific implementation process of S3-S4 can refer to the implementation process of S1-S2 in S4112 above.
[0411] In one implementation, the first node determines a first measurement level corresponding to a first data flow from a plurality of preset levels (ie, S801), including:
[0412] S801a: The first node determines a first measurement level corresponding to the first data flow from a plurality of preset levels according to the flow size of the first data flow.
[0413] The specific implementation process of S801a may refer to the implementation process of S201a, S401a or S601a mentioned above. It is understandable that in S201a, S401a or S601a, the controller 101 or the controller 301 determines the measurement level corresponding to the data flow from multiple preset levels according to the flow size of the data flow. In actual application, the process of S201a, S401a or S601a may also be executed by the transmission node, and this may not be limited in the embodiment of the present application.
[0414] In one implementation, the first node determines a first measurement level corresponding to a first data flow from a plurality of preset levels (ie, S801), including:
[0415] S801b: The first node determines a first measurement level corresponding to the first data flow from a plurality of preset levels according to a user operation.
[0416] The specific implementation process of S801b may refer to the implementation process of S201b, S401b or S601b mentioned above. Similar to S201a, S401a and S601a, in S201b, S401b or S601b, the controller 101 or the controller 301 determines the measurement level corresponding to the data flow from a plurality of preset levels according to the flow size of the data flow. In actual application, the process of S201b, S401b or S601b may also be executed by the transmission node, and this may not be limited in the embodiment of the present application.
[0417] In one implementation, the transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
[0418] In addition, as Fig.15 shown, the method may further include:
[0419] S901. The controller determines a first measurement level corresponding to the first data stream.
[0420] Wherein, the controller may be the controller 101 in the above Figure 4 , Figure 5 or Figure 6 , or the controller may be the controller 301 in the above Figure 8 , Fig. 9 or Fig.10 , or the controller may be the controller 501 in the above Fig.12 , or the controller may be the controller 701 in the above Fig.13 .
[0421] Wherein, for the specific implementation process of S901, reference may be made to the implementation processes of S201a or S401a in the foregoing text.
[0422] S902. The controller sends configuration information to a first node in the transmission network.
[0423] Wherein, the configuration information includes a first measurement level corresponding to the first data stream, and the configuration information is used to indicate determining a measurement policy according to the first measurement level; the first node is a transmission node through which the first data stream passes in the transmission network.
[0424] Wherein, for the specific implementation process of S902, reference may be made to the implementation processes of S202, S207, S213, S402, S403 or S602 in the foregoing text.
[0425] In one implementation, the first node determines a first measurement level corresponding to the first data stream (i.e., S901), including:
[0426] S901a. The first node determines a first measurement level corresponding to the first data stream according to the traffic volume of the first data stream.
[0427] Wherein, for the specific implementation process of S901a, reference may be made to the implementation processes of S201a, S401a or S601a in the foregoing text.
[0428] In one implementation, the first node determines a first measurement level corresponding to the first data stream (i.e., S901) from multiple preset levels, including:
[0429] S901b. The first node determines a first measurement level corresponding to the first data flow according to a user operation.
[0430] The specific implementation process of S901b may refer to the implementation process of S201b, S401b or S601b mentioned above.
[0431] In one implementation, the configuration information also includes: a consistent hashing algorithm corresponding to the transmission path of the first data stream in the transmission network; the virtual node mechanism of the consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path; and the consistent hashing algorithm is used to determine the measurement node corresponding to the first data stream.
[0432] In one implementation, in the virtual node mechanism of the above-mentioned consistent hashing algorithm, the number of virtual nodes corresponding to a transmission node is positively correlated with the memory size of the transmission node.
[0433] In one implementation, when there are multiple branch paths in the transmission path, the virtual node mechanism of the consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node. The target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0434] In one implementation, the transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
[0435] It is understandable that, in order to implement the above embodiments, each transmission node or controller includes a hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0436] like Fig.16 FIG. 1 is a schematic diagram of a data processing device provided by the present application. The data processing device 100 can be used to implement the above Figure 4-6 The functions of each step performed by the transmission node 121 described above, or the data processing device 100 can be used to implement the above Figure 8 or Fig. 9 The functions of each step performed by the transmission node 321 described above, or the data processing device 100 can be used to implement the above Fig.10 The functions of each step performed by the transmission node 322 described above, or the data processing device 100 can be used to implement the above Fig.14The functions of each step performed by the first node are described.
[0437] like Fig.16 As shown, the data processing device 100 includes: a level determination unit 1001 and a strategy determination unit 1002 .
[0438] The level determination unit 1001 is used to determine a first measurement level corresponding to a first data flow, where the first data flow is a data flow passing through a first node.
[0439] The strategy determining unit 1002 is configured to determine a measurement strategy according to a first measurement level.
[0440] In one implementation, the measurement strategy corresponding to the first measurement level includes: when the first measurement level is the first preset level among multiple preset levels, recording the measurement result of the first data stream. Different measurement levels among the multiple preset levels correspond to different measurement strategies. Alternatively, the above-mentioned measurement strategy includes: when the first measurement level is a level other than the first preset level among multiple preset levels, determining the measurement node corresponding to the first data stream from the transmission path of the first data stream. When the measurement node corresponding to the first data stream is the first node, recording the measurement result of the first data stream. The transmission path includes at least one transmission node, and the above-mentioned measurement node is included in the at least one transmission node.
[0441] In one implementation, when the first measurement level is the first preset level among multiple preset levels, recording the measurement result of the first data flow includes: when the first measurement level is the first preset level among multiple preset levels, using the flow table of the first data flow to record the measurement result of the first data flow.
[0442] In one implementation, when the measurement node corresponding to the first data stream is the first node, recording the measurement result of the first data stream includes: when the measurement node corresponding to the first data stream is the first node and the first measurement level is the second preset level among multiple preset levels, using the flow table of the first data stream to record the measurement result of the first data stream. The second preset level is a level other than the first preset level among the multiple preset levels. Alternatively, when the measurement node corresponding to the first data stream is the first node and the first measurement level is the third preset level among the multiple preset levels, using the sketching technology to measure the first data stream. The third preset level is a level other than the first preset level and the second preset level among the multiple preset levels.
[0443] In one implementation, when the first measurement level is a level other than the first preset level among multiple preset levels, determining a measurement node corresponding to the first data stream from a transmission path of the first data stream includes: when the first measurement level is a level other than the first preset level among multiple preset levels, obtaining a consistent hash algorithm corresponding to the transmission path. The first node determines the measurement node corresponding to the first data stream according to the consistent hash algorithm.
[0444] In one implementation, the virtual node mechanism of the above-mentioned consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path. The number of virtual nodes corresponding to one transmission node is positively correlated with the memory size of the transmission node. The consistent hashing algorithm is used to determine the virtual node corresponding to the data flow and determine the transmission node corresponding to the virtual node as the measurement node of the data flow.
[0445] In one implementation, there are multiple branch paths in the transmission path, and the virtual node mechanism of the consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node. The target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0446] In one implementation, determining the measurement node corresponding to the first data stream according to a consistent hashing algorithm includes: determining the transmission node to which the first summary data is mapped according to the first summary data and the consistent hashing algorithm. The first summary data is summary data obtained by performing a hash operation on an identifier of the first data stream. When the first summary data is mapped to a target transmission node, determining whether the measurement node corresponding to the first data stream is the first node according to a preset strategy. The preset strategy includes: selecting a preset proportion of a portion of the data stream in the data stream passing through the transmission path, and determining the measurement node corresponding to the portion of the data stream as the first node.
[0447] In one implementation, the level determination unit 1001 is used to determine the first measurement level corresponding to the first data flow, including: the level determination unit 1001 is used to determine the first measurement level corresponding to the first data flow according to the flow size of the first data flow.
[0448] In one implementation, the level determination unit 1001 is used to determine the first measurement level corresponding to the first data stream, including: the level determination unit 1001 is used to determine the first measurement level corresponding to the first data stream according to user indication information.
[0449] In one implementation, the data processing device is applied to a fat-tree network, or the transmission network is a leaf-spine network.
[0450] like Fig.17The data processing device 110 can be used to implement the above Figure 4-6 The controller 101 may be used to perform the functions of each step described above, or the data processing device 110 may be used to implement the above Figure 8-10 The controller 301 described above may be used to perform the functions of each step, or the data processing device 110 may be used to implement the above Fig.12 The controller 501 described above may be used to perform the functions of each step, or the data processing device 110 may be used to implement the above Fig.15 The functions of each step performed by the controller are described.
[0451] like Fig.17 As shown, the data processing device 110 includes:
[0452] The determining unit 1101 is configured to determine a first measurement level corresponding to a first data stream.
[0453] A communication unit 1102 is used for the controller to send configuration information to a first node in the transmission network, wherein the configuration information includes a first measurement level corresponding to the first data flow, and the configuration information is used to indicate that a measurement strategy is determined according to the first measurement level; wherein the first node is a transmission node in the transmission network through which the first data flow passes.
[0454] In one implementation, the determining unit 1101 is used to determine the first measurement level corresponding to the first data flow, including: a determining unit is used to determine the first measurement level corresponding to the first data flow according to the flow size of the first data flow.
[0455] In one implementation, the determining unit 1101 is used to determine the first measurement level corresponding to the first data stream, including: a determining unit is used to determine the first measurement level corresponding to the first data stream according to a user operation.
[0456] In one implementation, the configuration information also includes: a consistent hashing algorithm corresponding to the transmission path of the first data stream in the transmission network; the virtual node mechanism of the consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path; and the consistent hashing algorithm is used to determine the measurement node corresponding to the first data stream.
[0457] In one implementation, the virtual node mechanism of the above-mentioned consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path. The number of virtual nodes corresponding to one transmission node is positively correlated with the memory size of the transmission node. The consistent hashing algorithm is used to determine the virtual node corresponding to the data flow and determine the transmission node corresponding to the virtual node as the measurement node of the data flow.
[0458] In one implementation, there are multiple branch paths in the transmission path, and the virtual node mechanism of the above-mentioned consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node, and the target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
[0459] In one implementation, the transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
[0460] Fig.18 This is a schematic diagram of the structure of another data processing device provided in this embodiment. The data processing device 120 may be a chip or a system on a chip. In addition, the data processing device 120 may include all or part of the hardware in a switch, a router, a virtual switch, a desktop computer, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, a super mobile personal computer, a netbook, and a cellular phone, a personal digital assistant, an augmented reality\virtual reality device, etc., which can perform network measurement or control a network measurement device.
[0461] The data processing device 120 may include: a processor 1201 , a communication line 1202 , a memory 1203 , and part or all of at least one communication interface 1204 .
[0462] The processor 1201 is used to execute the above Figure 4-6 The functions of each step performed by the transmission node 121 described above, or for performing the above Figure 8 or Fig. 9 The functions of each step performed by the transmission node 321 described above, or for performing the above Fig.10 The functions of each step performed by the transmission node 322 described above, or for performing the above Fig.14 The functions of each step performed by the first node are described.
[0463] Alternatively, the processor 1201 is used to execute the above Figure 4-6 The functions of each step performed by the controller 101 described above, or for performing the above Figure 8-10 The functions of the steps performed by the controller 301 described above, or the functions of the steps performed by the controller 301 described above, Fig.12 The functions of each step performed by the controller 501 described above, or used to implement the above Fig.15 The functions of each step performed by the controller are described.
[0464] Specifically, the processor 1201 may include a general-purpose central processing unit (CPU), and the processor 1201 may also include a microprocessor, a field programmable gate array (Field Programmable Gate Array, FPGA), a digital signal processor (digital signal processing, DSP) or an application-specific integrated circuit (application-specific integrated circuit, ASIC), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0465] In a specific implementation, as an embodiment, the processor 1201 may include one or more CPUs, such as Fig.18 CPU0 and CPU1 in.
[0466] In a specific implementation, as an embodiment, the device 120 may include multiple processors, such as Fig.18 1 and 1206. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing, for example, computer data (computer program instructions).
[0467] In addition, the memory 1203 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM). Memory 1203 can be independent and connected to processor 1201 via communication line 1202. Memory 1203 can also be integrated with processor 1201.
[0468] The memory 1203 stores computer instructions. The processor 1201 can execute the computer instructions stored in the memory 1203 to perform all or part of the steps in the method provided in this embodiment.
[0469] Optionally, the computer-executable instructions in this embodiment may also be referred to as application program codes, which is not specifically limited in this embodiment.
[0470] In addition, the communication interface 1204 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0471] In addition, the communication line 1202 is used to connect the various components in the data processing device 120. Specifically, the communication line 1202 may include a data bus, a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are marked as communication lines 1202 in the figure.
[0472] In addition, the data processing device 120 may further include a storage medium 1205. The storage medium 1205 is used to store computer instructions and various data for implementing the technical solution of this embodiment. When the data processing device 120 executes the above method of this embodiment, the computer instructions and various data stored in the storage medium 1205 are loaded into the memory 1203, so that the processor 1201 can execute the computer instructions stored in the memory 1203 to execute the method provided by this embodiment.
[0473] The method steps in this embodiment can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, PROM, EPROM, EEPROM, registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a data processing device. Of course, the processor and the storage medium can also be present in the data processing device as discrete components.
[0474] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in this embodiment is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a communication device, a user device or other programmable device. The computer program or instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program or instruction can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, a hard disk, or a tape; it can also be an optical medium, such as a digital video disc (DVD); it can also be a semiconductor medium, such as an SSD.
[0475] In this embodiment, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different implementations are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form a new embodiment based on their internal logical relationships.
[0476] In this embodiment, "at least one" means one or more, "more than one" means two or more, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, for elements (element) in the singular form "a", "an" and "the", unless the context clearly stipulates otherwise, it does not mean "one or only one", but means "one or more than one". For example, "a device" means one or more such devices. Furthermore, at least one (at least one of)... "means one or any combination of subsequent associated objects, for example, "at least one of A, B and C" includes A, B, C, AB, AC, BC, or ABC. In the text description of this embodiment, the character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula of this embodiment, the character " / " indicates that the previous and next associated objects are in a "division" relationship.
Claims
1. A network measurement method, It is characterized in that Applied to a first node in a transmission network, the method comprises: The first node determines a first measurement level for a first data flow; the first data flow is a data flow passing through the first node; The first node determines a measurement strategy according to the first measurement level.
2. The method according to claim 1, It is characterized in that The measurement strategy includes: When the first measurement level is a first preset level among multiple preset levels, recording a measurement result of the first data stream; different measurement levels among the multiple preset levels correspond to different measurement strategies; Alternatively, the measurement strategy comprises: When the first measurement level is a level other than the first preset level among the multiple preset levels, determine the measurement node corresponding to the first data stream from the transmission path of the first data stream; when the measurement node corresponding to the first data stream is the first node, record the measurement result of the first data stream; the transmission path includes at least one transmission node, and the measurement node is included in the at least one transmission node.
3. The method according to claim 2, It is characterized in that When the first measurement level is the first preset level among the multiple preset levels, recording the measurement result of the first data stream includes: When the first measurement level is the first preset level among the multiple preset levels, the flow table of the first data flow is used to record the measurement result of the first data flow.
4. The method according to claim 2 or 3, It is characterized in that When the measurement node corresponding to the first data flow is the first node, recording the measurement result of the first data flow includes: When the measurement node corresponding to the first data flow is the first node and the first measurement level is a second preset level among the multiple preset levels, using the flow table of the first data flow to record the measurement result of the first data flow; the second preset level is a level among the multiple preset levels except the first preset level; Alternatively, when the measurement node corresponding to the first data stream is the first node and the first measurement level is the third preset level among the multiple preset levels, the first data stream is measured using sketch technology; the third preset level is the level among the multiple preset levels except the first preset level and the second preset level.
5. The method according to any one of claims 2 to 4, It is characterized in that When the first measurement level is a level other than the first preset level among the multiple preset levels, determining a measurement node corresponding to the first data stream from a transmission path of the first data stream includes: When the first measurement level is a level other than the first preset level among the multiple preset levels, obtaining a consistent hash algorithm corresponding to the transmission path; According to the consistent hashing algorithm, a measurement node corresponding to the first data stream is determined.
6. The method according to claim 5, It is characterized in that The virtual node mechanism of the consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path; the number of virtual nodes corresponding to one transmission node is positively correlated with the memory size of the transmission node, and the consistent hashing algorithm is used to determine the virtual node corresponding to the data flow and determine the transmission node corresponding to the virtual node as the measurement node of the data flow.
7. The method according to claim 5 or 6, It is characterized in that There are multiple branch paths in the transmission path, and the virtual node mechanism of the consistent hashing algorithm includes a virtual node corresponding to the target transmission node; the target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
8. The method according to claim 7, It is characterized in that The determining, according to the consistent hashing algorithm, a measurement node corresponding to the first data stream includes: Determine, according to the first summary data and the consistent hash algorithm, a transmission node to which the first summary data is mapped; the first summary data is summary data obtained by performing a hash operation on the identifier of the first data flow; When the first summary data is mapped to the target transmission node, determine whether the measurement node corresponding to the first data stream is the first node according to a preset strategy; the preset strategy includes: selecting a preset proportion of partial data streams in the data stream passing through the transmission path, and determining the measurement node corresponding to the partial data stream as the first node.
9. The method according to any one of claims 1 to 8, It is characterized in that The first node determines a first measurement level corresponding to the first data stream, including: The first node determines a first measurement level corresponding to the first data flow according to the flow size of the first data flow.
10. The method according to any one of claims 1 to 8, It is characterized in that The first node determines a first measurement level corresponding to the first data stream, including: The first node determines a first measurement level corresponding to the first data flow according to a user operation.
11. The method according to any one of claims 1 to 10, It is characterized in that The transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
12. A network measurement method, It is characterized in that Applied to a controller in a transmission network, the method comprises: The controller determines a first measurement level corresponding to the first data stream; The controller sends configuration information to a first node in the transmission network, the configuration information including a first measurement level corresponding to the first data flow, and the configuration information is used to indicate a measurement strategy determined according to the first measurement level; the first node is a transmission node in the transmission network through which the first data flow passes.
13. The method according to claim 12, It is characterized in that The controller determines a first measurement level corresponding to the first data stream, including: The controller determines a first measurement level corresponding to the first data flow according to the flow rate of the first data flow.
14. The method according to claim 12 or 13, It is characterized in that The controller determines a first measurement level corresponding to the first data stream, including: The controller determines a first measurement level corresponding to the first data stream according to a user operation.
15. The method according to any one of claims 12 to 14, It is characterized in that The configuration information also includes: a consistent hash algorithm corresponding to a transmission path of the first data flow in the transmission network; the consistent hash algorithm is used to determine a measurement node corresponding to the first data flow.
16. The method according to claim 15, It is characterized in that The virtual node mechanism of the consistent hashing algorithm includes virtual nodes corresponding to each transmission node on the transmission path; the number of virtual nodes corresponding to one transmission node is positively correlated with the memory size of the transmission node, and the consistent hashing algorithm is used to determine the virtual node corresponding to the data flow and determine the transmission node corresponding to the virtual node as the measurement node of the data flow.
17. The method according to claim 15 or 16, It is characterized in that When there are multiple branch paths in the transmission path, the virtual node mechanism of the consistent hashing algorithm includes the number of virtual nodes corresponding to the target transmission node; the target transmission node is used to indicate the transmission node obtained by taking the multiple branch path parts in the transmission path as a whole.
18. The method according to any one of claims 12 to 17, It is characterized in that The transmission network is a fat-tree network, or the transmission network is a leaf-spine network.
19. A data processing device, applied to a first node in a transmission network, the data processing device include: a level determination unit, configured to determine a first measurement level corresponding to the first data stream; The first data flow is a data flow passing through the first node; A measurement determination unit is configured to determine a measurement strategy according to the first measurement level.
20. A data processing device, It is characterized in that A controller applied to a transmission network, wherein the data processing device comprises: a determining unit, configured to determine a first measurement level corresponding to the first data stream; A communication unit, used for the controller to send configuration information to a first node in the transmission network, the configuration information including a first measurement level corresponding to the first data flow, and the configuration information is used to indicate a measurement strategy determined according to the first measurement level; the first node is a transmission node in the transmission network through which the first data flow passes.
21. A data processing device, It is characterized in that It comprises a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement the method as claimed in any one of claims 1 to 11 or to implement the method as claimed in any one of claims 12 to 18.
22. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a processor, the method according to any one of claims 1 to 11 or the method according to any one of claims 12 to 18 is implemented.
23. A computer program product, It is characterized in that The computer program product comprises instructions, which, when executed on a processor, are used to implement the method according to any one of claims 1 to 11 or to implement the method according to any one of claims 12 to 18.