WO2022110881A1 - Route processing method and apparatus, and devices - Google Patents

Route processing method and apparatus, and devices Download PDF

Info

Publication number
WO2022110881A1
WO2022110881A1 PCT/CN2021/109948 CN2021109948W WO2022110881A1 WO 2022110881 A1 WO2022110881 A1 WO 2022110881A1 CN 2021109948 W CN2021109948 W CN 2021109948W WO 2022110881 A1 WO2022110881 A1 WO 2022110881A1
Authority
WO
WIPO (PCT)
Prior art keywords
bgp
routing
route
list
attribute
Prior art date
Application number
PCT/CN2021/109948
Other languages
French (fr)
Chinese (zh)
Inventor
李明月
姚双龙
张嘉庆
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022110881A1 publication Critical patent/WO2022110881A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/18Loop-free operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a routing processing method, apparatus, and device.
  • Border Gateway Protocol is a dynamic routing protocol used between autonomous systems (Autonomous Systems, AS).
  • AS Autonomous Systems
  • AS Internet Services
  • ISPs Internet Service Providers
  • BGP's built-in routing loop prevention mechanism can solve the routing loop problem to a certain extent.
  • the existing BGP anti-loop mechanism may easily fail to prevent loops under improper use of devices, device failures, and special complex networking and configuration conditions, resulting in BGP routing loops.
  • the customer network often affects BGP route selection by adjusting routing attributes (for example, modifying the AS identifier in the AS_Path attribute).
  • routing attributes for example, modifying the AS identifier in the AS_Path attribute.
  • the re-routed route may form a routing loop with the original route, resulting in BGP routing. Routing loop problem. Therefore, how to avoid BGP routing loops under the conditions of improper use of equipment, equipment failure, and special complex networking and configuration has become a problem to be solved.
  • Embodiments of the present application provide a route processing method, device, and device, which can solve the BGP routing loop problem, support multi-vendor compatibility, compatibility between new and old versions, and help support smooth deployment on existing networks.
  • an embodiment of the present application provides a route processing method, and the method can be executed by a first BGP device.
  • the first BGP device receives a first BGP routing message from the second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix.
  • the first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes.
  • the first BGP device determines that the first identification list includes the identification of the first BGP device, and the first BGP device suppresses a route from the first BGP device to the second BGP device that uses the BGP route prefix as a destination address.
  • the BGP device can more accurately determine the specific device in which the routing loop occurs according to the identifier of the BGP device, and can also suppress the routes that cause the routing loop, thereby solving the BGP routing loop problem.
  • the path attribute list of the first BGP routing message includes an identification list attribute, where the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  • the identifier list attribute may be a newly added attribute in the path attribute list in the BGP routing message, which is beneficial to support smooth deployment on the existing network.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
  • the attribute of the identification list follows the existing BGP Request For Comments (RFC) standard, supports multi-vendor compatibility, and is compatible with old and new versions, which is beneficial to support smooth deployment on the existing network.
  • RFID BGP Request For Comments
  • the first BGP device discards the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
  • the first BGP device can directly discard the route that causes the routing loop, thereby helping to avoid the routing loop.
  • the first BGP device stores the received BGP routing prefix in the routing information table of the receiving direction. If the first BGP device detects a routing loop, the BGP routing prefix is sent from the receiving direction to the routing information table. deleted in.
  • the first BGP device decapsulates the received first BGP routing message, and stores the received BGP routing prefix in the routing information table in the receiving direction. If the route of the BGP routing prefix is a route that causes a routing loop, the first BGP device will delete the route of the BGP routing prefix, thereby helping to avoid routing loops.
  • the first BGP device stores a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address. If the priority of the route is lower than the priority of all the routes with the BGP route prefix as the destination address previously stored locally, the first BGP device records routing loop alarm information, where the routing loop alarm information includes one or more of the following Type: the identifier of the first BGP device, the first identifier list, the time when the BGP route has a routing loop, and the BGP routing loop log.
  • the first BGP device detects a routing loop, it can compare the previously stored priorities of all routes with the BGP routing prefix as the destination address and the received priorities of the routes with the BGP routing prefix as the destination address. By comparison, if the priority of the local route is higher than the priority of the received route, the first BGP device will still preferentially select the locally used route during route selection, thereby helping to avoid routing loops. Further, the first BGP device may also record the specific situation of the routing loop detected this time, which is helpful for troubleshooting the cause of the routing loop.
  • the first BGP device stores a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and sets the priority of the route to be lower than the previously locally stored route with the BGP prefix All routes whose route prefix is the destination address.
  • the first BGP device can process the routing loop, thereby solving the BGP routing loop problem.
  • the first BGP device determines that the identification list in the first BGP routing message does not include the identification of the first BGP device, and the first BGP device updates the first identification list; the updated first identification list includes the first identification list.
  • the first BGP device creates a BGP routing message, where the BGP routing message created by the first BGP device includes a BGP routing prefix and an updated first identification list.
  • the first BGP device adds its own identifier to the received identifier list, which can accurately record the routing path between ASs and/or within the AS, which is beneficial to Supports subsequent discovery of specific devices with routing loops.
  • the identifiers in the first identifier list are one or more of the following:
  • the BGP device can generate the local identifier in various ways as the identifier of the BGP device.
  • an embodiment of the present application provides a route processing method, and the method can be executed by a second BGP device.
  • the second BGP device creates a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix.
  • the first identification list includes the identification of the second BGP device.
  • the second BGP device sends the first BGP routing message to the first BGP device.
  • the second BGP device may carry the first identification list in the first BGP routing message, so as to accurately record each BGP device that the route transmits.
  • the path attribute list of the first BGP routing message includes an identification list attribute, where the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  • the identifier list attribute may be a newly added attribute in the path attribute list in the BGP routing message, which is beneficial to support smooth deployment on the existing network.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
  • the identity list attribute follows the existing BGP RFC standard, supports multi-manufacturer compatibility, and is compatible with old and new versions, which is conducive to supporting smooth deployment on the existing network.
  • the second BGP device is the originating device of the BGP routing prefix.
  • the second BGP device can add the attribute of the identification list, and generate the identification and identification list of the local machine, and carry the identification list in the BGP routing message and send it to Neighboring BGP devices.
  • the second BGP device is an intermediate device for the BGP routing prefix.
  • the second BGP device receives the second BGP routing message.
  • the second BGP routing message includes a second identification list and the BGP routing prefix.
  • the second identification list includes at least one identification, wherein each identification is a BGP device that the BGP routing prefix passes through. the identifiers; then the first identifier list also includes all identifiers in the second identifier list.
  • the second BGP device adds the local identifier to the existing identifier list, carries the updated identifier list in the BGP routing message, and sends it to Neighboring BGP devices.
  • the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
  • the BGP device can generate the local identifier in various ways as the identifier of the BGP device.
  • an embodiment of the present application provides a routing processing device, including a transceiver unit and a processing unit.
  • the transceiver unit is configured to receive a first BGP routing message from a second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix.
  • the first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes.
  • the processing unit is configured to determine that the first identifier list includes the identifier of the first BGP device; the processing unit is further configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
  • the path attribute list of the first BGP routing message includes an identification list attribute
  • the identification list attribute is used to indicate that the BGP routing message includes an identification list.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
  • the processing unit is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
  • the processing unit is configured to discard the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
  • the processing unit is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
  • the processing unit is used to store the route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and set the priority of the route to be lower than all the routes previously stored locally with the BGP route prefix as the destination address priority.
  • the processing unit is further configured to record routing loop alarm information, where the routing loop alarm information includes one or more of the following: the identifier of the first BGP device, the first identifier list, the BGP route existing route Time of the loop, BGP routing loop log.
  • the processing unit is also used to:
  • the BGP routing message created by the BGP device includes the BGP routing prefix and the updated first identifier list.
  • the identifiers in the first identifier list are one or more of the following:
  • an embodiment of the present application provides a route processing apparatus, including a processing unit and a transceiver unit.
  • the processing unit is configured to create a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix.
  • the first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes.
  • the transceiver unit is configured to send the first BGP routing message to the first BGP device.
  • the path attribute list of the first BGP routing message includes an identification list attribute, where the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
  • the second BGP device is the originating device of the BGP routing prefix.
  • the second BGP device is the originating device of the BGP routing prefix.
  • the processing unit is further configured to receive a second BGP routing message, where the second BGP routing message includes a second identification list and the BGP routing prefix, and the second identification list includes at least one identification, wherein each identification is a BGP passed by the BGP routing prefix
  • the identifier of the device; then the first identifier list also includes all identifiers in the second identifier list.
  • the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
  • an embodiment of the present application provides a BGP device, where the device has a function of implementing the route processing method provided in the first aspect.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present application provides a BGP device, where the device has a function of implementing the route processing method provided in the second aspect.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • an embodiment of the present application provides a BGP network system, where the BGP network system includes the route processing apparatus provided in the third aspect or the BGP device provided in the fifth aspect, and the route processing apparatus provided in the fourth aspect or the sixth aspect.
  • the BGP device provided by the aspect.
  • embodiments of the present application provide a computer-readable storage medium, where the readable storage medium includes a program or an instruction, and when the program or instruction is run on a computer, the computer executes the first aspect or the first aspect. method in any of the possible implementations.
  • an embodiment of the present application provides a computer-readable storage medium, where the readable storage medium includes a program or an instruction, when the program or instruction is run on a computer, the computer executes the second aspect or the second aspect. method in any of the possible implementations.
  • an embodiment of the present application provides a chip or a chip system, the chip or chip system includes at least one processor and an interface, the interface and the at least one processor are interconnected through a line, and the at least one processor is used for running a computer program or instruction, to perform the method described in any one of the first aspect or any of the possible implementations of the first aspect.
  • an embodiment of the present application provides a chip or a chip system, the chip or chip system includes at least one processor and an interface, the interface and the at least one processor are interconnected through a line, and the at least one processor is used for running a computer program or instruction , to perform the method described in any one of the second aspect or any possible implementation manner of the second aspect.
  • the interface in the chip may be an input/output interface, a pin or a circuit, or the like.
  • the chip system in the above aspects may be a system on chip (system on chip, SOC), or a baseband chip, etc.
  • the baseband chip may include a processor, a channel encoder, a digital signal processor, a modem, an interface module, and the like.
  • the chip or chip system described above in this application further includes at least one memory, where instructions are stored in the at least one memory.
  • the memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (eg, a read-only memory, a random access memory, etc.).
  • embodiments of the present application provide a computer program or computer program product, including codes or instructions, when the codes or instructions are run on a computer, the computer executes the first aspect or any one of the first aspects may be implemented method in method.
  • the embodiments of the present application provide a computer program or computer program product, including codes or instructions, when the codes or instructions are run on a computer, the computer executes the second aspect or any one of the second aspects may be implemented method in method.
  • FIG. 1 is a schematic diagram of a BGP network system according to an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a routing loop occurring between ASs according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a process flow of a BGP device for processing a BGP route according to an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a routing processing method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a format of an Update message message provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a path attribute list provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a routing processing process provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of another routing processing process provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of a route processing method provided by an embodiment of the present application applied to a scenario between multiple ASs;
  • FIG. 10 is a schematic diagram of a scenario between multiple ASs provided by an embodiment of the present application.
  • FIG. 11 is a schematic flowchart of a route processing method provided by an embodiment of the present application applied to a scenario in an AS;
  • FIG. 12 is a schematic diagram of a scenario in an AS provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a route processing apparatus provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of a first BGP device according to an embodiment of the present application.
  • 15 is a schematic diagram of another route processing apparatus provided by an embodiment of the present application.
  • FIG. 16 is a schematic diagram of a second BGP device according to an embodiment of the present application.
  • Border Gateway Protocol is a dynamic routing protocol used between autonomous systems (Autonomous Systems, AS). As a de facto network external routing protocol standard, BGP is widely used between Internet Service Providers (ISPs). BGP operates on a device in two ways. Among them, when BGP runs in the same AS, it is called Internal Border Gateway Protocol (Internal BGP, IBGP); when BGP runs between different ASs, it is called External Border Gateway Protocol (External BGP, EBGP).
  • IBGP Internal Border Gateway Protocol
  • EBGP External Border Gateway Protocol
  • FIG. 1 is a schematic diagram of a BGP network system according to an embodiment of the present application, where the BGP network system includes intra-AS and inter-AS.
  • the BGP network system includes BGP equipment 101 to BGP equipment 106, BGP equipment 101 to BGP equipment 106 belong to different ASs, and BGP equipment 101 to BGP equipment 106 all run the BGP protocol, as shown in FIG. 1 .
  • different ASs can be distinguished by different AS identifiers (also referred to as AS numbers).
  • AS identifiers also referred to as AS numbers.
  • FIG. 1 includes three ASs, and the AS identifiers of each AS are AS100, AS200, and AS300, respectively.
  • BGP device 102 and BGP device 103 establish EBGP neighbor relationship
  • BGP device 103 and BGP device 104 establish EBGP neighbor relationship
  • BGP device 105 and BGP device 106 establish EBGP neighbor relationship
  • BGP device 101, BGP device 102, BGP device 104 and An IBGP neighbor relationship is established between the BGP devices 105, as shown in FIG. 1 .
  • FIG. 2 is a schematic diagram of a routing loop occurring between ASs in a special networking situation.
  • the BGP network shown in FIG. 2 is a special networking, and the BGP device 101 is a route reflector (RR), and the BGP device 101 can communicate with the BGP device that has established an IBGP neighbor relationship and has a physical connection relationship.
  • RR route reflector
  • the BGP device 101 may send a BGP routing message to the BGP device 102 .
  • the BGP device 102 and the BGP device 103 establish an EBGP neighbor relationship and there is a physical connection relationship, then the BGP device 102 can send a BGP routing message to the BGP device 103 .
  • the BGP device 103 and the BGP device 104 can send a BGP routing message to the BGP device 104 .
  • the BGP device 104 and the BGP device 102 establish an MP_BGP neighbor relationship and there is a physical connection relationship, then the BGP device 104 can send a BGP routing message to the BGP device 102 .
  • the BGP routing message carrying the designated BGP routing prefix starts from the BGP device 101, and the BGP routing message can be sent to the BGP device that has established a BGP neighbor relationship with the BGP device 101 in a flooding manner, for example,
  • the BGP device 1 sends the message to the BGP device 102 , and according to the routing result, the BGP device 102 sends the BGP routing message carrying the specified BGP route prefix to the BGP device 103 .
  • the BGP device 103 modifies the routing attributes (for example, the AS_Path information is modified)
  • the BGP routing message does not contain the AS_Path.
  • AS ID i.e. does not contain AS 100.
  • the BGP device 104 in turn sends the BGP routing message carrying the specified BGP routing prefix to the BGP device 102 .
  • the BGP device 102, the BGP device 103, and the BGP device 104 form a routing loop, which may cause a network failure.
  • Mode 1 For routing loops between ASs, the AS path information carried in the BGP routing message is used to mark the passing ASs, and the routes with the local AS identifier will be discarded, thus avoiding routing loops between ASs.
  • Method 2 For routing loops in the AS, the routes learned by the BGP device in the AS are no longer advertised to the adjacent BGP devices in the AS, avoiding loops in the AS (for example, in special scenarios (such as routing) Reflector scenarios) use routing attributes Cluster_List and Originator_ID to prevent routing loops).
  • the BGP routing loop prevention mechanism shown in the first and second modes above may fail to prevent routing loops under improper use of devices, device failures, and special complex networking and configuration conditions, resulting in BGP routing loops.
  • the BGP device in Figure 2 deploys the BGP routing policy, it adjusts the routing attributes (such as the AS_Path attribute) through the BGP routing policy, and the AS identifier in the original AS_Path attribute is deleted or changed. As a result, the device cannot determine whether the AS_Path attribute is used. A loop occurs.
  • the priority of the route is artificially changed, so that when the BGP device receives the route sent by itself from the neighboring BGP device, according to the BGP route selection principle, if the priority of the newly received route is higher than the local original route on the BGP device , route re-routing will occur, resulting in a routing loop.
  • the embodiment of the present application provides a routing processing method, which can solve the BGP routing loop problem, and supports multi-vendor compatibility and compatibility between new and old versions , which is beneficial to support the smooth deployment of the existing network.
  • the route processing method can be applied to the BGP network system as shown in Figure 1, which can solve the routing loop problem between AS (such as between AS 100 and AS 200), and can also solve the problem within AS (such as within AS 100). ) routing loop problem.
  • BGP device also known as BGP speaker (BGP speaker)
  • BGP speaker BGP speaker
  • the BGP device described in this embodiment of the application is a device that runs the BGP protocol and is used to receive or generate new routing information, and to advertise (Advertise) routing information to other BGPs speaker.
  • the BGP devices may include but are not limited to routers, switches, firewalls, computer systems, servers, network elements in the core network, and the like.
  • AS ID (AS Number): Each AS in the BGP network is assigned a unique AS ID to distinguish different ASs.
  • the AS identifier is divided into a 2-byte AS identifier and a 4-byte AS identifier, where the range of the 2-byte AS identifier is 1 to 65535, and the range of the 4-byte AS identifier is 1 to 4294967295.
  • Devices that support 4-byte AS identifiers are compatible with devices that support 2-byte AS identifiers.
  • BGP peers BGP speakers that exchange BGP routing messages with each other are called peers.
  • BGP peers are also called BGP neighbors.
  • IBGP (intra-AS) and EBGP (inter-AS) neighbor relationships can be established between BGP peers.
  • a special neighbor relationship that is, a Multiprotocol BGP (Multiprotocol BGP) neighbor relationship, may also be established between BGP devices in an AS.
  • MP_BGP is forward compatible, that is, BGP devices that support BGP extension and BGP devices that do not support BGP extension can communicate with each other.
  • RR Route Reflector
  • Client Client
  • RR is a way to handle the surge of IBGP network connections within an AS.
  • one BGP device is used as the RR, and other BGP devices are used as the Client.
  • An IBGP connection is established between the client and the RR.
  • Clients and their connected RRs form a cluster.
  • RR reflects routing information between Clients, and no BGP connection needs to be established between Clients.
  • BGP Path Attributes is a set of parameters used to further describe specific routes, so that BGP devices can filter and select routes.
  • BGP path attributes can generally be divided into the following four categories:
  • All BGP devices can be identified, but they are not required to exist in the Update message, and can be selected according to specific circumstances.
  • Optional transition a property that is transferable between ASs.
  • a BGP device may not support this attribute, but it will still receive it and advertise it to other peers.
  • BGP Path Attributes include: Origin attribute, AS_Path attribute, Next_Hop attribute, MED (Multi-Exit-Discriminator) attribute, Local_Pref (Local Preference) attribute, etc.
  • Routing policy acts on routing and is used to implement functions such as route filtering and routing attribute setting. It changes the routing path that network traffic passes through by changing routing attributes (including reachability).
  • FIG. 3 is a schematic diagram of a process flow of a BGP device for processing a BGP route.
  • the BGP protocol itself cannot discover routes, its route sources include those imported from other protocols (including Direct routes, Static routes, Internal Gateway Protocol (IGP) routes, etc.) and received from neighbors two parts. Specifically include the following steps:
  • the BGP device creates a route through a route import policy
  • the BGP device receives the route from the neighbor through the route receiving policy
  • the BGP device performs route aggregation manually or automatically
  • the BGP device selects the route according to the BGP route selection rule
  • the BGP device issues a routing table
  • the BGP device filters the routes through the egress policy
  • the BGP device sends the filtered route to the BGP neighbor.
  • the BGP device can filter routes through routing policies, and can also modify the attributes of routes.
  • BGP adopts the specified routing policy to select the optimal route.
  • the common strategies of Local_Pref attribute, AS_Path attribute, Origin attribute, and MED attribute in BGP routing selection are as follows: Local_Pref attribute selects the route with the highest local priority (Local_Pref); AS_Path attribute selects the route with the shortest AS path (AS_Path); The Origin attribute selects the routes whose origin types are IGP, EGP, and Incomplete in sequence; the MED attribute selects the route with the lowest MED value.
  • S301a and S301b in the embodiment of FIG. 3 is not limited.
  • S301a and S301b may be parallel steps.
  • the order of execution is not limited between S304a and S304b, for example, S304a and S341b may be parallel steps.
  • BGP routing messages The operation of BGP is driven by messages.
  • the existing BGP protocols include message types such as Open, Update, Notification, Keep-alive, and Route-refresh.
  • Open message The Open message is the first message sent after the Transmission Control Protocol (TCP) connection is established, and is used to establish the connection relationship between BGP peers. After the BGP Peer receives the Open message and negotiates successfully, it will send a Keep-alive message to confirm and maintain the validity of the connection. After confirmation, messages such as Update, Notification, Keep-alive, and Route-refresh can be exchanged between BGP peers.
  • TCP Transmission Control Protocol
  • Update message is used to exchange routing information between BGP peers.
  • the Update message can publish multiple pieces of reachable route information with the same attributes, and can also revoke multiple pieces of unreachable route information.
  • an Update message can advertise multiple reachable routes with the same routing attributes, and these routes can share a set of routing attributes. All routing attributes contained in a given Update message apply to all destination addresses (represented by BGP routing prefixes) in the Network Layer Reachability Information (NLRI) field in the Update message.
  • NLRI Network Layer Reachability Information
  • an Update message can revoke multiple unreachable routes. Each route clearly defines the routes previously advertised between BGP Speakers through the destination address (represented by the BGP route prefix).
  • the BGP routing message described in this embodiment of the present application is an Update message.
  • Notification message When the BGP device detects an error state, it sends a Notification message to the BGP Peer, after which the BGP connection will be interrupted immediately.
  • BGP devices will periodically send Keep-alive messages to BGP peers to maintain the validity of the connection.
  • Route-refresh message The Route-refresh message is used to request the BGP Peer to resend all reachable route information.
  • BGP prefix indicates the destination route address, that is, a route passed between devices.
  • BGP prefixes can be carried in BGP routing messages and passed between BGP devices. For example, in the BGP network system shown in Figure 1, assuming that a BGP prefix is X.X.X.X, the BGP prefix can be carried in a BGP routing message, sent by BGP device 6 to BGP device 5, and then sent by BGP device 5 to BGP device 1, until the BGP prefix is sent to the BGP device indicated by the destination routing address.
  • FIG. 4 is a schematic flowchart of a routing processing method provided by an embodiment of the present application.
  • the route processing method may be implemented by interaction between a first BGP device and a second BGP device, and the first BGP device and the second BGP device may be adjacent BGP devices within an AS, or may be adjacent BGP devices between ASs
  • the BGP device is not limited in this embodiment.
  • the method may include the following steps:
  • a second BGP device creates a first BGP routing message, where the first BGP routing message includes a first identifier list and a BGP routing prefix;
  • the second BGP device sends the first BGP routing message to the first BGP device; correspondingly, the first BGP device receives the first BGP routing message from the second BGP device;
  • the first BGP device determines that the first identifier list includes the identifier of the first BGP device
  • the first BGP device suppresses the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
  • any one of the BGP devices (such as the first BGP device and the second BGP device) described in this embodiment has an identifier in the BGP network. That is to say, the identifier of the BGP device described in this embodiment is used to identify a BGP-enabled device, and the identifier of the BGP device is instruction information generated by a combination of mechanisms, manually configured or automatically generated.
  • the identifier of the first BGP device is the identifier of the first BGP device in the BGP network, and will not change with the modification of the AS identifier in the routing attribute; and the identifier of the first BGP device and the identifier of the second BGP device are Not the same, there is a one-to-one correspondence relationship.
  • the identifier of the BGP device is: the combination of the AS identifier of the AS where the BGP device is located and the router identifier (Router ID) of the BGP device, the random number corresponding to the BGP device, the IP address of the BGP device, and the like.
  • the identifier of the first BGP device is 100+1.1.1.1.
  • the identifier of the first BGP device is 00010010
  • the identifier of the second BGP device is 00010011
  • the random numbers corresponding to the first BGP device and the second BGP device are different.
  • the identification list (adv_list) attribute is a new optional transition attribute of Path Attributes in this embodiment of the application, and the identification list attribute is used to indicate that the BGP routing message includes an identification list. That is to say, if the Path Attributes in the BGP routing message includes adv_list, then the BGP routing message includes the identification list.
  • a new attribute adv_list is added to the Path Attributes attribute of the Update message to save the device identification list.
  • the format of the Update message is shown in Figure 5.
  • Withdrawn Routes Length indicates the length of the withdrawn route, which can be indicated by 16 bits. Among them, if Withdrawn Routes Length is 0, it means that there are withdrawn routes.
  • Withdrawn Routes represent withdrawn routes, expressed in the form of variables. Among them, Withdrawn Routes has a variable length.
  • Total Path Attributes Length indicates the total path attribute length, which can be indicated by 16 bits. If Total Path Attributes Length is 0, it means there is no path attribute.
  • Path Attributes represents a list of path attributes, represented in the form of variables.
  • Network Layer Reachability Information represents network layer reachability information in the form of variables.
  • Path Attributes is represented by the triple ⁇ attribute type, attribute length, attribute value>.
  • the attribute type (Attr.TYPE) field includes attribute flags (Attr.Flags) and attribute type codes (Attr.Type Code).
  • the attribute length field is represented by Attr.Length, and the attribute value field is represented by Attr.Value.
  • Attr.TYPE can be represented by 2 bytes
  • Attr.Flags occupies 1 byte (8 bits (bit))
  • Attr.Type Code occupies 1 byte (unsigned bit).
  • Attr.Flags represents the flag of the attribute, which can be represented by 8 bits, as shown in Figure 6. The meaning of each bit of Attr.Flags is as follows:
  • O bit indicating the optionality of the attribute. That is to say, this bit determines whether the attribute is a mandatory attribute.
  • the bit of the optional attribute is set to 1, and the bit of the well-known attribute (well-known) is set to 0.
  • T bit Transitive bit
  • this bit determines whether the property is transitive. Among them, for optional attributes, the bit is set to 1 for transferable attributes, and the bit is set to 0 for non-transferable attributes. This bit must be set to 1 for well-known attributes.
  • the P bit indicates the locality of the attribute. Among them, for the optional attributes that can be passed, the bit is set to 1 for local attributes, and the bit is set to 0 for global attributes. For non-transitive optional attributes and well-known attributes, this bit must be set to 0.
  • the E bit indicates whether the attribute length field (ie, Attr.Length) needs to be extended. Among them, for attributes that do not need to be extended, the bit is set to 0, and Attr.Length occupies 1 byte; for attributes that need to be extended, the bit is set to 1, and Attr.Length occupies 2 bytes.
  • Attr.Type Code represents the type number of the attribute.
  • the current Path Attributes attribute has been extended with multiple attributes, which is not limited in this embodiment.
  • the definition of the newly added identification list attribute in this embodiment is: the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification list The identifier of the BGP device in the identifier list; the attribute length field of the identifier list attribute indicates the length of the identifier list.
  • this embodiment defines the attribute tag that identifies the list attribute as an optional transition attribute. That is, a BGP device that supports the attribute of the identification list can add the attribute of the identification list to the BGP routing message, and a BGP device that does not support the attribute of the identification list only needs to directly forward the BGP routing message according to the requirements of the protocol.
  • the attribute mark definition of the identification list attribute may be 1100 0000 (C0), or other definitions may be adopted, which is not limited in this embodiment. For example, let the Attr.Type Code of adv_list be 50, that is, this byte is defined as 00110010.
  • the attribute type of the identity list attribute described in this embodiment may also be set as a recognized mandatory attribute, a recognized arbitrary attribute, or an optional non-transition attribute, which is not limited in this embodiment. It can be understood that, in this embodiment, it is a preferred setting manner to set the attribute type of the identification list attribute as an optional transition attribute.
  • the attribute value field of the identity list attribute of this embodiment includes the length of the identity of each BGP device in the identity list. For example, if a BGP device uses a 4-byte AS identifier + a 4-byte Router ID to form an identifier, the identifier length of each BGP device is 8 bytes.
  • the attribute length field of the identity list attribute indicates the length of the identity list. For example, if the identification list includes the identifications of 4 BGP devices, and the identification length of each BGP device indicated by the attribute value field is 8 bytes, then the attribute length of the identification list attribute is 32 bytes.
  • the ID list is a list storing the IDs of BGP devices, which can be carried in BGP routing messages and used to transmit IDs of BGP devices that the route passes through. That is, the identification list includes at least one identification, wherein each identification is an identification of a BGP device through which the BGP routing prefix passes.
  • the identification list may also be carried in a newly added BGP routing message.
  • the BGP device transmits the identification list through other types of BGP routing messages except the Update message, which is not limited in this embodiment.
  • the identifiers of all BGP devices passed by the BGP route prefix X.X.X.X can be added to the identifier list. It should be noted that, compared to the existing AS_Path attribute, the AS identifier is only added when routes are passed between EBGP neighbors of different ASs.
  • the identifier list attribute described in this embodiment only needs the BGP device to transmit routes to neighbors, regardless of whether it is inter-AS EBGP. Neighbors or intra-AS IBGP neighbors add the local ID to the ID list in the same way. It can be seen that the identification list described in this embodiment can accurately record each device that is routed, thereby helping to avoid routing loops.
  • the identifiers of the BGP devices are added to the identifier list in an order (eg, first-in, first-out order).
  • the length of the identification list is limited to 5.
  • cyclic coverage is performed (for example, cyclic coverage is performed in a first-in, first-out order).
  • the length of the identification list described in this embodiment is not limited to 5. In theory, the length of the identification list is variable, which is not limited in this embodiment.
  • the second BGP device is an originating device of the BGP route prefix.
  • the originating device in this embodiment is a BGP device that generates an originating route with a BGP route prefix as a destination address.
  • the originating route refers to a route that is first generated for a destination address.
  • the second BGP device needs to add an identifier list attribute in Path Attributes.
  • the second BGP device generates an identity of the local machine, and adds the identity of the local machine to the identity list.
  • the second BGP device advertises the first BGP routing message to the adjacent BGP device, where the first BGP routing message includes the first identification list and the BGP routing prefix.
  • the first identification list and the BGP routing prefix sent by the second BGP device to the adjacent BGP device can be carried in the Update message, so that the routing information can be exchanged between BGP peers.
  • a new BGP route message may be created due to the following conditions:
  • BGP devices in a BGP network need to update routes according to a certain period.
  • the neighbor relationship between BGP devices may change (for example, the physical connection between BGP devices fails), or some BGP devices themselves fail, so the BGP devices in the BGP network need to update routes periodically. That is, the second BGP device may periodically create a BGP routing message to send the BGP routing message of the second BGP device to the BGP device that has established a BGP neighbor relationship and that has established a physical connection in the BGP network.
  • Scenario 2 A routing device with an IP address of X.X.X.X is newly connected to the BGP network.
  • the routing device establishes a physical connection with the second BGP device, and the second BGP device can receive the routing message from the routing device.
  • the routing message Indicates that the IP address of the routing device is X.X.X.X.
  • the second BGP device may create a BGP routing message, where the BGP routing message includes the BGP routing prefix X.X.X.X.
  • the second BGP device is an intermediate device for BGP routing prefixes.
  • the intermediate device described in this embodiment is a BGP device that receives BGP routing messages and sends BGP routing messages to neighboring BGP devices. If the second BGP device is an intermediate device, before the second BGP device creates the first BGP routing message, the second BGP device receives the second BGP routing message, where the second BGP routing message includes the second identifier list; the second BGP device creates The first BGP routing message means that the second BGP device adds the identifier of the second BGP device to the second identifier list, thereby generating the first identifier list.
  • the second BGP device since the second BGP device has received the second identification list in advance, the second BGP device generates its own identification, and adds its own identification to the second identification list, that is, generates the first identification list.
  • the first identifier list includes the identifiers of the BGP devices that have passed before the BGP route prefix reaches the second BGP device, and also includes the identifiers of the second BGP device.
  • the second BGP device advertises the first BGP routing message to the adjacent BGP device, where the first BGP routing message includes the identification list and the BGP routing prefix. It should be noted that the second BGP routing message received by the second BGP device is compared with the first BGP routing message regenerated by the second BGP device, and the two BGP routing messages are different BGP routing messages.
  • the second BGP device After the second BGP device creates the first BGP routing message, it can send the first BGP routing message to the BGP device that establishes a BGP neighbor relationship with the second BGP device and establishes a physical connection in a flooding manner. For example, it can send the first BGP routing message to the first BGP device. The device sends the first BGP routing message. Correspondingly, the first BGP device receives the first BGP routing message from the second BGP device. For the first BGP routing message received by the first BGP device, such as an Update message, it needs to check whether the BGP routing message carries an identifier list; Whether to include the identifier of the first BGP device.
  • the first BGP device receives the first BGP routing message and implements route selection according to the BGP protocol routing principle. This embodiment is not limited.
  • the first BGP device can suppress the route that causes the BGP routing loop. That is, the first BGP device suppresses the route from the first BGP device to the second BGP device with the BGP route prefix as the destination address.
  • the first BGP device may directly discard the route from the first BGP device to the second BGP device that uses the BGP route prefix as the destination address to avoid routing loops. For example, for a BGP route prefix X.X.X.X in a BGP routing message, if a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address causes a routing loop, the first BGP device discards the route from the first BGP device A route to the second BGP device using the BGP route prefix X.X.X.X as the destination address.
  • the first BGP device may decapsulate the first BGP routing message to obtain a BGP routing prefix and a first identification list, and store the BGP routing prefix and the first identification list to the receiving device. direction routing information table.
  • the first BGP device processes the decapsulated data, and determines that the first identifier list includes the identifier of the first BGP device, which means that there is a routing loop in the BGP network. Then, the first BGP device may delete the BGP routing prefix from the routing information table in the receiving direction.
  • the first BGP device may cache the BGP route prefix (for example, cache the BGP route prefix in the routing information table of the receiving direction), and compare the priority of the second route with the BGP route prefix as the destination address with the local BGP route prefix.
  • the priorities of the cached first routes with the BGP route prefix as the destination address are compared, and corresponding operations are adopted to avoid routing loops. That is to say, the first BGP device may not directly discard the BGP routing prefix, and avoid routing loops through other methods.
  • the first route described in this embodiment is a route that has been used in the first BGP device with the BGP route prefix as the destination address, and the second route is a BGP route message received by the first BGP device, and the BGP route prefix is The route to the destination address. That is, for the same BGP route prefix, the first BGP device needs to compare the priorities of the first route and the second route, so as to determine which route to select.
  • the priority of the first route is higher than the priority of the second route, that is, for the same BGP route prefix, the priority of the local original route is higher than the priority of the newly received route.
  • the first BGP device performs route selection according to the BGP protocol, it still selects the first route, thereby avoiding routing loops. Therefore, if the priority of the first route is higher than the priority of the second route, the first BGP device will record the routing loop alarm information.
  • the routing loop alarm information is used to record related information of the routing loop detected by the first BGP device and related information of the first BGP device when the first BGP device detects the routing loop.
  • the routing loop alarm information includes one or more of the following: an identifier of the first BGP device, an identifier list, a time when the BGP route has a routing loop, and a BGP routing loop log.
  • the routing loop alarm information recorded by the first BGP device includes the identifier of the first BGP device, the identifier list recorded by the first BGP device, the time when the first BGP device detected the routing loop, and the BGP routing prefix where the routing loop occurred. and other information, which is not limited in this embodiment.
  • the first BGP device may also send the routing loop alarm information to the adjacent BGP device, which is beneficial for the operation and maintenance personnel to perform network maintenance with reference to the routing loop alarm information.
  • the priority of the first route is lower than the priority of the second route, that is, for the same BGP route prefix
  • the priority of the local original route is lower than the priority of the newly received route.
  • the first BGP device lowers the priority of the second route, so that the route selected by the first BGP device with the BGP route prefix as the destination address is the first BGP device or, the first BGP device prevents the second route from participating in the route selection, so that the route selected by the first BGP device with the BGP route prefix as the destination address is the first route.
  • the first BGP device will lower the priority of the received first BGP routing message to The BGP route prefix X.X.X.X is the priority of the route with the destination address, so that the first BGP device still selects the first route. Or, the first BGP device avoids the route with the BGP route prefix X.X.X.X as the destination address in the received first BGP routing message from participating in route selection, so that the first BGP device still selects the first route.
  • the cache of the BGP route prefix by the first BGP device in this embodiment means that the first BGP device will not directly discard the BGP route prefix, but will reduce the priority or avoid participating in route selection, thereby A route that avoids this BGP routing prefix is preferred, thereby causing routing loops in the BGP network system.
  • the cached BGP route prefix may be recorded in the routing loop log by the first BGP device for reference and use by subsequent operation and maintenance personnel when performing network maintenance.
  • processing flow described in the above S401 to S404 only reflects the processing process of the BGP device's identification and identification list of the newly added BGP device in the embodiment, and the processing process does not affect the existing BGP routing processing mechanism and. processing.
  • An example is used below to illustrate the existing BGP routing processing mechanism and processing process, combined with the BGP device's processing process for the identification and identification list of the newly added BGP device in this embodiment.
  • FIG. 7 is a schematic diagram of a routing processing process provided by an embodiment of the present application.
  • the routing processing process may be performed by the BGP device 106 in the BGP network system shown in FIG. 1.
  • the BGP device The AS where 106 is located is AS 300.
  • FIG. 8 is a schematic diagram of another routing processing process provided by an embodiment of the present application.
  • the routing processing process may be performed by the BGP device 104 in the BGP network system shown in FIG. 1 , and the AS where the BGP device 104 is located is the AS 100 .
  • the routing processing procedures shown in FIG. 7 and FIG. 8 include the existing BGP routing processing mechanism and processing procedure, and the routing processing method shown in FIG. 4 .
  • the BGP device 106 creates a BGP routing message, adds the AS identifier of the AS in the AS_Path attribute of the BGP routing message, and adds the identifier list attribute in the AS_Path attribute, and adds the local identifier to the identifier list;
  • the BGP device 106 sends the BGP routing message to the neighbor BGP device 105 in the AS 200.
  • the specific processing process of the BGP device is shown in FIG. 8, including the following steps:
  • the BGP device 104 receives the BGP routing message from the neighbor BGP device 103 in the AS 200;
  • the BGP device 104 detects whether the BGP routing message contains the AS identifier of the AS (that is, detects whether the BGP routing message contains the AS 100);
  • the BGP device 104 receives the BGP routing message and performs route selection;
  • the BGP device 104 discards the BGP routing prefix
  • the BGP device 104 detects whether the BGP routing message contains the identifier of the BGP device 104;
  • the BGP device 104 receives the BGP routing message and performs routing selection; wherein, the BGP device 104 adds the identification of the BGP device 104 to the identification list;
  • the BGP device 104 obtains a new BGP routing message according to the BGP routing prefix and the updated identification list, and continues to send the new BGP routing message to the BGP neighbor device;
  • the BGP device 104 suppresses the route from the BGP device 104 to the BGP device 103 with the BGP routing prefix as the destination address.
  • this embodiment does not limit the steps of the BGP device 104 detecting whether the BGP routing message contains the AS identifier of the AS, and the BGP device 104 detecting whether the BGP routing message contains the AS identifier.
  • the embodiment of the present application provides a route processing method, and the method can be implemented by interaction between a first BGP device and a second BGP device.
  • the second BGP device determines a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix.
  • the first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes.
  • the second BGP device sends the first BGP routing message to the first BGP device.
  • the first BGP device determines that the first identifier list includes the identifier of the first BGP device, the first BGP device suppresses the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address. It can be seen that the BGP device can more accurately determine the specific device that has a routing loop according to the identifier, and can also suppress the route of the BGP routing prefix that causes the routing loop, thereby solving the BGP routing loop problem.
  • FIG. 9 is a schematic flowchart of a scenario in which a route processing method provided by an embodiment of the present application is applied to multiple ASs.
  • the scenario between the multiple ASs is shown in FIG. 10 , including BGP device 1 (ie BGP device 101 in FIG. 1 ) to BGP device 6 (ie BGP device 106 in FIG. 1 ), BGP device 1 to BGP device 6 respectively belong to different ASs (including AS100, AS200, and AS300), and BGP devices 1 to 6 all run the BGP protocol.
  • BGP device 2 ie BGP device 102 in FIG. 1
  • BGP device 3 ie BGP device 103 in FIG.
  • BGP device 1 establish an EBGP neighbor relationship
  • BGP device 3 and BGP device 4 establish EBGP neighbor relationship
  • BGP device 5 that is, BGP device 105 in FIG. 1
  • BGP device 6 establish EBGP neighbor relationship
  • BGP device 1, BGP device 2, BGP device 4 and BGP device 5 Establish an IBGP neighbor relationship
  • BGP device 1 is an RR
  • BGP device 5 is an RR Client
  • MP_BGP neighbor relationship is established between BGP device 2 and BGP device 4.
  • the identifier of the BGP device is a combination of the AS identifier of the AS where it is located + the router identifier
  • the identifiers of each BGP device are shown in FIG. 10 .
  • the AS where BGP device 1 is located is AS 100
  • the router ID corresponding to BGP device 1 is 1.1.1.1
  • the ID of BGP device 1 is 100+1.1.1.1.
  • the method specifically includes the following steps:
  • the BGP device 6 creates a BGP routing message, and sends the BGP routing message to the BGP device 5 that has established an EBGP neighbor relationship, where the BGP routing message includes routing information and an identifier list of the BGP routing prefix X.X.X.X.
  • the BGP device 6 carries the local identifier through the adv_list in the Update message, and adds 300+6.6.6.6 to the adv_list.
  • the BGP device 5 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
  • the BGP device 5 sends a BGP routing message to the BGP device 1 that has established an IBGP neighbor relationship in the AS, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identifier list.
  • the carried adv_list is 100+5.5.5.5, 300+6.6.6.6.
  • the BGP device 1 receives the BGP routing message, and determines that the identifier list does not contain the local identifier;
  • the BGP device 1 acting as the RR, can send a BGP routing message to the BGP device 2 that has established an IBGP neighbor relationship in the AS, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated ID list.
  • the carried adv_list is 100+1.1.1.1, 100+5.5.5.5, 300+6.6.6.6.
  • the BGP device 2 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
  • the BGP device 2 sends a BGP routing message to the BGP device 3 that has established an EBGP neighbor relationship, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identifier list.
  • BGP device 2 when BGP device 2 sends BGP route prefix X.X.X.X to BGP device 3, it carries adv_list as 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5, 300+6.6.6.6.
  • the BGP device 3 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
  • the BGP device 3 sends a BGP routing message to the BGP device 4 that has established an EBGP neighbor relationship, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identification list.
  • BGP device 3 when BGP device 3 sends BGP route prefix X.X.X.X to BGP device 4, it carries adv_list as 200+3.3.3.3, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5, 300+6.6.6.6.
  • BGP device 3 can rewrite the AS identifier through a routing policy. For example, device 3 rewrites the AS identifier of the AS_Path attribute of the original route, and the AS identifier information corresponding to the original BGP route prefix X.X.X.X is changed from 100, 300 to 200 . That is to say, if BGP device 3 rewrites the AS identifier through the routing policy, the BGP routing message sent by BGP device 3 to BGP device 4 carries adv_list as 200+3.3.3.3, 200+2.2.2.2, 200+1.1 .1.1, 200+5.5.5.5, 200+6.6.6.6.
  • the BGP device 4 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
  • the BGP device 4 sends a BGP routing message to the BGP device 2 that has established the MP_BGP neighbor relationship, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identification list.
  • BGP device 4 when BGP device 4 sends BGP route prefix X.X.X.X to BGP device 2, it carries adv_list as 100+4.4.4.4, 200+3.3.3.3, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5. It should be noted that this embodiment assumes that the length of adv_list is limited to 5. After adding the identifier 100+4.4.4.4 of the BGP device 4, because the total length of the list exceeds 5, 300+6.6.6.6 is automatically overwritten.
  • the BGP device 2 receives the BGP routing message, and determines that the identifier list includes the local identifier.
  • the BGP routing message received by BGP device 2 carries adv_list as 100+4.4.4.4, 200+3.3.3.3, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5.
  • 100+2.2.2.2 is the identifier of BGP device 2, which means that BGP device 2 has received the route sent by the local machine, and there is a routing loop in the BGP network.
  • the BGP device 2 suppresses the route from the BGP device 4 to the BGP device 2 with the BGP route prefix X.X.X.X as the destination address.
  • BGP device 2 performs route selection on the received BGP route according to the RFC standard routing rules. If the BGP route prefix X.X.X.X is not preferred, it means that BGP device 2 will not preferentially select BGP device 2 to BGP device 4 using BGP The route prefix X.X.X.X is the route of the destination address, thereby avoiding routing loops. Further, the BGP device 2 records the routing loop alarm information.
  • BGP device 3 rewrites the AS identifier through the routing policy, then the BGP routing message sent by BGP device 3 to BGP device 4 carries adv_list as 200+3.3.3.3, 200+2.2.2.2, 200+1.1 .1.1, 200+5.5.5.5, 200+6.6.6.6.
  • the priority of the modified route is higher than that of the original route, that is, the route with the BGP route prefix X.X.X.X as the destination address received by BGP device 2 from BGP device 4 is higher than that received by BGP device 2 from BGP device 2.
  • the route received by 1 with the BGP route prefix X.X.X.X as the destination address is better.
  • BGP device 2 suppresses the route from BGP device 2 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, that is, processing the route from BGP device 2 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address , including reducing the priority of the route, preventing the route from participating in routing selection, and discarding the route. Meanwhile, BGP device 2 records routing loop alarm information.
  • BGP device 2 does not preferentially select the route from BGP device 2 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, but still preferentially selects the route from BGP device 2 to BGP device 1 with the BGP route prefix X.X.X.X as the destination address routing, thus avoiding routing loops.
  • FIG. 11 is a schematic flowchart of a route processing method provided by an embodiment of the present application applied to an intra-AS scenario.
  • the scene in the AS is shown in FIG. 12 , including BGP device 1 (ie, BGP device 101 in FIG. 1 ), BGP device 2 (ie, BGP device 102 in FIG. 1 ) and BGP device 4 (ie, BGP device 102 in FIG. 1 ) The BGP device 104) and the BGP device 5 (that is, the BGP device 105 in FIG. 1), each BGP device is located in the AS 100, and each BGP device runs the BGP protocol.
  • BGP device 1 ie, BGP device 101 in FIG. 1
  • BGP device 2 ie, BGP device 102 in FIG. 1
  • BGP device 4 ie, BGP device 102 in FIG. 1
  • the BGP device 104 and the BGP device 5 that is, the BGP device 105 in FIG. 1
  • each BGP device is located in the AS 100, and each BGP
  • An IBGP neighbor relationship is established between BGP device 1, BGP device 2, BGP device 4, and BGP device 5, where BGP device 1 is an RR, and BGP device 5 is an RR Client; an MP_BGP neighbor relationship is established between BGP device 2 and BGP device 4 .
  • a routing loop occurs between BGP device 1, BGP device 2, and BGP device 4 of AS100.
  • the identifier of the BGP device is a combination of the AS identifier of the AS where it is located + the router identifier
  • BGP device 1 BGP device 2
  • BGP device 4 BGP device 5
  • the logo is shown in Figure 12.
  • the BGP device 5 creates a BGP routing message, and sends the BGP routing message to the BGP device 1 serving as the RR, where the BGP routing message includes routing information and an identifier list of the BGP routing prefix X.X.X.X.
  • the BGP device 5 carries the local identifier through the adv_list in the Update message, and adds 100+5.5.5.5 to the adv_list.
  • the BGP device 1 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
  • the BGP device 1 acting as the RR, can send a BGP routing message to the BGP device 2 that has established an IBGP neighbor relationship in the AS, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identifier list.
  • the carried adv_list is 100+1.1.1.1, 100+5.5.5.5.
  • the BGP device 2 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
  • the BGP device 2 sends a BGP routing message to the BGP device 4 that has established the MP_BGP neighbor relationship, where the BGP routing message includes routing information of the BGP routing prefix X.X.X.X and the updated identification list.
  • BGP device 2 when BGP device 2 sends the BGP route prefix X.X.X.X to BGP device 4, it carries adv_list as 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5.
  • the BGP device 4 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
  • the BGP device 4 sends a BGP routing message to the BGP device 1 serving as the RR, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identification list.
  • BGP device 4 when BGP device 4 sends BGP route prefix X.X.X.X to BGP device 1, it carries adv_list as 100+4.4.4.4, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5.
  • BGP device 4 can increase the route priority through a routing policy. For example, by increasing the route priority in the outbound direction of BGP device 4, the priority of the route with the BGP route prefix X.X.X.X from BGP device 1 to BGP device 4 is higher than that of BGP device 4. The priority of the route from BGP device 1 to BGP device 5 with the BGP route prefix X.X.X.X.
  • the BGP device 1 receives the BGP routing message, and determines that the identifier list includes the identifier of the local device.
  • the BGP routing message received by BGP device 1 carries adv_list as 100+4.4.4.4, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5.
  • 100+1.1.1.1 is the identifier of BGP device 1, which means that BGP device 1 has received the route sent by the local machine, and there is a routing loop in the BGP network.
  • the BGP device 1 suppresses the route from the BGP device 1 to the BGP device 4 with the BGP route prefix X.X.X.X as the destination address.
  • BGP device 1 performs route selection on the received BGP route according to the RFC standard routing rules. If the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address is not preferred, it means that BGP device 1 The route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address will not be preferentially selected to avoid routing loops. Further, the BGP device 1 records the routing loop alarm information.
  • the outbound direction of BGP device 4 increases the route priority, so that the route from BGP device 1 to BGP device 4 is increased.
  • Routes with BGP route prefix X.X.X.X have higher priority than routes from BGP device 1 to BGP device 5 with BGP route prefix X.X.X.X, resulting in BGP route prefix X.X.X.X from BGP device 1 to BGP device 5.
  • the routes of the BGP route prefix X.X.X.X from BGP device 1 to BGP device 4 are replaced, and routing loops and route flapping occur.
  • BGP device 1 suppresses the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, that is, it enforces the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address Automatic processing, including reducing the priority of the route, inhibiting the route from participating in routing selection, and discarding the route. At the same time, BGP device 1 records routing loop alarm information.
  • BGP device 1 does not preferentially select the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, but still preferentially selects the route from BGP device 1 to BGP device 5 with the BGP route prefix X.X.X.X routing, thus avoiding routing loops.
  • An embodiment of the present application provides a route processing apparatus.
  • the route processing apparatus is used to implement the method executed by the first BGP device in the embodiment shown in FIG. 4 , and specifically includes:
  • Transceiver unit 1301 configured to receive a first BGP routing message from a second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix; the identification list includes at least one identification, where each identification is the BGP route The identifier of the BGP device that the prefix passes through;
  • a processing unit 1302 configured to determine that the first identification list includes the identification of the first BGP device
  • the processing unit 1302 is further configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
  • the path attribute list of the first BGP routing message includes an identification list attribute
  • the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
  • the processing unit 1302 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
  • the processing unit 1302 is configured to discard the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
  • the processing unit 1302 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
  • the processing unit 1302 is configured to store the route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and set the priority of the route to be lower than all the routes previously stored locally with the BGP route prefix as the destination address priority.
  • the processing unit 1302 is further configured to record routing loop alarm information, where the routing loop alarm information includes one or more of the following: an identifier of the first BGP device, a first identifier list, and a BGP route exists in a routing loop Time of the route, BGP routing loop log.
  • processing unit 1302 is further configured to:
  • the first identification list in the first BGP routing message does not include the identification of the first BGP device, and the first identification list is updated; the updated first identification list includes the identification of the first BGP device; the BGP routing message is created, the created The BGP routing message includes the updated first identification list.
  • the identifiers in the first identifier list are one or more of the following:
  • FIG. 14 is a schematic structural diagram of a first BGP device provided by an embodiment of the present application.
  • the first BGP device may be a device that performs the routing processing function described in the embodiment shown in FIG. 4 (for example, chip).
  • the first BGP device may include a transceiver 1401 , at least one processor 1402 and a memory 1403 .
  • the transceiver 1401, the processor 1402, and the memory 1403 may be connected to each other through one or more communication buses, or may be connected to each other in other ways.
  • the transceiver 1401 may be used for sending data or receiving data. It can be understood that the transceiver 1401 is a general term and may include a receiver and a transmitter. For example, the receiver is used to receive BGP routing messages from the second BGP device.
  • the processor 1402 may be configured to process the data of the first BGP device, for example, suppress the route of the BGP prefix.
  • the processor 1402 may include one or more processors, for example, the processor 1402 may be one or more central processing units (CPUs), network processors (NPs), hardware chips or any combination thereof .
  • the processor 1402 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
  • the memory 1403 is used for storing program codes and the like.
  • the memory 1403 may include volatile memory (volatile memory), such as random access memory (RAM); the memory 1403 may also include non-volatile memory (non-volatile memory), such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 1403 may also include a combination of the above-mentioned types of memory.
  • processor 1402 and memory 1403 may be coupled through an interface, or may be integrated together, which is not limited in this embodiment.
  • the transceiver 1401 and the processor 1402 described above can be used in the routing processing method in the embodiment shown in FIG. 4 , where the specific implementation is as follows:
  • the transceiver 1401 is configured to receive a first BGP routing message from a second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes at least one identification, wherein each identification is the The identifier of the BGP device through which the BGP route prefix passes;
  • a processor 1402 configured to determine that the first identification list includes the identification of the first BGP device
  • the processor 1402 is further configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
  • the path attribute list of the first BGP routing message includes an identification list attribute
  • the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
  • the processor 1402 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
  • the processor 1402 is configured to discard the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
  • the processor 1402 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
  • the processing unit is configured to store a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and set the priority of the route to be lower than the BGP route prefix previously stored locally The priority of all routes for the destination address.
  • the processor 1402 is further configured to record routing loop alarm information, where the routing loop alarm information includes one or more of the following: the identifier of the first BGP device, the first identifier list, the BGP route existing route Time of the loop, BGP routing loop log.
  • the processor 1402 is also used to:
  • the first identification list in the BGP routing message does not include the identification of the first BGP device, and the first identification list is updated; the updated first identification list includes the identification of the first BGP device; the BGP routing message is created, and the created BGP route The message includes the updated first identification list.
  • the identifiers in the first identifier list are one or more of the following:
  • An embodiment of the present application provides a route processing apparatus.
  • the route processing apparatus is used to implement the method executed by the second BGP device in the embodiment shown in FIG. 4 , and specifically includes:
  • a processing unit 1501 configured to create a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes an identification of a second BGP device;
  • the transceiver unit 1502 is configured to send the first BGP routing message to the first BGP device.
  • the path attribute list of the first BGP routing message includes an identification list attribute
  • the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
  • the second BGP device is an originating device of the BGP route prefix.
  • the second BGP device is an intermediate device of a BGP routing prefix; the processing unit 1501 is further configured to receive a second BGP routing message, where the second BGP routing message includes a second identification list and a BGP routing prefix, and the second BGP routing message
  • the identification list includes at least one identification, wherein each identification is an identification of a BGP device through which the BGP routing prefix passes; then the first identification list also includes all identifications in the second identification list.
  • the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
  • FIG. 16 is a schematic structural diagram of a second BGP device provided by an embodiment of the present application.
  • the second BGP device may be a device that performs the routing processing function described in the embodiment shown in FIG. 4 (for example, chip).
  • the second BGP device may include a transceiver 1601 , at least one processor 1602 and a memory 1603 .
  • the transceiver 1601, the processor 1602, and the memory 1603 may be connected to each other through one or more communication buses, or may be connected to each other in other ways.
  • the transceiver 1601 may be used for sending data or receiving data. It can be understood that the transceiver 1601 is a general term and can include a receiver and a transmitter.
  • the sender is configured to send a BGP routing message to the first BGP device.
  • the processor 1602 may be configured to process data of the second BGP device, for example, determine a BGP routing message.
  • the processor 1602 may include one or more processors, for example, the processor 1602 may be one or more central processing units (CPUs), network processors (NPs), hardware chips, or any combination thereof .
  • the processor 1602 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
  • the memory 1603 is used to store program codes and the like.
  • the memory 1603 may include volatile memory (volatile memory), such as random access memory (RAM); the memory 1603 may also include non-volatile memory (non-volatile memory), such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 1603 may also include a combination of the above-mentioned types of memory.
  • processor 1602 and memory 1603 may be coupled through an interface, or may be integrated together, which is not limited in this embodiment.
  • transceiver 1601 and the processor 1602 described above can be used in the routing processing method in the embodiment shown in FIG. 4 , where the specific implementation is as follows:
  • a processor 1602 configured to create a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes an identification of a second BGP device;
  • the transceiver 1601 is configured to send the first BGP routing message to the first BGP device.
  • the path attribute list of the first BGP routing message includes an identification list attribute
  • the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  • the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
  • the second BGP device is an originating device of the BGP route prefix.
  • the second BGP device is an intermediate device of a BGP routing prefix; the processor 1602 is further configured to receive a second BGP routing message, where the second BGP routing message includes a second identification list and the BGP routing prefix,
  • the second identification list includes at least one identification, wherein each identification is an identification of a BGP device that the BGP routing prefix passes through; then the first identification list also includes all identifications in the second identification list.
  • the identifiers of the first identifier list and/or the second identifier list are one or more of the following:
  • An embodiment of the present application provides a BGP network system, where the BGP network system includes the first BGP device and the second BGP device described in the foregoing embodiments.
  • An embodiment of the present application provides a computer-readable storage medium, where a program or an instruction is stored in the computer-readable storage medium, and when the program or instruction is executed on a computer, the computer can execute the data processing method in the embodiment of the present application.
  • An embodiment of the present application provides a chip or a chip system, the chip or chip system includes at least one processor and an interface, the interface and the at least one processor are interconnected through a line, and the at least one processor is used to run a computer program or instruction to execute the present application The data processing method in the embodiment.
  • the interface in the chip may be an input/output interface, a pin or a circuit, or the like.
  • the chip system in the above aspects may be a system on chip (system on chip, SOC), or a baseband chip, etc.
  • the baseband chip may include a processor, a channel encoder, a digital signal processor, a modem, an interface module, and the like.
  • the chip or chip system described above in this application further includes at least one memory, where instructions are stored in the at least one memory.
  • the memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (eg, a read-only memory, a random access memory, etc.).
  • a computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server, or data center over a wire (e.g.
  • coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to transmit to another website site, computer, server or data center.
  • a computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • the available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, high-density digital video discs (DVDs)), or semiconductor media (eg, solid state disks, SSD)) etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Provided in the embodiments of the present application is a route processing method. The method may be executed by a first BGP device. The first BGP device receives a first BGP routing message from a second BGP device, the BGP routing message comprising an identifier list and a BGP routing prefix. The identifier list comprises at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP routing prefix passes. The first BGP device determines that the identifier list comprises the identifier of the first BGP device, and the first BGP device suppresses a route from the first BGP device to the second BGP device that uses the BGP routing prefix as a destination address. Hence, according to the identifier, the BGP devices may more accurately determine the specific device that has a routing loop, and may also suppress the route of the BGP routing prefix that causes the routing loop, thereby solving the BGP routing loop problem.

