SRv6 policy state monitoring method and device, equipment and storage medium
By real-time monitoring of the segment list status changes of SRv6 policy routing, the problem of high resource consumption in the existing technology is solved, and efficient SRv6 policy status monitoring is achieved.
Patent Information
- Application Number
- CN202510946838.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-09-09
AI Technical Summary
In the existing technology, the controller needs to periodically process a large number of SRv6 Policy status reports, resulting in high resource consumption and low monitoring efficiency.
By obtaining the real-time SRv6 policy routing reported by the device based on the changes in the segment list status, the policy path control information is parsed and encapsulated into a message structure in the target format, and the segment list and SRv6 policy status are determined based on the segment list key value.
It realizes real-time monitoring of SRv6 policy status, reduces resource consumption, improves monitoring efficiency, and avoids unnecessary information carrying.
Smart Images

Figure CN120614289A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to an SRv6 policy status monitoring method, device, equipment, and storage medium. Background Art
[0002] Existing controller monitoring solutions for SRv6 Policy (Segment Routing over IPv6) mostly use Telemetry to monitor SRv6 Policy status. If Telemetry is used, the controller and devices establish a TCP connection. The Telemetry function on each device periodically collects SRv6 Policy status information and pushes it to the controller for processing. If a large number of SRv6 Policies exist on the network and rapid detection of SRv6 Policy status is required, devices must periodically report SRv6 Policy status even if the status has not changed. This forces the controller to continuously process messages pushed by devices, impacting its processing efficiency.
[0003] It can be seen that how to improve the efficiency of monitoring SRv6 Policy status while reducing resource consumption is a technical problem that technicians in this field urgently need to solve. Summary of the Invention
[0004] In view of this, the object of the present invention is to provide an SRv6 policy status monitoring method, apparatus, device and storage medium, which solve the technical problem of low efficiency in monitoring SRv6 Policy status in the prior art.
[0005] To solve the above technical problems, the present invention provides an SRv6 policy status monitoring method, comprising:
[0006] Obtain SRv6 policy routing reported by the device in real time based on changes in segment list status;
[0007] Parsing the SRv6 policy routing to obtain policy path control information, and encapsulating the SRv6 policy routing into a message structure in a target format based on the policy path control information;
[0008] Determine a segment list based on a segment list key value in the policy path control information carried by the message structure, and then determine a status of the segment list; and determine an SRv6 policy status based on a status of the segment list corresponding to the SRv6 policy routing.
[0009] Optionally, parsing the SRv6 policy routing to obtain policy path control information, and encapsulating the SRv6 policy routing into a message structure in a target format based on the policy path control information, including:
[0010] The SRv6 policy routing is analyzed based on the RFC standard.
[0011] Optionally, the policy path control information includes a binding segment identifier of the SRv6 policy, information of the candidate path, and the segment list key value, so as to determine the status of the segment list based on the binding segment identifier, information of the candidate path, and the segment list key value.
[0012] Optionally, determining a segment list based on a segment list key value in the policy path control information carried by the message structure, and then determining a status of the segment list, and determining an SRv6 policy status based on a status of the segment list corresponding to the SRv6 policy routing, including:
[0013] Determine the SRv6 policy corresponding to the SRv6 policy routing according to the binding segment identifier carried by the message structure, determine the candidate path corresponding to the SRv6 policy in combination with the priority in the information of the candidate path, and locate the segment list based on the candidate path and the segment list key value.
[0014] Optionally, determining the status of the segment list includes:
[0015] When the S bit of the candidate path status in the information of the candidate path in the message structure is 1, determining that the status of the segment list is unavailable;
[0016] When the S bit of the candidate path status is 0 and the M bit of the segment list is 1, determining that the status of the segment list is unavailable;
[0017] When the S bit of the candidate path status is 0, and the M bit of the segment list is 0 and the R bit is 1, determining that the status of the segment list is available;
[0018] In the remaining other cases, the status of the segment list is determined to be unavailable.
[0019] Optionally, determining the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy routing includes:
[0020] Querying the status of all the segment lists associated with the SRv6 policy routing;
[0021] When there is a segment list whose status is available, determining that the SRv6 policy status is available;
[0022] When the status of all the segment lists is unavailable, it is determined that the SRv6 policy status is unavailable.
[0023] Optionally, also include:
[0024] When a link is broken between the device and the server, the server automatically cancels all SRv6 policy routes previously reported by the device, and determines that the SRv6 policy status and the status of the segment list are unknown.
[0025] An embodiment of the present invention further provides an SRv6 policy status monitoring device, which is applied to a server and includes:
[0026] SRv6 policy routing determination module, used to obtain SRv6 policy routing reported by the device in real time based on changes in segment list status;
[0027] A message structure encapsulation module is used to parse the SRv6 policy routing to obtain policy path control information, and encapsulate the SRv6 policy routing into a message structure in a target format based on the policy path control information;
[0028] An SRv6 policy status determination module is used to determine a segment list based on a segment list key value in the policy path control information carried by the message structure, thereby determining the status of the segment list, and determining the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy route.
[0029] An embodiment of the present invention further provides an SRv6 policy status monitoring device, including:
[0030] memory for storing computer programs;
[0031] A processor is configured to execute the computer program to implement the steps of the above-mentioned SRv6 policy status monitoring method.
[0032] An embodiment of the present invention further provides a storage medium (computer-readable storage medium) having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned SRv6 policy status monitoring method are implemented.
[0033] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned SRv6 policy status monitoring method.
[0034] It can be seen that the present invention reports SRv6 policy routing in real time by acquiring the change of the segment list status of the device; parses the SRv6 policy routing to obtain the policy path control information, and encapsulates the SRv6 policy routing into a message structure in the target format based on the policy path control information; determines the segment list based on the segment list key value in the policy path control information carried by the message structure, determines the status of the segment list, and determines the status of the SRv6 policy based on the status of the segment list corresponding to the SRv6 policy routing.
[0035] The beneficial effects of the embodiments of the present invention are as follows: compared with the current periodic reporting of the SRv6 Policy status, which leads to low efficiency in monitoring the SRv6 Policy status, the technical solution device provided by the present invention will report the SRv6 policy route in real time based on the change of the segment list status. Since the change of the segment list status will lead to the change of the SRv6 policy status, real-time monitoring of the SRv6 policy status is achieved, and the device does not carry all the information of the SRv6 policy route, but only carries part of the information of the SRv6 policy route. The status of the SRv6 policy can be determined based on the part of the information later, thereby reducing resource consumption and improving the efficiency of monitoring the SRv6 Policy status.
[0036] In addition, the present invention also provides an SRv6 policy status monitoring device, equipment and storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0038] Figure 1 A flowchart of a method for monitoring SRv6 policy status provided by an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of the structure of an SRv6 Policy provided in an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of an SRv6 Policy TLV provided in an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of a candidate path TLV provided in an embodiment of the present invention;
[0042] Figure 5A schematic diagram of a segment list TLV provided in an embodiment of the present invention;
[0043] Figure 6 A schematic diagram of a network structure provided by an embodiment of the present invention;
[0044] Figure 7 A schematic diagram of the structural framework of an SRv6 policy status monitoring device provided by an embodiment of the present invention;
[0045] Figure 8 A schematic diagram of the structural framework of an SRv6 policy status monitoring device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0047] Some of the terms that appear in the description of the embodiments of this application are subject to the following interpretations:
[0048] SRv6 is a segment routing technology based on IPv6 (Internet Protocol version 6). It embeds segment identifiers in the extension header field of IPv6 packets, enabling fine-grained control over packet routing. SRv6 leverages the programmability of the 128-bit IPv6 address to convert network functions into instructions, with each instruction representing a specific network function or service. This technology translates service requirements into an ordered list of instructions, which are then executed by network devices along the route, enabling flexible orchestration and on-demand customization of network services.
[0049] SRv6 Policy is an application of SRv6 technology that defines and controls the path of data packets within the network. SRv6 Policy can be considered a set of rules that describe the path selection, forwarding logic, and processing for packets from the source node to the destination node. SRv6 Policy leverages the source routing mechanism of segment routing and guides packets through the network by encapsulating an ordered list of instructions (forwarding path instructions) at the head node.
[0050] BGP-LS is a BGP-based link state information distribution protocol. It extends TLVs (TLVs are a flexible data encapsulation format: Type identifies the field type (such as a new function code); Length defines the length of the Value field; and Value carries specific data (such as bandwidth, latency, and custom policy parameters)) to report SRv6 Policy status. In an SRv6 network, every node needs to understand SRv6 Policy status information to correctly perform forwarding and processing operations. Using BGP-LS, nodes can report SRv6 Policy status information to the controller or other relevant nodes, ensuring synchronization and consistency across the entire network. When a node experiences an SRv6 Policy status change (such as a path failure or insufficient resources), the node can report this information to the controller via BGP-LS. Upon receiving this information, the controller can recalculate paths and regenerate SRv6 Policies to ensure network stability and reliability.
[0051] Please refer to Figure 1 , Figure 1 This is a flowchart of a method for monitoring SRv6 policy status provided by an embodiment of the present invention. Applied to a server, the method may include:
[0052] S101: Obtain SRv6 policy routing reported in real time by a device based on changes in a segment list status.
[0053] The execution subject of this embodiment is the server, which includes a network control system and a BGP message management system, wherein the network control system is used to store the SRv6 Policy database, and the BGP message management system is used to receive and parse routes. In this embodiment, the device reports the SRv6 policy route in real time based on the change of the segment list status. The BGP message management system obtains the SRv6 policy route reported by the device in real time based on the change of the segment list status, and parses it. In this embodiment, the SRv6 policy route based on the real-time reporting of the segment list status is the BGP policy route. It should be noted that before using the system corresponding to the above-mentioned SRv6 policy status monitoring method, this embodiment needs to create a BGP-LS neighbor between the device and the BGP message management system to implement system intercommunication configuration. Configure basic networking, including isis (establishing an IGP (Interior Gateway Protocol) network to achieve routing reachability between devices and provide underlying connectivity for subsequent MPLS and BGP) and mpls (providing label distribution capabilities for SR (Segment Routing) or LDP and supporting traffic engineering). After the BGP link address is connected, configure the BGP message management system and the device link-state address family neighbors through the network control system. Finally, the device and the BGP message management system successfully establish neighbors. It is also necessary to create an SRv6 Policy and store the data in the data table, including the headend (head node), endpoint (tail node), color (color), and BSID information of the SRv6 Policy. Synchronize the segment-index information of the segment list generated by the device to the data table. This segment-index is the unique key value for subsequent one-to-one matching to the segment list under the policy. SRv6 Policy is based on Figure 2 The model is stored in the database, and the network control system synchronizes the segment-index information of each segment list under the policy on the device. Figure 2 This diagram illustrates the structure of an SRv6 Policy provided in an embodiment of the present invention. This SRv6 Policy includes Protocol-origin (path source protocol); Originator (path initiator (controller / device); Discriminator (path unique identifier); SID sequence (explicit path instruction); and Weight (load sharing ratio). After successful creation, the device reports the SRv6 Policy route to the BGP message management system. The device then reports the corresponding route generated for each segment list in the SRv6 Policy to the BGP message management system via a TCP connection.
[0054] S102: Parse the SRv6 policy routing to obtain policy path control information, and encapsulate the SRv6 policy routing into a message structure in a target format based on the policy path control information.
[0055] The execution subject in this embodiment can be the BGP message management system on the server side. The BGP message management system is mainly a system for configuring the BGP-LS server-side neighbors of the device and parsing the messages reported by the device. The policy path control information in this embodiment is information related to the status of the determined segment list. When reporting, the existing technology needs to report all information related to the status of SRv6 policy routing. The present invention only needs to report part of the information (policy path control information). This embodiment does not limit the specific target format. For example, the target format in this embodiment can be a message structure in the kafka format, or the target format in this embodiment can be a message structure in Apache Pulsar. For example, after the BGP message management system receives the policy routing, according to Figure 3 The SRv6 Policy TLV information is parsed to obtain the policy's BSID. Figure 3 A schematic diagram of an SRv6 Policy TLV provided in an embodiment of the present invention, from Figure 3 This section describes the protocol data structure of the SRv6 PolicyBinding SID (Binding Segment Identifier). The structure includes the following: Type identifies the TLV type, Length indicates the length of the entire TLV, BSID Flags indicates bits that control BSID behavior, RESERVED indicates a reserved bit, Binding SID (BSID), and Specified Binding SID.
[0056] It should be further explained that, based on any of the above embodiments, to improve parsing accuracy, parsing the SRv6 policy route to obtain policy path control information and encapsulating the SRv6 policy route into a target format message structure based on the policy path control information may include parsing the SRv6 policy route based on the RFC standard. The RFC (Request For Comments, an official document describing Internet technology standards) in this embodiment uniformly defines the information for parsing SRv6 policy routes using a unified NLRI (Network Layer Reachability Information) protocol number and BGP TLV (Type-Length-Value) encoding format, thereby masking differences in model definitions between different equipment vendors.
[0057] S103: Determine the segment list based on the segment list key value in the policy path control information carried by the message structure, and then determine the status of the segment list. Determine the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy routing.
[0058] In this embodiment, the segment list is determined based on the segment list key value in the policy path control information carried by the message structure. The process of determining the status of the segment list can be: find the corresponding policy in the database according to the BSID in the policy path control information carried by the message structure, and then find the candidate path with the corresponding priority in combination with the preference of the candidate path, and finally find the corresponding segment list according to the key value segment-index of the segment list and write the status into the database storing the SRv6 Policy. The reason why this embodiment can determine the status of the SRv6 policy (SRv6 Policy) (i.e., the SRv6 policy status) based on the status of the segment list is based on the relationship between the status of the segment list and the status of the SRv6 policy. This embodiment can be based on the status of the segment list according to Figure 4 The TLV type of candidatepath is parsed to obtain the preference, originator, discriminator and flag information of the candidate path. Figure 4 A schematic diagram of a candidate path TLV provided in an embodiment of the present invention. Figure 4 The Type field in the field identifies the policy (SRv6 policy) type, Length indicates the total length of the TLV, Priority indicates the policy execution priority, RESERVED indicates a reserved bit, Flags indicates the policy action flag, and Preference indicates the path priority. The Policy parameter contains the specific path definition. The meaning of the Flags field in the candidate path is as follows: Flags (S / A / B / E / V / O / D / C / I / T): Flag field;
[0059] S: When set, it indicates that the candidate path is in shutdown state;
[0060] A: When set, it indicates that the candidate path is active;
[0061] B: When set, it indicates that the candidate path is a backup path;
[0062] E: When set, it indicates that the candidate path is valid;
[0063] V: When set, it indicates that the candidate path has at least one valid seglist;
[0064] O: When set, it indicates that the policy is generated by ODN;
[0065] D: When set, it indicates that the candidate path is calculated by the PCE / controller;
[0066] C: When set, it indicates that the candidate path is issued by the PCE / controller;
[0067] I: When set, it indicates that the forwarding path is invalid and the packet is discarded;
[0068] T: When set, indicates forwarding is available.
[0069] according to Figure 5 The TLV type of the segment list is parsed to obtain the segment-index and flag of the segment list. Figure 5 This is a schematic diagram of a segment list TLV provided by an embodiment of the present invention, where MTID represents a multi-topology identifier, Algorithm represents a path calculation algorithm, and sub-TLVs represents a variable extension length.
[0070] It should be further explained that, based on any of the above embodiments, the policy path control information includes the SRv6 policy's binding segment identifier, candidate path information, and the segment list key, thereby determining the segment list status based on the binding segment identifier, candidate path information, and segment list key. In this embodiment, the binding segment identifier is the SRv6 policy's BSID information, and the candidate path information is the candidate path information. This embodiment provides specific policy path control information, improving the accuracy of subsequent determination of the segment list status based on the policy path control information.
[0071] It should be further explained that, based on the above embodiment, determining the segment list based on the segment list key value in the policy path control information carried by the message structure, and then determining the status of the segment list, and determining the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy route, can include: determining the SRv6 policy corresponding to the SRv6 policy route based on the binding segment identifier carried by the message structure, determining the candidate path corresponding to the SRv6 policy based on the priority in the candidate path information, and locating the segment list based on the candidate path and the segment list key value. This embodiment provides a specific method for locating the segment list related to the SRv6 policy status. Based on the set of key values (BSID, preference, segment-index), each route can uniquely locate a segment list, and the status carried by the route is the status of the segment list.
[0072] It should be further explained that, based on any of the above embodiments, the logic for calculating the status of the segment list may include:
[0073] Step 1: When the S bit of the candidate path status in the candidate path information in the message structure is 1, the status of the segment list is determined to be unavailable;
[0074] Step 2: When the S bit of the candidate path status is 0 and the M state of the segment list is 1, the status of the segment list is determined to be unavailable;
[0075] Step 3: When the S bit of the candidate path status is 0, and the M state of the segment list is 0 and R is 1, the status of the segment list is determined to be available;
[0076] Step 4: In the remaining cases, determine that the status of the segment list is unavailable.
[0077] Other situations in this embodiment include: the S bit is 0, the M bit of the segment list is 0, and the R bit is 0. This situation is not available.
[0078] It is understandable that the meaning of the Flags bit of the Segment list is as follows:
[0079] Flags: Flags of the SID list, used to indicate the attributes and status of the SID list. This flag bit is 2 bytes long, of which the first 9 bits have meanings. Starting from the first bit, they are D|E|C|V|R|F|A|T|M|. The specific meanings of each bit are as follows:
[0080] D: When set, it indicates that the SID list consists of SRv6 SIDs. When not set, it indicates that the SID list consists of SR-MPLS labels.
[0081] E: When set, it indicates that the SID list is associated with the explicit candidate path. When not set, it indicates that the SID list is associated with the dynamic candidate path.
[0082] C: When set, indicates that the SID list calculation is used for dynamic paths;
[0083] V: When set, it indicates that the SID list has passed verification or does not need verification. When not set, it indicates that the SID list has not passed verification;
[0084] R: When set, it indicates that the first segment of the SID list has been resolved. When not set, it indicates that the resolution failed;
[0085] F: When set, it indicates that the dynamic path calculation failed. When not set, it indicates that the dynamic path calculation was successful or no calculation is required.
[0086] A: When set, it indicates that all SIDs in the SID list belong to the specified algorithm;
[0087] T: When set, it indicates that all SIDs in the SID list belong to the specified topology;
[0088] M: When set, indicates that the SID list was removed from the forwarding plane due to a fault detected by the monitoring mechanism. When not set, indicates that no fault was detected or monitoring was not performed.
[0089] The logic for calculating the segment list status is: if the S bit of the candidate path is 1, the segment-list status is down; if the S bit of the candidate path is 0, and the M status of the segment-list is 1, the segment list status is down; if the M status of the segment list is 0 and the R bit is 1, the segment list status is up, otherwise the segment list status is down. The calculation formula is Status=S cp ∨(¬S cp ∧(M sl ∨(¬M sl ∧¬R sl ))), S cp Indicates the S position of the candidate path; ¬ means negation; M sl Indicates the M position of the segment list; R sl Indicates the R bit of the segment list.
[0090] It should be further noted that, based on any of the above embodiments, determining the state of the SRv6 policy based on the state of the segment list corresponding to the SRv6 policy routing may include:
[0091] S1031: Query the status of all segment lists associated with SRv6 policy routing;
[0092] S1032: When a segment list exists in an available state, determine that the SRv6 policy state is available;
[0093] S1033: When the status of all segment lists is unavailable, determine that the SRv6 policy status is unavailable.
[0094] The logic for calculating the SRv6 Policy status in this embodiment is as follows: query the status of all segment lists associated with the SRv6 policy status in the database. As long as the status of one segment list is up, the policy status is up. Conversely, the policy status is set to down only when the status of all segment lists is down.
[0095] It should be further explained that, based on any of the above embodiments, the above SRv6 policy status monitoring method may further include: when a link between the device and the server is disconnected, the server automatically revoking all SRv6 policy routes previously reported by the device and determining that the SRv6 policy status and segment list status are unknown. In this embodiment, when a link between the device and the BGP message management system is disconnected, the server automatically revoks all SRv6 policy routes previously reported by the device, and the SRv6 policy status and segment list status are both set to unknown.
[0096] An SRv6 policy status monitoring method provided by an embodiment of the present invention may include: S101, obtaining SRv6 policy routing reported by a device in real time based on changes in segment list status; S102, parsing the SRv6 policy routing to obtain policy path control information, and encapsulating the SRv6 policy routing into a message structure in a target format based on the policy path control information; S103, determining the segment list based on the segment list key value in the policy path control information carried by the message structure, and then determining the status of the segment list, and determining the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy routing. The beneficial effects of the embodiments of the present invention are as follows: compared with the current periodic reporting of the SRv6 Policy status, which leads to low efficiency in monitoring the SRv6 Policy status, the technical solution device provided by the present invention will report the SRv6 policy route in real time based on the change of the segment list status. Since the change of the segment list status will lead to the change of the SRv6 policy status, real-time monitoring of the SRv6 policy status is achieved (the update of the segment list status will immediately update the SRv6 policy status), and it does not carry all the information of the SRv6 policy route, but only carries part of the information of the SRv6 policy route. The status of the SRv6 policy can be determined based on this part of information later, thereby reducing resource consumption and improving the efficiency of monitoring the SRv6 Policy status.
[0097] For easier understanding, please refer to Figure 6 , Figure 6 A schematic diagram of a network structure provided by an embodiment of the present invention includes PE, a network control system and a BGP message management system.
[0098] The network control system may include: a device management module. This module is a functional module of the network control system and manages devices, initializes the basic network, configures ISIS to connect to the IGP network, and manages the distribution of neighbor configurations between devices and the BGP message management system. An SRv6 Policy Management Module is a functional module of the network control system and manages the SRv6 Policy database, distributes SRv6 Policy configurations, and synchronizes policies, candidate paths, and segment lists generated on devices. It establishes a mapping between the database and the segment list paths on devices and stores the segment index on devices in the database. The corresponding segment list under the policy can then be uniquely located based on the policy's BSID and the segment list's segment index. A BGP Neighbor Management Module is a functional module of the network control system and is responsible for neighbor configuration in the BGP message management system and distribution of BGP neighbor configurations to devices. A Kafka Message Receiving Module is a functional module of the network control system and is responsible for receiving Kafka messages sent by the BGP-LS route resolution module, calculating the policy status, and updating the segment list and policy status.
[0099] The BGP message management system can include a BGP session management module, which belongs to the BGP protocol control module and is responsible for managing BGP sessions between the BGP message management system and devices. A BGP-LS route resolution module, which belongs to the BGP protocol control module and is responsible for reporting, withdrawing, and updating BGP-LS routes on devices, as well as parsing reported and updated policy routes. A Kafka message sending module, which belongs to the BGP protocol control module and is responsible for assembling each policy route into a defined Kafka structure and sending it to the SRv6 Policy management module.
[0100] The following introduces an SRv6 policy status monitoring device provided by an embodiment of the present invention. The SRv6 policy status monitoring device described below and the SRv6 policy status monitoring method described above can refer to each other.
[0101] Please refer to Figure 7 , Figure 7 A schematic diagram of the structural framework of an SRv6 policy status monitoring device provided in an embodiment of the present invention may include:
[0102] SRv6 policy routing determination module 100, configured to obtain SRv6 policy routing reported in real time by a device based on changes in segment list status;
[0103] A message structure encapsulation module 200 is configured to parse the SRv6 policy routing to obtain policy path control information, and encapsulate the SRv6 policy routing into a message structure in a target format based on the policy path control information;
[0104] The SRv6 policy status determination module 300 is used to determine the segment list based on the segment list key value in the policy path control information carried by the message structure, and then determine the status of the segment list, and determine the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy route.
[0105] Further, based on any of the above embodiments, the message structure encapsulation module 200 may include:
[0106] The parsing unit is configured to parse the SRv6 policy routing based on the RFC standard.
[0107] Further, based on any of the above embodiments, the policy path control information includes the binding segment identifier of the SRv6 policy, the information of the candidate path and the segment list key value, so as to determine the status of the segment list based on the binding segment identifier, the information of the candidate path and the segment list key value.
[0108] Furthermore, based on any of the above embodiments, the SRv6 policy state determination module 300 may include:
[0109] A segment list determination unit is used to determine the SRv6 policy corresponding to the SRv6 policy routing based on the binding segment identifier carried by the message structure, determine the candidate path corresponding to the SRv6 policy in combination with the priority in the candidate path information, and locate the segment list based on the candidate path and the segment list key value.
[0110] Furthermore, based on any of the above embodiments, the SRv6 policy state determination module 300 may include:
[0111] a first state determining unit, configured to determine that the state of the segment list is unavailable when the S bit of the candidate path state in the information of the candidate path in the message structure is 1;
[0112] a second state determining unit, configured to determine that the state of the segment list is unavailable when the S bit of the candidate path state is 0 and the M state of the segment list is 1;
[0113] a third state determining unit, configured to determine that the state of the segment list is available when the S bit of the candidate path state is 0, the M state of the segment list is 0, and the R bit is 1;
[0114] The fourth status determining unit is configured to determine, in other remaining circumstances, that the status of the segment list is unavailable.
[0115] Furthermore, based on any of the above embodiments, the SRv6 policy state determination module 300 may include:
[0116] a segment list status determining unit, configured to query the status of all segment lists associated with the SRv6 policy;
[0117] a first SRv6 policy state determining unit, configured to determine that the SRv6 policy state is available when there is a segment list whose state is available;
[0118] The second SRv6 policy status determining unit is configured to determine that the SRv6 policy status is unavailable when the status of all the segment lists is unavailable.
[0119] Furthermore, based on any of the above embodiments, the SRv6 policy status monitoring device may further include:
[0120] The link break processing module is used for, when a link break occurs between the device and the server, the server automatically cancels all SRv6 policy routes previously reported by the device, and determines that the SRv6 policy status and the status of the segment list are unknown.
[0121] It should be noted that the order of the modules and units in the above-mentioned SRv6 policy status monitoring device can be changed without affecting the logic.
[0122] An SRv6 policy status monitoring device provided by an embodiment of the present invention may include: an SRv6 policy routing determination module 100, used to obtain the SRv6 policy routing reported in real time by the edge device based on the change of the segment list status; a message structure encapsulation module 200, used to use the BGP message management system to parse the SRv6 policy routing to obtain policy path control information, and encapsulate the SRv6 policy routing into a message structure in a target format based on the policy path control information; an SRv6 policy status determination module 300, used to determine the segment list based on the segment list key value in the policy path control information carried by the message structure, and then determine the status of the segment list, and determine the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy routing. Compared with the current periodic reporting of the SRv6 policy status, which leads to low efficiency in monitoring the SRv6 policy status, the edge device of the technical solution provided by the present invention will report the SRv6 policy route in real time based on the change of the segment list status. Since the change of the segment list status will lead to the change of the SRv6 policy status, real-time monitoring of the SRv6 policy status is achieved. It does not carry all the information of the SRv6 policy route, but only carries part of the information of the SRv6 policy route. The status of the SRv6 policy can be determined based on the partial information later, thereby reducing resource consumption and improving the efficiency of monitoring the status of the SRv6 policy.
[0123] An SRv6 policy status monitoring device provided by an embodiment of the present invention is introduced below. The SRv6 policy status monitoring device described below and the SRv6 policy status monitoring method described above can refer to each other.
[0124] Please refer to Figure 8 , Figure 8 A schematic diagram of the structural framework of an SRv6 policy status monitoring device provided in an embodiment of the present invention may include:
[0125] Memory 10, for storing computer programs;
[0126] The processor 20 is configured to execute a computer program to implement the above-mentioned SRv6 policy status monitoring method.
[0127] The memory 10 , the processor 20 , and the communication interface 30 all communicate with each other via a communication bus 40 .
[0128] In the embodiment of the present invention, the memory 10 is used to store one or more programs. The program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory 10 may store programs for implementing the following functions:
[0129] Obtain SRv6 policy routing reported by the device in real time based on changes in segment list status;
[0130] Parse the SRv6 policy routing to obtain policy path control information, and encapsulate the SRv6 policy routing into a target format message structure based on the policy path control information;
[0131] The segment list is determined based on the segment list key value in the policy path control information carried by the message structure, and then the status of the segment list is determined. The SRv6 policy status is determined based on the status of the segment list corresponding to the SRv6 policy routing.
[0132] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function, etc.; the data storage area may store data created during use.
[0133] In addition, the memory 10 may include a read-only memory and a random access memory, and provides instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset or an extended set thereof. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.
[0134] The processor 20 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic device. The processor 20 may be a microprocessor or any conventional processor. The processor 20 may call a program stored in the memory 10 .
[0135] The communication interface 30 may be an interface of a communication module, and is used to connect to other devices or systems.
[0136] Of course, it needs to be explained that Figure 8 The structure shown does not constitute a limitation on the SRv6 policy status monitoring device in the embodiment of the present invention. In actual applications, the SRv6 policy status monitoring device may include Figure 8 More or fewer components than shown, or combinations of certain components.
[0137] The following describes a computer-readable storage medium provided in an embodiment of the present invention. The computer-readable storage medium described below and the SRv6 policy status monitoring method described above may refer to each other.
[0138] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned SRv6 policy status monitoring method are implemented.
[0139] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program codes.
[0140] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0141] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0142] Finally, it should be noted that, in this document, relationships such as first and second, etc., are used solely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0143] The above describes in detail the SRv6 policy status monitoring method, apparatus, device, and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is intended only to help understand the method and core concept of the present invention. Furthermore, those skilled in the art will appreciate that, based on the concepts of the present invention, variations may occur in the specific implementation methods and scope of application. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A method for monitoring SRv6 policy status, characterized in that: Applied to the server, including: Obtain SRv6 policy routing reported by the device in real time based on changes in segment list status; Parsing the SRv6 policy routing to obtain policy path control information, and encapsulating the SRv6 policy routing into a message structure in a target format based on the policy path control information; Determine a segment list based on a segment list key value in the policy path control information carried by the message structure, and then determine a status of the segment list; and determine an SRv6 policy status based on a status of the segment list corresponding to the SRv6 policy routing.
2. The SRv6 policy status monitoring method according to claim 1, characterized in that: Parsing the SRv6 policy routing to obtain policy path control information, and encapsulating the SRv6 policy routing into a target format message structure based on the policy path control information, including: The SRv6 policy routing is analyzed based on the RFC standard.
3. The SRv6 policy status monitoring method according to claim 1, characterized in that: The policy path control information includes a binding segment identifier of the SRv6 policy, information of a candidate path, and the segment list key value, so as to determine a state of the segment list based on the binding segment identifier, information of the candidate path, and the segment list key value.
4. The SRv6 policy status monitoring method according to claim 3, characterized in that: Determining a segment list based on a segment list key value in the policy path control information carried by the message structure, and then determining a status of the segment list, and determining an SRv6 policy status based on a status of the segment list corresponding to the SRv6 policy routing, including: Determine the SRv6 policy corresponding to the SRv6 policy routing according to the binding segment identifier carried by the message structure, determine the candidate path corresponding to the SRv6 policy in combination with the priority in the information of the candidate path, and locate the segment list based on the candidate path and the segment list key value.
5. The SRv6 policy status monitoring method according to claim 3, characterized in that: Determining the status of the segment list includes: When the S bit of the candidate path status in the information of the candidate path in the message structure is 1, determining that the status of the segment list is unavailable; When the S bit of the candidate path status is 0 and the M bit of the segment list is 1, determining that the status of the segment list is unavailable; When the S bit of the candidate path status is 0, and the M bit of the segment list is 0 and the R bit is 1, determining that the status of the segment list is available; In the remaining other cases, the status of the segment list is determined to be unavailable.
6. The SRv6 policy status monitoring method according to any one of claims 1 to 5, characterized in that: Determining an SRv6 policy state based on a state of the segment list corresponding to the SRv6 policy routing includes: Querying the status of all the segment lists associated with the SRv6 policy routing; When there is a segment list whose status is available, determining that the SRv6 policy status is available; When the status of all the segment lists is unavailable, it is determined that the SRv6 policy status is unavailable.
7. The SRv6 policy status monitoring method according to claim 1, characterized in that: Also includes: When a link is broken between the device and the server, the server automatically cancels all SRv6 policy routes previously reported by the device, and determines that the SRv6 policy status and the status of the segment list are unknown.
8. An SRv6 policy status monitoring device, characterized in that: Applied to the server, including: SRv6 policy routing determination module, used to obtain SRv6 policy routing reported by the device in real time based on changes in segment list status; A message structure encapsulation module is used to parse the SRv6 policy routing to obtain policy path control information, and encapsulate the SRv6 policy routing into a message structure in a target format based on the policy path control information; An SRv6 policy status determination module is used to determine a segment list based on a segment list key value in the policy path control information carried by the message structure, thereby determining the status of the segment list, and determining the SRv6 policy status based on the status of the segment list corresponding to the SRv6 policy route.
9. An SRv6 policy status monitoring device, characterized in that: include: memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the SRv6 policy status monitoring method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the SRv6 policy status monitoring method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the SRv6 policy status monitoring method according to any one of claims 1 to 7.
