A Packet Transmission Analysis Method Combining SRv6 and k-Nearest Neighbor Algorithm
The integration of k-NN algorithm with SRv6 optimizes path selection and address allocation, addressing suboptimal data transmission in SRv6 networks by predicting faults and reducing resource consumption.
Patent Information
- Application Number
- CN202211320372.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-10-26
AI Technical Summary
In the existing SRv6 network, the uniqueness and path optimization problems of SIDs have not been effectively solved, resulting in inaccuracy of transmitted data and waste of resources.
SRv6 combined with k nearest neighbor algorithm is adopted to build k nearest neighbor algorithm model and early warning model, intelligent allocation identification is generated, path selection is optimized, resource consumption is reduced, and data transmission accuracy is improved.
It realizes the accuracy and flexibility of forwarding complex service packets in super-large networks, reduces resource consumption, and improves the accuracy and configuration flexibility of data transmission.
Smart Images

Figure CN115914071B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network technology and security, and particularly relates to a method for analyzing packet transmission by combining SRv6 with the k-nearest neighbor algorithm. Background Art
[0002] With the rapid development of computer technology, information networks have become an important guarantee for social development. Under the background of the cloud-network integration era, flexible and agile network service capabilities directly affect the competitiveness of operators. SR (Segment Routing) is a type of source routing technology, and SRv6 is the application of SR technology in the IPv6 network. The emergence of SRv6 is a huge innovation. It combines SDN technology to enable programmable networks, which provides an innovative soil for network basic services and value-added network services in the cloud-network era.
[0003] Chinese invention patent CN201911329833.1 discloses a method and device for SID allocation based on an SRv6 network, including: obtaining at least one network segment, each network segment including at least one IPv6 address; dividing each network segment into multiple SID segments of different types and having no intersection with each other; determining the corresponding allocation method according to the type of each SID segment; and allocating the corresponding SID to the routing information of the SR device according to the corresponding allocation method for each SID segment, so that the SR device generates a routing table according to the allocated SID. However, this invention only ensures the uniqueness of SIDs and cannot ensure the optimal path.
[0004] Chinese invention patent CN202010346913.4 discloses a data processing method and related device based on SRv6, including: a controller generating a segment identifier, the segment identifier including location information, an instruction, and a path identifier, the path identifier being used to indicate the forwarding path of an SRv6 packet between network devices in an SR network; and the controller sending the segment identifier to the network device so that the network device forwards the SRv6 packet according to the segment identifier. However, this invention cannot perform intelligent allocation of address identifiers. Summary of the Invention
[0005] In view of the deficiencies of the prior art, the present invention provides a method for analyzing packet transmission by combining SRv6 with the k-nearest neighbor algorithm. This method highlights the status of artificial intelligence in the scenario of combining the method of selecting an optimal path in an SRv6 network with the SRv6 packet environment, and improves the accuracy of transmitted data and flexible configuration by adopting different allocation algorithms for the SRv6 packet routing allocation mechanism.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for analyzing packet transmission by combining SRv6 with the k-nearest neighbor algorithm, comprising the following steps:
[0008] S11. An initial allocation address identifier generation module for SRv6 network nodes;
[0009] S12. A module for constructing a k-nearest neighbor algorithm model, an early warning model, and generating an intelligent allocation identifier;
[0010] The step S12 includes the following steps:
[0011] S121. Obtain the failure rates of all next-hop SR nodes associated with the initiating node through the k-nearest neighbor algorithm model, and then predict the alarm probabilities of all next-hop SR nodes through the early warning model;
[0012] S122. Determine the optimal next-hop SR node by calculating the failure rate and the alarm probability, until the optimal SR node for each hop to reach the destination SR node is obtained and concatenated into an optimal address identifier;
[0013] S123. If each hop SR node of the optimal address identifier is better than each hop SR node of the initial address identifier, update the Argument initial address identifier in the SRH part of the IPv6 extension header.
[0014] The SRv6 is a network forwarding technology. SR refers to the Segment Routing technology, and v6 refers to native IPv6. SRv6 is IPv6 + Segment Routing; the initial allocation identifier is all the SIDs of the Segment List of all paths from the current SR node to the target SR node, concatenated together from bottom to top, separated by signs in the middle, to generate the initial address identifier; the optimal address identifier is to build a k-nearest neighbor algorithm model and an early warning model, add AI fault prediction and path intelligent optimization, compare and select the best to replace the initial allocation identifier, provide a new solution for complex service packet forwarding in a super-large network, reduce the resource consumption of packet forwarding, and improve the accuracy of transmitted data and flexible configuration.
[0015] The SR is to cut the packet forwarding path into different segments, insert segment information into the packet at the starting point of the path, and the intermediate nodes only need to forward according to the segment information carried in the packet. Such a path segment is called "Segment", and is identified by SID (Segment Identifier);
[0016] As a further description of the method for analyzing packet transmission by combining SRv6 with the k-nearest neighbor algorithm of the present invention, the step S11 includes the following steps:
[0017] S111. Obtain all the path Segment Lists from the current SR node to the target SR node;
[0018] S112. Extract all the SIDs in the Segment List, concatenate them from bottom to top, and separate them with signs in the middle to generate the initial address identifier;
[0019] S113. Before transmitting from the current SR node to the next-hop SR node, put the initial address identifier into the Argument in the SRH part of the IPv6 extension header.
[0020] The Segment List is all the paths automatically allocated by the networking route when the current SR node in the SRv6 network transmits an IPv6 packet to the target SR node, and it is stored in the SRv6 packet protocol SID; the IPv6 extension header SRH is mainly composed of Locator, Function, and Argument, where Locator = location information reachability, Function = service function definition, and Argument = enhancement; the address identifier facilitates the positioning of communication objects.
[0021] As a further description of the packet transmission analysis method of SRv6 combined with the k-nearest neighbor algorithm of the present invention, the steps of the k-nearest neighbor algorithm in step S121 include the following steps:
[0022] S1211. Prepare the data and arrange the data in dimensions in sequence;
[0023] S1212. Calculate the distance from the test sample point to each other sample point;
[0024] S1213. Sort each distance, and then select the K points with the smallest distance;
[0025] S1214. Compare the categories to which the K points belong, and according to the principle of the minority obeying the majority, classify the test sample point into the category with the highest proportion among the K points.
[0026] The k-nearest neighbor algorithm is used for data mining classification. The so-called K nearest neighbors means K nearest neighbors. It means that each sample can be represented by its K closest neighboring values. The nearest neighbor algorithm is a method of classifying each record in the data set.
[0027] As a further description of the packet transmission analysis method of SRv6 combined with the k-nearest neighbor algorithm of the present invention, the k-nearest neighbor algorithm model formula is:
[0028]
[0029] In the formula: x1 x2... xn is the n-dimensional data of sample X; y1, y2, ..., y n is the n-dimensional data of sample Y; X is time, and Y is the network latency in milliseconds (ms); d(x, y) is the distance between samples X and Y, which is the associated node with a network node latency of <= 50 milliseconds in 24 hours in the present invention.
[0030] As a further illustration of the message transfer analysis method combining SRv6 and the k-nearest neighbor algorithm in the present invention, the warning model is constructed using a Markov chain, and the formula is:
[0031] X(k + 1) = X(k) × P
[0032] In the formula: X(k) represents the state vector of the trend analysis and prediction object at time t = k, P represents the one-step transition probability matrix, and X(k + 1) represents the state vector of the trend analysis and prediction object at time t = k + 1.
[0033] As a further illustration of the message transfer analysis method combining SRv6 and the k-nearest neighbor algorithm in the present invention, the calculation method for the failure rate and warning probability in step S13 is weighted average. The weighted average is used to calculate the original data according to a reasonable ratio.
[0034] The present invention has the following beneficial effects:
[0035] When an IPv6 node joins the network in the SRv6 network, the present invention uses the k-nearest neighbor algorithm to obtain the probability of faulty nodes among all possible network nodes that can be used as the first hop, thereby screening out healthy network nodes. Then, a Markov chain is used to analyze the probability of each Sid network node failing based on historical traffic warning data and assign probability values. By adding AI fault prediction and intelligent path optimization, a new solution is provided for complex service message forwarding in a super-large network, reducing the resource consumption of message forwarding, and at the same time improving the accuracy of transmitted data and flexible configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is the overall scheme flowchart of the message transfer analysis method combining SRv6 and the k-nearest neighbor algorithm in the present invention.
[0037] Figure 2 is Figure 1 the flowchart of the initial allocation address identifier generation module in
[0038] Figure 3 is Figure 1 the flowchart of the module for constructing the k-nearest neighbor algorithm model, warning model, and generating intelligent allocation identifiers in
[0039] Figure 4 is the SRv6 protocol structure diagram.
[0040] Figure 5 It is the flowchart of the k-nearest neighbor algorithm.
[0041] Figure 6 It is a schematic diagram of the principle of the k-nearest neighbor algorithm model.
[0042] Figure 7 It is the overall framework diagram of the message transfer analysis method combining SRv6 with the k-nearest neighbor algorithm of the present invention. Specific implementation manners
[0043] The present invention will be further described below with reference to the accompanying drawings.
[0044] A message transfer analysis method combining SRv6 with the k-nearest neighbor algorithm, as Figure 1 shown, includes the following steps:
[0045] S11. SRv6 network node initial allocation address identifier generation module;
[0046] As Figure 2 shown, it specifically includes the following steps:
[0047] S111. Obtain all path Segment Lists from the current SR node to the target SR node; when the current SR node in the SRv6 network transmits an IPv6 message to the target SR node, the network routing will automatically allocate all paths that can automatically reach the target SR node, simply referred to as Segment List, which is stored in the SRv6 message protocol SID;
[0048] S112. Extract all SIDs in the Segment List, concatenate them together from bottom to top, and separate them with signs in the middle to generate an initial address identifier;
[0049] S113. Before the current SR node transmits to the next-hop SR node, put the initial address identifier into the Argument in the SRH part of the IPv6 extension header.
[0050] S12. Build a k-nearest neighbor algorithm model, an early warning model, and generate an intelligent allocation identifier module;
[0051] As Figure 3 shown, it specifically includes the following steps:
[0052] S121. Obtain the failure rates of all next-hop SR nodes associated with the initiating node through the k-nearest neighbor algorithm model, and then predict the warning probabilities of all next-hop SR nodes through the early warning model;
[0053] S122. Calculate the failure rate and alarm probability, and determine the optimal next-hop SR node until the optimal SR nodes for each hop to reach the destination SR node are obtained and concatenated into the optimal address identifier. The calculation method of the failure rate and alarm probability is weighted average;
[0054] S123. If each hop SR node of the optimal address identifier is better than each hop SR node of the initial address identifier, update the Argument initial address identifier of the SRH part of the IPv6 extension header.
[0055] The SRv6 protocol structure is as Figure 4 shown. An SRH (Segment Routing Header) extension header is added to the IPv6 routing extension header. This extension header specifies an explicit path of IPv6, stores the IPv6 Segment List information, and the Segment List is a forwarding path obtained by arranging segments and network nodes in an orderly manner; the programmable ability of SRv6 comes from the use of SRv6 SID with 128 bits. The SRv6 Segment defines the network instructions in SRv6 network programming, indicating where to go and how to go. The ID identifying the SRv6 Segment is called SRv6 SID, and SRv6 SID is a 128-bit value in the form of an IPv6 address, which consists of three parts: Locator, Function, and Arguments; the Locator of the SRv6 Segment structure has a positioning function and provides the routing ability of IPv6. Packets are addressed and forwarded through this field. In addition, the corresponding route of the Locator is also aggregatable; Function: used to express the forwarding action to be performed by the device instruction, and different forwarding behaviors are expressed by different Functions; Arguments: an optional field, which is a supplement to the Function and is the parameter corresponding to the instruction when it is executed. These parameters may include flows, services, or any other relevant information; each Segment of SRv6 is 128 bits and can be flexibly divided into multiple segments. The function and length of each segment can be customized, thus having the flexible programming ability, that is, the service can be edited; through the above programming space, SRv6 has a more powerful network programming ability, can better meet different network path requirements, and is perfectly integrated with SDN technology to realize the interaction between the network and applications, enabling the service-driven programmable network.
[0056] The SR technology designs two implementation methods for the data plane. One is SR-MPLS that reuses the MPLS data plane, and the other is SRv6. SRv6 uses the IPv6 data plane and is extended based on the IPv6 routing extension header. This part of the extension does not damage the standard IPv6 header. Moreover, only SRv6 nodes need to perform additional processing for the extension header, which has no impact on other ordinary IPv6 nodes. This enables SRv6 to be seamlessly compatible with existing IPv6 networks and makes the forwarding layer achieve the most minimalist forwarding of pure IPv6. SR-MPLS uses a 4-byte label to identify path information. The MPLS label can only identify three pieces of information: the label value, TTL, and the bottom of the label stack, and has no ability to carry extended information. Different from the Segment of SR-MPLS, the ID of the Segment of SRv6 is called SRv6 SID, which is a 128-bit value and is divided into three parts:
[0057] Locator (Location Identifier): An identifier assigned to a network node in the network, which can be used for routing and forwarding data packets. Locator has two important attributes: routable and aggregatable. In the SRv6 SID, Locator is a variable-length part used to adapt to networks of different scales.
[0058] Function: An ID value assigned by a device to a local forwarding instruction. This value can be used to represent the forwarding actions that the device needs to perform, similar to the operation code of a computer instruction. In SRv6 network programming, different forwarding behaviors are represented by different function IDs. To a certain extent, the function ID is similar to the MPLS label and is used to identify VPN forwarding instances, etc.
[0059] Args (Variables): The parameters required when the forwarding instruction is executed. These parameters may include flows, services, or any other relevant variable information.
[0060] In summary, SRv6 has both routing and MPLS forwarding attributes, has TE traffic engineering capabilities, scalability capabilities, is compatible with IPv6, and is also convenient for future fixed-mobile convergence to achieve the unification of IP forwarding technologies.
[0061] Furthermore, as Figure 5 shown, the k-nearest neighbor algorithm in step S121 includes the following steps:
[0062] S1211. Prepare the data and arrange the data in order of dimensions.
[0063] S1212. Calculate the distance from the test sample point to each other sample point.
[0064] S1213. Sort each distance and then select the K points with the smallest distances.
[0065] S1214. Compare the categories to which the K points belong. According to the principle of the minority obeying the majority, classify the test sample point into the category with the highest proportion among the K points.
[0066] The working principle of the k-nearest neighbor algorithm is as follows: There is a sample data set and data labels, and the corresponding relationship between the samples and the labels is known; input data without labels, and compare each feature of the new data with the corresponding features of the data in the sample set; extract the classification labels of the data with the most similar features in the sample set, and only select the first k most similar data. Generally, k is less than 20.
[0067] Furthermore, the model formula of the k-nearest neighbor algorithm is:
[0068]
[0069] In the formula: x1 x2... x n are the n-dimensional data of sample X; y1 y2... y n are the n-dimensional data of sample Y; X is time, and Y is the network delay in milliseconds (ms); d(x, y) is the distance between samples X and Y, which is the associated node with a 24-hour delay in milliseconds <= 50 of the current network node in the present invention..
[0070] The principle of the k-nearest neighbor algorithm model is schematically shown as Figure 6 shown.
[0071] The calculation of the failure rate is illustrated by the following example:
[0072] After the current SID node obtains the data of 10 network nodes associated with it through log analysis and calculates, determine the alarm status through the alarm status (0 = no alarm, 1 = alarm) of the 10 nodes. Thus, the failure prediction of the current sample is completed.
[0073] Model operation result: If 3 out of 10 of the associated nodes with a 24-hour delay in milliseconds <= 50 of the current network node have had alarms, the network quality failure rate of the current node is 30%.
[0074] Furthermore, the early warning model is constructed using a Markov chain, and the formula is:
[0075] X(k + 1) = X(k) × P
[0076] In the formula: X(k) represents the state vector of the trend analysis and prediction object at time t = k, P represents the one-step transition probability matrix, and X(k + 1) represents the state vector of the trend analysis and prediction object at time t = k + 1.
[0077] The calculation of the alarm probability is illustrated by the following example:
[0078] Current node forwarding historical probability [0.3, 0.7];
[0079] Current node's probability of this alarm transferring to normal [0.6, 0.4];
[0080] Current node's probability of this normal state transferring to alarm [0.3, 0.7];
[0081] Calculated through the model formula:
[0082] This time's priority forwarding probability = 0.3 x 0.6 + 0.3 x 0.7 = 0.39;
[0083] This time's non - priority forwarding probability = 0.3 x 0.4 + 0.7 x 0.7 = 0.61.
[0084] From the above embodiments, the overall structure of the present invention can be obtained as Figure 7 shown. It creatively highlights the status of artificial intelligence in the forwarding of SRv6 network packets. First, the starting node of the Srv6 network extracts all SIDs in the Segment List and concatenates them from bottom to top with in between to generate an initial address identifier. Secondly, the failure rates of all next - hop SR nodes associated with the initiating node are obtained through the k - nearest neighbor algorithm model. Then, the alarm probability of all next - hop SR nodes is predicted through the warning model. If each hop of the optimal address identifier is better than each hop of the initial address identifier for the SR nodes, then update the Argument initial address identifier in the SRH part of the IPv6 extension header. This method adds AI failure prediction and intelligent path optimization compared with the existing Srv6 packet forwarding mechanism, provides a new solution for the forwarding of complex service packets in a super - large network, reduces the resource consumption of packet forwarding, and improves the accuracy of transmitted data and flexible configuration at the same time.
[0085] The above embodiments are only exemplary embodiments of the present invention and are not used to limit the present invention. The protection scope of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements within the essence and protection scope of the present invention, and such modifications or equivalent replacements should also be regarded as falling within the protection scope of the present invention.
Claims
1. A method for analyzing packet transmission by combining SRv6 with the k-nearest neighbor algorithm, characterized in that It includes the following steps: S11. Srv6 network node initial allocation address identifier generation module; S12. Build a k-nearest neighbor algorithm model, an early warning model and generate an intelligent allocation identifier module; The step S12 includes the following steps: S121. Obtain the failure rates of all next-hop SR nodes associated with the initiating node through the k-nearest neighbor algorithm model, and then predict the alarm probabilities of all next-hop SR nodes through the early warning model; S122. Calculate the failure rate and the alarm probability to determine the optimal next-hop SR node until the optimal SR node for each hop to reach the destination SR node is obtained and concatenated into an optimal address identifier; S123. If each hop SR node of the optimal address identifier is better than each hop SR node of the initial address identifier, update the Argument initial address identifier in the SRH part of the IPv6 extension header; The early warning model is constructed using a Markov chain, and the formula is: ; Where: X(k) represents the state vector of the trend analysis and prediction object at t = k, P represents the one-step transition probability matrix, and X(k + 1) represents the state vector of the trend analysis and prediction object at t = k + 1.
2. The packet transmission analysis method combining SRv6 and the k-nearest neighbor algorithm according to claim 1, wherein: The step S11 includes the following steps: S111. Obtain all path Segment Lists from the current SR node to the target SR node; S112. Extract all SIDs in the Segment List, concatenate them from bottom to top, and separate them with to generate an initial address identifier; S113. Before the current SR node transmits to the next-hop SR node, put the initial address identifier into the Argument in the SRH part of the IPv6 extension header.
3. The packet transmission analysis method combining SRv6 and the k-nearest neighbor algorithm according to claim 1, wherein: The k-nearest neighbor algorithm in the step S121 includes the following steps: S1211. Prepare the data and arrange the data in dimensions in sequence; S1212. Calculate the distance from the test sample point to each other sample point; S1213. Sort each distance, and then select the K points with the smallest distance; S1214. Compare the categories to which the K points belong, and according to the principle of the minority obeying the majority, classify the test sample point into the category with the highest proportion among the K points.
4. The packet transmission analysis method combining SRv6 and the k-nearest neighbor algorithm according to claim 1, wherein: The calculation method of the failure rate and the alarm probability in the step S122 is weighted average.
Citation Information
Patent Citations
SID distribution method and device based on SRv6 network
CN110995596A
SRv6-based data processing method and related equipment
CN111541613A
Traffic scheduling method and device
CN112118181A
Path prediction method and related device
CN114598614A
Intelligent network and equipment fault prediction method and system based on SRv6
CN114978930A