Description

一种路由处理方法、装置及设备A route processing method, device and device
本申请要求于2020年11月28日提交中国国家知识产权局、申请号为202011365507.9、申请名称为“一种路由处理方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011365507.9 and the application title "A Routing Processing Method, Apparatus and Equipment" filed with the State Intellectual Property Office of China on November 28, 2020, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种路由处理方法、装置及设备。The present application relates to the field of computer technologies, and in particular, to a routing processing method, apparatus, and device.
背景技术Background technique
边界网关协议(Border Gateway Protocol,BGP)是一种用于自治系统(Autonomous System,AS)间的动态路由协议。BGP作为事实上的网络外部路由协议标准,被广泛应用于网络服务提供商(Internet Service Provider,ISP)之间。其中,对于BGP网络中的路由,可能出现路由环路,即数据包不断在这个BGP网络传输,始终到达不了目的地,导致掉线或者网络瘫痪。BGP自带的防止路由环路机制(简称:“防环机制”)可以一定程度上解决路由环路的问题。The Border Gateway Protocol (BGP) is a dynamic routing protocol used between autonomous systems (Autonomous Systems, AS). As a de facto network external routing protocol standard, BGP is widely used between Internet Service Providers (ISPs). Among them, for the routes in the BGP network, routing loops may occur, that is, data packets are continuously transmitted in this BGP network and cannot reach the destination all the time, resulting in dropped calls or network paralysis. BGP's built-in routing loop prevention mechanism (abbreviated as "anti-loop mechanism") can solve the routing loop problem to a certain extent.
但是,现有BGP防环机制,在设备使用不当、设备故障以及特殊复杂组网和配置条件下会很容易防环失效,从而导致BGP路由环路。例如,客户网络经常通过调整路由属性(如修改AS_Path属性中的AS标识)来影响BGP路由选路,但是调整路由属性后可能导致重新选路的路由与原路由构成了路由环路,从而导致BGP路由环路问题。因此,在设备使用不当、设备故障以及特殊复杂组网和配置条件下如何避免BGP路由环路成为待解决的问题。However, the existing BGP anti-loop mechanism may easily fail to prevent loops under improper use of devices, device failures, and special complex networking and configuration conditions, resulting in BGP routing loops. For example, the customer network often affects BGP route selection by adjusting routing attributes (for example, modifying the AS identifier in the AS_Path attribute). However, after adjusting the routing attributes, the re-routed route may form a routing loop with the original route, resulting in BGP routing. Routing loop problem. Therefore, how to avoid BGP routing loops under the conditions of improper use of equipment, equipment failure, and special complex networking and configuration has become a problem to be solved.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种路由处理方法、装置及设备,该方法可以解决BGP路由环路问题,并且支持多厂家兼容,新旧版本兼容,有利于支持现网平滑部署。Embodiments of the present application provide a route processing method, device, and device, which can solve the BGP routing loop problem, support multi-vendor compatibility, compatibility between new and old versions, and help support smooth deployment on existing networks.
第一方面,本申请实施例提供一种路由处理方法,该方法可以由第一BGP设备执行。其中,第一BGP设备接收来自第二BGP设备的第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀。其中,第一标识列表包括至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识。第一BGP设备确定第一标识列表包括第一BGP设备的标识,第一BGP设备抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。In a first aspect, an embodiment of the present application provides a route processing method, and the method can be executed by a first BGP device. The first BGP device receives a first BGP routing message from the second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix. The first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes. The first BGP device determines that the first identification list includes the identification of the first BGP device, and the first BGP device suppresses a route from the first BGP device to the second BGP device that uses the BGP route prefix as a destination address.
可见,BGP设备可以根据该BGP设备的标识更准确地判断发生路由环路的具体设备,并且还可以抑制导致路由环路的路由,从而解决BGP路由环路问题。It can be seen that the BGP device can more accurately determine the specific device in which the routing loop occurs according to the identifier of the BGP device, and can also suppress the routes that cause the routing loop, thereby solving the BGP routing loop problem.
在一种可能的设计中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示第一BGP路由消息包括第一标识列表。In a possible design, the path attribute list of the first BGP routing message includes an identification list attribute, where the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
可见,标识列表属性可以是BGP路由消息中的路径属性列表中的新增属性,有利于支持现网平滑部署。It can be seen that the identifier list attribute may be a newly added attribute in the path attribute list in the BGP routing message, which is beneficial to support smooth deployment on the existing network.
在一种可能的设计中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In a possible design, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
可见,标识列表属性遵循现有的BGP请求评论(Request For Comments,RFC)标准, 支持多厂家兼容,新旧版本兼容,有利于支持现网平滑部署。It can be seen that the attribute of the identification list follows the existing BGP Request For Comments (RFC) standard, supports multi-vendor compatibility, and is compatible with old and new versions, which is beneficial to support smooth deployment on the existing network.
在一种可能的设计中,第一BGP设备丢弃从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。In a possible design, the first BGP device discards the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
可见,若第一BGP设备检测到路由环路,第一BGP设备可以直接丢弃导致路由环路的路由,从而有利于避免路由环路。It can be seen that, if the first BGP device detects a routing loop, the first BGP device can directly discard the route that causes the routing loop, thereby helping to avoid the routing loop.
在一种可能的设计中,第一BGP设备将接收到的BGP路由前缀存储至收方向路由信息表,若第一BGP设备检测到路由环路,则将该BGP路由前缀从收方向路由信息表中删除。In a possible design, the first BGP device stores the received BGP routing prefix in the routing information table of the receiving direction. If the first BGP device detects a routing loop, the BGP routing prefix is sent from the receiving direction to the routing information table. deleted in.
可见,第一BGP设备会对接收到的第一BGP路由消息进行解封装处理,并且将接收到的BGP路由前缀存储至收方向路由信息表。若该BGP路由前缀的路由为导致路由环路的路由,则第一BGP设备将删除该BGP路由前缀的路由,从而有利于避免路由环路。It can be seen that the first BGP device decapsulates the received first BGP routing message, and stores the received BGP routing prefix in the routing information table in the receiving direction. If the route of the BGP routing prefix is a route that causes a routing loop, the first BGP device will delete the route of the BGP routing prefix, thereby helping to avoid routing loops.
在一种可能的设计中,第一BGP设备存储从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。若该路由的优先级低于此前本地存储的以该BGP路由前缀为目的地址的所有路由的优先级,第一BGP设备记录路由环路告警信息,该路由环路告警信息包括以下一种或多种:第一BGP设备的标识、第一标识列表、BGP路由存在路由环路的时刻、BGP路由环路日志。In a possible design, the first BGP device stores a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address. If the priority of the route is lower than the priority of all the routes with the BGP route prefix as the destination address previously stored locally, the first BGP device records routing loop alarm information, where the routing loop alarm information includes one or more of the following Type: the identifier of the first BGP device, the first identifier list, the time when the BGP route has a routing loop, and the BGP routing loop log.
可见,若第一BGP设备检测到路由环路,可以将此前本地存储的以该BGP路由前缀为目的地址的所有路由的优先级与接收到的以该BGP路由前缀为目的地址的路由的优先级进行比较,若本地路由的优先级高于接收到的路由的优先级,那么第一BGP设备在路由选路时还是会优先选择本地已使用的路由,从而有利于避免路由环路。进一步,第一BGP设备还可以记录本次检测到路由环路的具体情况,有利于排查出现路由环路的原因。It can be seen that if the first BGP device detects a routing loop, it can compare the previously stored priorities of all routes with the BGP routing prefix as the destination address and the received priorities of the routes with the BGP routing prefix as the destination address. By comparison, if the priority of the local route is higher than the priority of the received route, the first BGP device will still preferentially select the locally used route during route selection, thereby helping to avoid routing loops. Further, the first BGP device may also record the specific situation of the routing loop detected this time, which is helpful for troubleshooting the cause of the routing loop.
在一种可能的设计中,第一BGP设备存储从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,且设置该路由的优先级低于此前本地存储的以该BGP路由前缀为目的地址的所有路由。In a possible design, the first BGP device stores a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and sets the priority of the route to be lower than the previously locally stored route with the BGP prefix All routes whose route prefix is the destination address.
可见,第一BGP设备检测到路由环路后,可以对路由环路进行处理,从而解决BGP路由环路问题。It can be seen that after detecting the routing loop, the first BGP device can process the routing loop, thereby solving the BGP routing loop problem.
在一种可能的设计中,第一BGP设备确定第一BGP路由消息中的标识列表不包括第一BGP设备的标识,第一BGP设备更新第一标识列表;更新后的第一标识列表包括第一BGP设备的标识。第一BGP设备创建BGP路由消息,其中,第一BGP设备创建的BGP路由消息包括BGP路由前缀和更新后的第一标识列表。In a possible design, the first BGP device determines that the identification list in the first BGP routing message does not include the identification of the first BGP device, and the first BGP device updates the first identification list; the updated first identification list includes the first identification list. An identifier of a BGP device. The first BGP device creates a BGP routing message, where the BGP routing message created by the first BGP device includes a BGP routing prefix and an updated first identification list.
可见,若第一BGP设备未检测到路由环路,第一BGP设备在接收到的标识列表中新增本机的标识,可以精确记录路由在AS间和/或AS内的传递路径,有利于支持后续发现出现路由环路的具体设备。It can be seen that, if the first BGP device does not detect a routing loop, the first BGP device adds its own identifier to the received identifier list, which can accurately record the routing path between ASs and/or within the AS, which is beneficial to Supports subsequent discovery of specific devices with routing loops.
在一种可能的设计中,第一标识列表中的标识为以下一种或多种:In one possible design, the identifiers in the first identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
可见,BGP设备可以通过多种方式生成本机的标识,作为该BGP设备的标识。It can be seen that the BGP device can generate the local identifier in various ways as the identifier of the BGP device.
第二方面,本申请实施例提供一种路由处理方法,该方法可以由第二BGP设备执行。其中,第二BGP设备创建第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀。其中,该第一标识列表包括第二BGP设备的标识。第二BGP设备向第一BGP设备发送该第一BGP路由消息。In a second aspect, an embodiment of the present application provides a route processing method, and the method can be executed by a second BGP device. The second BGP device creates a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix. Wherein, the first identification list includes the identification of the second BGP device. The second BGP device sends the first BGP routing message to the first BGP device.
可见,第二BGP设备可以在第一BGP路由消息中携带第一标识列表,以精确记录路由传递的每一台BGP设备。It can be seen that the second BGP device may carry the first identification list in the first BGP routing message, so as to accurately record each BGP device that the route transmits.
在一种可能的设计中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示第一BGP路由消息包括第一标识列表。In a possible design, the path attribute list of the first BGP routing message includes an identification list attribute, where the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
可见,标识列表属性可以是BGP路由消息中的路径属性列表中的新增属性,有利于支持现网平滑部署。It can be seen that the identifier list attribute may be a newly added attribute in the path attribute list in the BGP routing message, which is beneficial to support smooth deployment on the existing network.
在一种可能的设计中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In a possible design, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
可见,标识列表属性遵循现有的BGP RFC标准,支持多厂家兼容,新旧版本兼容,有利于支持现网平滑部署。It can be seen that the identity list attribute follows the existing BGP RFC standard, supports multi-manufacturer compatibility, and is compatible with old and new versions, which is conducive to supporting smooth deployment on the existing network.
在一种可能的设计中,第二BGP设备为该BGP路由前缀的始发设备。In a possible design, the second BGP device is the originating device of the BGP routing prefix.
可见,若第二BGP设备为始发路由对应的BGP设备,则第二BGP设备可以新增标识列表属性,并生成本机的标识和标识列表,将该标识列表携带在BGP路由消息中发送给相邻的BGP设备。It can be seen that if the second BGP device is the BGP device corresponding to the originating route, the second BGP device can add the attribute of the identification list, and generate the identification and identification list of the local machine, and carry the identification list in the BGP routing message and send it to Neighboring BGP devices.
在一种可能的设计中,第二BGP设备为该BGP路由前缀的中间设备。第二BGP设备接收第二BGP路由消息,第二BGP路由消息包含第二标识列表和该BGP路由前缀,第二标识列表包含至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识;则第一标识列表还包含第二标识列表中的所有标识。In a possible design, the second BGP device is an intermediate device for the BGP routing prefix. The second BGP device receives the second BGP routing message. The second BGP routing message includes a second identification list and the BGP routing prefix. The second identification list includes at least one identification, wherein each identification is a BGP device that the BGP routing prefix passes through. the identifiers; then the first identifier list also includes all identifiers in the second identifier list.
可见,若第二BGP设备为中继路由对应的BGP设备,则第二BGP设备将本机的标识添加到已有的标识列表中,将该更新后的标识列表携带在BGP路由消息中发送给相邻的BGP设备。It can be seen that if the second BGP device is the BGP device corresponding to the relay route, the second BGP device adds the local identifier to the existing identifier list, carries the updated identifier list in the BGP routing message, and sends it to Neighboring BGP devices.
在一种可能的设计中,第一标识列表和/或第二标识列表中的标识为以下一种或多种:In a possible design, the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
可见,BGP设备可以通过多种方式生成本机的标识,作为该BGP设备的标识。It can be seen that the BGP device can generate the local identifier in various ways as the identifier of the BGP device.
第三方面,本申请实施例提供一种路由处理装置,包括收发单元和处理单元。其中,收发单元用于接收来自第二BGP设备的第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀。其中,第一标识列表包括至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识。处理单元用于确定该第一标识列表包括第一BGP设备的标识;处理单元还用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。In a third aspect, an embodiment of the present application provides a routing processing device, including a transceiver unit and a processing unit. The transceiver unit is configured to receive a first BGP routing message from a second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix. The first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes. The processing unit is configured to determine that the first identifier list includes the identifier of the first BGP device; the processing unit is further configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
在一种可能的设计中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示BGP路由消息包括标识列表。In a possible design, the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the BGP routing message includes an identification list.
在一种可能的设计中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In a possible design, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
在一种可能的设计中,处理单元用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,包括:In a possible design, the processing unit is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
处理单元用于丢弃从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目 的地址的路由。The processing unit is configured to discard the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
在一种可能的设计中,处理单元用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,包括:In a possible design, the processing unit is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
处理单元用于存储从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,且设置该路由的优先级低于此前本地存储的以该BGP路由前缀为目的地址的所有路由的优先级。The processing unit is used to store the route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and set the priority of the route to be lower than all the routes previously stored locally with the BGP route prefix as the destination address priority.
在一种可能的设计中,处理单元还用于记录路由环路告警信息,该路由环路告警信息包括以下一种或多种:第一BGP设备的标识、第一标识列表、BGP路由存在路由环路的时刻、BGP路由环路日志。In a possible design, the processing unit is further configured to record routing loop alarm information, where the routing loop alarm information includes one or more of the following: the identifier of the first BGP device, the first identifier list, the BGP route existing route Time of the loop, BGP routing loop log.
在一种可能的设计中,处理单元还用于:In one possible design, the processing unit is also used to:
确定第一BGP路由消息中的第一标识列表不包括第一BGP设备的标识;更新该第一标识列表;更新后的第一标识列表包括第一BGP设备的标识;创建BGP路由消息,第一BGP设备创建的BGP路由消息包括BGP路由前缀和更新后的第一标识列表。Determine that the first identification list in the first BGP routing message does not include the identification of the first BGP device; update the first identification list; the updated first identification list includes the identification of the first BGP device; create a BGP routing message, the first The BGP routing message created by the BGP device includes the BGP routing prefix and the updated first identifier list.
在一种可能的设计中,第一标识列表中的标识为以下一种或多种:In one possible design, the identifiers in the first identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
第四方面,本申请实施例提供一种路由处理装置,包括处理单元和收发单元。其中,处理单元用于创建第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀。其中,第一标识列表包括至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识。收发单元用于向第一BGP设备发送该第一BGP路由消息。In a fourth aspect, an embodiment of the present application provides a route processing apparatus, including a processing unit and a transceiver unit. The processing unit is configured to create a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix. The first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes. The transceiver unit is configured to send the first BGP routing message to the first BGP device.
在一种可能的设计中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示第一BGP路由消息包括第一标识列表。In a possible design, the path attribute list of the first BGP routing message includes an identification list attribute, where the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
在一种可能的设计中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In a possible design, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute Indicates the length of the identity list.
在一种可能的设计中,第二BGP设备为该BGP路由前缀的始发设备。In a possible design, the second BGP device is the originating device of the BGP routing prefix.
在一种可能的设计中,第二BGP设备为该BGP路由前缀的始发设备。处理单元还用于接收第二BGP路由消息,第二BGP路由消息包含第二标识列表和该BGP路由前缀,第二标识列表包含至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识;则所述第一标识列表还包含所述第二标识列表中的所有标识。In a possible design, the second BGP device is the originating device of the BGP routing prefix. The processing unit is further configured to receive a second BGP routing message, where the second BGP routing message includes a second identification list and the BGP routing prefix, and the second identification list includes at least one identification, wherein each identification is a BGP passed by the BGP routing prefix The identifier of the device; then the first identifier list also includes all identifiers in the second identifier list.
在一种可能的设计中,第一标识列表和/或第二标识列表中的标识为以下一种或多种:In a possible design, the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
第五方面,本申请实施例提供一种BGP设备,该设备具有实现第一方面所提供的路由处理方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a fifth aspect, an embodiment of the present application provides a BGP device, where the device has a function of implementing the route processing method provided in the first aspect. This function can be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions.
第六方面,本申请实施例提供一种BGP设备,该设备具有实现第二方面所提供的路由处理方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a sixth aspect, an embodiment of the present application provides a BGP device, where the device has a function of implementing the route processing method provided in the second aspect. This function can be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions.
第七方面,本申请实施例提供一种BGP网络系统,该BGP网络系统包括上述第三方面提供的路由处理装置或第五方面提供的BGP设备,以及第四方面提供的路由处理装置或第六方面提供的BGP设备。In a seventh aspect, an embodiment of the present application provides a BGP network system, where the BGP network system includes the route processing apparatus provided in the third aspect or the BGP device provided in the fifth aspect, and the route processing apparatus provided in the fourth aspect or the sixth aspect. The BGP device provided by the aspect.
第八方面,本申请实施例提供一种计算机可读存储介质,该可读存储介质包括程序或指令,当所述程序或指令在计算机上运行时,使得计算机执行第一方面或第一方面中任一种可能实现方式中的方法。In an eighth aspect, embodiments of the present application provide a computer-readable storage medium, where the readable storage medium includes a program or an instruction, and when the program or instruction is run on a computer, the computer executes the first aspect or the first aspect. method in any of the possible implementations.
第九方面,本申请实施例提供一种计算机可读存储介质,该可读存储介质包括程序或指令,当所述程序或指令在计算机上运行时,使得计算机执行第二方面或第二方面中任一种可能实现方式中的方法。In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, where the readable storage medium includes a program or an instruction, when the program or instruction is run on a computer, the computer executes the second aspect or the second aspect. method in any of the possible implementations.
第十方面,本申请实施例提供一种芯片或者芯片系统,该芯片或者芯片系统包括至少一个处理器和接口,接口和至少一个处理器通过线路互联,至少一个处理器用于运行计算机程序或指令,以进行第一方面或第一方面的任一种可能的实现方式中任一项所描述的方法。In a tenth aspect, an embodiment of the present application provides a chip or a chip system, the chip or chip system includes at least one processor and an interface, the interface and the at least one processor are interconnected through a line, and the at least one processor is used for running a computer program or instruction, to perform the method described in any one of the first aspect or any of the possible implementations of the first aspect.
第十一方面,本申请实施例提供一种芯片或者芯片系统,该芯片或者芯片系统包括至少一个处理器和接口,接口和至少一个处理器通过线路互联,至少一个处理器用于运行计算机程序或指令,以进行第二方面或第二方面的任一种可能的实现方式中任一项所描述的方法。In an eleventh aspect, an embodiment of the present application provides a chip or a chip system, the chip or chip system includes at least one processor and an interface, the interface and the at least one processor are interconnected through a line, and the at least one processor is used for running a computer program or instruction , to perform the method described in any one of the second aspect or any possible implementation manner of the second aspect.
其中,芯片中的接口可以为输入/输出接口、管脚或电路等。Wherein, the interface in the chip may be an input/output interface, a pin or a circuit, or the like.
上述方面中的芯片系统可以是片上系统(system on chip,SOC),也可以是基带芯片等,其中基带芯片可以包括处理器、信道编码器、数字信号处理器、调制解调器和接口模块等。The chip system in the above aspects may be a system on chip (system on chip, SOC), or a baseband chip, etc., where the baseband chip may include a processor, a channel encoder, a digital signal processor, a modem, an interface module, and the like.
在一种可能的实现中,本申请中上述描述的芯片或者芯片系统还包括至少一个存储器,该至少一个存储器中存储有指令。该存储器可以为芯片内部的存储单元,例如,寄存器、缓存等,也可以是该芯片的存储单元(例如,只读存储器、随机存取存储器等)。In a possible implementation, the chip or chip system described above in this application further includes at least one memory, where instructions are stored in the at least one memory. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (eg, a read-only memory, a random access memory, etc.).
第十二方面,本申请实施例提供一种计算机程序或计算机程序产品,包括代码或指令,当代码或指令在计算机上运行时,使得计算机执行第一方面或第一方面中任一种可能实现方式中的方法。A twelfth aspect, embodiments of the present application provide a computer program or computer program product, including codes or instructions, when the codes or instructions are run on a computer, the computer executes the first aspect or any one of the first aspects may be implemented method in method.
第十三方面,本申请实施例提供一种计算机程序或计算机程序产品,包括代码或指令,当代码或指令在计算机上运行时,使得计算机执行第二方面或第二方面中任一种可能实现方式中的方法。In a thirteenth aspect, the embodiments of the present application provide a computer program or computer program product, including codes or instructions, when the codes or instructions are run on a computer, the computer executes the second aspect or any one of the second aspects may be implemented method in method.
附图说明Description of drawings
图1为本申请实施例提供的一种BGP网络系统的示意图;1 is a schematic diagram of a BGP network system according to an embodiment of the present application;
图2为本申请实施例提供的一种AS间发生路由环路的示意图;2 is a schematic diagram of a routing loop occurring between ASs according to an embodiment of the present application;
图3为本申请实施例提供的一种BGP设备对BGP路由的处理流程的示意图;3 is a schematic diagram of a process flow of a BGP device for processing a BGP route according to an embodiment of the present application;
图4为本申请实施例提供的一种路由处理方法的流程示意图;4 is a schematic flowchart of a routing processing method provided by an embodiment of the present application;
图5为本申请实施例提供的一种Update消息报文格式的示意图;5 is a schematic diagram of a format of an Update message message provided by an embodiment of the present application;
图6为本申请实施例提供的一种路径属性列表的示意图;6 is a schematic diagram of a path attribute list provided by an embodiment of the present application;
图7为本申请实施例提供的一种路由处理过程的示意图;7 is a schematic diagram of a routing processing process provided by an embodiment of the present application;
图8为本申请实施例提供的另一种路由处理过程的示意图;FIG. 8 is a schematic diagram of another routing processing process provided by an embodiment of the present application;
图9为本申请实施例提供的一种路由处理方法应用于多个AS间的场景中的流程示意图;FIG. 9 is a schematic flowchart of a route processing method provided by an embodiment of the present application applied to a scenario between multiple ASs;
图10为本申请实施例提供的一种多个AS间的场景的示意图;10 is a schematic diagram of a scenario between multiple ASs provided by an embodiment of the present application;
图11为本申请实施例提供的一种路由处理方法应用于AS内的场景中的流程示意图;11 is a schematic flowchart of a route processing method provided by an embodiment of the present application applied to a scenario in an AS;
图12为本申请实施例提供的一种AS内的场景的示意图;FIG. 12 is a schematic diagram of a scenario in an AS provided by an embodiment of the present application;
图13为本申请实施例提供的一种路由处理装置的示意图;13 is a schematic diagram of a route processing apparatus provided by an embodiment of the present application;
图14为本申请实施例提供的一种第一BGP设备的示意图;FIG. 14 is a schematic diagram of a first BGP device according to an embodiment of the present application;
图15为本申请实施例提供的另一种路由处理装置的示意图;15 is a schematic diagram of another route processing apparatus provided by an embodiment of the present application;
图16为本申请实施例提供的一种第二BGP设备的示意图。FIG. 16 is a schematic diagram of a second BGP device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
边界网关协议(Border Gateway Protocol,BGP)是一种用于自治系统(Autonomous System,AS)之间的动态路由协议。BGP作为事实上的网络外部路由协议标准,被广泛应用于网络服务提供商(Internet Service Provider,ISP)之间。BGP在设备上采用两种方式运行。其中,当BGP运行于同一AS内时,被称为内部边界网关协议(Internal BGP,IBGP);当BGP运行于不同AS间时,被称为外部边界网关协议(External BGP,EBGP)。The Border Gateway Protocol (BGP) is a dynamic routing protocol used between autonomous systems (Autonomous Systems, AS). As a de facto network external routing protocol standard, BGP is widely used between Internet Service Providers (ISPs). BGP operates on a device in two ways. Among them, when BGP runs in the same AS, it is called Internal Border Gateway Protocol (Internal BGP, IBGP); when BGP runs between different ASs, it is called External Border Gateway Protocol (External BGP, EBGP).
请参见图1,图1为本申请实施例提供的一种BGP网络系统的示意图,该BGP网络系统包括AS内和AS间。其中,该BGP网络系统包括BGP设备101至BGP设备106,BGP设备101至BGP设备106分别属于不同的AS,且BGP设备101至BGP设备106均运行BGP协议,如图1所示。其中,不同的AS可以通过不同AS标识(也称为AS号)来区分,例如,图1包括3个AS,各个AS的AS标识分别为AS100、AS200、AS300。其中,BGP设备102和BGP设备103建立EBGP邻居关系,BGP设备103和BGP设备104建立EBGP邻居关系,BGP设备105和BGP设备106建立EBGP邻居关系,BGP设备101、BGP设备102、BGP设备104和BGP设备105之间建立IBGP邻居关系,如图1所示。Please refer to FIG. 1. FIG. 1 is a schematic diagram of a BGP network system according to an embodiment of the present application, where the BGP network system includes intra-AS and inter-AS. The BGP network system includes BGP equipment 101 to BGP equipment 106, BGP equipment 101 to BGP equipment 106 belong to different ASs, and BGP equipment 101 to BGP equipment 106 all run the BGP protocol, as shown in FIG. 1 . Wherein, different ASs can be distinguished by different AS identifiers (also referred to as AS numbers). For example, FIG. 1 includes three ASs, and the AS identifiers of each AS are AS100, AS200, and AS300, respectively. Among them, BGP device 102 and BGP device 103 establish EBGP neighbor relationship, BGP device 103 and BGP device 104 establish EBGP neighbor relationship, BGP device 105 and BGP device 106 establish EBGP neighbor relationship, BGP device 101, BGP device 102, BGP device 104 and An IBGP neighbor relationship is established between the BGP devices 105, as shown in FIG. 1 .
其中,路由环路是各种类型的网络(尤其是计算机网络)的常见问题。例如,请参见图2,图2为一种特殊组网的情况下,AS间发生路由环路的示意图。其中,在图2所示的BGP网络为一种特殊组网,BGP设备101为路由反射器(Route Reflector,RR),该BGP设备101可以向建立了IBGP邻居关系且存在物理连接关系的BGP设备发送BGP路由消息,例如,BGP设备101可以向BGP设备102发送BGP路由消息。BGP设备102和BGP设备103建立EBGP邻居关系且存在物理连接关系,那么BGP设备102可以向BGP设备103发送BGP路由消息。类似的,BGP设备103和BGP设备104建立EBGP邻居关系且存在物理连接关系,那么BGP设备103可以向BGP设备104发送BGP路由消息。BGP设备104和BGP设备102建立MP_BGP邻居关系且存在物理连接关系,那么BGP设备104可以向BGP设备102发送BGP路由消息。Among them, routing loops are a common problem in various types of networks, especially computer networks. For example, please refer to FIG. 2 . FIG. 2 is a schematic diagram of a routing loop occurring between ASs in a special networking situation. The BGP network shown in FIG. 2 is a special networking, and the BGP device 101 is a route reflector (RR), and the BGP device 101 can communicate with the BGP device that has established an IBGP neighbor relationship and has a physical connection relationship. To send a BGP routing message, for example, the BGP device 101 may send a BGP routing message to the BGP device 102 . The BGP device 102 and the BGP device 103 establish an EBGP neighbor relationship and there is a physical connection relationship, then the BGP device 102 can send a BGP routing message to the BGP device 103 . Similarly, if the BGP device 103 and the BGP device 104 establish an EBGP neighbor relationship and have a physical connection relationship, the BGP device 103 can send a BGP routing message to the BGP device 104 . The BGP device 104 and the BGP device 102 establish an MP_BGP neighbor relationship and there is a physical connection relationship, then the BGP device 104 can send a BGP routing message to the BGP device 102 .
其中,携带指定BGP路由前缀(即指定目的地址)的BGP路由消息从BGP设备101出发,可以采用洪泛的方式向与BGP设备101建立了BGP邻居关系的BGP设备发送该BGP路由消息,例如,BGP设备1发送至BGP设备102,根据路由选路结果,BGP设备102又将携带指定BGP路由前缀的BGP路由消息发送给BGP设备103。其中,由于BGP设备103修改了路由属性(如修改了AS_Path信息),使得BGP设备103又将携带指定BGP路由前缀的BGP路由消息发送给BGP设备104时,该BGP路由消息中不包含本AS的AS标识(即不包含AS 100)。BGP设备104又将携带指定BGP路由前缀的BGP路由消息发送给BGP设备102。此时,针对该指定BGP路由前缀,BGP设备102、BGP设备103和BGP设备104构成路由环路,可能会导致网络故障。Wherein, the BGP routing message carrying the designated BGP routing prefix (that is, the designated destination address) starts from the BGP device 101, and the BGP routing message can be sent to the BGP device that has established a BGP neighbor relationship with the BGP device 101 in a flooding manner, for example, The BGP device 1 sends the message to the BGP device 102 , and according to the routing result, the BGP device 102 sends the BGP routing message carrying the specified BGP route prefix to the BGP device 103 . Wherein, because the BGP device 103 modifies the routing attributes (for example, the AS_Path information is modified), when the BGP device 103 sends the BGP routing message carrying the specified BGP routing prefix to the BGP device 104, the BGP routing message does not contain the AS_Path. AS ID (i.e. does not contain AS 100). The BGP device 104 in turn sends the BGP routing message carrying the specified BGP routing prefix to the BGP device 102 . At this time, for the designated BGP routing prefix, the BGP device 102, the BGP device 103, and the BGP device 104 form a routing loop, which may cause a network failure.
为了解决BGP网络中的路由环路问题,现有的BGP防止路由环路机制如下:To solve the routing loop problem in BGP networks, the existing BGP mechanism to prevent routing loops is as follows:
方式一:针对AS间的路由环路,BGP路由消息中携带的AS路径信息用于标记途经的 AS,带有本地AS标识的路由将被丢弃,从而避免了AS间产生路由环路。Mode 1: For routing loops between ASs, the AS path information carried in the BGP routing message is used to mark the passing ASs, and the routes with the local AS identifier will be discarded, thus avoiding routing loops between ASs.
方式二:针对AS内的路由环路,BGP设备在AS内学到的路由不再通告给AS内的相邻的BGP设备,避免了AS内产生环路(例如,在特殊场景中(如路由反射器场景中)使用路由属性Cluster_List和Originator_ID防止路由环路)。Method 2: For routing loops in the AS, the routes learned by the BGP device in the AS are no longer advertised to the adjacent BGP devices in the AS, avoiding loops in the AS (for example, in special scenarios (such as routing) Reflector scenarios) use routing attributes Cluster_List and Originator_ID to prevent routing loops).
但是,上述方式一和方式二所示的BGP防止路由环路机制,在设备使用不当、设备故障以及特殊复杂组网和配置条件下会发生防止路由环路失效,从而导致BGP路由环路。例如,图2中的BGP设备在部署BGP路由策略时,通过BGP路由策略调整路由属性(如AS_Path属性),原有的AS_Path属性中的AS标识被删除或更改,导致设备无法通过AS_Path属性判断是否发生环路。同时,路由的优先级被人为改变,导致当BGP设备从相邻BGP设备收到自身发出的路由后,根据BGP选路原则,如果新收到的路由优先级高于BGP设备上的本地原始路由,则会发生路由重新选路,导致路由环路。However, the BGP routing loop prevention mechanism shown in the first and second modes above may fail to prevent routing loops under improper use of devices, device failures, and special complex networking and configuration conditions, resulting in BGP routing loops. For example, when the BGP device in Figure 2 deploys the BGP routing policy, it adjusts the routing attributes (such as the AS_Path attribute) through the BGP routing policy, and the AS identifier in the original AS_Path attribute is deleted or changed. As a result, the device cannot determine whether the AS_Path attribute is used. A loop occurs. At the same time, the priority of the route is artificially changed, so that when the BGP device receives the route sent by itself from the neighboring BGP device, according to the BGP route selection principle, if the priority of the newly received route is higher than the local original route on the BGP device , route re-routing will occur, resulting in a routing loop.
为了解决现有的BGP防止路由环路机制失效情况下的路由环路问题,本申请实施例提供一种路由处理方法,该方法可以解决BGP路由环路问题,并且支持多厂家兼容,新旧版本兼容,有利于支持现网平滑部署。其中,该路由处理方法可以应用于如图1所示的BGP网络系统中,可以解决AS间(如AS 100和AS 200之间)的路由环路问题,也可以解决AS内(如AS 100内)的路由环路问题。In order to solve the routing loop problem when the existing BGP routing loop prevention mechanism fails, the embodiment of the present application provides a routing processing method, which can solve the BGP routing loop problem, and supports multi-vendor compatibility and compatibility between new and old versions , which is beneficial to support the smooth deployment of the existing network. Among them, the route processing method can be applied to the BGP network system as shown in Figure 1, which can solve the routing loop problem between AS (such as between AS 100 and AS 200), and can also solve the problem within AS (such as within AS 100). ) routing loop problem.
为了便于理解,下面对本申请实施例所涉及的相关名词进行解释。For ease of understanding, related terms involved in the embodiments of the present application are explained below.
BGP设备:也称为BGP发言者(BGP Speaker),本申请实施例所述的BGP设备为运行BGP协议的设备,用于接收或产生新的路由信息,并发布(Advertise)路由信息给其它BGP speaker。其中,BGP设备可以包括但不限于路由器、交换机、防火墙、计算机系统、服务器、核心网中的网元等。BGP device: also known as BGP speaker (BGP speaker), the BGP device described in this embodiment of the application is a device that runs the BGP protocol and is used to receive or generate new routing information, and to advertise (Advertise) routing information to other BGPs speaker. The BGP devices may include but are not limited to routers, switches, firewalls, computer systems, servers, network elements in the core network, and the like.
AS标识(AS Number):BGP网络中的每个AS都被分配一个唯一的AS标识,用于区分不同的AS。AS标识分为2字节AS标识和4字节AS标识,其中2字节AS标识的范围为1至65535,4字节AS标识的范围为1至4294967295。支持4字节AS标识的设备能够与支持2字节AS标识的设备兼容。AS ID (AS Number): Each AS in the BGP network is assigned a unique AS ID to distinguish different ASs. The AS identifier is divided into a 2-byte AS identifier and a 4-byte AS identifier, where the range of the 2-byte AS identifier is 1 to 65535, and the range of the 4-byte AS identifier is 1 to 4294967295. Devices that support 4-byte AS identifiers are compatible with devices that support 2-byte AS identifiers.
BGP对等体(BGP Peer):相互交换BGP路由消息的BGP speaker之间互称对等体,BGP Peer也称为BGP邻居。其中,BGP Peer之间可以建立IBGP(AS内)和EBGP(AS间)两种邻居关系。可选的,AS内的BGP设备之间还可以建立一种特殊的邻居关系,即多协议BGP(Multiprotocol BGP)邻居关系。其中,MP_BGP向前兼容,即支持BGP扩展的BGP设备和不支持BGP扩展的BGP设备可以互通。BGP peers: BGP speakers that exchange BGP routing messages with each other are called peers. BGP peers are also called BGP neighbors. Among them, IBGP (intra-AS) and EBGP (inter-AS) neighbor relationships can be established between BGP peers. Optionally, a special neighbor relationship, that is, a Multiprotocol BGP (Multiprotocol BGP) neighbor relationship, may also be established between BGP devices in an AS. Among them, MP_BGP is forward compatible, that is, BGP devices that support BGP extension and BGP devices that do not support BGP extension can communicate with each other.
路由反射器(Route Reflector,RR)和客户机(Client):RR是处理AS内的IBGP网络连接激增的一种方法。在一个AS内,令一台BGP设备作为RR,其它BGP设备作为Client。Client与RR之间建立IBGP连接。Clients和与其相连接的RR组成一个集群(Cluster)。RR在Clients之间反射路由信息,Clients之间不需要建立BGP连接。Route Reflector (RR) and Client (Client): RR is a way to handle the surge of IBGP network connections within an AS. In an AS, one BGP device is used as the RR, and other BGP devices are used as the Client. An IBGP connection is established between the client and the RR. Clients and their connected RRs form a cluster. RR reflects routing information between Clients, and no BGP connection needs to be established between Clients.
BGP路径属性列表(BGP Path Attributes):BGP路径属性列表是一套参数,用于对特定的路由进行进一步的描述,以使BGP设备能够对路由进行过滤和选择。BGP路径属性通常可以分为以下4类:BGP Path Attributes: BGP Path Attributes is a set of parameters used to further describe specific routes, so that BGP devices can filter and select routes. BGP path attributes can generally be divided into the following four categories:
1、公认必须遵循的(Well-known mandatory):所有BGP设备都可以识别,且必须存在于Update消息中。如果缺少这种属性,路由信息就会出错。1. Well-known mandatory: All BGP devices can be identified and must exist in the Update message. If this attribute is missing, the routing information will be wrong.
2、公认任意(Well-known discretionary):所有BGP设备都可以识别,但不要求必须存在于Update消息中,可以根据具体情况来选择。2. Well-known discretionary: All BGP devices can be identified, but they are not required to exist in the Update message, and can be selected according to specific circumstances.
3、可选过渡(Optional transitive):在AS间具有可传递性的属性。BGP设备可以不支持此属性,但它仍然会接收这类属性,并通告给其他对等体。3. Optional transition: a property that is transferable between ASs. A BGP device may not support this attribute, but it will still receive it and advertise it to other peers.
4、可选非过渡(Optional non-transitive):如果BGP设备不支持此属性,则相应的这类属性会被忽略,且不会通告给其他对等体。4. Optional non-transitive: If the BGP device does not support this attribute, the corresponding attribute will be ignored and will not be notified to other peers.
其中,几种常用的BGP Path Attributes包括:Origin属性、AS_Path属性、Next_Hop属性、MED(Multi-Exit-Discriminator)属性、Local_Pref(Local Preference)属性等。Among them, several commonly used BGP Path Attributes include: Origin attribute, AS_Path attribute, Next_Hop attribute, MED (Multi-Exit-Discriminator) attribute, Local_Pref (Local Preference) attribute, etc.
路由策略(Routing Policy):路由策略作用于路由,用于实现路由过滤和路由属性设置等功能,它通过改变路由属性(包括可达性)来改变网络流量所经过的路由路径。请参见图3,图3为一种BGP设备对BGP路由的处理流程的示意图。其中,由于BGP协议自身不能发现路由,其路由来源包括从其他协议(包括直连(Direct)路由、静态(Static)路由、内部网关协议(Internal Gateway Protocol,IGP)路由等)引入和从邻居接收两个部分。具体包括以下步骤:Routing Policy: Routing policy acts on routing and is used to implement functions such as route filtering and routing attribute setting. It changes the routing path that network traffic passes through by changing routing attributes (including reachability). Please refer to FIG. 3 , which is a schematic diagram of a process flow of a BGP device for processing a BGP route. Among them, since the BGP protocol itself cannot discover routes, its route sources include those imported from other protocols (including Direct routes, Static routes, Internal Gateway Protocol (IGP) routes, etc.) and received from neighbors two parts. Specifically include the following steps:
S301a,BGP设备通过路由引入策略创建路由;S301a, the BGP device creates a route through a route import policy;
S301b,BGP设备通过路由接收策略从邻居接收路由;S301b, the BGP device receives the route from the neighbor through the route receiving policy;
S302,BGP设备通过手动或自动的方式进行路由聚合;S302, the BGP device performs route aggregation manually or automatically;
S303,BGP设备根据BGP路由选择规则对路由进行选择;S303, the BGP device selects the route according to the BGP route selection rule;
S304a,BGP设备下发路由表;S304a, the BGP device issues a routing table;
S304b,BGP设备通过出口策略对路由进行过滤;S304b, the BGP device filters the routes through the egress policy;
S305,BGP设备将过滤后的路由发送给BGP邻居。S305, the BGP device sends the filtered route to the BGP neighbor.
其中,BGP设备可以通过路由策略实现对路由的过滤,也可以修改路由的属性。当到达同一目的地存在多条路由时,BGP采取指定的路由策略进行路由选路,选出最优路由。例如,常见的Local_Pref属性、AS_Path属性、Origin属性、MED属性在BGP路由选路中的策略如下:Local_Pref属性优选本地优先级(Local_Pref)最高的路由;AS_Path属性优选AS路径(AS_Path)最短的路由;Origin属性依次优选Origin类型为IGP、EGP、Incomplete的路由;MED属性优选MED值最低的路由。Among them, the BGP device can filter routes through routing policies, and can also modify the attributes of routes. When there are multiple routes to the same destination, BGP adopts the specified routing policy to select the optimal route. For example, the common strategies of Local_Pref attribute, AS_Path attribute, Origin attribute, and MED attribute in BGP routing selection are as follows: Local_Pref attribute selects the route with the highest local priority (Local_Pref); AS_Path attribute selects the route with the shortest AS path (AS_Path); The Origin attribute selects the routes whose origin types are IGP, EGP, and Incomplete in sequence; the MED attribute selects the route with the lowest MED value.
需要注意的是,图3实施例中的S301a和S301b之间不限定执行顺序,例如,S301a和S301b可以是并列的步骤。类似的,S304a和S304b之间页不限定执行顺序,例如,S304a和S341b可以是并列的步骤。It should be noted that the execution sequence of S301a and S301b in the embodiment of FIG. 3 is not limited. For example, S301a and S301b may be parallel steps. Similarly, the order of execution is not limited between S304a and S304b, for example, S304a and S341b may be parallel steps.
BGP路由消息:BGP的运行是通过消息驱动的,现有的BGP协议中包括Open、Update、Notification、Keep-alive和Route-refresh等消息类型。BGP routing messages: The operation of BGP is driven by messages. The existing BGP protocols include message types such as Open, Update, Notification, Keep-alive, and Route-refresh.
1、Open消息:Open消息是传输控制协议(Transmission Control Protocol,TCP)连接建立后发送的第一个消息,用于建立BGP Peer之间的连接关系。BGP Peer在接收到Open消息并协商成功后,将发送Keep-alive消息确认并保持连接的有效性。确认后,BGP Peer间可以进行Update、Notification、Keep-alive和Route-refresh等消息的交换。1. Open message: The Open message is the first message sent after the Transmission Control Protocol (TCP) connection is established, and is used to establish the connection relationship between BGP peers. After the BGP Peer receives the Open message and negotiates successfully, it will send a Keep-alive message to confirm and maintain the validity of the connection. After confirmation, messages such as Update, Notification, Keep-alive, and Route-refresh can be exchanged between BGP peers.
2、Update消息:Update消息用于在BGP Peer之间交换路由信息。Update消息可以发布多条属性相同的可达路由信息,也可以撤销多条不可达路由信息。例如,一条Update消息可以发布多条具有相同路由属性的可达路由,这些路由可共享一组路由属性。所有包含在一个指定的Update消息里的路由属性适用于该Update消息中的网络层可通达性信息(Network Layer Reachability Information,NLRI)字段里的所有目的地址(用BGP路由前缀表示)。又例如,一条Update消息可以撤销多条不可达路由。每一个路由通过目的地址(用BGP路由前缀表示),清楚的定义了BGP Speaker之间先前通告过的路由。本申请实施例所述的BGP 路由消息为Update消息。2. Update message: Update message is used to exchange routing information between BGP peers. The Update message can publish multiple pieces of reachable route information with the same attributes, and can also revoke multiple pieces of unreachable route information. For example, an Update message can advertise multiple reachable routes with the same routing attributes, and these routes can share a set of routing attributes. All routing attributes contained in a given Update message apply to all destination addresses (represented by BGP routing prefixes) in the Network Layer Reachability Information (NLRI) field in the Update message. For another example, an Update message can revoke multiple unreachable routes. Each route clearly defines the routes previously advertised between BGP Speakers through the destination address (represented by the BGP route prefix). The BGP routing message described in this embodiment of the present application is an Update message.
3、Notification消息:当BGP设备检测到错误状态时,就向BGP Peer发出Notification消息,之后BGP连接会立即中断。3. Notification message: When the BGP device detects an error state, it sends a Notification message to the BGP Peer, after which the BGP connection will be interrupted immediately.
4、Keep-alive消息:BGP设备会周期性的向BGP Peer发出Keep-alive消息,用来保持连接的有效性。4. Keep-alive messages: BGP devices will periodically send Keep-alive messages to BGP peers to maintain the validity of the connection.
5、Route-refresh消息:Route-refresh消息用来请求BGP Peer重新发送所有的可达路由信息。5. Route-refresh message: The Route-refresh message is used to request the BGP Peer to resend all reachable route information.
BGP路由前缀(BGP prefix):BGP prefix表示目标路由地址,即表示一条设备间传递的路由。BGP prefix可以携带在BGP路由消息中,在BGP设备之间传递。例如,在图1所示的BGP网络系统中,假设一个BGP prefix为X.X.X.X,该BGP prefix可以携带在BGP路由消息中,由BGP设备6发送给BGP设备5,再由BGP设备5发送给BGP设备1,直至将该BGP prefix发送至目标路由地址指示的BGP设备。BGP route prefix (BGP prefix): BGP prefix indicates the destination route address, that is, a route passed between devices. BGP prefixes can be carried in BGP routing messages and passed between BGP devices. For example, in the BGP network system shown in Figure 1, assuming that a BGP prefix is X.X.X.X, the BGP prefix can be carried in a BGP routing message, sent by BGP device 6 to BGP device 5, and then sent by BGP device 5 to BGP device 1, until the BGP prefix is sent to the BGP device indicated by the destination routing address.
下面对本申请实施例进行详细的描述。The embodiments of the present application are described in detail below.
请参见图4,图4为本申请实施例提供的一种路由处理方法的流程示意图。其中,该路由处理方法可以由第一BGP设备和第二BGP设备之间的交互实现,第一BGP设备和第二BGP设备可以是AS内的相邻BGP设备,也可以是AS间的相邻BGP设备,本实施例不作限定。该方法可以包括以下步骤:Please refer to FIG. 4 , which is a schematic flowchart of a routing processing method provided by an embodiment of the present application. The route processing method may be implemented by interaction between a first BGP device and a second BGP device, and the first BGP device and the second BGP device may be adjacent BGP devices within an AS, or may be adjacent BGP devices between ASs The BGP device is not limited in this embodiment. The method may include the following steps:
S401,第二BGP设备创建第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀;S401, a second BGP device creates a first BGP routing message, where the first BGP routing message includes a first identifier list and a BGP routing prefix;
S402,第二BGP设备向第一BGP设备发送第一BGP路由消息;对应的,第一BGP设备接收来自第二BGP设备的第一BGP路由消息;S402, the second BGP device sends the first BGP routing message to the first BGP device; correspondingly, the first BGP device receives the first BGP routing message from the second BGP device;
S403,第一BGP设备确定第一标识列表包括第一BGP设备的标识;S403, the first BGP device determines that the first identifier list includes the identifier of the first BGP device;
S404,第一BGP设备抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。S404, the first BGP device suppresses the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
本实施例所述的任意一个BGP设备(如第一BGP设备和第二BGP设备),在BGP网络中具备一个标识。也就是说,本实施例所述的BGP设备的标识用于标识一台使能了BGP的设备,BGP设备的标识是按照某种机制组合生成、手工配置或自动产生的指示信息。Any one of the BGP devices (such as the first BGP device and the second BGP device) described in this embodiment has an identifier in the BGP network. That is to say, the identifier of the BGP device described in this embodiment is used to identify a BGP-enabled device, and the identifier of the BGP device is instruction information generated by a combination of mechanisms, manually configured or automatically generated.
其中,任意一个BGP设备与该BGP设备的标识为一一对应的关系。例如,第一BGP设备的标识为第一BGP设备在BGP网络中的标识,不会随着路由属性中的AS标识的修改而变化;并且第一BGP设备的标识与第二BGP设备的标识是不相同的,具有一一对应的关系。Wherein, there is a one-to-one correspondence between any BGP device and the identifier of the BGP device. For example, the identifier of the first BGP device is the identifier of the first BGP device in the BGP network, and will not change with the modification of the AS identifier in the routing attribute; and the identifier of the first BGP device and the identifier of the second BGP device are Not the same, there is a one-to-one correspondence relationship.
其中,BGP设备的标识为:BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识(Router ID)的组合、BGP设备对应的随机数、BGP设备的IP地址等。例如,假设第一BGP设备在AS 100,且第一BGP设备的Router ID为1.1.1.1,则第一BGP设备的标识为100+1.1.1.1。又例如,第一BGP设备的标识为00010010,第二BGP设备的标识为00010011,第一BGP设备和第二BGP设备对应的随机数不同。The identifier of the BGP device is: the combination of the AS identifier of the AS where the BGP device is located and the router identifier (Router ID) of the BGP device, the random number corresponding to the BGP device, the IP address of the BGP device, and the like. For example, assuming that the first BGP device is in AS 100, and the Router ID of the first BGP device is 1.1.1.1, the identifier of the first BGP device is 100+1.1.1.1. For another example, the identifier of the first BGP device is 00010010, the identifier of the second BGP device is 00010011, and the random numbers corresponding to the first BGP device and the second BGP device are different.
标识列表(adv_list)属性为本申请实施例新增的一种Path Attributes可选过渡属性,该标识列表属性用于指示BGP路由消息包括标识列表。也就是说,若BGP路由消息中的Path Attributes包括adv_list,那么该BGP路由消息中包括标识列表。The identification list (adv_list) attribute is a new optional transition attribute of Path Attributes in this embodiment of the application, and the identification list attribute is used to indicate that the BGP routing message includes an identification list. That is to say, if the Path Attributes in the BGP routing message includes adv_list, then the BGP routing message includes the identification list.
举例来说,本实施例通过在Update消息的Path Attributes属性增加新属性adv_list,用于保存设备标识列表。其中,Update消息报文格式如图5所示。其中,Withdrawn Routes Length 表示被撤销路由的长度,可以采用16位来指示。其中,若Withdrawn Routes Length为0则表示有被撤销路由。Withdrawn Routes表示被撤销路由,以变量(variable)的形式来表示。其中,Withdrawn Routes长度可变。Total Path Attributes Length表示总路径属性长度,可以采用16位来指示。若Total Path Attributes Length为0则表示没有路径属性。Path Attributes表示路径属性列表,以变量(variable)的形式来表示。Network Layer Reachability Information表示网络层可达信息,以变量(variable)的形式来表示。For example, in this embodiment, a new attribute adv_list is added to the Path Attributes attribute of the Update message to save the device identification list. The format of the Update message is shown in Figure 5. Among them, Withdrawn Routes Length indicates the length of the withdrawn route, which can be indicated by 16 bits. Among them, if Withdrawn Routes Length is 0, it means that there are withdrawn routes. Withdrawn Routes represent withdrawn routes, expressed in the form of variables. Among them, Withdrawn Routes has a variable length. Total Path Attributes Length indicates the total path attribute length, which can be indicated by 16 bits. If Total Path Attributes Length is 0, it means there is no path attribute. Path Attributes represents a list of path attributes, represented in the form of variables. Network Layer Reachability Information represents network layer reachability information in the form of variables.
其中,按RFC4271协议规定,Path Attributes用三元组<属性类型、属性长度、属性值>来表示。请参见图6,图6为一种路径属性列表的示意图。其中,属性类型(Attr.TYPE)字段包括属性标记(Attr.Flags)和属性类型代码(Attr.Type Code)。属性长度字段用Attr.Length来表示,属性值字段用Attr.Value来表示。Among them, according to the RFC4271 protocol, Path Attributes is represented by the triple <attribute type, attribute length, attribute value>. Please refer to FIG. 6 , which is a schematic diagram of a path attribute list. The attribute type (Attr.TYPE) field includes attribute flags (Attr.Flags) and attribute type codes (Attr.Type Code). The attribute length field is represented by Attr.Length, and the attribute value field is represented by Attr.Value.
其中,Attr.TYPE可以采用2字节来表示,Attr.Flags占1个字节(8个比特(bit)),Attr.Type Code占1个字节(无符号位)。其中,Attr.Flags表示属性的标记,可以采用8个bit来表示,如图6所示。Attr.Flags每个bit位的意义如下:Among them, Attr.TYPE can be represented by 2 bytes, Attr.Flags occupies 1 byte (8 bits (bit)), and Attr.Type Code occupies 1 byte (unsigned bit). Among them, Attr.Flags represents the flag of the attribute, which can be represented by 8 bits, as shown in Figure 6. The meaning of each bit of Attr.Flags is as follows:
1、O比特(Optional bit),表示属性的可选性。也就是说,该bit位决定属性是否为必携带属性。其中,可选属性(optional)的该bit位设为1,公认属性(well-known)的该bit位设为0。1. O bit (Optional bit), indicating the optionality of the attribute. That is to say, this bit determines whether the attribute is a mandatory attribute. The bit of the optional attribute (optional) is set to 1, and the bit of the well-known attribute (well-known) is set to 0.
2、T比特(Transitive bit),表示属性的可传递性。也就是说,该bit位决定属性是否为可传递属性。其中,对于可选属性,是可传递的属性该bit位设为1,非可传递的属性该bit位设为0。对于公认属性该bit位必须设为1。2. T bit (Transitive bit), which indicates the transferability of the attribute. That is, this bit determines whether the property is transitive. Among them, for optional attributes, the bit is set to 1 for transferable attributes, and the bit is set to 0 for non-transferable attributes. This bit must be set to 1 for well-known attributes.
3、P比特(Partial bit),表示属性的局部性。其中,对于可传递的可选属性,是局部的属性该bit位设为1,是全局的属性该bit位设为0。对于非可传递的可选属性和公认属性,该bit位必须设为0。3. The P bit (Partial bit) indicates the locality of the attribute. Among them, for the optional attributes that can be passed, the bit is set to 1 for local attributes, and the bit is set to 0 for global attributes. For non-transitive optional attributes and well-known attributes, this bit must be set to 0.
4、E比特(Extended Length bit),表示属性长度字段(即Attr.Length)是否需要扩展。其中,不需要扩展的属性该bit位设为0,Attr.Length占1个字节;需要扩展的属性该bit位设为1,Attr.Length占2个字节。4. The E bit (Extended Length bit) indicates whether the attribute length field (ie, Attr.Length) needs to be extended. Among them, for attributes that do not need to be extended, the bit is set to 0, and Attr.Length occupies 1 byte; for attributes that need to be extended, the bit is set to 1, and Attr.Length occupies 2 bytes.
5、U比特(Unused bits),如图6所示的属性标记Attr.Flags的低4位没有使用,发送时必须全部设为零,并且在接收时被忽略。5. U bits (Unused bits), the lower 4 bits of the attribute flag Attr.Flags as shown in Figure 6 are not used, they must be all set to zero when sending, and they are ignored when receiving.
其中,Attr.Type Code表示属性的类型号。例如,当前的Path Attributes属性已扩展多个属性,本实施例不作限定。Among them, Attr.Type Code represents the type number of the attribute. For example, the current Path Attributes attribute has been extended with multiple attributes, which is not limited in this embodiment.
其中,基于上述对Path Attributes的描述,本实施例新增的标识列表属性的定义为:标识列表属性的属性类型字段指示标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。Wherein, based on the above description of Path Attributes, the definition of the newly added identification list attribute in this embodiment is: the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification list The identifier of the BGP device in the identifier list; the attribute length field of the identifier list attribute indicates the length of the identifier list.
具体的,为了保证功能简单易用,本实施例将标识列表属性的属性标记定义为可选过渡属性。也就是说,支持该标识列表属性的BGP设备即可将该标识列表属性加入BGP路由消息中,不支持该标识列表属性的BGP设备只需按协议要求直接转发BGP路由消息即可。例如,标识列表属性的属性标记定义可以为1100 0000(C0),也可以采用其他的定义,本实施例不作限定。例如,令adv_list的Attr.Type Code为50,即此字节定义为00110010。Specifically, in order to ensure that the function is simple and easy to use, this embodiment defines the attribute tag that identifies the list attribute as an optional transition attribute. That is, a BGP device that supports the attribute of the identification list can add the attribute of the identification list to the BGP routing message, and a BGP device that does not support the attribute of the identification list only needs to directly forward the BGP routing message according to the requirements of the protocol. For example, the attribute mark definition of the identification list attribute may be 1100 0000 (C0), or other definitions may be adopted, which is not limited in this embodiment. For example, let the Attr.Type Code of adv_list be 50, that is, this byte is defined as 00110010.
可选的,本实施例所述的标识列表属性的属性类型还可以设置为公认必须遵循属性、公认任意属性或者可选非过渡属性,本实施例不作限定。可以理解的是,本实施例将标识列表属性的属性类型设置为可选过渡属性是优选的设置方式。Optionally, the attribute type of the identity list attribute described in this embodiment may also be set as a recognized mandatory attribute, a recognized arbitrary attribute, or an optional non-transition attribute, which is not limited in this embodiment. It can be understood that, in this embodiment, it is a preferred setting manner to set the attribute type of the identification list attribute as an optional transition attribute.
本实施例的标识列表属性的属性值字段包括标识列表中的每一个BGP设备的标识的长 度。例如,若BGP设备采用4字节AS标识+4字节Router ID组成标识,那么每一个BGP设备的标识长度为8字节。标识列表属性的属性长度字段指示标识列表的长度。例如,若标识列表中包括4个BGP设备的标识,且属性值字段指示的每一个BGP设备的标识长度为8字节,那么该标识列表属性的属性长度为32字节。The attribute value field of the identity list attribute of this embodiment includes the length of the identity of each BGP device in the identity list. For example, if a BGP device uses a 4-byte AS identifier + a 4-byte Router ID to form an identifier, the identifier length of each BGP device is 8 bytes. The attribute length field of the identity list attribute indicates the length of the identity list. For example, if the identification list includes the identifications of 4 BGP devices, and the identification length of each BGP device indicated by the attribute value field is 8 bytes, then the attribute length of the identification list attribute is 32 bytes.
标识列表为存储BGP设备的标识的列表,可以携带于BGP路由消息中,用于传递路由沿途经过的BGP设备的标识。也就是说,标识列表包括至少一个标识,其中每一个标识为BGP路由前缀所经过的BGP设备的标识。The ID list is a list storing the IDs of BGP devices, which can be carried in BGP routing messages and used to transmit IDs of BGP devices that the route passes through. That is, the identification list includes at least one identification, wherein each identification is an identification of a BGP device through which the BGP routing prefix passes.
可选的,标识列表也可以通过新增的BGP路由消息携带,例如,BGP设备通过除Update消息之外的其他类型的BGP路由消息传递标识列表,本实施例不作限定。Optionally, the identification list may also be carried in a newly added BGP routing message. For example, the BGP device transmits the identification list through other types of BGP routing messages except the Update message, which is not limited in this embodiment.
其中,BGP路由前缀X.X.X.X所经过的所有BGP设备的标识,都可以添加到标识列表中。需要注意的是,相较于现有AS_Path属性仅在不同AS的EBGP邻居间传递路由时才添加AS标识,本实施例所述的标识列表属性只要BGP设备向邻居传递路由,无论是AS间EBGP邻居还是AS内IBGP邻居,均按照相同方式将本机的标识添加至标识列表。可见,本实施例所述的标识列表可以准确地记录路由传递的每一台设备,从而有利于避免路由环路。The identifiers of all BGP devices passed by the BGP route prefix X.X.X.X can be added to the identifier list. It should be noted that, compared to the existing AS_Path attribute, the AS identifier is only added when routes are passed between EBGP neighbors of different ASs. The identifier list attribute described in this embodiment only needs the BGP device to transmit routes to neighbors, regardless of whether it is inter-AS EBGP. Neighbors or intra-AS IBGP neighbors add the local ID to the ID list in the same way. It can be seen that the identification list described in this embodiment can accurately record each device that is routed, thereby helping to avoid routing loops.
可选的,BGP路由前缀每经过一个BGP设备,都将该BGP设备的标识按序(如先进先出的顺序)添加到标识列表中。考虑常见故障发生场景,本申请实施例假设标识列表的长度限制为5,则当标识列表中的标识超过5个时,会进行循环覆盖(如按照先进先出的顺序进行循环覆盖)。需要注意的是,本实施例所述的标识列表的长度不限于5,理论上标识列表的长度是可变的,本实施例不作限定。Optionally, each time the BGP route prefix passes through a BGP device, the identifiers of the BGP devices are added to the identifier list in an order (eg, first-in, first-out order). Considering a common fault occurrence scenario, the embodiment of the present application assumes that the length of the identification list is limited to 5. When there are more than 5 identifications in the identification list, cyclic coverage is performed (for example, cyclic coverage is performed in a first-in, first-out order). It should be noted that the length of the identification list described in this embodiment is not limited to 5. In theory, the length of the identification list is variable, which is not limited in this embodiment.
在一种实现方式中,第二BGP设备为BGP路由前缀的始发设备。其中,本实施例所述始发设备为生成以BGP路由前缀为目的地址的始发路由的BGP设备。其中,始发路由是指针对一个目的地址首次生成的路由。例如,第二BGP设备为BGP路由前缀的始发设备,则第二BGP设备需要在Path Attributes中新增标识列表属性。第二BGP设备生成本机的标识,并且将本机的标识添加至标识列表中。第二BGP设备将第一BGP路由消息发布给相邻的BGP设备,该第一BGP路由消息包括第一标识列表和BGP路由前缀。需要注意的是,第二BGP设备向相邻的BGP设备发送的第一标识列表和BGP路由前缀可以携带在Update消息中,以使该路由信息在BGP Peer之间交换。In an implementation manner, the second BGP device is an originating device of the BGP route prefix. The originating device in this embodiment is a BGP device that generates an originating route with a BGP route prefix as a destination address. The originating route refers to a route that is first generated for a destination address. For example, if the second BGP device is the originating device of the BGP route prefix, the second BGP device needs to add an identifier list attribute in Path Attributes. The second BGP device generates an identity of the local machine, and adds the identity of the local machine to the identity list. The second BGP device advertises the first BGP routing message to the adjacent BGP device, where the first BGP routing message includes the first identification list and the BGP routing prefix. It should be noted that the first identification list and the BGP routing prefix sent by the second BGP device to the adjacent BGP device can be carried in the Update message, so that the routing information can be exchanged between BGP peers.
可选的,第二BGP设备为始发路由的BGP设备时,可能由于以下情况而创建新的BGP路由消息:Optionally, when the second BGP device is the BGP device that originates the route, a new BGP route message may be created due to the following conditions:
情况一:BGP网络中的BGP设备需要按照一定的周期更新路由。例如,BGP设备之间的邻居关系可能发生变化(如BGP设备之间的物理连接发生故障),或者部分BGP设备自身发生故障,那么BGP网络中的BGP设备需要周期性地更新路由。也就是说,第二BGP设备可以周期性地创建BGP路由消息,以向BGP网络中已建立BGP邻居关系并且已建立物理连接的BGP设备发送第二BGP设备的BGP路由消息。Scenario 1: BGP devices in a BGP network need to update routes according to a certain period. For example, the neighbor relationship between BGP devices may change (for example, the physical connection between BGP devices fails), or some BGP devices themselves fail, so the BGP devices in the BGP network need to update routes periodically. That is, the second BGP device may periodically create a BGP routing message to send the BGP routing message of the second BGP device to the BGP device that has established a BGP neighbor relationship and that has established a physical connection in the BGP network.
情况二:BGP网络中新接入了一台IP地址为X.X.X.X的路由设备,该路由设备与第二BGP设备建立了物理连接,第二BGP设备可以接收来自该路由设备的路由消息,该路由消息指示该路由设备的IP地址为X.X.X.X。为了将该路由设备的IP地址广播给BGP网络中的其他BGP设备,第二BGP设备可以创建BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X。Scenario 2: A routing device with an IP address of X.X.X.X is newly connected to the BGP network. The routing device establishes a physical connection with the second BGP device, and the second BGP device can receive the routing message from the routing device. The routing message Indicates that the IP address of the routing device is X.X.X.X. In order to broadcast the IP address of the routing device to other BGP devices in the BGP network, the second BGP device may create a BGP routing message, where the BGP routing message includes the BGP routing prefix X.X.X.X.
在一种实现方式中,第二BGP设备为BGP路由前缀的中间设备。其中,本实施例所述的中间设备为接收BGP路由消息,并向邻居BGP设备发送BGP路由消息的BGP设备。若 第二BGP设备为中间设备,那么第二BGP设备创建第一BGP路由消息之前,第二BGP设备接收第二BGP路由消息,该第二BGP路由消息包含第二标识列表;第二BGP设备创建第一BGP路由消息,也就是指第二BGP设备将第二BGP设备的标识添加至第二标识列表中,从而生成第一标识列表。In an implementation manner, the second BGP device is an intermediate device for BGP routing prefixes. The intermediate device described in this embodiment is a BGP device that receives BGP routing messages and sends BGP routing messages to neighboring BGP devices. If the second BGP device is an intermediate device, before the second BGP device creates the first BGP routing message, the second BGP device receives the second BGP routing message, where the second BGP routing message includes the second identifier list; the second BGP device creates The first BGP routing message means that the second BGP device adds the identifier of the second BGP device to the second identifier list, thereby generating the first identifier list.
例如,由于第二BGP设备已预先接收到第二标识列表,则第二BGP设备生成本机的标识,并且将本机的标识添加至第二标识列表中,即生成第一标识列表。其中,第一标识列表包括BGP路由前缀到达第二BGP设备之前,已经过的BGP设备的标识,还包括第二BGP设备的标识。然后,第二BGP设备将第一BGP路由消息发布给相邻的BGP设备,该第一BGP路由消息包括标识列表和BGP路由前缀。需要注意的是,第二BGP设备接收的第二BGP路由消息,与第二BGP设备重新生成的第一BGP路由消息相比较来说,这两个BGP路由消息是不同的BGP路由消息。For example, since the second BGP device has received the second identification list in advance, the second BGP device generates its own identification, and adds its own identification to the second identification list, that is, generates the first identification list. Wherein, the first identifier list includes the identifiers of the BGP devices that have passed before the BGP route prefix reaches the second BGP device, and also includes the identifiers of the second BGP device. Then, the second BGP device advertises the first BGP routing message to the adjacent BGP device, where the first BGP routing message includes the identification list and the BGP routing prefix. It should be noted that the second BGP routing message received by the second BGP device is compared with the first BGP routing message regenerated by the second BGP device, and the two BGP routing messages are different BGP routing messages.
第二BGP设备创建第一BGP路由消息后,可以采用洪泛的方式向与第二BGP设备建立BGP邻居关系并且建立物理连接的BGP设备发送该第一BGP路由消息,例如,可以向第一BGP设备发送该第一BGP路由消息。对应的,第一BGP设备接收来自第二BGP设备的第一BGP路由消息。第一BGP设备对接收到的第一BGP路由消息,如Update消息,需要检查该BGP路由消息中是否携带标识列表;若携带,则检查标识列表中是否包含本机的标识,即检查标识列表中是否包含第一BGP设备的标识。After the second BGP device creates the first BGP routing message, it can send the first BGP routing message to the BGP device that establishes a BGP neighbor relationship with the second BGP device and establishes a physical connection in a flooding manner. For example, it can send the first BGP routing message to the first BGP device. The device sends the first BGP routing message. Correspondingly, the first BGP device receives the first BGP routing message from the second BGP device. For the first BGP routing message received by the first BGP device, such as an Update message, it needs to check whether the BGP routing message carries an identifier list; Whether to include the identifier of the first BGP device.
在一种实现方式中,若第一BGP路由消息中的标识列表不包含第一BGP设备的标识,则表示未出现路由环路。那么第一BGP设备接收该第一BGP路由消息并按照BGP协议选路原则实施选路,例如,按照AS_Path属性优选AS路径(AS_Path)最短的路由,或者按照其他的选路原则进行路由选路,本实施例不作限定。In an implementation manner, if the identifier list in the first BGP routing message does not contain the identifier of the first BGP device, it means that no routing loop occurs. Then the first BGP device receives the first BGP routing message and implements route selection according to the BGP protocol routing principle. This embodiment is not limited.
在一种实现方式中,若第一BGP路由消息中的标识列表包含第一BGP设备的标识,则表示第一BGP设备收到了本机发出去的路由,即表示BGP网络中存在路由环路。针对存在路由环路的情况,第一BGP设备可以抑制导致BGP路由环路的路由。也就是说,第一BGP设备抑制从第一BGP设备到第二BGP设备以BGP路由前缀为目的地址的路由。In an implementation manner, if the identifier list in the first BGP routing message includes the identifier of the first BGP device, it means that the first BGP device has received the route sent by the local machine, which means that there is a routing loop in the BGP network. In the case of a routing loop, the first BGP device can suppress the route that causes the BGP routing loop. That is, the first BGP device suppresses the route from the first BGP device to the second BGP device with the BGP route prefix as the destination address.
可选的,第一BGP设备可以直接丢弃从第一BGP设备到第二BGP设备以BGP路由前缀为目的地址的路由,以避免路由环路。例如,针对BGP路由消息中的一个BGP路由前缀X.X.X.X,若从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由导致路由环路,第一BGP设备丢弃从第一BGP设备到第二BGP设备以该BGP路由前缀X.X.X.X为目的地址的路由。Optionally, the first BGP device may directly discard the route from the first BGP device to the second BGP device that uses the BGP route prefix as the destination address to avoid routing loops. For example, for a BGP route prefix X.X.X.X in a BGP routing message, if a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address causes a routing loop, the first BGP device discards the route from the first BGP device A route to the second BGP device using the BGP route prefix X.X.X.X as the destination address.
可选的,第一BGP设备接收第一BGP路由消息后,可以将该第一BGP路由消息解封装,得到BGP路由前缀和第一标识列表,并将BGP路由前缀和第一标识列表储存至收方向路由信息表中。第一BGP设备对解封装后的数据进行处理,确定第一标识列表中包括第一BGP设备的标识,即表示BGP网络中存在路由环路。那么第一BGP设备可以从收方向路由信息表中删除该BGP路由前缀。Optionally, after receiving the first BGP routing message, the first BGP device may decapsulate the first BGP routing message to obtain a BGP routing prefix and a first identification list, and store the BGP routing prefix and the first identification list to the receiving device. direction routing information table. The first BGP device processes the decapsulated data, and determines that the first identifier list includes the identifier of the first BGP device, which means that there is a routing loop in the BGP network. Then, the first BGP device may delete the BGP routing prefix from the routing information table in the receiving direction.
可选的,第一BGP设备可以缓存该BGP路由前缀(例如,将该BGP路由前缀缓存至收方向路由信息表中),将以该BGP路由前缀为目的地址的第二路由的优先级与本地已缓存的以该BGP路由前缀为目的地址的第一路由的优先级进行比较,再采用对应的操作来避免路由环路。也就是说,第一BGP设备也可以不直接丢弃该BGP路由前缀,通过其他方法来避免路由环路。Optionally, the first BGP device may cache the BGP route prefix (for example, cache the BGP route prefix in the routing information table of the receiving direction), and compare the priority of the second route with the BGP route prefix as the destination address with the local BGP route prefix. The priorities of the cached first routes with the BGP route prefix as the destination address are compared, and corresponding operations are adopted to avoid routing loops. That is to say, the first BGP device may not directly discard the BGP routing prefix, and avoid routing loops through other methods.
其中,本实施例所述的第一路由为第一BGP设备中已使用的以BGP路由前缀为目的地 址的路由,第二路由为第一BGP设备接收的BGP路由消息中,以BGP路由前缀为目的地址的路由。也就是说,针对同一个BGP路由前缀,第一BGP设备需要将第一路由和第二路由的优先级进行比较,从而确定选择哪个路由。The first route described in this embodiment is a route that has been used in the first BGP device with the BGP route prefix as the destination address, and the second route is a BGP route message received by the first BGP device, and the BGP route prefix is The route to the destination address. That is, for the same BGP route prefix, the first BGP device needs to compare the priorities of the first route and the second route, so as to determine which route to select.
在一种实现方式中,若第一路由的优先级高于第二路由的优先级,即针对同一个BGP路由前缀,本地原始路由的优先级高于新收到的路由的优先级。第一BGP设备按照BGP协议进行路由选路时,还是选择第一路由,从而避免路由环路。因此,若第一路由的优先级高于第二路由的优先级,第一BGP设备将记录路由环路告警信息。In an implementation manner, if the priority of the first route is higher than the priority of the second route, that is, for the same BGP route prefix, the priority of the local original route is higher than the priority of the newly received route. When the first BGP device performs route selection according to the BGP protocol, it still selects the first route, thereby avoiding routing loops. Therefore, if the priority of the first route is higher than the priority of the second route, the first BGP device will record the routing loop alarm information.
其中,路由环路告警信息用于当第一BGP设备检测到路由环路时,记录第一BGP设备检测到的路由环路的相关信息以及第一BGP设备的相关信息。具体的,路由环路告警信息包括以下一种或多种:第一BGP设备的标识、标识列表、BGP路由存在路由环路的时刻、BGP路由环路日志。例如,第一BGP设备记录的路由环路告警信息包括第一BGP设备的标识,第一BGP设备记录的标识列表,第一BGP设备检测到路由环路的时刻,发生路由环路的BGP路由前缀等信息,本实施例不作限定。可选的,第一BGP设备还可以向相邻的BGP设备发送该路由环路告警信息,有利于运维人员参考该路由环路告警信息进行网络维护。The routing loop alarm information is used to record related information of the routing loop detected by the first BGP device and related information of the first BGP device when the first BGP device detects the routing loop. Specifically, the routing loop alarm information includes one or more of the following: an identifier of the first BGP device, an identifier list, a time when the BGP route has a routing loop, and a BGP routing loop log. For example, the routing loop alarm information recorded by the first BGP device includes the identifier of the first BGP device, the identifier list recorded by the first BGP device, the time when the first BGP device detected the routing loop, and the BGP routing prefix where the routing loop occurred. and other information, which is not limited in this embodiment. Optionally, the first BGP device may also send the routing loop alarm information to the adjacent BGP device, which is beneficial for the operation and maintenance personnel to perform network maintenance with reference to the routing loop alarm information.
在一种实现方式中,若第一路由的优先级低于第二路由的优先级,即针对同一个BGP路由前缀,本地原始路由的优先级低于新收到的路由的优先级。第一BGP设备按照BGP协议进行路由选路时,将会优先选择优先级更高的路由即第二路由,从而导致BGP网络系统中的路由环路。因此,若第一路由的优先级低于第二路由的优先级,第一BGP设备降低第二路由的优先级,以使第一BGP设备选择的以BGP路由前缀为目的地址的路由为第一路由;或者,第一BGP设备避免第二路由参与路由选路,以使第一BGP设备选择的以BGP路由前缀为目的地址的路由为第一路由。In an implementation manner, if the priority of the first route is lower than the priority of the second route, that is, for the same BGP route prefix, the priority of the local original route is lower than the priority of the newly received route. When the first BGP device performs route selection according to the BGP protocol, it will preferentially select a route with a higher priority, that is, the second route, thereby causing a routing loop in the BGP network system. Therefore, if the priority of the first route is lower than the priority of the second route, the first BGP device lowers the priority of the second route, so that the route selected by the first BGP device with the BGP route prefix as the destination address is the first BGP device or, the first BGP device prevents the second route from participating in the route selection, so that the route selected by the first BGP device with the BGP route prefix as the destination address is the first route.
例如,针对同一个BGP路由前缀X.X.X.X,若该BGP路由前缀对应的第一路由的优先级低于对应的第二路由的优先级,则第一BGP设备降低接收到的第一BGP路由消息中以BGP路由前缀X.X.X.X为目的地址的路由的优先级,使得第一BGP设备还是选择第一路由。或者,第一BGP设备避免接收到的第一BGP路由消息中的以BGP路由前缀X.X.X.X为目的地址的路由参与选路,使得第一BGP设备还是选择第一路由。For example, for the same BGP route prefix X.X.X.X, if the priority of the first route corresponding to the BGP route prefix is lower than the priority of the corresponding second route, the first BGP device will lower the priority of the received first BGP routing message to The BGP route prefix X.X.X.X is the priority of the route with the destination address, so that the first BGP device still selects the first route. Or, the first BGP device avoids the route with the BGP route prefix X.X.X.X as the destination address in the received first BGP routing message from participating in route selection, so that the first BGP device still selects the first route.
需要注意的是,本实施例所述的第一BGP设备缓存BGP路由前缀,是指第一BGP设备不会直接丢弃该BGP路由前缀,但是会通过降低优先级或者避免参与选路的方式,从而避免该BGP路由前缀的路由被优选,从而导致BGP网络系统中的路由环路。可选的,被缓存的BGP路由前缀可以由第一BGP设备记录在路由环路日志中,以便后续运维人员进行网络维护时参考使用。It should be noted that the cache of the BGP route prefix by the first BGP device in this embodiment means that the first BGP device will not directly discard the BGP route prefix, but will reduce the priority or avoid participating in route selection, thereby A route that avoids this BGP routing prefix is preferred, thereby causing routing loops in the BGP network system. Optionally, the cached BGP route prefix may be recorded in the routing loop log by the first BGP device for reference and use by subsequent operation and maintenance personnel when performing network maintenance.
需要注意的是,上述S401至S404所述的处理流程仅体现了BGP设备对实施例新增的BGP设备的标识以及标识列表的处理过程,该处理过程不影响现有BGP对路由的处理机制和处理过程。下面通过一个示例来说明,现有BGP对路由的处理机制和处理过程,结合BGP设备对本实施例新增的BGP设备的标识以及标识列表的处理过程。It should be noted that the processing flow described in the above S401 to S404 only reflects the processing process of the BGP device's identification and identification list of the newly added BGP device in the embodiment, and the processing process does not affect the existing BGP routing processing mechanism and. processing. An example is used below to illustrate the existing BGP routing processing mechanism and processing process, combined with the BGP device's processing process for the identification and identification list of the newly added BGP device in this embodiment.
请参见图7和图8,图7为本申请实施例提供的一种路由处理过程的示意图,该路由处理过程可以由图1所示的BGP网络系统中的BGP设备106所执行,该BGP设备106所在AS为AS 300。图8为本申请实施例提供的另一种路由处理过程的示意图,该路由处理过程可以由图1所示的BGP网络系统中的BGP设备104所执行,该BGP设备104所在AS为AS100。其中,图7和图8所示的路由处理过程包括现有BGP对路由的处理机制和处理过程,以及如图4所示的路由处理方法。Please refer to FIG. 7 and FIG. 8. FIG. 7 is a schematic diagram of a routing processing process provided by an embodiment of the present application. The routing processing process may be performed by the BGP device 106 in the BGP network system shown in FIG. 1. The BGP device The AS where 106 is located is AS 300. FIG. 8 is a schematic diagram of another routing processing process provided by an embodiment of the present application. The routing processing process may be performed by the BGP device 104 in the BGP network system shown in FIG. 1 , and the AS where the BGP device 104 is located is the AS 100 . The routing processing procedures shown in FIG. 7 and FIG. 8 include the existing BGP routing processing mechanism and processing procedure, and the routing processing method shown in FIG. 4 .
其中,对于BGP设备106,该BGP设备的具体处理过程如图7所示,包括以下步骤:Wherein, for the BGP device 106, the specific processing process of the BGP device is shown in FIG. 7, including the following steps:
S701,BGP设备106创建一个BGP路由消息,在该BGP路由消息的AS_Path属性中添加所在AS的AS标识,并且在AS_Path属性中添加标识列表属性,将本机的标识添加至标识列表中;S701, the BGP device 106 creates a BGP routing message, adds the AS identifier of the AS in the AS_Path attribute of the BGP routing message, and adds the identifier list attribute in the AS_Path attribute, and adds the local identifier to the identifier list;
S702,BGP设备106将该BGP路由消息发送给AS 200中的邻居BGP设备105。S702, the BGP device 106 sends the BGP routing message to the neighbor BGP device 105 in the AS 200.
对于BGP设备104,该BGP设备的具体处理过程如图8所示,包括以下步骤:For the BGP device 104, the specific processing process of the BGP device is shown in FIG. 8, including the following steps:
S801,BGP设备104接收来自AS 200中的邻居BGP设备103的BGP路由消息;S801, the BGP device 104 receives the BGP routing message from the neighbor BGP device 103 in the AS 200;
S802,BGP设备104检测该BGP路由消息中是否包含本AS的AS标识(即检测该BGP路由消息中是否包含AS 100);S802, the BGP device 104 detects whether the BGP routing message contains the AS identifier of the AS (that is, detects whether the BGP routing message contains the AS 100);
S803,若该BGP路由消息不包含本AS的AS标识,BGP设备104接收该BGP路由消息,并进行路由选路;S803, if the BGP routing message does not contain the AS identifier of the local AS, the BGP device 104 receives the BGP routing message and performs route selection;
S804,若该BGP路由消息包含本AS的AS标识,BGP设备104丢弃该BGP路由前缀;S804, if the BGP routing message contains the AS identifier of the current AS, the BGP device 104 discards the BGP routing prefix;
S805,BGP设备104检测该BGP路由消息中是否包含BGP设备104的标识;S805, the BGP device 104 detects whether the BGP routing message contains the identifier of the BGP device 104;
S806,若该BGP路由消息不包含BGP设备104的标识,BGP设备104接收该BGP路由消息,并进行路由选路;其中,BGP设备104将BGP设备104的标识添加至标识列表中;S806, if the BGP routing message does not contain the identification of the BGP device 104, the BGP device 104 receives the BGP routing message and performs routing selection; wherein, the BGP device 104 adds the identification of the BGP device 104 to the identification list;
其中,若该BGP路由消息中的BGP路由前缀被优选,BGP设备104根据该BGP路由前缀和更新后的标识列表,得到新的BGP路由消息,继续向BGP邻居设备发送新的BGP路由消息;Wherein, if the BGP routing prefix in the BGP routing message is preferred, the BGP device 104 obtains a new BGP routing message according to the BGP routing prefix and the updated identification list, and continues to send the new BGP routing message to the BGP neighbor device;
S807,若该BGP路由消息包含BGP设备104的标识,BGP设备104抑制从BGP设备104到BGP设备103以该BGP路由前缀为目的地址的路由。S807, if the BGP routing message includes the identifier of the BGP device 104, the BGP device 104 suppresses the route from the BGP device 104 to the BGP device 103 with the BGP routing prefix as the destination address.
需要注意的是,上述图8所示的处理过程中,本实施例并不限定BGP设备104检测BGP路由消息中是否包含本AS的AS标识的步骤,以及BGP设备104检测BGP路由消息中是否包含BGP设备104的标识的步骤的执行顺序。也就是说,本实施例中BGP设备104可以同时执行S802和S805;也可以先执行S802,再执行S805;还可以先执行S805,再执行S802,本实施例不作限定。It should be noted that, in the above processing process shown in FIG. 8 , this embodiment does not limit the steps of the BGP device 104 detecting whether the BGP routing message contains the AS identifier of the AS, and the BGP device 104 detecting whether the BGP routing message contains the AS identifier. The order in which the steps of identification of the BGP device 104 are performed. That is, in this embodiment, the BGP device 104 may execute S802 and S805 at the same time; may also execute S802 first, and then execute S805; or may execute S805 first, and then execute S802, which is not limited in this embodiment.
本申请实施例提供一种路由处理方法,该方法可以由第一BGP设备和第二BGP设备之间的交互实现。其中,第二BGP设备确定第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀。其中,第一标识列表包括至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识。第二BGP设备向第一BGP设备发送该第一BGP路由消息。若第一BGP设备确定第一标识列表包括第一BGP设备的标识,第一BGP设备抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。可见,BGP设备可以根据标识更准确地判断发生路由环路的具体设备,并且还可以抑制导致路由环路的BGP路由前缀的路由,从而解决BGP路由环路问题。The embodiment of the present application provides a route processing method, and the method can be implemented by interaction between a first BGP device and a second BGP device. The second BGP device determines a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix. The first identifier list includes at least one identifier, wherein each identifier is an identifier of a BGP device through which the BGP route prefix passes. The second BGP device sends the first BGP routing message to the first BGP device. If the first BGP device determines that the first identifier list includes the identifier of the first BGP device, the first BGP device suppresses the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address. It can be seen that the BGP device can more accurately determine the specific device that has a routing loop according to the identifier, and can also suppress the route of the BGP routing prefix that causes the routing loop, thereby solving the BGP routing loop problem.
下面对本申请实施例提供的路由处理方法应用于多个AS间或应用于AS内的具体过程进行详细的描述。The following describes in detail the specific process in which the routing processing method provided by the embodiment of the present application is applied between multiple ASs or within an AS.
在一种示例中,请参见图9,图9为本申请实施例提供的一种路由处理方法应用于多个AS间的场景中的流程示意图。其中,该多个AS间的场景如图10所示,包括BGP设备1(即图1中的BGP设备101)至BGP设备6(即图1中的BGP设备106),BGP设备1至BGP设备6分别属于不同的AS(包括AS100、AS200、AS300),且BGP设备1至BGP设备6均运行BGP协议。其中,BGP设备2(即图1中的BGP设备102)和BGP设备3(即图1中的BGP设备103)建立EBGP邻居关系,BGP设备3和BGP设备4(即图1中的BGP设备 104)建立EBGP邻居关系,BGP设备5(即图1中的BGP设备105)和BGP设备6建立EBGP邻居关系,BGP设备1、BGP设备2、BGP设备4和BGP设备5之间建立IBGP邻居关系,并且BGP设备1是RR,BGP设备5是RR Client,BGP设备2和BGP设备4之间建立MP_BGP邻居关系。发生网络异常后,在AS100的设备2、设备4以及AS200的设备3三台设备之间产生环路。In an example, please refer to FIG. 9 , which is a schematic flowchart of a scenario in which a route processing method provided by an embodiment of the present application is applied to multiple ASs. The scenario between the multiple ASs is shown in FIG. 10 , including BGP device 1 (ie BGP device 101 in FIG. 1 ) to BGP device 6 (ie BGP device 106 in FIG. 1 ), BGP device 1 to BGP device 6 respectively belong to different ASs (including AS100, AS200, and AS300), and BGP devices 1 to 6 all run the BGP protocol. Wherein, BGP device 2 (ie BGP device 102 in FIG. 1 ) and BGP device 3 (ie BGP device 103 in FIG. 1 ) establish an EBGP neighbor relationship, and BGP device 3 and BGP device 4 (ie BGP device 104 in FIG. 1 ) ) Establish EBGP neighbor relationship, BGP device 5 (that is, BGP device 105 in FIG. 1 ) and BGP device 6 establish EBGP neighbor relationship, BGP device 1, BGP device 2, BGP device 4 and BGP device 5 Establish an IBGP neighbor relationship, And BGP device 1 is an RR, BGP device 5 is an RR Client, and an MP_BGP neighbor relationship is established between BGP device 2 and BGP device 4. After a network abnormality occurs, a loop occurs between devices 2 and 4 of AS100 and device 3 of AS200.
在图9所示的应用实施例中,假设BGP设备的标识为所在AS的AS标识+路由器标识的组合,那么对于BGP设备1至BGP设备6,各个BGP设备的标识如图10所示。例如,BGP设备1所在AS为AS 100,BGP设备1对应的路由器标识为1.1.1.1,那么BGP设备1的标识为100+1.1.1.1。In the application embodiment shown in FIG. 9 , assuming that the identifier of the BGP device is a combination of the AS identifier of the AS where it is located + the router identifier, then for BGP device 1 to BGP device 6, the identifiers of each BGP device are shown in FIG. 10 . For example, if the AS where BGP device 1 is located is AS 100, and the router ID corresponding to BGP device 1 is 1.1.1.1, then the ID of BGP device 1 is 100+1.1.1.1.
具体的,本申请实施例提供的一种路由处理方法应用于如图10所示的多个AS间的场景中时,具体包括以下步骤:Specifically, when a route processing method provided in this embodiment of the present application is applied to the scenario between multiple ASs as shown in FIG. 10 , the method specifically includes the following steps:
S901,BGP设备6创建BGP路由消息,向已建立EBGP邻居关系的BGP设备5发送该BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和标识列表。S901, the BGP device 6 creates a BGP routing message, and sends the BGP routing message to the BGP device 5 that has established an EBGP neighbor relationship, where the BGP routing message includes routing information and an identifier list of the BGP routing prefix X.X.X.X.
例如,BGP设备6在Update消息内通过adv_list携带本机的标识,将300+6.6.6.6添加到adv_list。For example, the BGP device 6 carries the local identifier through the adv_list in the Update message, and adds 300+6.6.6.6 to the adv_list.
S902,BGP设备5接收BGP路由消息,确定标识列表中不包含本机的标识;S902, the BGP device 5 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
S903,BGP设备5向AS内已建立IBGP邻居关系的BGP设备1发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S903, the BGP device 5 sends a BGP routing message to the BGP device 1 that has established an IBGP neighbor relationship in the AS, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identifier list.
例如,BGP设备5发送BGP路由前缀X.X.X.X到BGP设备1时,携带的adv_list为100+5.5.5.5,300+6.6.6.6。For example, when BGP device 5 sends the BGP route prefix X.X.X.X to BGP device 1, the carried adv_list is 100+5.5.5.5, 300+6.6.6.6.
S904,BGP设备1接收BGP路由消息,确定标识列表中不包含本机的标识;S904, the BGP device 1 receives the BGP routing message, and determines that the identifier list does not contain the local identifier;
S905,BGP设备1作为RR,可以向AS内已建立IBGP邻居关系的BGP设备2发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S905, the BGP device 1, acting as the RR, can send a BGP routing message to the BGP device 2 that has established an IBGP neighbor relationship in the AS, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated ID list.
例如,BGP设备1发送BGP路由前缀X.X.X.X到BGP设备2时,携带的adv_list为100+1.1.1.1,100+5.5.5.5,300+6.6.6.6。For example, when BGP device 1 sends the BGP route prefix X.X.X.X to BGP device 2, the carried adv_list is 100+1.1.1.1, 100+5.5.5.5, 300+6.6.6.6.
S906,BGP设备2接收BGP路由消息,确定标识列表中不包含本机的标识;S906, the BGP device 2 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
S907,BGP设备2向已建立EBGP邻居关系的BGP设备3发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S907, the BGP device 2 sends a BGP routing message to the BGP device 3 that has established an EBGP neighbor relationship, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identifier list.
例如,BGP设备2发送BGP路由前缀X.X.X.X到BGP设备3时,携带adv_list为100+2.2.2.2,100+1.1.1.1,100+5.5.5.5,300+6.6.6.6。For example, when BGP device 2 sends BGP route prefix X.X.X.X to BGP device 3, it carries adv_list as 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5, 300+6.6.6.6.
S908,BGP设备3接收BGP路由消息,确定标识列表中不包含本机的标识;S908, the BGP device 3 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
S909,BGP设备3向已建立EBGP邻居关系的BGP设备4发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S909 , the BGP device 3 sends a BGP routing message to the BGP device 4 that has established an EBGP neighbor relationship, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identification list.
例如,BGP设备3发送BGP路由前缀X.X.X.X到BGP设备4时,携带adv_list为200+3.3.3.3,100+2.2.2.2,100+1.1.1.1,100+5.5.5.5,300+6.6.6.6。For example, when BGP device 3 sends BGP route prefix X.X.X.X to BGP device 4, it carries adv_list as 200+3.3.3.3, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5, 300+6.6.6.6.
可选的,BGP设备3可以通过路由策略重写AS标识,例如,设备3上将原始路由AS_Path属性的AS标识重写,原来BGP路由前缀X.X.X.X对应的AS标识信息由100,300被改成200。也就是说,若BGP设备3通过路由策略重写AS标识,那么BGP设备3向BGP设备4发送的BGP路由消息中,携带adv_list变为200+3.3.3.3,200+2.2.2.2,200+1.1.1.1,200+5.5.5.5,200+6.6.6.6。Optionally, BGP device 3 can rewrite the AS identifier through a routing policy. For example, device 3 rewrites the AS identifier of the AS_Path attribute of the original route, and the AS identifier information corresponding to the original BGP route prefix X.X.X.X is changed from 100, 300 to 200 . That is to say, if BGP device 3 rewrites the AS identifier through the routing policy, the BGP routing message sent by BGP device 3 to BGP device 4 carries adv_list as 200+3.3.3.3, 200+2.2.2.2, 200+1.1 .1.1, 200+5.5.5.5, 200+6.6.6.6.
S910,BGP设备4接收BGP路由消息,确定标识列表中不包含本机的标识;S910, the BGP device 4 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
S911,BGP设备4向已建立MP_BGP邻居关系的BGP设备2发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S911, the BGP device 4 sends a BGP routing message to the BGP device 2 that has established the MP_BGP neighbor relationship, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identification list.
例如,BGP设备4发送BGP路由前缀X.X.X.X到BGP设备2时,携带adv_list为100+4.4.4.4,200+3.3.3.3,100+2.2.2.2,100+1.1.1.1,100+5.5.5.5。需要注意的是,本实施例假设adv_list的长度限制为5,当加入BGP设备4的标识100+4.4.4.4之后,因列表总长度超过5,300+6.6.6.6被自动覆盖掉。For example, when BGP device 4 sends BGP route prefix X.X.X.X to BGP device 2, it carries adv_list as 100+4.4.4.4, 200+3.3.3.3, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5. It should be noted that this embodiment assumes that the length of adv_list is limited to 5. After adding the identifier 100+4.4.4.4 of the BGP device 4, because the total length of the list exceeds 5, 300+6.6.6.6 is automatically overwritten.
S912,BGP设备2接收BGP路由消息,确定标识列表中包含本机的标识。S912, the BGP device 2 receives the BGP routing message, and determines that the identifier list includes the local identifier.
例如,BGP设备2接收到的BGP路由消息中携带adv_list为100+4.4.4.4,200+3.3.3.3,100+2.2.2.2,100+1.1.1.1,100+5.5.5.5。其中,100+2.2.2.2为BGP设备2的标识,则表示BGP设备2接收到了本机发出的路由,BGP网络中存在路由环路。For example, the BGP routing message received by BGP device 2 carries adv_list as 100+4.4.4.4, 200+3.3.3.3, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5. Among them, 100+2.2.2.2 is the identifier of BGP device 2, which means that BGP device 2 has received the route sent by the local machine, and there is a routing loop in the BGP network.
S913,BGP设备2抑制从BGP设备4到BGP设备2以BGP路由前缀X.X.X.X为目的地址的路由。S913, the BGP device 2 suppresses the route from the BGP device 4 to the BGP device 2 with the BGP route prefix X.X.X.X as the destination address.
例如,BGP设备2对收到的BGP路由按照RFC标准的选路规则实施选路,若BGP路由前缀X.X.X.X未被优选,则表示BGP设备2不会优先选择从BGP设备2到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由,从而避免路由环路。进一步,BGP设备2记录路由环路告警信息。For example, BGP device 2 performs route selection on the received BGP route according to the RFC standard routing rules. If the BGP route prefix X.X.X.X is not preferred, it means that BGP device 2 will not preferentially select BGP device 2 to BGP device 4 using BGP The route prefix X.X.X.X is the route of the destination address, thereby avoiding routing loops. Further, the BGP device 2 records the routing loop alarm information.
又例如,S905中BGP设备3通过路由策略重写AS标识,那么BGP设备3向BGP设备4发送的BGP路由消息中,携带adv_list变为200+3.3.3.3,200+2.2.2.2,200+1.1.1.1,200+5.5.5.5,200+6.6.6.6。根据路由选路的原则,修改后的路由的优先级比原始路由的优先级高,即BGP设备2从BGP设备4接收到的以BGP路由前缀X.X.X.X为目的地址的路由比BGP设备2从BGP设备1接收到的以BGP路由前缀X.X.X.X为目的地址的路由更优,导致BGP设备2从BGP设备1接收到的以BGP路由前缀X.X.X.X为目的地址的路由被替换掉,进而发生路由环路和路由震荡。在这种情况下,BGP设备2抑制从BGP设备2到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由,即对BGP设备2到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由实施处理,包括降低该路由的优先级、避免该路由参与路由选路、丢弃该路由等。同时,BGP设备2记录路由环路告警信息。可见,通过路由抑制的处理,BGP设备2未优先选择BGP设备2到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由,仍然优先选择BGP设备2到BGP设备1以BGP路由前缀X.X.X.X为目的地址的路由,从而避免了路由环路。For another example, in S905, BGP device 3 rewrites the AS identifier through the routing policy, then the BGP routing message sent by BGP device 3 to BGP device 4 carries adv_list as 200+3.3.3.3, 200+2.2.2.2, 200+1.1 .1.1, 200+5.5.5.5, 200+6.6.6.6. According to the principle of route selection, the priority of the modified route is higher than that of the original route, that is, the route with the BGP route prefix X.X.X.X as the destination address received by BGP device 2 from BGP device 4 is higher than that received by BGP device 2 from BGP device 2. The route received by 1 with the BGP route prefix X.X.X.X as the destination address is better. As a result, the route received by BGP device 2 from BGP device 1 with the BGP route prefix X.X.X.X as the destination address is replaced, resulting in routing loops and route flapping. . In this case, BGP device 2 suppresses the route from BGP device 2 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, that is, processing the route from BGP device 2 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address , including reducing the priority of the route, preventing the route from participating in routing selection, and discarding the route. Meanwhile, BGP device 2 records routing loop alarm information. It can be seen that through the route suppression process, BGP device 2 does not preferentially select the route from BGP device 2 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, but still preferentially selects the route from BGP device 2 to BGP device 1 with the BGP route prefix X.X.X.X as the destination address routing, thus avoiding routing loops.
在一种示例中,请参见图11,图11为本申请实施例提供的一种路由处理方法应用于AS内的场景中的流程示意图。其中,该AS内的场景如图12所示,包括BGP设备1(即图1中的BGP设备101)、BGP设备2(即图1中的BGP设备102)、BGP设备4(即图1中的BGP设备104)和BGP设备5(即图1中的BGP设备105),各个BGP设备均位于AS 100内,且各个BGP设备均运行BGP协议。BGP设备1、BGP设备2、BGP设备4和BGP设备5之间建立IBGP邻居关系,其中,BGP设备1是RR,BGP设备5是RR Client;BGP设备2和BGP设备4之间建立MP_BGP邻居关系。发生网络异常后,在AS100的BGP设备1、BGP设备2和BGP设备4三台设备之间产生路由环路。In an example, please refer to FIG. 11 , which is a schematic flowchart of a route processing method provided by an embodiment of the present application applied to an intra-AS scenario. The scene in the AS is shown in FIG. 12 , including BGP device 1 (ie, BGP device 101 in FIG. 1 ), BGP device 2 (ie, BGP device 102 in FIG. 1 ) and BGP device 4 (ie, BGP device 102 in FIG. 1 ) The BGP device 104) and the BGP device 5 (that is, the BGP device 105 in FIG. 1), each BGP device is located in the AS 100, and each BGP device runs the BGP protocol. An IBGP neighbor relationship is established between BGP device 1, BGP device 2, BGP device 4, and BGP device 5, where BGP device 1 is an RR, and BGP device 5 is an RR Client; an MP_BGP neighbor relationship is established between BGP device 2 and BGP device 4 . After a network exception occurs, a routing loop occurs between BGP device 1, BGP device 2, and BGP device 4 of AS100.
在图11所示的应用实施例中,假设BGP设备的标识为所在AS的AS标识+路由器标识的组合,那么对于BGP设备1、BGP设备2、BGP设备4和BGP设备5,各个BGP设备的标识如图12所示。In the application example shown in FIG. 11 , assuming that the identifier of the BGP device is a combination of the AS identifier of the AS where it is located + the router identifier, then for BGP device 1, BGP device 2, BGP device 4, and BGP device 5, the The logo is shown in Figure 12.
具体的,本申请实施例提供的一种路由处理方法应用于如图12所示的AS内的场景中时, 具体包括以下步骤:Specifically, when a route processing method provided in this embodiment of the present application is applied to the scenario in the AS as shown in FIG. 12 , it specifically includes the following steps:
S1101,BGP设备5创建BGP路由消息,向作为RR的BGP设备1发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和标识列表。S1101, the BGP device 5 creates a BGP routing message, and sends the BGP routing message to the BGP device 1 serving as the RR, where the BGP routing message includes routing information and an identifier list of the BGP routing prefix X.X.X.X.
例如,BGP设备5在Update消息内通过adv_list携带本机的标识,将100+5.5.5.5添加到adv_list。For example, the BGP device 5 carries the local identifier through the adv_list in the Update message, and adds 100+5.5.5.5 to the adv_list.
S1102,BGP设备1接收BGP路由消息,确定标识列表中不包含本机的标识;S1102, the BGP device 1 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
S1103,BGP设备1作为RR,可以向AS内已建立IBGP邻居关系的向BGP设备2发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S1103, the BGP device 1, acting as the RR, can send a BGP routing message to the BGP device 2 that has established an IBGP neighbor relationship in the AS, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identifier list.
例如,BGP设备1发送BGP路由前缀X.X.X.X到BGP设备2时,携带的adv_list为100+1.1.1.1,100+5.5.5.5。For example, when BGP device 1 sends the BGP route prefix X.X.X.X to BGP device 2, the carried adv_list is 100+1.1.1.1, 100+5.5.5.5.
S1104,BGP设备2接收BGP路由消息,确定标识列表中不包含本机的标识;S1104, the BGP device 2 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
S1105,BGP设备2向已建立MP_BGP邻居关系的BGP设备4发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S1105, the BGP device 2 sends a BGP routing message to the BGP device 4 that has established the MP_BGP neighbor relationship, where the BGP routing message includes routing information of the BGP routing prefix X.X.X.X and the updated identification list.
例如,BGP设备2发送BGP路由前缀X.X.X.X到BGP设备4时,携带adv_list为100+2.2.2.2,100+1.1.1.1,100+5.5.5.5。For example, when BGP device 2 sends the BGP route prefix X.X.X.X to BGP device 4, it carries adv_list as 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5.
S1106,BGP设备4接收BGP路由消息,确定标识列表中不包含本机的标识;S1106, the BGP device 4 receives the BGP routing message, and determines that the identifier list does not contain the identifier of the local machine;
S1107,BGP设备4向作为RR的BGP设备1发送BGP路由消息,该BGP路由消息包括BGP路由前缀X.X.X.X的路由信息和更新后的标识列表。S1107, the BGP device 4 sends a BGP routing message to the BGP device 1 serving as the RR, where the BGP routing message includes the routing information of the BGP routing prefix X.X.X.X and the updated identification list.
例如,BGP设备4发送BGP路由前缀X.X.X.X到BGP设备1时,携带adv_list为100+4.4.4.4,100+2.2.2.2,100+1.1.1.1,100+5.5.5.5。可选的,BGP设备4可以通过路由策略提高路由优先级,例如,BGP设备4出方向通过提高路由优先级,使得从BGP设备1到BGP设备4的BGP路由前缀X.X.X.X的路由的优先级高于从BGP设备1到BGP设备5的BGP路由前缀X.X.X.X的路由的优先级。For example, when BGP device 4 sends BGP route prefix X.X.X.X to BGP device 1, it carries adv_list as 100+4.4.4.4, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5. Optionally, BGP device 4 can increase the route priority through a routing policy. For example, by increasing the route priority in the outbound direction of BGP device 4, the priority of the route with the BGP route prefix X.X.X.X from BGP device 1 to BGP device 4 is higher than that of BGP device 4. The priority of the route from BGP device 1 to BGP device 5 with the BGP route prefix X.X.X.X.
S1108,BGP设备1接收BGP路由消息,确定标识列表中包含本机的标识。S1108, the BGP device 1 receives the BGP routing message, and determines that the identifier list includes the identifier of the local device.
例如,BGP设备1接收到的BGP路由消息中携带adv_list为100+4.4.4.4,100+2.2.2.2,100+1.1.1.1,100+5.5.5.5。其中,100+1.1.1.1为BGP设备1的标识,则表示BGP设备1接收到了本机发出的路由,BGP网络中存在路由环路。For example, the BGP routing message received by BGP device 1 carries adv_list as 100+4.4.4.4, 100+2.2.2.2, 100+1.1.1.1, 100+5.5.5.5. Among them, 100+1.1.1.1 is the identifier of BGP device 1, which means that BGP device 1 has received the route sent by the local machine, and there is a routing loop in the BGP network.
S1109,BGP设备1抑制从BGP设备1到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由。S1109, the BGP device 1 suppresses the route from the BGP device 1 to the BGP device 4 with the BGP route prefix X.X.X.X as the destination address.
例如,BGP设备1对收到的BGP路由按照RFC标准的选路规则实施选路,若从BGP设备1到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由未被优选,则表示BGP设备1不会优先选择从BGP设备1到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由,从而避免路由环路。进一步,BGP设备1记录路由环路告警信息。For example, BGP device 1 performs route selection on the received BGP route according to the RFC standard routing rules. If the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address is not preferred, it means that BGP device 1 The route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address will not be preferentially selected to avoid routing loops. Further, the BGP device 1 records the routing loop alarm information.
可选的,若从BGP设备1到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由被优选,例如,S1107中BGP设备4出方向通过提高路由优先级,使得从BGP设备1到BGP设备4的BGP路由前缀X.X.X.X的路由的优先级高于从BGP设备1到BGP设备5的BGP路由前缀X.X.X.X的路由的优先级,从而导致从BGP设备1到BGP设备5的BGP路由前缀X.X.X.X的路由被从BGP设备1到BGP设备4的BGP路由前缀X.X.X.X的路由替换掉,进而发生路由环路和路由震荡。在这种情况下,BGP设备1抑制从BGP设备1到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由,即对从BGP设备1到BGP设备4以BGP路 由前缀X.X.X.X为目的地址的路由实施自动处理,包括降低该路由的优先级、抑制该路由参与路由选路、丢弃该路由等。同时,BGP设备1记录路由环路告警信息。可见,通过路由抑制的处理,BGP设备1未优先选择从BGP设备1到BGP设备4以BGP路由前缀X.X.X.X为目的地址的路由,仍然优先选择从BGP设备1到BGP设备5的BGP路由前缀X.X.X.X的路由,从而避免了路由环路。Optionally, if the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address is preferred, for example, in S1107, the outbound direction of BGP device 4 increases the route priority, so that the route from BGP device 1 to BGP device 4 is increased. Routes with BGP route prefix X.X.X.X have higher priority than routes from BGP device 1 to BGP device 5 with BGP route prefix X.X.X.X, resulting in BGP route prefix X.X.X.X from BGP device 1 to BGP device 5. The routes of the BGP route prefix X.X.X.X from BGP device 1 to BGP device 4 are replaced, and routing loops and route flapping occur. In this case, BGP device 1 suppresses the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, that is, it enforces the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address Automatic processing, including reducing the priority of the route, inhibiting the route from participating in routing selection, and discarding the route. At the same time, BGP device 1 records routing loop alarm information. It can be seen that through the process of route suppression, BGP device 1 does not preferentially select the route from BGP device 1 to BGP device 4 with the BGP route prefix X.X.X.X as the destination address, but still preferentially selects the route from BGP device 1 to BGP device 5 with the BGP route prefix X.X.X.X routing, thus avoiding routing loops.
以下结合图13至图16详细说明本申请实施例的通信装置及通信设备。The communication apparatus and the communication device according to the embodiments of the present application will be described in detail below with reference to FIG. 13 to FIG. 16 .
本申请实施例提供一种路由处理装置,如图13所示,该路由处理装置用于实现上述图4所示的实施例中第一BGP设备所执行的方法,具体包括:An embodiment of the present application provides a route processing apparatus. As shown in FIG. 13 , the route processing apparatus is used to implement the method executed by the first BGP device in the embodiment shown in FIG. 4 , and specifically includes:
收发单元1301,用于接收来自第二BGP设备的第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀;标识列表包括至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识; Transceiver unit 1301, configured to receive a first BGP routing message from a second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix; the identification list includes at least one identification, where each identification is the BGP route The identifier of the BGP device that the prefix passes through;
处理单元1302,用于确定第一标识列表包括第一BGP设备的标识;a processing unit 1302, configured to determine that the first identification list includes the identification of the first BGP device;
处理单元1302,还用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。The processing unit 1302 is further configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
在一种实现方式中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示第一BGP路由消息包括第一标识列表。In an implementation manner, the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
在一种实现方式中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In an implementation manner, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
在一种实现方式中,处理单元1302用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,包括:In an implementation manner, the processing unit 1302 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
处理单元1302用于丢弃从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。The processing unit 1302 is configured to discard the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
在一种实现方式中,处理单元1302用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,包括:In an implementation manner, the processing unit 1302 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
处理单元1302用于存储从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,且设置该路由的优先级低于此前本地存储的以BGP路由前缀为目的地址的所有路由的优先级。The processing unit 1302 is configured to store the route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and set the priority of the route to be lower than all the routes previously stored locally with the BGP route prefix as the destination address priority.
在一种实现方式中,处理单元1302还用于记录路由环路告警信息,路由环路告警信息包括以下一种或多种:第一BGP设备的标识、第一标识列表、BGP路由存在路由环路的时刻、BGP路由环路日志。In an implementation manner, the processing unit 1302 is further configured to record routing loop alarm information, where the routing loop alarm information includes one or more of the following: an identifier of the first BGP device, a first identifier list, and a BGP route exists in a routing loop Time of the route, BGP routing loop log.
在一种实现方式中,处理单元1302还用于:In one implementation, the processing unit 1302 is further configured to:
确定第一BGP路由消息中的第一标识列表不包括第一BGP设备的标识,更新该第一标识列表;更新后的第一标识列表包括第一BGP设备的标识;创建BGP路由消息,创建的BGP路由消息包括更新后的第一标识列表。It is determined that the first identification list in the first BGP routing message does not include the identification of the first BGP device, and the first identification list is updated; the updated first identification list includes the identification of the first BGP device; the BGP routing message is created, the created The BGP routing message includes the updated first identification list.
在一种实现方式中,第一标识列表中的标识为以下一种或多种:In an implementation manner, the identifiers in the first identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
在一种实现方式中,图13中的各个单元所实现的相关功能可以通过收发器和处理器来实 现。请参见图14,图14是本申请实施例提供的一种第一BGP设备的结构示意图,该第一BGP设备可以为具有执行图4所示的实施例所述的路由处理功能的设备(例如芯片)。该第一BGP设备可以包括收发器1401、至少一个处理器1402和存储器1403。其中,收发器1401、处理器1402和存储器1403可以通过一条或多条通信总线相互连接,也可以通过其它方式相连接。In an implementation manner, the related functions implemented by each unit in FIG. 13 can be implemented by a transceiver and a processor. Please refer to FIG. 14. FIG. 14 is a schematic structural diagram of a first BGP device provided by an embodiment of the present application. The first BGP device may be a device that performs the routing processing function described in the embodiment shown in FIG. 4 (for example, chip). The first BGP device may include a transceiver 1401 , at least one processor 1402 and a memory 1403 . The transceiver 1401, the processor 1402, and the memory 1403 may be connected to each other through one or more communication buses, or may be connected to each other in other ways.
其中,收发器1401可以用于发送数据,或者接收数据。可以理解的是,收发器1401是统称,可以包括接收器和发送器。例如,接收器用于接收来自第二BGP设备的BGP路由消息。The transceiver 1401 may be used for sending data or receiving data. It can be understood that the transceiver 1401 is a general term and may include a receiver and a transmitter. For example, the receiver is used to receive BGP routing messages from the second BGP device.
其中,处理器1402可以用于对第一BGP设备的数据进行处理,例如,抑制BGP前缀的路由。处理器1402可以包括一个或多个处理器,例如该处理器1402可以是一个或多个中央处理器(central processing unit,CPU),网络处理器(network processor,NP),硬件芯片或者其任意组合。在处理器1402是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 1402 may be configured to process the data of the first BGP device, for example, suppress the route of the BGP prefix. The processor 1402 may include one or more processors, for example, the processor 1402 may be one or more central processing units (CPUs), network processors (NPs), hardware chips or any combination thereof . In the case where the processor 1402 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
其中,存储器1403用于存储程序代码等。存储器1403可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM);存储器1403也可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器1403还可以包括上述种类的存储器的组合。Among them, the memory 1403 is used for storing program codes and the like. The memory 1403 may include volatile memory (volatile memory), such as random access memory (RAM); the memory 1403 may also include non-volatile memory (non-volatile memory), such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 1403 may also include a combination of the above-mentioned types of memory.
其中,上述处理器1402和存储器1403可以通过接口耦合,也可以集成在一起,本实施例不作限定。The above-mentioned processor 1402 and memory 1403 may be coupled through an interface, or may be integrated together, which is not limited in this embodiment.
上述收发器1401和处理器1402可以用于图4所示的实施例中的路由处理方法,其中,具体实现方式如下:The transceiver 1401 and the processor 1402 described above can be used in the routing processing method in the embodiment shown in FIG. 4 , where the specific implementation is as follows:
收发器1401,用于接收来自第二BGP设备的第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀;第一标识列表包括至少一个标识,其中每一个标识为该BGP路由前缀所经过的BGP设备的标识;The transceiver 1401 is configured to receive a first BGP routing message from a second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes at least one identification, wherein each identification is the The identifier of the BGP device through which the BGP route prefix passes;
处理器1402,用于确定第一标识列表包括第一BGP设备的标识;a processor 1402, configured to determine that the first identification list includes the identification of the first BGP device;
处理器1402,还用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。The processor 1402 is further configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address.
在一种实现方式中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示第一BGP路由消息包括第一标识列表。In an implementation manner, the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
在一种实现方式中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In an implementation manner, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
在一种实现方式中,处理器1402用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,包括:In an implementation manner, the processor 1402 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
处理器1402用于丢弃从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由。The processor 1402 is configured to discard the route from the first BGP device to the second BGP device whose destination address is the BGP route prefix.
在一种实现方式中,处理器1402用于抑制从第一BGP设备到第二BGP设备以该BGP路由前缀为目的地址的路由,包括:In an implementation manner, the processor 1402 is configured to suppress the route from the first BGP device to the second BGP device using the BGP route prefix as the destination address, including:
处理单元用于存储从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由,且设置该路由的优先级低于此前本地存储的以所述BGP路由前缀为目的地址的所有路由的优先级。The processing unit is configured to store a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and set the priority of the route to be lower than the BGP route prefix previously stored locally The priority of all routes for the destination address.
在一种实现方式中,处理器1402还用于记录路由环路告警信息,该路由环路告警信息包括以下一种或多种:第一BGP设备的标识、第一标识列表、BGP路由存在路由环路的时刻、BGP路由环路日志。In an implementation manner, the processor 1402 is further configured to record routing loop alarm information, where the routing loop alarm information includes one or more of the following: the identifier of the first BGP device, the first identifier list, the BGP route existing route Time of the loop, BGP routing loop log.
在一种实现方式中,处理器1402还用于:In one implementation, the processor 1402 is also used to:
确定BGP路由消息中的第一标识列表不包括第一BGP设备的标识,更新该第一标识列表;更新后的第一标识列表包括第一BGP设备的标识;创建BGP路由消息,创建的BGP路由消息包括更新后的第一标识列表。It is determined that the first identification list in the BGP routing message does not include the identification of the first BGP device, and the first identification list is updated; the updated first identification list includes the identification of the first BGP device; the BGP routing message is created, and the created BGP route The message includes the updated first identification list.
在一种实现方式中,第一标识列表中的标识为以下一种或多种:In an implementation manner, the identifiers in the first identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
本申请实施例提供一种路由处理装置,如图15所示,该路由处理装置用于实现上述图4所示的实施例中第二BGP设备所执行的方法,具体包括:An embodiment of the present application provides a route processing apparatus. As shown in FIG. 15 , the route processing apparatus is used to implement the method executed by the second BGP device in the embodiment shown in FIG. 4 , and specifically includes:
处理单元1501,用于创建第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀;第一标识列表包括第二BGP设备的标识;a processing unit 1501, configured to create a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes an identification of a second BGP device;
收发单元1502,用于向第一BGP设备发送该第一BGP路由消息。The transceiver unit 1502 is configured to send the first BGP routing message to the first BGP device.
在一种实现方式中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示第一BGP路由消息包括第一标识列表。In an implementation manner, the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
在一种实现方式中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In an implementation manner, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
在一种实现方式中,第二BGP设备为BGP路由前缀的始发设备。In an implementation manner, the second BGP device is an originating device of the BGP route prefix.
在一种实现方式中,第二BGP设备为BGP路由前缀的中间设备;处理单元1501还用于接收第二BGP路由消息,该第二BGP路由消息包含第二标识列表和BGP路由前缀,第二标识列表包含至少一个标识,其中每一个标识为BGP路由前缀所经过的BGP设备的标识;则第一标识列表还包含第二标识列表中的所有标识。In an implementation manner, the second BGP device is an intermediate device of a BGP routing prefix; the processing unit 1501 is further configured to receive a second BGP routing message, where the second BGP routing message includes a second identification list and a BGP routing prefix, and the second BGP routing message The identification list includes at least one identification, wherein each identification is an identification of a BGP device through which the BGP routing prefix passes; then the first identification list also includes all identifications in the second identification list.
在一种实现方式中,第一标识列表和/或第二标识列表中的标识为以下一种或多种:In an implementation manner, the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
在一种实现方式中,在一种实现方式中,图15中的各个单元所实现的相关功能可以通过收发器和处理器来实现。请参见图16,图16是本申请实施例提供的一种第二BGP设备的结构示意图,该第二BGP设备可以为具有执行图4所示的实施例所述的路由处理功能的设备(例如芯片)。该第二BGP设备可以包括收发器1601、至少一个处理器1602和存储器1603。其中,收发器1601、处理器1602和存储器1603可以通过一条或多条通信总线相互连接,也可以通过其它方式相连接。In an implementation manner, in an implementation manner, the related functions implemented by each unit in FIG. 15 may be implemented by a transceiver and a processor. Please refer to FIG. 16. FIG. 16 is a schematic structural diagram of a second BGP device provided by an embodiment of the present application. The second BGP device may be a device that performs the routing processing function described in the embodiment shown in FIG. 4 (for example, chip). The second BGP device may include a transceiver 1601 , at least one processor 1602 and a memory 1603 . The transceiver 1601, the processor 1602, and the memory 1603 may be connected to each other through one or more communication buses, or may be connected to each other in other ways.
其中,收发器1601可以用于发送数据,或者接收数据。可以理解的是,收发器1601是统称,可以包括接收器和发送器。例如,发送器用于向第一BGP设备发送BGP路由消息。The transceiver 1601 may be used for sending data or receiving data. It can be understood that the transceiver 1601 is a general term and can include a receiver and a transmitter. For example, the sender is configured to send a BGP routing message to the first BGP device.
其中,处理器1602可以用于对第二BGP设备的数据进行处理,例如,确定BGP路由消息。处理器1602可以包括一个或多个处理器,例如该处理器1602可以是一个或多个中央处理器(central processing unit,CPU),网络处理器(network processor,NP),硬件芯片或者其 任意组合。在处理器1602是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。The processor 1602 may be configured to process data of the second BGP device, for example, determine a BGP routing message. The processor 1602 may include one or more processors, for example, the processor 1602 may be one or more central processing units (CPUs), network processors (NPs), hardware chips, or any combination thereof . In the case where the processor 1602 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
其中,存储器1603用于存储程序代码等。存储器1603可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM);存储器1603也可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器1603还可以包括上述种类的存储器的组合。Among them, the memory 1603 is used to store program codes and the like. The memory 1603 may include volatile memory (volatile memory), such as random access memory (RAM); the memory 1603 may also include non-volatile memory (non-volatile memory), such as read-only memory (read- only memory, ROM), flash memory (flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); the memory 1603 may also include a combination of the above-mentioned types of memory.
其中,上述处理器1602和存储器1603可以通过接口耦合,也可以集成在一起,本实施例不作限定。The above-mentioned processor 1602 and memory 1603 may be coupled through an interface, or may be integrated together, which is not limited in this embodiment.
上述收发器1601和处理器1602可以用于图4所示的实施例中的路由处理方法,其中,具体实现方式如下:The transceiver 1601 and the processor 1602 described above can be used in the routing processing method in the embodiment shown in FIG. 4 , where the specific implementation is as follows:
处理器1602,用于创建第一BGP路由消息,该第一BGP路由消息包括第一标识列表和BGP路由前缀;第一标识列表包括第二BGP设备的标识;A processor 1602, configured to create a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes an identification of a second BGP device;
收发器1601,用于向第一BGP设备发送该第一BGP路由消息。The transceiver 1601 is configured to send the first BGP routing message to the first BGP device.
在一种实现方式中,第一BGP路由消息的路径属性列表包括标识列表属性,该标识列表属性用于指示第一BGP路由消息包括第一标识列表。In an implementation manner, the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
在一种实现方式中,标识列表属性的属性类型字段指示该标识列表属性为可选过渡属性;标识列表属性的属性值字段指示标识列表中的BGP设备的标识;标识列表属性的属性长度字段指示标识列表的长度。In an implementation manner, the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates the identification of the BGP device in the identification list; the attribute length field of the identification list attribute indicates Identifies the length of the list.
在一种实现方式中,第二BGP设备为BGP路由前缀的始发设备。In an implementation manner, the second BGP device is an originating device of the BGP route prefix.
在一种实现方式中,第二BGP设备为BGP路由前缀的中间设备;处理器1602还用于接收第二BGP路由消息,该第二BGP路由消息包含第二标识列表和所述BGP路由前缀,所述第二标识列表包含至少一个标识,其中每一个标识为所述BGP路由前缀所经过的BGP设备的标识;则所述第一标识列表还包含所述第二标识列表中的所有标识。In an implementation manner, the second BGP device is an intermediate device of a BGP routing prefix; the processor 1602 is further configured to receive a second BGP routing message, where the second BGP routing message includes a second identification list and the BGP routing prefix, The second identification list includes at least one identification, wherein each identification is an identification of a BGP device that the BGP routing prefix passes through; then the first identification list also includes all identifications in the second identification list.
在一种实现方式中,第一标识列表和/或第二标识列表的标识为以下一种或多种:In an implementation manner, the identifiers of the first identifier list and/or the second identifier list are one or more of the following:
BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
BGP设备对应的随机数;The random number corresponding to the BGP device;
BGP设备的IP地址。IP address of the BGP device.
本申请实施例提供一种BGP网络系统,该BGP网络系统包括前述实施例所述的第一BGP设备和第二BGP设备。An embodiment of the present application provides a BGP network system, where the BGP network system includes the first BGP device and the second BGP device described in the foregoing embodiments.
本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质存储有程序或指令,当所述程序或指令在计算机上运行时,使得计算机执行本申请实施例中的数据处理方法。An embodiment of the present application provides a computer-readable storage medium, where a program or an instruction is stored in the computer-readable storage medium, and when the program or instruction is executed on a computer, the computer can execute the data processing method in the embodiment of the present application.
本申请实施例提供一种芯片或者芯片系统,该芯片或者芯片系统包括至少一个处理器和接口,接口和至少一个处理器通过线路互联,至少一个处理器用于运行计算机程序或指令,以进行本申请实施例中的数据处理方法。An embodiment of the present application provides a chip or a chip system, the chip or chip system includes at least one processor and an interface, the interface and the at least one processor are interconnected through a line, and the at least one processor is used to run a computer program or instruction to execute the present application The data processing method in the embodiment.
其中,芯片中的接口可以为输入/输出接口、管脚或电路等。Wherein, the interface in the chip may be an input/output interface, a pin or a circuit, or the like.
上述方面中的芯片系统可以是片上系统(system on chip,SOC),也可以是基带芯片等,其中基带芯片可以包括处理器、信道编码器、数字信号处理器、调制解调器和接口模块等。The chip system in the above aspects may be a system on chip (system on chip, SOC), or a baseband chip, etc., where the baseband chip may include a processor, a channel encoder, a digital signal processor, a modem, an interface module, and the like.
在一种实现方式中,本申请中上述描述的芯片或者芯片系统还包括至少一个存储器,该至少一个存储器中存储有指令。该存储器可以为芯片内部的存储单元,例如,寄存器、缓存等,也可以是该芯片的存储单元(例如,只读存储器、随机存取存储器等)。In an implementation manner, the chip or chip system described above in this application further includes at least one memory, where instructions are stored in the at least one memory. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (eg, a read-only memory, a random access memory, etc.).
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,高密度数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server, or data center over a wire (e.g. coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to transmit to another website site, computer, server or data center. A computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, high-density digital video discs (DVDs)), or semiconductor media (eg, solid state disks, SSD)) etc.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize 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. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (31)

  1. 一种路由处理方法,其特征在于,包括:A routing processing method, comprising:
    第一边界网关协议BGP设备接收来自第二BGP设备的第一BGP路由消息,所述第一BGP路由消息包括第一标识列表和BGP路由前缀;所述第一标识列表包括至少一个标识,其中每一个标识为所述BGP路由前缀所经过的BGP设备的标识;The first Border Gateway Protocol BGP device receives a first BGP routing message from the second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes at least one identification, where each An identifier is the identifier of the BGP device through which the BGP routing prefix passes;
    所述第一BGP设备确定所述第一标识列表包括所述第一BGP设备的标识;The first BGP device determines that the first identifier list includes the identifier of the first BGP device;
    所述第一BGP设备抑制从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由。The first BGP device suppresses a route from the first BGP device to the second BGP device using the BGP route prefix as a destination address.
  2. 根据权利要求1所述的方法,其特征在于,所述第一BGP路由消息的路径属性列表包括标识列表属性,所述标识列表属性用于指示所述第一BGP路由消息包括所述第一标识列表。The method according to claim 1, wherein the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  3. 根据权利要求2所述的方法,其特征在于,所述标识列表属性的属性类型字段指示所述标识列表属性为可选过渡属性;所述标识列表属性的属性值字段指示所述标识列表中的BGP设备的标识;所述标识列表属性的属性长度字段指示所述标识列表的长度。The method according to claim 2, wherein the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates that the attribute value field in the identification list The identity of the BGP device; the attribute length field of the identity list attribute indicates the length of the identity list.
  4. 根据权利要求1至3任意一项所述的方法,其特征在于,所述第一BGP设备抑制从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由,包括:The method according to any one of claims 1 to 3, wherein the first BGP device suppresses a route from the first BGP device to the second BGP device using the BGP route prefix as a destination address ,include:
    所述第一BGP设备丢弃从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由。The first BGP device discards a route from the first BGP device to the second BGP device that uses the BGP route prefix as a destination address.
  5. 根据权利要求1至3任意一项所述的方法,其特征在于,所述第一BGP设备抑制从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由,包括:The method according to any one of claims 1 to 3, wherein the first BGP device suppresses a route from the first BGP device to the second BGP device using the BGP route prefix as a destination address ,include:
    所述第一BGP设备存储从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由,且设置该路由的优先级低于此前本地存储的以所述BGP路由前缀为目的地址的所有路由的优先级。The first BGP device stores a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and sets the priority of the route to be lower than the previously locally stored route with the BGP prefix. The priority of all routes whose route prefix is the destination address.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:
    所述第一BGP设备记录路由环路告警信息,所述路由环路告警信息包括以下一种或多种:所述第一BGP设备的标识、所述第一标识列表、所述BGP路由存在路由环路的时刻、所述BGP路由环路日志。The first BGP device records routing loop alarm information, where the routing loop alarm information includes one or more of the following: the identifier of the first BGP device, the first identifier list, and the BGP route existing route The moment of the loop, the log of the BGP routing loop.
  7. 根据权利要求1至3任意一项所述的方法,其特征在于,所述第一BGP设备接收来自第二BGP设备的第一BGP路由消息之后,所述方法还包括:The method according to any one of claims 1 to 3, wherein after the first BGP device receives the first BGP routing message from the second BGP device, the method further comprises:
    所述第一BGP设备确定所述第一BGP路由消息中的第一标识列表不包括所述第一BGP设备的标识;The first BGP device determines that the first identifier list in the first BGP routing message does not include the identifier of the first BGP device;
    所述第一BGP设备更新所述第一标识列表,更新后的第一标识列表包括所述第一BGP设备的标识;The first BGP device updates the first identification list, and the updated first identification list includes the identification of the first BGP device;
    所述第一BGP设备创建BGP路由消息,所述第一BGP设备创建的BGP路由消息包括所述BGP路由前缀和所述更新后的第一标识列表。The first BGP device creates a BGP routing message, and the BGP routing message created by the first BGP device includes the BGP routing prefix and the updated first identification list.
  8. 根据权利要求1至7任意一项所述的方法,其特征在于,所述第一标识列表中的标识为以下一种或多种:The method according to any one of claims 1 to 7, wherein the identifiers in the first identifier list are one or more of the following:
    BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
    BGP设备对应的随机数;The random number corresponding to the BGP device;
    BGP设备的互联网协议IP地址。The Internet Protocol IP address of the BGP device.
  9. 一种路由处理方法,其特征在于,包括:A routing processing method, comprising:
    第二边界网关协议BGP设备创建第一BGP路由消息,所述第一BGP路由消息包括第一标识列表和BGP路由前缀;所述第一标识列表包括所述第二BGP设备的标识;The second Border Gateway Protocol BGP device creates a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes the identification of the second BGP device;
    所述第二BGP设备向第一BGP设备发送所述第一BGP路由消息。The second BGP device sends the first BGP routing message to the first BGP device.
  10. 根据权利要求9所述的方法,其特征在于,所述第一BGP路由消息的路径属性列表包括标识列表属性,所述标识列表属性用于指示所述第一BGP路由消息包括所述第一标识列表。The method according to claim 9, wherein the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  11. 根据权利要求10所述的方法,其特征在于,所述标识列表属性的属性类型字段指示所述标识列表属性为可选过渡属性;所述标识列表属性的属性值字段指示所述标识列表中的BGP设备的标识;所述标识列表属性的属性长度字段指示所述标识列表的长度。The method according to claim 10, wherein the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates that the attribute value field in the identification list The identity of the BGP device; the attribute length field of the identity list attribute indicates the length of the identity list.
  12. 根据权利要求9至11任意一项所述的方法,其特征在于,所述第二BGP设备为所述BGP路由前缀的始发设备。The method according to any one of claims 9 to 11, wherein the second BGP device is an originating device of the BGP routing prefix.
  13. 根据权利要求9至11任意一项所述的方法,其特征在于,The method according to any one of claims 9 to 11, wherein,
    所述第二BGP设备为所述BGP路由前缀的中间设备,所述方法还包括:The second BGP device is an intermediate device of the BGP routing prefix, and the method further includes:
    所述第二BGP设备接收第二BGP路由消息,所述第二BGP路由消息包含第二标识列表和所述BGP路由前缀,所述第二标识列表包含至少一个标识,其中每一个标识为所述BGP路由前缀所经过的BGP设备的标识;The second BGP device receives a second BGP routing message, the second BGP routing message includes a second identification list and the BGP routing prefix, the second identification list includes at least one identification, wherein each identification is the The identifier of the BGP device through which the BGP route prefix passes;
    则所述第一标识列表还包含所述第二标识列表中的所有标识。Then, the first identification list further includes all the identifications in the second identification list.
  14. 根据权利要求9至13任意一项所述的方法,其特征在于,所述第一标识列表和/或所述第二标识列表中的标识为以下一种或多种:The method according to any one of claims 9 to 13, wherein the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
    BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
    BGP设备对应的随机数;The random number corresponding to the BGP device;
    BGP设备的互联网协议IP地址。The Internet Protocol IP address of the BGP device.
  15. 一种路由处理装置,其特征在于,包括:A routing processing device, comprising:
    收发单元,用于接收来自第二BGP设备的第一BGP路由消息,所述第一BGP路由消息包括第一标识列表和BGP路由前缀;所述第一标识列表包括至少一个标识,其中每一个标识为所述BGP路由前缀所经过的BGP设备的标识;A transceiver unit, configured to receive a first BGP routing message from a second BGP device, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes at least one identification, wherein each identification is the identifier of the BGP device through which the BGP routing prefix passes;
    处理单元,用于确定所述第一标识列表包括所述第一BGP设备的标识;a processing unit, configured to determine that the first identification list includes the identification of the first BGP device;
    所述处理单元,还用于抑制从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由。The processing unit is further configured to suppress a route from the first BGP device to the second BGP device using the BGP route prefix as a destination address.
  16. 根据权利要求15所述的装置,其特征在于,所述第一BGP路由消息的路径属性列表包括标识列表属性,所述标识列表属性用于指示所述第一BGP路由消息包括所述第一标识列表。The apparatus according to claim 15, wherein the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  17. 根据权利要求16所述的装置,其特征在于,所述标识列表属性的属性类型字段指示所述标识列表属性为可选过渡属性;所述标识列表属性的属性值字段指示所述标识列表中的BGP设备的标识;所述标识列表属性的属性长度字段指示所述标识列表的长度。The apparatus according to claim 16, wherein the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates that the attribute value field in the identification list The identity of the BGP device; the attribute length field of the identity list attribute indicates the length of the identity list.
  18. 根据权利要求15至17任意一项所述的装置,其特征在于,处理单元用于抑制从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由,包括:The apparatus according to any one of claims 15 to 17, wherein the processing unit is configured to suppress a route from the first BGP device to the second BGP device using the BGP route prefix as a destination address, comprising: :
    所述处理单元用于丢弃从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由。The processing unit is configured to discard a route from the first BGP device to the second BGP device that takes the BGP route prefix as a destination address.
  19. 根据权利要求15至17任意一项所述的装置,其特征在于,处理单元用于抑制从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由,包括:The apparatus according to any one of claims 15 to 17, wherein the processing unit is configured to suppress a route from the first BGP device to the second BGP device using the BGP route prefix as a destination address, comprising: :
    所述处理单元用于存储从所述第一BGP设备到所述第二BGP设备以所述BGP路由前缀为目的地址的路由,且设置该路由的优先级低于此前本地存储的以所述BGP路由前缀为目的地址的所有路由的优先级。The processing unit is configured to store a route from the first BGP device to the second BGP device with the BGP route prefix as the destination address, and set the priority of the route to be lower than the previously locally stored route with the BGP prefix. The priority of all routes whose route prefix is the destination address.
  20. 根据权利要求19所述的装置,其特征在于,所述处理单元还用于记录路由环路告警信息,所述路由环路告警信息包括以下一种或多种:所述第一BGP设备的标识、所述第一标识列表、所述BGP路由存在路由环路的时刻、所述BGP路由环路日志。The apparatus according to claim 19, wherein the processing unit is further configured to record routing loop alarm information, and the routing loop alarm information includes one or more of the following: an identifier of the first BGP device , the first identification list, the time when the BGP route has a routing loop, and the BGP routing loop log.
  21. 根据权利要求15至17任意一项所述的装置,其特征在于,所述处理单元还用于:The device according to any one of claims 15 to 17, wherein the processing unit is further configured to:
    确定所述BGP路由消息中的第一标识列表不包括所述第一BGP设备的标识;determining that the first identifier list in the BGP routing message does not include the identifier of the first BGP device;
    更新所述第一标识列表;更新后的第一标识列表包括所述第一BGP设备的标识;updating the first identification list; the updated first identification list includes the identification of the first BGP device;
    创建BGP路由消息,所述处理单元创建的BGP路由消息包括所述BGP路由前缀和所述更新后的第一标识列表。A BGP routing message is created, where the BGP routing message created by the processing unit includes the BGP routing prefix and the updated first identification list.
  22. 根据权利要求15至21任意一项所述的装置,其特征在于,所述第一标识列表中的标识为以下一种或多种:The device according to any one of claims 15 to 21, wherein the identifiers in the first identifier list are one or more of the following:
    BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
    BGP设备对应的随机数;The random number corresponding to the BGP device;
    BGP设备的互联网协议IP地址。The Internet Protocol IP address of the BGP device.
  23. 一种路由处理装置,其特征在于,包括:A routing processing device, comprising:
    处理单元,用于创建第一BGP路由消息,所述第一BGP路由消息包括第一标识列表和BGP路由前缀;所述第一标识列表包括所述第二BGP设备的标识;a processing unit, configured to create a first BGP routing message, where the first BGP routing message includes a first identification list and a BGP routing prefix; the first identification list includes an identification of the second BGP device;
    收发单元,用于向第一BGP设备发送所述第一BGP路由消息。A transceiver unit, configured to send the first BGP routing message to the first BGP device.
  24. 根据权利要求23所述的装置,其特征在于,所述第一BGP路由消息的路径属性列表包括标识列表属性,所述标识列表属性用于指示所述第一BGP路由消息包括所述第一标识列表。The apparatus according to claim 23, wherein the path attribute list of the first BGP routing message includes an identification list attribute, and the identification list attribute is used to indicate that the first BGP routing message includes the first identification list.
  25. 根据权利要求24所述的装置,其特征在于,所述标识列表属性的属性类型字段指示所述标识列表属性为可选过渡属性;所述标识列表属性的属性值字段指示所述标识列表中的BGP设备的标识;所述标识列表属性的属性长度字段指示所述标识列表的长度。The apparatus according to claim 24, wherein the attribute type field of the identification list attribute indicates that the identification list attribute is an optional transition attribute; the attribute value field of the identification list attribute indicates that the attribute value field in the identification list The identity of the BGP device; the attribute length field of the identity list attribute indicates the length of the identity list.
  26. 根据权利要求23至25任意一项所述的装置,其特征在于,所述第二BGP设备为所述BGP路由前缀的始发设备。The apparatus according to any one of claims 23 to 25, wherein the second BGP device is an originating device of the BGP routing prefix.
  27. 根据权利要求23至25任意一项所述的装置,其特征在于,The device according to any one of claims 23 to 25, characterized in that:
    所述第二BGP设备为所述BGP路由前缀的中间设备,所述处理单元还用于:The second BGP device is an intermediate device of the BGP routing prefix, and the processing unit is further configured to:
    接收第二BGP路由消息,所述第二BGP路由消息包含第二标识列表和所述BGP路由前缀,所述第二标识列表包含至少一个标识,其中每一个标识为所述BGP路由前缀所经过的BGP设备的标识;Receive a second BGP routing message, where the second BGP routing message includes a second identification list and the BGP routing prefix, the second identification list includes at least one identification, wherein each identification is a route passed by the BGP routing prefix The identity of the BGP device;
    则所述第一标识列表还包含所述第二标识列表中的所有标识。Then, the first identification list further includes all the identifications in the second identification list.
  28. 根据权利要求23至27任意一项所述的装置,其特征在于,所述第一标识列表和/或所述第二标识列表中的标识为以下一种或多种:The apparatus according to any one of claims 23 to 27, wherein the identifiers in the first identifier list and/or the second identifier list are one or more of the following:
    BGP设备所在自治系统AS的AS标识与BGP设备的路由器标识的组合;The combination of the AS ID of the AS where the BGP device is located and the router ID of the BGP device;
    BGP设备对应的随机数;The random number corresponding to the BGP device;
    BGP设备的互联网协议IP地址。The Internet Protocol IP address of the BGP device.
  29. 一种边界网关协议BGP设备,其特征在于,包括:存储器和处理器;A border gateway protocol (BGP) device, comprising: a memory and a processor;
    所述存储器,用于存储指令;the memory for storing instructions;
    所述处理器,用于执行所述指令,使得如权利要求1至8或9至14中任意一项所述的方法被执行。the processor for executing the instructions such that the method of any one of claims 1 to 8 or 9 to 14 is performed.
  30. 一种BGP网络系统,其特征在于,包括:A BGP network system, comprising:
    第一BGP设备,用于执行如权利要求1至8任意一项所述的方法;a first BGP device, configured to execute the method according to any one of claims 1 to 8;
    第二BGP设备,用于执行如权利要求9至14任意一项所述的方法。The second BGP device is configured to execute the method according to any one of claims 9 to 14.
  31. 一种计算机可读存储介质,其特征在于,包括程序或指令,当所述程序或指令在计算机上运行时,如权利要求1至8或9至14中任意一项所述的方法被执行。A computer-readable storage medium, characterized by comprising programs or instructions, when the programs or instructions are run on a computer, the method according to any one of claims 1 to 8 or 9 to 14 is performed.
