Search

CN-116389341-B - Data keep-alive method and device

CN116389341BCN 116389341 BCN116389341 BCN 116389341BCN-116389341-B

Abstract

The application provides a data keep-alive method and a data keep-alive device, wherein the method is applied to first network equipment and comprises the following steps of: when the first network device and the second network device reestablish BGP neighbor relation, judging whether to send first inheritance information of SR Policy corresponding to the SR Policy route to the second network device, if so, sending a first BGP UPDATE message to the second network device, wherein the first BGP UPDATE message comprises 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.

Inventors

  • GUO WEI

Assignees

  • 新华三技术有限公司

Dates

Publication Date
20260505
Application Date
20230306

Claims (10)

  1. 1. A method of data keep-alive, the method being applied to a first network device, the method comprising; when the first network equipment and the second network equipment rebuild BGP neighbor relation, judging whether to send first inheritance information of SR Policy corresponding to SR Policy route to the second network equipment; If the first inheritance information is determined to be sent to the second network equipment, a first BGP UPDATE message is sent to the second network equipment, wherein the first BGP UPDATE message comprises the SR Policy route and the first inheritance information, so that the second network equipment locally activates the SR Policy and inherits the first inheritance information under the SR Policy; the first inheritance information is used for enabling the second network equipment to inherit information before link recovery after the link failure between the second network equipment and the first network equipment is recovered.
  2. 2. The method of claim 1, wherein when the first network device reestablishes BGP neighbor relation with the second network device, before determining whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device, the method further comprises: And when the first network equipment and the second network equipment have established BGP neighbor relation, sending a second BGP UPDATE message to the second network equipment, wherein the first BGP UPDATE message comprises the SR Policy route and an inheritance field, so that the second network equipment locally generates an SR forwarding table item corresponding to the SR Policy according to the SR Policy route, and determines to carry out multidimensional statistics on the SR Policy according to the inheritance field.
  3. 3. The method of claim 2, wherein after the sending the second BGP UPDATE message to the second network device, the method further comprises: Sending a first keep-alive message to the second network device, wherein the first keep-alive message comprises the inheritance field; And receiving a second keep-alive message sent by the second network equipment, wherein the second keep-alive message comprises the inheritance field, the inheritance field bears second inheritance information, and the second inheritance information is obtained after the second network equipment performs multidimensional statistics on the SR Policy according to the inheritance field.
  4. 4. The method of claim 3, wherein the inheritance field comprises a type encoding attribute, a length attribute, and a value attribute; the type coding attribute is used for indicating an inheritance type, the value of the length attribute is the length of the value attribute, and the value attribute is used for bearing inheritance information corresponding to the inheritance type.
  5. 5. The method of claim 4, wherein the value attribute is further used to carry color attributes and endpoint attributes of the SR Policy.
  6. 6. The method of claim 5, wherein after receiving the second keep-alive message sent by the second network device, the method further comprises: 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.
  7. 7. The method of claim 6, wherein when the first network device reestablishes BGP neighbor relation with the second network device, before determining whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device, the method further comprises: Recording a second time when the link between the first network device and the second network device fails; Acquiring the second inheritance information and the first time included in the last second keep-alive message, wherein the second inheritance information comprises the message number and the message rate which are counted by the second network equipment and forwarded through the SR Policy; Calculating the inheritance data quantity to be stored by using the message quantity, the message rate, the first time and the second time; and storing the inheritance data quantity as the first inheritance information.
  8. 8. The method according to claim 7, wherein calculating the amount of inherited data to be stored using the number of messages, the message rate, the first time, and the second time, specifically comprises: Subtracting the second time from the first time to obtain a difference value; multiplying the difference value with the message rate to obtain a product; And adding the product and the message quantity to obtain the inheritance data quantity.
  9. 9. The method of claim 6, wherein the determining whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network device specifically includes: when a BGP OPEN message sent by the second network equipment is received, judging whether a first address group supported by the second network equipment and the second address group supported by the first network equipment are the same or not, wherein the first address group is included in the BGP OPEN message; If so, judging whether color attributes and endpoint attributes included in the SR Policy route to be sent are respectively matched with color attributes and endpoint attributes of SR Policy included in the SR Policy route in the sent third BGP UPDATE message; if the first inheritance information is matched, the first inheritance information is determined to be sent to the second network equipment; The third BGP UPDATE message is a last BGP UPDATE message sent before a link failure between the first network device and the second network device.
  10. 10. A data keep-alive device, the device being applied to a first network apparatus, the device comprising; the judging unit is used for judging whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network equipment or not when the first network equipment and the second network equipment reestablish the BGP neighbor relation; a sending unit, configured to send a first BGP UPDATE packet to the second network device if it is determined to send the first inheritance information to the second network device, where the first BGP UPDATE packet includes the SR Policy route and the first inheritance information, so that the second network device locally activates the SR Policy, and inherits the first inheritance information under the SR Policy; the first inheritance information is used for enabling the second network equipment to inherit information before link recovery after the link failure between the second network equipment and the first network equipment is recovered.

