Data keep-alive method and device
By sending inherited information of SR Policy routes when network devices rebuild BGP neighbor relationships, the problem of loss of critical information caused by the instability of dynamic SR Policy routes is solved, ensuring that the information is retained and extended after the link is restored.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2023-03-06
- Publication Date
- 2026-05-05
AI Technical Summary
The existing dynamically learned SR Policy routes are unstable, resulting in the loss of critical information needed by users and network administrators.
When a network device rebuilds a BGP neighbor relationship, it determines whether to send SR Policy route inheritance information. It then carries the SR Policy route and inheritance information in a BGP UPDATE message, enabling the receiving end to activate and inherit the information locally.
It enables the maximum retention of critical information in faulty network devices and expands the information in the message through the TLV structure after the link is restored, ensuring the continuity and integrity of the information.
Smart Images

Figure CN116389341B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data keep-alive method and apparatus. Background Technology
[0002] Segment Routing (SR), Multi-Protocol Label Switching (MPLS), Segment Routing Policy, and Traffic Engineering (TE) Policy—that is, SR-MPLS TE Policy—provides a flexible method for selecting forwarding paths to meet different user forwarding needs. When multiple paths exist between the source and destination nodes within an SR network, rationally utilizing SR-MPLS TE Policy to select forwarding paths not only facilitates administrator management and planning of the SR network but also effectively reduces the forwarding load on network devices.
[0003] To support SR-MPLS TE Policy, MP-BGP defines a new sub-address family—the BGP IPv4 SRPolicy address family—and adds Network Layer Reachability Information (NLRI), namely BGP IPv4 SR Policy routes. BGP IPv4 SR Policy routes include relevant configurations for SR-MPLS TE Policy, such as BSID, color, Endpoint, Preference, and Weight. After a Border Gateway Protocol (BGP) speaker publishes a BGP IPv4 SR Policy route to its BGP peers, the BGP peers can also generate corresponding SRPolicy and SR forwarding table entries locally based on the BGP IPv4 SR Policy route, thereby enabling the forwarding of service traffic according to the SR-MPLS TE Policy.
[0004] The SR Policy generated locally through dynamic publishing via the BGP protocol can also be called a dynamic SRPolicy. It is the same as the statically configured Policy, both of which can generate SR forwarding entries and can also be configured with various additional functions such as BFD, traffic statistics, rate limiting, and traffic redirection.
[0005] Dynamic SR Policy, as a traffic redirection strategy, controls the forwarding path and direction of service traffic. When it fails, network devices will switch service traffic to other SR Policies or forward it according to the new route. When it recovers, network devices will typically switch service traffic back to the original dynamic SR Policy for forwarding.
[0006] However, since the original SR Policy is dynamically generated, its stability is somewhat worse than that of a statically configured Policy. If a BGP peer or intermediate link fails, or if the BGP configuration at any end changes, BGP route cancellation is likely to occur. Therefore, the router that generates the dynamic SR Policy will delete it locally, similar to deleting a statically configured SR Policy. Before the router regenerates the dynamic SR Policy, some previously retained user data (such as billing, maintenance information, path sharing data, etc.) may also be deleted.
[0007] In summary, the currently dynamically learned SR Policy routes, including IPv4 / IPv6 SR Policy routes, the corresponding generated SR Policy, and SR forwarding table entries, may all suffer from routing instability, leading to the loss of critical information needed by users and network administrators. Summary of the Invention
[0008] In view of this, this application provides a data keep-alive method and apparatus to solve the problem that critical information needed by users and network administrators is lost due to the instability of existing dynamically learned SR Policy routes.
[0009] In a first aspect, this application provides a data keep-alive method, the method being applied to a first network device, the method comprising:
[0010] When the first network device and the second network device re-establish the BGP neighbor relationship, determine whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device.
[0011] If it is determined that the first inheritance information will be sent to the second network device, then a first BGP UPDATE message will be sent to the second network device. The first BGP UPDATE message includes the SR Policy route and the first inheritance information, so that the second network device can activate the SR Policy locally and inherit the first inheritance information under the SR Policy.
[0012] Secondly, this application provides a data keep-alive device, which is applied to a first network device and includes:
[0013] The judgment unit is used to determine whether to send the first inherited information of the SR Policy corresponding to the SR Policy route to the second network device when the first network device and the second network device re-establish the BGP neighbor relationship.
[0014] The sending unit is configured to send a first BGP UPDATE message to the second network device if it is determined that the first inheritance information will be sent to the second network device. The first BGP UPDATE message includes the SR Policy route and the first inheritance information, so that the second network device activates the SR Policy locally and inherits the first inheritance information under the SR Policy.
[0015] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.
[0016] Therefore, when the first network device and the second network device rebuild their BGP neighbor relationship using the data keep-alive method and apparatus provided in this application, the first network device determines whether to send the first inheritance information of the SRPolicy corresponding to the SR Policy route to the second network device. If it determines to send the first inheritance information to the second network device, the first network device sends a first BGP UPDATE message to the second network device. The first BGP UPDATE message includes the SR Policy route and the first inheritance information, so that the second network device can activate the SR Policy locally and inherit the first inheritance information under the SRPolicy.
[0017] In this way, by using the BGP UPDATE message carried by the sending end to carry SR Policy routes and corresponding inheritance information, the receiving end can reactivate the SR Policy locally and inherit the inherited information under the SR Policy for subsequent statistical processing. This solves the problem that existing dynamically learned SR Policy routes, due to route instability, cause the loss of critical information needed by users and network administrators. It achieves the maximum retention of critical information of dynamic SR Policy in faulty network devices, and expands it within the message through a TLV structure, so that critical information is retained when the link recovers after a turbulence. Attached Figure Description
[0018] Figure 1A flowchart of the data preservation method provided in the embodiments of this application;
[0019] Figure 2 This is a structural diagram of the data preservation device provided in the embodiments of this application;
[0020] Figure 3 The network device hardware structure provided in the embodiments of this application. Detailed Implementation
[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0022] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the corresponding listed items.
[0023] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0024] The data preservation method provided in the embodiments of this application will be described in detail below. See also Figure 1 , Figure 1 This is a flowchart illustrating a data keep-alive method provided in an embodiment of this application. The method is applied to a first network device, which may specifically be a sender of SR Policy routes, and a second network device may specifically be a receiver of SR Policy routes. The data keep-alive method provided in this embodiment may include the following steps.
[0025] Step 110: When the first network device and the second network device re-establish the BGP neighbor relationship, determine whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device;
[0026] Specifically, the first network device and the second network device have established a BGP neighbor relationship. Using the BGP protocol, the first network device can synchronize at least one learned SR Policy route to the second network device. The second network device learns each synchronized SR Policy route and generates a corresponding SR forwarding table entry locally.
[0027] Furthermore, at least one SR Policy route can be synchronized to the second network device via one or more BGP update messages. The BGP update message also includes an inheritance field. This inheritance field is used to enable the second network device to determine, after learning multiple SR Policy routes, which SR Policy to perform statistical analysis on based on the attributes included in the inheritance field.
[0028] When the link between the first and second network devices fails, the established BGP neighbor relationship between the two network devices is lost. Simultaneously, the second network device, acting as the receiver of SR Policy routes, deletes the synchronously learned SR Policy routes, SR forwarding table entries, statistics, and other related information from its local machine.
[0029] After the link is restored, the first network device and the second network device re-establish their BGP neighbor relationship. The first network device can then synchronize at least one learned SR Policy route to the second network device. The first network device then determines whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device.
[0030] In this embodiment, the first inherited information is the amount of inherited SRPolicy data calculated by the first network device after a link failure, which is also the key information of the SR Policy. This inherited data allows the second network device to inherit the information before the link recovery, ensuring the continuity of key information.
[0031] If the first network device determines to send the first inheritance information to the network device, then the first network device executes step 120; otherwise, the first network device ends the current process.
[0032] The location of the inheritance field in the BGP UPDATE message, the internal structure of the inheritance field, and the determination by the first network device whether to send the first inheritance information to the network device will be explained in subsequent embodiments, and will not be repeated here.
[0033] Step 120: If it is determined that the first inheritance information is to be sent to the second network device, then a first BGP UPDATE message is sent to the second network device. The first BGP UPDATE message includes the SR Policy route and the first inheritance information, so that the second network device activates the SR Policy locally and inherits the first inheritance information under the SR Policy.
[0034] Specifically, according to the description of step 110, if the first network device determines to send first inheritance information to the second network device, the first network device generates and sends a first BGP UPDATE message to the second network device. This first BGP UPDATE message includes the SR Policy route and the first inheritance information, enabling the second network device to activate the SRPolicy locally and inherit the first inheritance information under the SR Policy. Subsequently, the second network device can continue to perform information statistics on the SR Policy.
[0035] The following embodiments will explain how the first BGP UPDATE message carries the first inheritance information, and will not be repeated here.
[0036] It should be noted that, before performing the aforementioned steps, the first network device and the second network device can receive configuration commands issued by the controller or input by the user, and configure the inherited capabilities locally through these commands. This inherited capability allows the first network device and the second network device to carry inherited information in subsequent exchange messages.
[0037] Therefore, applying the data keep-alive method provided in this application, when the first network device and the second network device re-establish their BGP neighbor relationship, the first network device determines whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device; if it determines to send the first inheritance information to the second network device, the first network device sends a first BGP UPDATE message to the second network device, which includes the SR Policy route and the first inheritance information, so that the second network device can activate the SR Policy locally and inherit the first inheritance information under the SR Policy.
[0038] In this way, by using the BGP UPDATE message carried by the sending end to carry SR Policy routes and corresponding inheritance information, the receiving end can reactivate the SR Policy locally and inherit the inherited information under the SR Policy for subsequent statistical processing. This solves the problem that existing dynamically learned SR Policy routes may lose critical information needed by users and network administrators due to route instability. It achieves the maximum retention of critical information of dynamic SR Policy in faulty network devices, and expands it within the message through a TLV structure, so that critical information is retained when the link recovers after an instability.
[0039] Optionally, in this embodiment of the application, before the first network device executes step 110, it also executes the process of sending a second BGP UPDATE message to the second network device.
[0040] Specifically, after the first network device establishes a BGP neighbor relationship with the second network device, the first network device can synchronize the SR Policy routes it has learned to the second network device. The first network device generates a second BGP UPDATE message, which includes the SR Policy routes and inheritance fields.
[0041] The number of SR Policy routes learned above can be at least one, and synchronization is achieved through at least one second BGPUPDATE message.
[0042] After receiving the second BGP UPDATE message, the second network device retrieves the SR Policy route and inheritance field from it. Based on the SR Policy route, the second network device learns the SR Policy route and generates the corresponding SR forwarding table entry locally. Based on the inheritance field, the second network device determines that multi-dimensional statistics are still needed for the SR Policy. Subsequently, the second network device can perform multi-dimensional statistics on packets redirected to the SR Policy.
[0043] Optionally, in this embodiment of the application, after the first network device sends a second BGP UPDATE message to the second network device, the process further includes the first network device carrying an inheritance field through a keep-alive message and receiving inheritance information through the keep-alive message.
[0044] Specifically, after the first network device sends a second BGP UPDATE message to the second network device, in order to ensure the recording of real-time data before the receiver fails, when the receiver cannot send or receive BGP messages normally, the network devices can carry an inheritance field in the keep-alive message to ensure that the sender can record the key information of the SR Policy in real time and realize the synchronization of the key information after the receiver recovers.
[0045] It is understandable that the aforementioned keepalive message can specifically be a keepalive message within the BGP protocol, or a dynamic routing protocol within the domain's IBGP, such as the IS-IS protocol, OSPF protocol, etc. The dynamic routing protocol within the domain can inject inherited information into the keepalive message; or, the BGP protocol can inject inherited information into the keepalive message of the dynamic routing protocol within the domain.
[0046] During the keep-alive period, the first network device generates and sends a first keep-alive message to the second network device. This first keep-alive message includes an inheritance field. After receiving the first keep-alive message, the second network device retrieves the inheritance field from it. Based on the inheritance field, the second network device first determines the corresponding SR Policy; then, based on the inheritance field again, the second network device determines that multi-dimensional statistics are still needed for the SR Policy.
[0047] Subsequently, the second network device can perform multi-dimensional statistics on the packets diverted to the SR Policy.
[0048] After performing multi-dimensional statistics on the packets diverted to the SR Policy, the second network device obtains the second inheritance information. The second network device generates and sends a second keep-alive message to the first network device. This second keep-alive message includes an inheritance field, which carries the second inheritance information.
[0049] After receiving the second keep-alive message sent by the second network device, the first network device obtains the second inherited information from it. The first network device may store the second inherited information locally.
[0050] Optionally, in embodiments of this application, the inherited field can be carried in the BGP UPDATE message or the keep-alive message through a newly added sub-TLV.
[0051] Inheritance fields include a type code attribute, a length attribute, and a value attribute; the type code attribute indicates the inheritance type; the value of the length attribute is determined based on the length of the value attribute; and the value attribute carries the inheritance information corresponding to the inheritance type.
[0052] The above inheritance types include, but are not limited to, traffic statistics, maintenance information, etc.
[0053] Optionally, the value attribute can also be used to carry the color attribute and endpoint attribute of the SR Policy. When the inheritance type is statistical, the high 64 bits of the value attribute are fixed, and the remaining bits carry inheritance information. The inheritance information is multi-dimensional, including but not limited to message count, message rate, maintenance information, and other key information that needs to be stored.
[0054] It should be noted that of the high 64 bits, the highest 32 bits are used to carry the color attribute of the SR Policy; the remaining 32 bits are used to carry the endpoint attribute of the SR Policy.
[0055] In this embodiment of the application, the sub-TLV carrying the inheritance field can be located in the TLV of the Type field in the SR TE Policy route, that is, a new sub-TLV is added under this TLV to carry the inheritance field.
[0056] Optionally, in this embodiment, the first network device and the second network device may periodically send keep-alive messages. Each time the first network device receives a keep-alive message, it may store the second inheritance information within the inheritance field of the latest received keep-alive message. Simultaneously, the first network device also records the first time (T1) at which the keep-alive message is received.
[0057] It should be noted that, since the first network device and the second network device exchange multiple first keep-alive messages and second keep-alive messages, when the first network device receives a new second keep-alive message, it updates the second inheritance information in the inheritance field of the previously stored second keep-alive message to the second inheritance information in the inheritance field of the newly received second keep-alive message. At the same time, the first time (T1) is also updated accordingly.
[0058] Thus, the first network device stores the second inheritance information in the inheritance field included in the last second keepalive message sent by the second network device and records the first time (T1) when the last second keepalive message is received.
[0059] Optionally, in this embodiment, since there is a time interval between the interactive keep-alive messages, and the second network device may also record some key information during the interval, in order to achieve the best possible fidelity of the key information, the process of the first network device calculating and storing the amount of inherited data is also included.
[0060] Specifically, after the first network device detects a link failure between itself and the second network device, the first network device records the second time of the link failure. The first network device obtains the second inherited information and the first time from the last second keep-alive message locally. The second inherited information includes the number of messages (X) and the message rate (s) forwarded through the SR Policy as counted by the second network device.
[0061] Using the number of packets (X), packet rate (s), first time (T1), and second time (T2), the first network device calculates the amount of inherited data to be stored. The first network device stores the inherited data as first inherited information.
[0062] Optionally, the first network device calculates the amount of inherited data to be stored using the number of messages, message rate, first time, and second time, specifically as follows:
[0063] The first network device subtracts the second time (T2) from the first time (T1) to obtain the difference; the first network device multiplies the difference with the packet rate to obtain the product; the first network device adds the product with the number of packets to obtain the inherited data volume.
[0064] The inherited data size is obtained by the following formula (1):
[0065] Inherited data volume = X + (T2 - T1) * s (1)
[0066] Optionally, in this embodiment of the application, in the aforementioned step 110, the first network device determines whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device. The specific process is as follows:
[0067] When the first network device and the second network device re-establish their BGP neighbor relationship, both ends send BGP OPEN messages to the other end. When the first network device receives a BGP OPEN message from the second network device, the first network device determines whether the first address family supported by the second network device included in the BGP OPEN message is the same as the second address family supported by the first network device.
[0068] If the first address family is the same as the second address family, the first network device determines whether the color attribute and endpoint attribute of the SR Policy route to be sent match the color attribute and endpoint attribute of the SR Policy route in the SRPolicy route in the third BGP UPDATE message that has been sent.
[0069] If both the color and endpoint attributes match, the first network device will send the first inheritance information to the second network device.
[0070] The third BGP UPDATE message is the last BGP UPDATE message sent before the link between the first network device and the second network device fails.
[0071] It should be noted that the above-mentioned SR Policy routes can specifically be IPv4 SP Policy routes, IPv6 SPPolicy routes, SR-MPLS TE Policy routes, etc.
[0072] In one example, router A and router B are IBGP neighbors and each has configured the IS-IS routing protocol. Assuming router A is the receiver and router B is the sender, router B can synchronize at least one SR Policy route it has learned to router A. Router B generates a BGP UPDATE message 1, which includes at least one SR Policy route and an inheritance field.
[0073] After receiving BGP UPDATE message 1, router A retrieves at least one SR Policy route and its inheritance field. The second network device learns each SR Policy route and generates an SR forwarding table entry for each SR Policy locally.
[0074] Based on the inheritance fields, the second network device determines which SR Policy to perform information statistics on and which dimensions. For example, traffic statistics need to be performed on packets redirected to SR Policy1; the color attribute of SR Policy1 is 2; and the endpoint is 2.2.2.2. The internal structure of the inheritance fields has been described in detail in the aforementioned embodiments and will not be repeated here.
[0075] When router A performs multi-dimensional statistics on packets diverted to SR Policy1, it includes the packet count and packet rate as inheritance information in the inheritance field. Router A generates an IS-IS keepalive message, which includes inheritance information 1. During the keepalive period, router A sends an IS-IS keepalive message to router B.
[0076] After receiving the IS-IS keep-alive message, router B retrieves and stores the inheritance information 1 locally.
[0077] In this embodiment, Router A and Router B can periodically send IS-IS keepalive messages. Each time Router B receives an IS-IS keepalive message, it stores the inheritance information 1 included in the latest received IS-IS keepalive message. Simultaneously, Router B also records the reception time (T1) of the IS-IS keepalive message.
[0078] Currently, 100,000 packets are redirected from router A to SR Policy1. If the link between router A and router B fails, and the established IBGP neighbor relationship between router A and router B is lost, router B first records the link failure time (T2), for example, 15:30:20. Simultaneously, router B also retrieves the inheritance information 1 and the reception time (T1) from the last received IS-IS keepalive message, for example, 15:30:16. Inheritance information 1 includes the number of packets (X), for example, 100,000, and the packet rate (s), for example, 1000 packets / s.
[0079] According to equation (1) above, the amount of inherited data calculated by router B is 4*1000+100000=104000. Router B stores the amount of inherited data as inheritance information 2.
[0080] Subsequently, after the link between Router A and Router B is restored, Router A and Router B re-establish their IBGP neighbor relationship. Both ends send BGP OPEN messages to each other. After receiving the BGP OPEN message from Router A, Router B determines, based on the address family, the color attribute of the SR Policy, and the endpoint attribute, that it needs to send the SR Policy1 route and its corresponding inheritance information 2 to Router A. Router B then retrieves the inheritance information 2 corresponding to SR Policy1 from its local machine.
[0081] Router B generates BGP UPDATE message 2, which includes the SR Policy1 route and inheritance information 2. Router B sends BGP UPDATE message 2 to Router A. After receiving BGP UPDATE message 2, Router A retrieves the SR Policy1 route and inheritance information 2 from it. Based on the SR Policy1 route, Router A relearns the SR Policy1 route and regenerates the corresponding SR forwarding table entry locally. Simultaneously, Router A inherits inheritance information 2 under SR Policy1. It can be understood that when Router A subsequently performs multi-dimensional statistics on packets redirected to SR Policy1, it can continue the statistics based on the 104,000 packets included in inheritance information 2.
[0082] Based on the same inventive concept, embodiments of this application also provide a data keep-alive device corresponding to the data keep-alive method. See also Figure 2 , Figure 2 The data keep-alive device provided in this application embodiment is applied to a first network device, and the device includes:
[0083] The judgment unit 210 is used to determine whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device when the first network device and the second network device re-establish the BGP neighbor relationship;
[0084] The sending unit 220 is configured to send a first BGP UPDATE message to the second network device if it is determined that the first inheritance information will be sent to the second network device. The first BGP UPDATE message includes the SR Policy route and the first inheritance information, so that the second network device activates the SR Policy locally and inherits the first inheritance information under the SR Policy.
[0085] Optionally, the sending unit 220 is further configured to send a second BGP UPDATE message to the second network device when the first network device has established a BGP neighbor relationship with the second network device. The first BGP UPDATE message includes the SR Policy route and an inheritance field, so that the second network device generates an SR forwarding table entry corresponding to the SR Policy locally according to the SR Policy route, and determines to perform multi-dimensional statistics on the SRPolicy according to the inheritance field.
[0086] Optionally, the sending unit 220 is further configured to send a first keep-alive message to the second network device, the first keep-alive message including the inheritance field;
[0087] The device further includes a receiving unit (not shown in the figure) for receiving a second keep-alive message sent by the second network device. The second keep-alive message includes the inheritance field, and the inheritance field carries second inheritance information. The second inheritance information is obtained by the second network device after performing multi-dimensional statistics on the SR Policy based on the inheritance field.
[0088] Optionally, the inherited field includes a type encoding attribute, a length attribute, and a value attribute;
[0089] The type encoding attribute is used to indicate the inheritance type; the value of the length attribute is the length of the value attribute; the value attribute is used to carry the inheritance information corresponding to the inheritance type.
[0090] Optionally, the value attribute is also used to carry the color attribute and endpoint attribute of the SR Policy.
[0091] Optionally, the device further includes: a storage unit (not shown in the figure) for storing the second inheritance information in the inheritance field included in the last second keep-alive message sent by the second network device and recording the first time of receiving the last second keep-alive message.
[0092] Optionally, the device further includes: a recording unit (not shown in the figure), used to record a second time when the link between the first network device and the second network device fails;
[0093] The acquisition unit (not shown in the figure) is used to acquire the second inherited information and the first time included in the last second keep-alive message. The second inherited information includes the number of messages forwarded through the SRPolicy and the message rate as counted by the second network device.
[0094] A calculation unit (not shown in the figure) is used to calculate the amount of inherited data to be stored using the number of messages, the message rate, the first time, and the second time.
[0095] The storage unit (not shown in the figure) is also used to store the inherited data as the first inheritance information.
[0096] Optionally, the calculation unit (not shown in the figure) is specifically used to subtract the second time from the first time to obtain the difference;
[0097] Multiply the difference by the message rate to obtain the product;
[0098] The product is added to the number of messages to obtain the inherited data volume.
[0099] Optionally, the determination unit 210 specifically includes: when receiving a BGP OPEN message sent by the second network device, determining whether the first address family supported by the second network device included in the BGP OPEN message is the same as the second address family supported by the first network device;
[0100] If they are the same, then determine whether the color attribute and endpoint attribute of the SR Policy route to be sent match the color attribute and endpoint attribute of the SR Policy route in the third BGP UPDATE message that has been sent.
[0101] If a match is found, then the first inheritance information will be sent to the second network device.
[0102] The third BGP UPDATE message is the last BGP UPDATE message sent before the link between the first network device and the second network device fails.
[0103] Therefore, using the data keep-alive device provided in this application, when the first network device and the second network device re-establish their BGP neighbor relationship, the first network device determines whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device; if it determines to send the first inheritance information to the second network device, the first network device sends a first BGP UPDATE message to the second network device, which includes the SR Policy route and the first inheritance information, so that the second network device can activate the SR Policy locally and inherit the first inheritance information under the SR Policy.
[0104] In this way, by using the BGP UPDATE message carried by the sending end to carry SR Policy routes and corresponding inheritance information, the receiving end can reactivate the SR Policy locally and inherit the inherited information under the SR Policy for subsequent statistical processing. This solves the problem that existing dynamically learned SR Policy routes may lose critical information needed by users and network administrators due to route instability. It achieves the maximum retention of critical information of dynamic SR Policy in faulty network devices, and expands it within the message through a TLV structure, so that critical information is retained when the link recovers after an instability.
[0105] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 3 As shown, the system includes a processor 310, a transceiver 320, and a machine-readable storage medium 330. The machine-readable storage medium 330 stores machine-executable instructions that can be executed by the processor 310. The processor 310 is prompted by the machine-executable instructions to execute the data keep-alive method provided in the embodiments of this application. (The foregoing...) Figure 2 The data preservation device shown can be adopted as follows: Figure 3 The hardware structure of the network device shown is implemented.
[0106] The aforementioned computer-readable storage medium 330 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 330 may also be at least one storage device located remotely from the aforementioned processor 310.
[0107] The processor 310 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0108] In this embodiment, the processor 310 reads the machine-executable instructions stored in the machine-readable storage medium 330, and is prompted by the machine-executable instructions to enable the processor 310 itself and the transceiver 320 to execute the data keep-alive method described in the aforementioned embodiment.
[0109] In addition, this application provides a machine-readable storage medium 330 that stores machine-executable instructions. When called and executed by the processor 310, the machine-executable instructions cause the processor 310 itself and the transceiver 320 to execute the data keep-alive method described in the aforementioned application.
[0110] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0111] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0112] For the data preservation device and machine-readable storage medium embodiments, since the methods involved are basically similar to those in the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.
[0113] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A data preservation method, characterized in that, The method is applied to a first network device, and the method includes: When the first network device and the second network device re-establish the BGP neighbor relationship, determine whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device. If it is determined that the first inheritance information will be sent to the second network device, then a first BGP UPDATE message will be sent to the second network device. The first BGP UPDATE message includes the SR Policy route and the first inheritance information, so that the second network device can activate the SR Policy locally and inherit the first inheritance information under the SR Policy. The first inherited information is used to enable the second network device to inherit the information before the link was restored after the link failure between the second network device and the first network device is restored.
2. The method according to claim 1, characterized in that, Before determining whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device when the first network device and the second network device re-establish the BGP neighbor relationship, the method further includes: When the first network device has established a BGP neighbor relationship with the second network device, it sends a second BGP UPDATE message to the second network device. The first BGP UPDATE message includes the SR Policy route and the inheritance field, so that the second network device can generate the SR forwarding table entry corresponding to the SR Policy locally according to the SR Policy route, and determine to perform multi-dimensional statistics on the SR Policy according to the inheritance field.
3. The method according to claim 2, characterized in that, After sending the second BGPUPDATE message to the second network device, the method further includes: Send a first keep-alive message to the second network device, the first keep-alive message including the inheritance field; The second network device receives a second keep-alive message, which includes the inheritance field and carries second inheritance information. The second inheritance information is obtained by the second network device after performing multi-dimensional statistics on the SR Policy based on the inheritance field.
4. The method according to claim 3, characterized in that, The inherited fields include type encoding attributes, length attributes, and value attributes; The type encoding attribute is used to indicate the inheritance type; the value of the length attribute is the length of the value attribute; the value attribute is used to carry the inheritance information corresponding to the inheritance type.
5. The method according to claim 4, characterized in that, The value attribute is also used to carry the color attribute and endpoint attribute of the SR Policy.
6. The method according to claim 5, characterized in that, After receiving the second keep-alive message sent by the second network device, the method further includes: The second inheritance information in the inheritance field included in the last second keep-alive message sent by the second network device is stored, and the first time of receiving the last second keep-alive message is recorded.
7. The method according to claim 6, characterized in that, Before determining whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device when the first network device and the second network device re-establish the BGP neighbor relationship, the method further includes: When a link failure occurs between the first network device and the second network device, record the second time when the link failure occurs. Obtain the second inherited information and the first time included in the last second keep-alive message. The second inherited information includes the number of messages forwarded through the SR Policy and the message rate as counted by the second network device. The amount of inherited data to be stored is calculated using the number of messages, the message rate, the first time, and the second time. The inherited data is stored as the first inheritance information.
8. The method according to claim 7, characterized in that, The step of calculating the amount of inherited data to be stored using the number of messages, message rate, first time, and second time specifically includes: Subtract the second time from the first time to obtain the difference; Multiply the difference by the message rate to obtain the product; The product is added to the number of messages to obtain the inherited data volume.
9. The method according to claim 6, characterized in that, The determination of whether to send the first inherited information of the SR Policy corresponding to the SRPolicy route to the second network device specifically includes: When a BGP OPEN message is received from the second network device, it is determined whether the first address family supported by the second network device included in the BGP OPEN message is the same as the second address family supported by the first network device. If they are the same, then determine whether the color attribute and endpoint attribute of the SR Policy route to be sent match the color attribute and endpoint attribute of the SR Policy route in the third BGP UPDATE message that has been sent. If a match is found, then the first inheritance information will be sent to the second network device. The third BGP UPDATE message is the last BGP UPDATE message sent before the link between the first network device and the second network device fails.
10. A data preservation device, characterized in that, The device is applied to a first network device, and the device includes: The judgment unit is used to determine whether to send the first inherited information of the SR Policy corresponding to the SR Policy route to the second network device when the first network device and the second network device re-establish the BGP neighbor relationship. The sending unit is configured to send a first BGP UPDATE message to the second network device if it is determined that the first inheritance information will be sent to the second network device. The first BGP UPDATE message includes the SR Policy route and the first inheritance information, so that the second network device activates the SR Policy locally and inherits the first inheritance information under the SR Policy. The first inherited information is used to enable the second network device to inherit the information before the link was restored after the link failure between the second network device and the first network device is restored.
Citation Information
Patent Citations
Routing attribute updating method, network equipment and system
CN115720207A