PCT/CN2021/109948 2020-11-28 2021-07-31 Route processing method and apparatus, and devices WO2022110881A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011365507.9 2020-11-28
CN202011365507.9A CN114640623A (en) 2020-11-28 2020-11-28 Route processing method, device and equipment

Publications (1)

Publication Number Publication Date
WO2022110881A1 true WO2022110881A1 (en) 2022-06-02

Family

ID=81755268

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109948 WO2022110881A1 (en) 2020-11-28 2021-07-31 Route processing method and apparatus, and devices

Country Status (2)

Country Link
CN (1) CN114640623A (en)
WO (1) WO2022110881A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425978A (en) * 2008-12-02 2009-05-06 中兴通讯股份有限公司 Method and device for preventing routing loop in autonomous system
CN101534226A (en) * 2009-04-14 2009-09-16 杭州华三通信技术有限公司 VLAN-based whole network loop detection method and loop detection equipment
US20120281539A1 (en) * 2011-05-02 2012-11-08 Keyur Patel Detecting and Avoiding Routing Loops with BGP Route Server Extensions
CN103944823A (en) * 2014-03-27 2014-07-23 杭州华三通信技术有限公司 Route releasing method and device
CN104660502A (en) * 2015-03-16 2015-05-27 杭州华三通信技术有限公司 Method and device for announcing route to EBGP (external border gateway protocol) neighbor
WO2021114838A1 (en) * 2019-12-10 2021-06-17 华为技术有限公司 Method for reducing routing loops, apparatus and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425978A (en) * 2008-12-02 2009-05-06 中兴通讯股份有限公司 Method and device for preventing routing loop in autonomous system
CN101534226A (en) * 2009-04-14 2009-09-16 杭州华三通信技术有限公司 VLAN-based whole network loop detection method and loop detection equipment
US20120281539A1 (en) * 2011-05-02 2012-11-08 Keyur Patel Detecting and Avoiding Routing Loops with BGP Route Server Extensions
CN103944823A (en) * 2014-03-27 2014-07-23 杭州华三通信技术有限公司 Route releasing method and device
CN104660502A (en) * 2015-03-16 2015-05-27 杭州华三通信技术有限公司 Method and device for announcing route to EBGP (external border gateway protocol) neighbor
WO2021114838A1 (en) * 2019-12-10 2021-06-17 华为技术有限公司 Method for reducing routing loops, apparatus and system