Description

Data keep-alive method and device Technical Field The present application relates to the field of communications technologies, and in particular, to a data keep-alive method and apparatus. Background Segment Routing (SR) multiprotocol label switching (Multi-Protocol Label Switching, MPLS) (Segment Routing Policy ) traffic engineering (TRAFFIC ENGINEERING, TE) Policy (Policy), i.e., SR-MPLS TE Policy, provides a flexible forwarding path selection method, which satisfies different forwarding demands of users. When a plurality of paths exist between a source node and a destination node in the SR network, the SR-MPLS TE Policy is reasonably utilized to select a forwarding path, so that an administrator can conveniently manage and plan the SR network, and the forwarding pressure of network equipment can be effectively reduced. In order to support SR-MPLS TE Policy, MP-BGP defines a new sub-address family, namely BGP IPv4 SR Policy address family, and adds network layer reachability information (English: network Layer Reachability Information, abbreviated: NLRI), namely BGP IPv4 SR Policy route. BGP IPv4 SR Policy routes include relevant configurations of SR-MPLS TE Policy, such as BSID, color, endpoint, preference and Weight, etc. After a border gateway protocol (English: border Gateway Protocol, abbreviated as BGP) speaker issues a BGP IPv4 SR Policy route to a BGP peer, the BGP peer can locally generate corresponding SR Policy and SR forwarding table items according to the BGP IPv4 SR Policy route, so as to realize forwarding service traffic according to the SR-MPLS TE Policy. The SR Policy generated locally and correspondingly by dynamic publishing of BGP protocol can be also called dynamic SR Policy, which is the same as the Policy configured statically, and can generate SR forwarding table entry, and can also configure various additional functions such as BFD, traffic statistics, speed limit, drainage, etc. Dynamic SR Policy is used as a drainage Policy to control the forwarding path and trend of the traffic. When it fails, the network device switches the traffic to other SR Policy or forwards according to the new route. When it returns to normal, the network device typically switches the traffic back to the original dynamic SR Policy implementation for forwarding. But because the original SR Policy is dynamically generated, its stability is somewhat worse than that of a statically configured Policy. BGP route withdrawal behavior is likely to occur if BGP peers or intermediate links fail, or BGP configurations at either end change. In this way, a router that generates dynamic SR Policy is caused to delete dynamic SR Policy from the home, similar to the behavior of deleting statically configured SR Policy. Some of its previously reserved user data (e.g., billing, maintenance information, path sharing data, etc.) may also be deleted before the router regenerates the dynamic SR Policy. In summary, the currently dynamically learned SR Policy route, including the SR Policy route of IPv4/IPv6, the corresponding generated SR Policy, and the SR forwarding table entry may lose key information required by the user and the network administrator due to the instability of the route. Disclosure of Invention In view of this, the present application provides a data keep-alive method and apparatus, which are used to solve the problem that the key information required by the user and the network administrator is lost due to the instability of the existing SR Policy route. In a first aspect, the present application provides a data keep-alive method, the method being applied to a first network device, the method comprising; when the first network equipment and the second network equipment rebuild BGP neighbor relation, judging whether to send first inheritance information of SR Policy corresponding to SR Policy route to the second network equipment; And if the first inheritance information is determined to be sent to the second network equipment, sending a first BGP UPDATE message to the second network equipment, wherein the first BGP UPDATE message comprises the SR Policy route and the first inheritance information, so that the second network equipment locally activates the SR Policy and inherits the first inheritance information under the SR Policy. In a second aspect, the present application provides a data keep-alive apparatus, the apparatus being applied to a first network device, the apparatus comprising; the judging unit is used for judging whether to send the first inheritance information of the SR Policy corresponding to the SR Policy route to the second network equipment or not when the first network equipment and the second network equipment reestablish the BGP neighbor relation; And the sending unit is used for sending a first BGP UPDATE message to the second network equipment if the first inheritance information is sent to the second network equipment, wherein the first BGP UPDATE message comprises the SR Policy r