Also Published As

Publication number Publication date
CN114640623A (en) 2022-06-17

Similar Documents

Publication Publication Date Title
US10972391B2 (en) Full-path validation in segment routing
US7532631B2 (en) Method and apparatus for accelerating border gateway protocol convergence
EP1999896B1 (en) Network routing apparatus that performs soft graceful restart
US8170033B1 (en) Virtual private local area network service (VPLS) flush mechanism for BGP-based VPLS networks
US7953103B2 (en) Multi-homing using controlled route leakage at a backup service provider
US11611509B2 (en) Communication method, communications device, and communications system
US7940776B2 (en) Fast re-routing in distance vector routing protocol networks
US20070180105A1 (en) Technique for distinguishing between link and node failure using bidirectional forwarding detection (BFD)
US8451750B2 (en) Validation of routes advertised by border gateway protocol
US11477114B2 (en) Packet forwarding method and apparatus
JP7306642B2 (en) Loop avoidance communication method, loop avoidance communication device and loop avoidance communication system
JP2018500828A (en) Reliable routing between communication network systems
CN112868214B (en) Coordinated load transfer OAM records within packets
EP4092977A1 (en) Route attribute update method, network device and system
EP3817285B1 (en) Method and device for monitoring forwarding table entry
US20230010837A1 (en) Fault diagnosis method and apparatus thereof
JP2022052741A (en) Target neighbor search for boundary gateway protocol
US8670299B1 (en) Enhanced service status detection and fault isolation within layer two networks
US8085654B2 (en) Method for reducing fault detection time in a telecommunication network
CA3147310A1 (en) Interior gateway protocol flooding optimization method and device, and storage medium
WO2022110881A1 (en) Route processing method and apparatus, and devices
WO2023098703A1 (en) Path notification method, topology algorithm combination generation method, path calculation method, data transmission method, electronic device, and computer-readable storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21896388

Country of ref document: EP

Kind code of ref document: A1