WO2022143854A1 - 一种路由方法及相关设备 - Google Patents

一种路由方法及相关设备 Download PDF

Info

Publication number
WO2022143854A1
WO2022143854A1 PCT/CN2021/142797 CN2021142797W WO2022143854A1 WO 2022143854 A1 WO2022143854 A1 WO 2022143854A1 CN 2021142797 W CN2021142797 W CN 2021142797W WO 2022143854 A1 WO2022143854 A1 WO 2022143854A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
route
request message
orf
network
Prior art date
Application number
PCT/CN2021/142797
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP21914585.1A priority Critical patent/EP4262281A1/en
Publication of WO2022143854A1 publication Critical patent/WO2022143854A1/zh
Priority to US18/343,463 priority patent/US20230344756A1/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/42Centralised routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/028Dynamic adaptation of the update intervals, e.g. event-triggered updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/14Routing performance; Theoretical aspects
    • 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/74Address processing for routing

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a routing method and related equipment.
  • each first network device In the network scenario where multiple first network devices are deployed under the second network device, the routes of each first network device will be spread to other network devices, that is, each first network device needs to save all other network devices In this way, although the service distribution can be ensured, it puts forward higher requirements on the hardware capacity of the first network device.
  • a default route or an aggregated route is also adopted at present, that is, the second network device only advertises a default route or an aggregated route to each first network device to reach itself.
  • the first network device sends all traffic matching the default route or the aggregated route to the second network device, which is then forwarded by the second network device to another first network device.
  • each first network device only needs to save a default route or aggregated route to the second network device, and there is no need to save the detailed routes of the first network device to all other network devices, which greatly reduces the need for the first network device.
  • Requirements for the storage capacity of network devices However, in the mode of the default route or the aggregated route, all traffic needs to be detoured from the second network device. In this way, in the case of a large amount of traffic, a huge load pressure will be caused to the second network device.
  • Embodiments of the present application provide a routing method and related equipment.
  • the second network On the basis of saving a default route or an aggregated route to a second network device on the first network device, when a preset condition is satisfied, the second network The device requests the required route to one or some first network devices, and implements flexible route advertisement, which not only enables the low-end first network device to support network deployment, but also reduces the default route or aggregated route mode to provide.
  • the load pressure brought by the second network device is not only enables the low-end first network device to support network deployment, but also reduces the default route or aggregated route mode to provide.
  • an embodiment of the present application provides a routing method.
  • the method in an initial state, only a default route or an aggregated route to a second network device is stored on the first network device.
  • the first network device as the traffic sender sends a request message to the second network device, requesting a route to at least one other network device; then, in response to the request message, the second network device can Send a routing message to the first network device of the traffic sender, where the routing message carries a route to the at least one other network device, wherein the first network device and the other network device are both connected to the second network device.
  • the direct or indirect connection of network devices in an initial state, only a default route or an aggregated route to a second network device is stored on the first network device.
  • a Border Gateway Protocol (English: Border Gateway Protocol, BGP for short) neighbor relationship in pull (English: pull) mode between the first network device and the second network device may also be referred to as BGP neighbor relationship in request mode or BGP neighbor relationship in subscription mode.
  • the first network device may be the route receiver in pull mode
  • the second network device may be the route sender in pull mode
  • the second network device sends the route to the first network device to the second network a first route of the device, where the first route is used to instruct the first network device to send traffic destined for the other network device to the second network device; the first network device sends traffic to the second network device based on the first condition A request message is sent, and the second network device sends a route to at least one other network device to the first network device in response to the request message.
  • the role of the network device belonging to the BGP neighbor relationship in the pull mode may be statically configured through a command line or the like.
  • the role of the network device belonging to the BGP neighbor relationship in pull mode may also be dynamically determined through negotiation. For example, before the BGP neighbor relationship in pull mode is established between the first network device and the second network device, The first network device sends a first negotiation packet including a first role identifier to the second network device, where the first negotiation packet is used to indicate that the role of the first network device in the BGP neighbor relationship in pull mode will be the first role indicated by the first role identifier, and the second network device sends a second negotiation packet including the second role identifier to the first network device, where the second negotiation packet is used to indicate the second network The role of the device in the BGP neighbor relationship in pull mode will be the role indicated by the second role identifier.
  • the first role identifier included in the first negotiation packet indicates that the first network device is a route receiver in pull mode
  • the second role identifier included in the second negotiation packet indicates that the first network device is a router in pull mode.
  • the route sender, the first network device determines, according to the first negotiation packet and the second negotiation packet, that in the BGP neighbor relationship in pull mode established with the second network device, its role is to receive routes in pull mode.
  • the role of the second network device is the routing sender in pull mode.
  • the above negotiation message may be, for example, a BGP start (English: OPEN) message, and the BGP OPEN message is the first message that needs to be sent when establishing a BGP neighbor relationship, and is used to negotiate two network devices to be established BGP neighbor relationship. Whether there is a capability available on both ends.
  • the first network device before the first network device sends the request message to the second network device, the first network device saves a first route to the second network device, where the first route is used to indicate the first The network device sends traffic destined for the other network device to the second network device.
  • the first route is a default route or an aggregated route.
  • the method provided by the embodiment of the present application may further include: the first network device receives a first packet, the first packet is a packet destined for a third network device, and the third network device belongs to the at least one other network device; then, the first network device determines that the first packet matches the first route; and sends the first packet to the second network device according to the first route. In this way, before the first condition is satisfied, the first network device can effectively forward the packet from the second network device to other network devices.
  • the method may further include: the first network device receives a second packet, where the second packet is a packet destined for the third network device; the first network device determines that the second packet is the same as the second packet. After the second route is matched, the second packet may be sent to the third network device according to the second route. In this way, the message from the first network device to the third network device does not need to be forwarded by the second network device, and can be directly sent from the first network device to the second network device, which can save network resources to a certain extent.
  • the first condition may include, but is not limited to, at least one of the following conditions: Condition 1, the first network device determines that the network status of the at least one other network device satisfies the second condition; Condition 2, there is an optimization requirement for the service type from the first network device to the at least one other network device; Condition 3, the first network device receives an indication message, and the indication message is used to instruct the first network device to request to the at least one other network device. Describe the route of at least one other network device.
  • the second condition in condition 1 includes, but is not limited to, at least one of the following conditions: the traffic from the first network device to the at least one other network device is greater than or equal to the first threshold; The delay of the at least one other network device is greater than or equal to the second threshold.
  • the request message includes identification information of the at least one other network device, and the identification information may include a prefix of the at least one other network device, or reach the at least one other network device
  • the number of at least one autonomous domain (English: Autonomous System, abbreviated as: AS) that the path passes through.
  • the request message sent by the first network device to the second network device may be, for example, an outbound route filtering (English: Outbound Route Filtering, ORF for short) request message.
  • the ORF request message may include a type (English: Type) field, and the value of the type field indicates that the ORF request message includes an incremental ORF field.
  • the incremental ORF field in the ORF request message may include: a type field, an incremental ORF type (English: Embedded ORF Type) field, and a specific value corresponding to the incremental ORF type (English: Embedded ORF Type Specific Value) field , where the value of the type field is used to indicate that the ORF request message includes an incremental ORF field; the value of the incremental ORF type field is used to indicate the specific type of the incremental ORF field, for example, incremental ORF
  • an embodiment of the present application provides a routing method, and the method is applied to a second network device.
  • the method may include: the second network device receives a request message sent by the first network device, where the request message is used to request Routing to at least one other network device, wherein the first network device and the other network device are both connected to the second network device; in response to the request message, the second network device sends a routing message to the first network device , the routing message carries the route to the at least one other network device.
  • a border gateway protocol BGP neighbor relationship in pull mode is established between the first network device and the second network device, the first network device is the route receiver in the pull mode, and the first network device is the route receiver in the pull mode.
  • the second network device is the route sender in the pull mode, and the second network device sends the first route to the second network device to the first network device, where the first route is used to instruct the first network device to send
  • the traffic destined for the other network device is sent to the second network device; the first network device sends a request message to the second network device based on the first condition, and the second network device responds to the request message to the second network device;
  • the method may further include: the second network device sends a negotiation packet including the role identifier to the first network device , the negotiation message is used to indicate that the role of the second network device in the BGP neighbor relationship in the pull mode will be the role indicated by the role identifier.
  • the roles in the BGP neighbor relationship in the pull mode include: the route receiver in the pull mode, the route sender in the pull mode, or the route sender and the route receiver in the pull mode.
  • the method may further include: the second network device sends a first network device to the first network device to the second network device. a route for instructing the first network device to send traffic destined for the other network device to the second network device.
  • the first route is a default route or an aggregated route.
  • the method may further include: a second network device receiving a first packet sent by the first network device, where the first packet is a packet destined for a third network device, the The third network device belongs to the at least one other network device; then, the second network device sends the first packet to the third network device.
  • the request message includes identification information of the at least one other network device, the identification information includes a prefix of the at least one other network device, or the request message includes a path to the at least one other network device The AS number of at least one autonomous domain passed through.
  • the request message is an outbound route filtering ORF request message
  • the ORF request message may include a type field, and the value of the type field is used to indicate that the type of the ORF request message is incremental type ORF request message.
  • the embodiment of the present application may further include: the second network device determines the The first sequence number Sequence in the incremental ORF field does not match all the sequence numbers in the sequence number set on the second network device, then save the first sequence number and the sequence number carried in the incremental ORF field The corresponding relationship of the identification information of the at least one other network device.
  • the first sequence number Sequence in the incremental ORF field does not match all sequence numbers in the sequence number set on the second network device, which means that the first sequence number and all sequence numbers stored on the second network device are not the same.
  • this embodiment of the present application may further include: a second network device Determine that the first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device, then use the at least one other network carried in the incremental ORF field
  • the identification information of the device replaces the content corresponding to the second serial number.
  • the first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device, which means that the first sequence number is the same as the second sequence number stored on the second network device.
  • the incremental ORF field is used to request the second network device to incrementally send a route corresponding to the identification information to the at least one other network device to the first network device.
  • the embodiment of the present application may further include: the second network device determines that the first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device, and according to the If the incremental ORF field obtains a deletion instruction, the content corresponding to the second serial number is deleted. Wherein, the second network device obtains the deletion instruction according to the incremental ORF field. In one case, it may mean that the incremental ORF field does not carry any identification information of the network device.
  • the incremental ORF field determines that the content corresponding to the first sequence number (or the second sequence number) needs to be deleted; in another case, it may mean that the incremental ORF field includes indication information, and the indication information is used to indicate Delete the content corresponding to the first sequence number (or the second sequence number), then the second network device determines that the content corresponding to the first sequence number (or the second sequence number) needs to be deleted according to the indication information in the incremental ORF field.
  • the deleted content may include: the second serial number previously saved on the second network device and the identification information of the corresponding network device.
  • the first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device, which means that the first sequence number is the same as the second sequence number stored on the second network device.
  • an embodiment of the present application further provides a routing apparatus, where the apparatus is applied to a first network device, and the apparatus may include a first sending unit and a first receiving unit.
  • the first sending unit is configured to send a request message to the second network device based on satisfying the first condition, where the request message is used to request a route to at least one other network device, the first network device and the other network device Both the network device and the second network device; a first receiving unit, configured to receive a routing message sent by the second network device in response to the request message, where the routing message is carried to the at least one other network device route.
  • a border gateway protocol BGP neighbor relationship in pull mode is established between the first network device and the second network device, and the first network device is a route receiver in the pull mode , the second network device is the route sender in the pull mode, the second network device sends the first route to the second network device to the first network device, and the first route uses instructing the first network device to send traffic destined for the other network device to the second network device; the first network device sends a request message to the second network device based on the first condition, The second network device sends a route to the at least one other network device to the first network device in response to the request message.
  • the apparatus may further include a second sending unit.
  • the second sending unit is configured to send a negotiation message including a role identifier to the second network device before establishing the BGP neighbor relationship in the pull mode with the second network device, and the negotiation message
  • the text is used to indicate that the role of the first network device in the BGP neighbor relationship in the pull mode will be the role indicated by the role identifier.
  • the roles in the BGP neighbor relationship in the pull mode include: the route receiver in the pull mode, the route sender in the pull mode, or the route sender and the route receiver in the pull mode.
  • the first network device before the first network device sends the request message to the second network device, the first network device saves a first route to the second network device, and the first network device saves the first route to the second network device.
  • a route is used to instruct the first network device to send traffic destined for the other network device to the second network device.
  • the first route is a default route or an aggregated route.
  • the apparatus may further include: a second receiving unit, a first determining unit, and a third sending unit.
  • the second receiving unit is configured to receive a first packet, where the first packet is a packet destined for a third network device, and the third network device belongs to the at least one other network device; the first determines a unit, configured to determine that the first packet matches the first route; and a third sending unit, configured to send the first packet to the second network device according to the first route.
  • the route to the at least one other network device includes a second route to the third network device
  • the apparatus may further include: a third receiving unit, a second determining unit and the fourth sending unit.
  • the third receiving unit is configured to, after receiving the routing message sent by the second network device in response to the request message, receive a second packet, where the second packet is destined for the third a packet of a network device; the second determining unit is configured to determine that the second packet matches the second route; and a fourth sending unit is configured to send a message to the third network according to the second route The device sends the second packet.
  • the first condition includes at least one of the following conditions: the first network device determines that the network status of the at least one other network device satisfies the second condition; the first There is an optimization requirement for the service type from the network device to the at least one other network device; the first network device receives an indication message, where the indication message is used to instruct the first network device to request a service from the at least one other network device. routing.
  • the second condition includes at least one of the following conditions: the traffic from the first network device to the at least one other network device is greater than or equal to a first threshold; or, the first network device to the The delay of at least one other network device is greater than or equal to the second threshold.
  • the request message may include identification information of the at least one other network device, and the identification information includes a prefix of the at least one other network device, or, reaching the at least one other network device The AS number of at least one autonomous domain that the path traverses.
  • the request message may filter ORF request messages for outbound routing.
  • the ORF request message may include a type field, and the value of the type field indicates that the ORF request message includes an incremental ORF field.
  • routing device provided in the third aspect is used to perform the related operations mentioned in the first aspect.
  • an embodiment of the present application further provides a routing apparatus, the apparatus is applied to a second network device, and the apparatus may include: a first receiving unit and a first sending unit.
  • the first receiving unit is configured to receive a request message sent by a first network device, where the request message is used to request a route to at least one other network device, and both the first network device and the other network device are connected to the The second network device is connected; the first sending unit is configured to send a routing message to the first network device in response to the request message, where the routing message carries a route to the at least one other network device.
  • the border gateway protocol BGP neighbor relationship in pull mode is between the first network device and the second network device, and the first network device is the route receiver in the pull mode, so
  • the second network device is the route sender in the pull mode, the second network device sends the first route to the second network device to the first network device, and the first route is used to indicate
  • the first network device sends traffic destined for the other network device to the second network device; the first network device sends a request message to the second network device based on the first condition, the The second network device sends a route to the at least one other network device to the first network device in response to the request message.
  • the apparatus may further include a second sending unit.
  • the second sending unit is configured to send a negotiation message including a role identifier to the first network device before establishing the BGP neighbor relationship in the pull mode with the first network device, and the negotiation message
  • the text is used to indicate that the role of the second network device in the BGP neighbor relationship in the pull mode will be the role indicated by the role identifier.
  • the roles in the BGP neighbor relationship in the pull mode include: the route receiver in the pull mode, the route sender in the pull mode, or the route sender and the route receiver in the pull mode.
  • the apparatus may further include a third sending unit.
  • the third sending unit is configured to, before receiving the request message sent by the first network device, send to the first network device a first route to the second network device, where the first route is used to indicate the The first network device sends traffic destined for the other network device to the second network device.
  • the first route may be a default route or an aggregated route.
  • the apparatus may further include a second receiving unit and a fourth sending unit.
  • the second receiving unit is configured to receive a first packet sent by the first network device, where the first packet is a packet destined for a third network device, and the third network device belongs to the at least one one other network device; and a fourth sending unit, configured to send the first packet to the third network device.
  • the request message includes identification information of the at least one other network device, and the identification information includes a prefix of the at least one other network device, or the request message includes information reaching the at least one other network device.
  • the identification information includes a prefix of the at least one other network device, or the request message includes information reaching the at least one other network device.
  • the request message may filter ORF request messages for outbound routing.
  • the ORF request message includes a type field, and the value of the type field is used to indicate that the type of the ORF request message is an incremental ORF request message.
  • the incremental ORF field carries the identification information of the at least one other network device, and the incremental ORF field is used to request the second network
  • the device increment sends a route corresponding to the identification information reaching the at least one other network device to the first network device
  • the apparatus may further include: a first processing unit configured to determine the increase If the first sequence number Sequence in the quantitative ORF field does not match all the sequence numbers in the sequence number set on the second network device, then save the first sequence number and the sequence number carried in the incremental ORF field.
  • the ORF request message includes an incremental ORF field
  • the incremental ORF field carries the identification information of the at least one other network device
  • the incremental ORF field is used to request the second
  • the network device incrementally sends, to the first network device, a route corresponding to the identification information reaching the at least one other network device
  • the apparatus may further include: a second processing unit configured to determine the The first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device, then the identifier of the at least one other network device carried in the incremental ORF field is used The information replaces the content corresponding to the second serial number.
  • the incremental ORF field is used to request the second network device to incrementally send to the first network device a route corresponding to the identification information reaching the at least one other network device.
  • the apparatus may further include: a third processing unit, the third processing unit is configured to determine whether the first sequence number Sequence in the incremental ORF field is the same as that already existing on the second network device. If the second sequence number matches and a deletion instruction is obtained according to the incremental ORF field, the content corresponding to the second sequence number is deleted.
  • the first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device, for example, it may mean that the first sequence number is the same as the second sequence number stored on the second network device; the The first sequence number Sequence in the incremental ORF field matches all existing sequence numbers on the second network device, for example, it may mean that the first sequence number is different from all sequence numbers stored on the second network device.
  • routing device provided in the fourth aspect is used to perform the relevant operations mentioned in the second aspect above.
  • an embodiment of the present application further provides a first network device, including: a memory and a processor.
  • the memory is used for storing program codes or instructions; the processor is used for running the program codes or instructions, so that the first network device executes the method provided in the first aspect above.
  • an embodiment of the present application further provides a second network device, including: a memory and a processor.
  • the memory is used for storing program codes or instructions; the processor is used for running the program codes or instructions, so that the second network device executes the method provided in the second aspect above.
  • embodiments of the present application also provide a computer-readable storage medium, where program codes or instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer can execute the first aspect or the second A method provided in any possible implementation manner provided by the aspect.
  • an embodiment of the present application further provides a computer program product, which, when the computer program product runs on a network device, enables the network device to perform any one of the possible implementations of the first aspect or the second aspect.
  • the present application provides a first network device, where the first network device includes: a main control board and an interface board.
  • the main control board includes: a first processor and a first memory.
  • the interface board includes: a second processor, a second memory and an interface card. The main control board and the interface board are coupled.
  • the first memory may be used for storing program codes
  • the first processor is used for calling the program codes in the first memory to perform the following operations: determining that the first message matches the first route, and so on.
  • the second memory can be used to store program codes
  • the second processor is used to call the program codes in the second memory to trigger the interface card to perform the following operations: based on satisfying the first condition, send a request message to the second network device, the request message for requesting a route to at least one other network device, the first network device and the other network device are both connected to the second network device; receiving the route sent by the second network device in response to the request message message, where the route to the at least one other network device is carried in the routing message.
  • an inter-process communication (inter-process communication, IPC) channel is established between the main control board and the interface board, and the main control board and the interface board communicate through the IPC channel.
  • IPC inter-process communication
  • the present application provides a second network device, where the second network device includes: a main control board and an interface board.
  • the main control board includes: a first processor and a first memory.
  • the interface board includes: a second processor, a second memory and an interface card. The main control board and the interface board are coupled.
  • the first memory can be used to store program codes
  • the first processor is used to call the program codes in the first memory to perform the following operations: determine that the first sequence number Sequence in the incremental ORF field is the same as that already on the second network device. If all the sequence numbers in the sequence number set do not match, the corresponding relationship between the first sequence number and the identification information of the at least one other network device carried in the incremental ORF field is stored, and so on.
  • the second memory may be used to store program codes
  • the second processor may be used to call the program codes in the second memory to trigger the interface card to perform the following operations: receive a request message sent by the first network device, where the request message is used to request at least one A route for another network device, the first network device and the other network device are both connected to the second network device; in response to the request message, a routing message is sent to the first network device, and the route The message carries a route to the at least one other network device.
  • an inter-process communication (inter-process communication, IPC) channel is established between the main control board and the interface board, and the main control board and the interface board communicate through the IPC channel.
  • IPC inter-process communication
  • the present application provides a chip, including a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory to execute the first aspect or the second aspect above.
  • the above chip only includes a processor, and the processor is configured to read and execute the computer program stored in the memory, and when the computer program is executed, the processor executes the method in the first aspect or the second aspect.
  • an embodiment of the present application further provides a network system, where the network system may include a first network device and a second network device.
  • the first network device is configured to execute the method in the first aspect; and the second network device is configured to execute the method in the second aspect.
  • FIG. 1 is a schematic structural diagram of a network scenario in an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a routing method 100 provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a TLV field carrying a role identifier in a negotiation message according to an embodiment of the present application
  • FIG. 5 is a schematic diagram of a specific value corresponding to an incremental ORF type in an embodiment of the application.
  • FIG. 6 is a schematic structural diagram of a routing device 600 in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a routing device 700 according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a network device 800 in an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a network device 900 in an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a network system 1000 in an embodiment of the present application.
  • the network scenario includes a network device 101 , a network device 102 , . . . , a network device 10N, and a network device 201 , where N is an integer greater than 1.
  • the network device 101 , the network device 102 , . . . , and the network device 10N are respectively connected to the network device 201 .
  • the network device 101, the network device 102, . that is, an intermediate network device also exists between these network devices and the network device 201 .
  • the network device 201 may be a core device, and the network device 101 , network device 102 , .
  • Device A, the network device 104 is connected to user equipment B, and the traffic of user equipment A needs to reach user equipment B as an example for description below.
  • the routes of the network devices are fully intercommunicated, that is, the routes of each network device in the network device 101, the network device 102, . . . , and the network device 10N are spread to Other network devices, for example, the network device 101 sends its own route 1 to the network device 201, and the network device 201 sends the route 1 reaching the network device 101 to the network device 102 to the network device 10N respectively.
  • the network device 101 needs to save all routes reaching the network device 102 to the network device 10N. With the continuous expansion of the network scale, the number of N continues to increase.
  • each network device Even if each network device only generates one route, each network device also needs to save a large number of routes.
  • network devices 101 to network devices 10N These network devices close to the user side are usually deployed with relatively low-end devices.
  • the hardware capacity of low-end devices is relatively small, and it is impossible to save so many routes in a large-scale network.
  • the route advertisement can also be performed by using a default route or an aggregated route, that is, the network device 201 only has Advertise the default route or aggregated route to network device 201 to each network device in network device 101 to network device 10N, and each network device in network device 101 to network device 10N only maintains the default route or aggregated route to network device 201
  • the routing effectively reduces the number of routes that need to be saved on each network device in the network device 101 to the network device 10N, and reduces the storage requirements for these low-end devices.
  • network device 101 can match the destination address of packet 1 to reach the network
  • the default route 2 (or aggregated route 2) of the device 201 sends the packet 1 to the network device 201 according to the default route 2 (or the aggregated route 2); after receiving the packet 1, the network device 201 can The destination address matches the route 3 reaching the network device 104, and the packet 1 is sent to the network device 104 according to the route 3, and the network device 104 sends the packet 1 to the user equipment B.
  • the default route (English: Default Route) is a special static route.
  • the default route has a route prefix of 0.0.0.0 and a subnet mask of 0.0.0.0 in the routing table.
  • the aggregated route is that the second network device aggregates several routes saved on it to obtain an aggregated route.
  • the prefix of the aggregated route can cover the prefixes of the above-mentioned several routes, so that the traffic matching the above-mentioned several routes can also match the aggregated route.
  • the size of the routing table in each network device can be reduced, the memory can be saved, and the time required for operations such as analysis and table lookup during packet forwarding can be reduced.
  • an embodiment of the present application provides a routing method.
  • a default route or an aggregated route to the second network device is stored on the first network device.
  • the first network device as the traffic sender sends a request message to the second network device, requesting a route to at least one other network device; then, in response to the request message, the second network device can send the traffic to the
  • the first network device of the party sends a routing message, where the routing message carries a route to the at least one other network device.
  • the method provided by this embodiment of the present application may include, for example: in the first stage, the network device 201 notifies each network device in the network device 101 to the network device 10N about the arrival of the network device 201 respectively.
  • Default route 2 (or aggregated route 2), in this stage, user equipment A sends packet 1 to user equipment B connected to network device 104 through network device 101.
  • route 3 to network device 104 can be matched according to the destination address of message 1, and message 1 is sent to network device 104 according to route 3, and then network device 104 sends message 1 to user equipment B.
  • the network device 101 sends a request message for requesting route 4 to the network device 104 to the network device 201.
  • the network device 201 After receiving the request message, the network device 201 responds by: Send route 4 to network device 104 to network device 101; after network device 101 receives route 4 to network device 104, network device 101 can save default route 2 (or aggregated route 2) to network device 201 and reach Route 4 of the network device 104; in this stage, the user equipment A sends the packet 2 to the user equipment B connected to the network device 104 through the network device 101. After the network device 101 receives the packet 2, it can The destination address matches the route 4 reaching the network device 104, and the packet 2 is sent to the network device 104 according to the route 4, and the network device 104 sends the packet 1 to the user device B.
  • the network device 101 After the network device 101 receives the packet 2, it can The destination address matches the route 4 reaching the network device 104, and the packet 2 is sent to the network device 104 according to the route 4, and the network device 104 sends the packet 1 to the user device B.
  • the route is dynamically advertised according to the demand, which not only solves the problem that the full route advertisement method has high requirements on each network device, but also overcomes the traffic flow.
  • the load pressure brought by the default route or the aggregated route to the network device 201 realizes flexible route advertisement.
  • the network architecture applicable to the embodiments of the present application may be referred to as a centralized network architecture, for example, may include a central device and multiple distributed devices, and a central device and each distributed devices are connected.
  • the central device in the centralized network architecture may also be referred to as the core device of the network.
  • the network device 201 may be the controller 201, the network device 101 to the network device 10N may be the forwarding device 101 to the forwarding device 10N, and each forwarding device establishes a communication connection with the controller 201,
  • the controller 201 is responsible for controlling or managing each forwarding device.
  • the network device 201 can be the central hub 201, the network device 101 to the network device 10N can be the backbone spines 101 to 10N, each spine establishes a communication connection with the hub 201, and the hub 201, as the central device, is responsible for controlling each spine , manage or forward the packets of each spine.
  • the network device 201 can also be the backbone spine 201, and the network device 101 to the network device 10N can be leaf leaves 101 to 10N. Each leaf establishes a communication connection with the spine 201. Control, manage, or forward packets of each Leaf.
  • the network device 201 may be a virtual extended local area network (English: Virtual eXtensible Local Area Network, abbreviated as: VXLAN) gateway 201, and the network device 101 to the network device 10N may be the endpoint device 101 to the endpoint device 10N.
  • the VXLAN gateway 201 establishes a communication connection, and as a central device, the VXLAN gateway 201 is responsible for forwarding the packets sent by each endpoint device.
  • the network device 201 may be a control plane (English: Control Plane, referred to as: CP) device 201, and the network devices 101 to 10N may be user plane (English: User Plane, referred to as: UP) devices 101 to UP devices 10N , each UP device establishes a communication connection with the CP device 201, and the CP device 201, as a central device, is responsible for controlling and managing each UP device or forwarding the messages of each UP device.
  • CP Control Plane
  • UP User Plane
  • the network device involved in the embodiments of the present application may refer to any physical device capable of implementing a message forwarding function, such as a switch, a router, etc.; or, a network device capable of message forwarding Functional boards, chips, etc.
  • the second network device or network device 201 may also be a control management entity, that is, any device or functional entity capable of controlling the network device, such as a network cloud engine (English: Network Cloud Engine, Abbreviation: NCE), server or router, etc.; for example, it can also be a functional entity integrated in any network device, and the functional entity can be embodied in the form of hardware or software.
  • FIG. 2 is a schematic flowchart of a routing method 100 in an embodiment of the present application.
  • the method 100 describes the embodiment of the present application with an interaction process between a first network device and a second network device.
  • the first network device may be applied to any one of the network devices 101 to 10N shown in FIG. 2 , for example, and the second network device may be applied to the network device 201 shown in FIG. 2 , for example.
  • multiple network devices are respectively directly or indirectly connected to the second network device, the multiple network devices include at least the first network device, and the multiple network devices may also include a third network device.
  • a Border Gateway Protocol (English: Border Gateway Protocol, BGP for short) neighbor relationship is established between the second network device and the first network device, and the second network device saves routes to the multiple network devices; multiple network devices There can be physical connections between them, but the BGP neighbor relationship is not established, and direct packet exchange cannot be performed.
  • the method 100 may, for example, include the following S101 to S104:
  • the first network device Based on satisfying the first condition, the first network device sends a request message to the second network device, where the request message is used to request a route to at least one other network device.
  • the second network device receives the request message sent by the first network device.
  • the first network device and the second network device in the network may be configured as a BGP neighbor relationship in a pull (English: pull) mode, which may also be referred to as a BGP neighbor relationship in a request mode or a BGP neighbor relationship in a subscription mode. relation.
  • the network devices that belong to the BGP neighbor relationship in pull mode can have different roles.
  • the first network device and the second network device in the embodiment of the present application as an example, the first network device may be a route receiver in pull mode, and the second network device may be a route sender in pull mode.
  • the network device may send to the first network device a first route to the second network device, where the first route is used to instruct the first network device to send traffic destined for the other network device to the second network device; the first network device The device may also send a request message to the second network device based on the first condition, and the second network device sends a route to the at least one other network device to the first network device in response to the request message.
  • the role of the network device that belongs to the BGP neighbor relationship in pull mode can be statically configured through command lines. For example, by configuring command line 1 on the first network device to specify that the first network device is a route in pull mode The receiver, by configuring the command line 2 on the second network device, specifies that the second network device is the route sender in the pull mode.
  • the role of the network device belonging to the BGP neighbor relationship in pull mode may also be dynamically determined through negotiation. For example, before the BGP neighbor relationship in pull mode is established between the first network device and the second network device, The first network device sends a first negotiation packet including a first role identifier to the second network device, where the first negotiation packet is used to indicate that the role of the first network device in the BGP neighbor relationship in pull mode will be the first role indicated by the first role identifier, and the second network device sends a second negotiation packet including the second role identifier to the first network device, where the second negotiation packet is used to indicate the second network The role of the device in the BGP neighbor relationship in pull mode will be the role indicated by the second role identifier.
  • the first role identifier included in the first negotiation packet indicates that the first network device is a route receiver in pull mode
  • the second role identifier included in the second negotiation packet indicates that the first network device is a router in pull mode.
  • the route sender, the first network device determines, according to the first negotiation packet and the second negotiation packet, that in the BGP neighbor relationship in pull mode established with the second network device, its role is to receive routes in pull mode.
  • the role of the second network device is the routing sender in pull mode.
  • the negotiation message can be, for example, a BGP start (English: OPEN) message, and the BGP OPEN message is the first message that needs to be sent when establishing a BGP neighbor relationship, and is used to negotiate one of the two network devices that are to establish a BGP neighbor relationship. Whether there is a capability available at both ends.
  • the type length value (English: Type Length Value, TLV for short) field in the BGP OPEN message can be used to carry its own role identifier.
  • TLV field that carries the role identifier in the BGP OPEN message please refer to As shown in FIG.
  • the TLV field may include: a 1-byte Capability Code (English: Capability Code) field, a 1-byte Capability Length (English: Capability Length) field, and a variable-length Capability Value (English: Capability Value) ) field, wherein the value of the Capability Code field can be any value allocated by the Internet Engineering Task Force (English: The Internet Engineering Task Force, referred to as: IETF) to indicate the type of the TLV field, indicating that the TLV field
  • the Capability Value field carries the role identifier of the network device that sends the BGP OPEN message; the value of the Capability Length field is used to indicate the length of the Capability Value field; the value of the Capability Value field is used to indicate the network sending the BGP OPEN message
  • the route receiver (also called the client client) refers to the default route or aggregated route that is only saved to the route sender network device in the initial state.
  • the route sender (also called the server server) refers to the role that saves detailed routes to all route receiver network devices, but only sends detailed routes after receiving a request message from the route receiver network device.
  • the role of a network device in a BGP neighbor relationship in pull mode can be determined according to the capabilities of the network device in a specific BGP neighbor relationship. In different BGP neighbor relationships, a network device can have two different roles, or can have the same role. a role.
  • the first network device in the pull mode BGP neighbor relationship between the first network device and the second network device, the first network device may be the route receiver in pull mode, and the second network device may be the route sender in pull mode, but the second network device may be the route sender in pull mode.
  • the second network device In the pull mode BGP neighbor relationship between the network device and the fourth network device, the second network device may be the route receiver in pull mode, and the fourth network device may be the route sender in pull mode.
  • the role of the first network device It can be a route receiver in pull mode
  • the role of the second network device can be either a route receiver in pull mode or a route sender in pull mode
  • the fourth network device can be a route sender in pull mode.
  • the first network device and the second network device in the network can also be configured as a conventional BGP neighbor relationship, and the following process is implemented through the configuration on the first network device and the second network device:
  • Initialization the second network device may send the first route to the second network device to the first network device, where the first route is used to instruct the first network device to send the traffic destined for the other network device to the second network device; the first network device may also send a request message to the second network device based on the first condition, and the second network device sends a route to the at least one other network device to the first network device in response to the request message.
  • an instruction set 1 on the second network device where the instruction set 1 is used to instruct the second network device to send only the first network device and other network devices that belong to the same location as the first network device to the first network device in the initial state.
  • the default route or aggregated route of the network device is sent only after receiving a request message from the first network device or other network devices that belong to the same location as the first network device;
  • An instruction set 2 is configured on other network devices that belong to the same location, and the instruction set 2 is used to instruct the first network device or other network devices that belong to the same location as the first network device to only save the defaults of the second network device in the initial state.
  • the second network device sends a first route to the first network device, where the first route is used to instruct the first network device to send the traffic destined for the other network device to the second network device,
  • the first network device receives and saves the first route.
  • the first route may be a default route or an aggregated route.
  • the default route is a special static route.
  • a network device sends the packet to a specified location (in this embodiment of the present application, it is sent to a second network device) according to a default route.
  • the default route in the routing table has a route prefix of 0.0.0.0 and a subnet mask of 0.0.0.0.
  • the code is 0.0.0.0.
  • the aggregated route is that the second network device aggregates several routes saved on it to obtain an aggregated route.
  • the prefix of the aggregated route can cover the prefixes of the above-mentioned several routes, so that the traffic matching the above-mentioned several routes can also match the aggregated route.
  • the size of the routing table in each network device can be reduced, the memory can be saved, and the time required for operations such as analysis and table lookup during packet forwarding can be reduced.
  • this embodiment of the present application may further include: S105, the first network device sends the third network device to the third network device through the second network device according to the first route. Send the first packet, where the third network device is any one of the other network devices that belong to the same location as the first network device, for example, the network device 104 shown in FIG. 1 .
  • S105 may, for example, include: S1051, the first network device receives a first packet, where the first packet is a packet destined for the third network device; S1052, the first network device determines whether the first packet is related to the The first route is matched; S1053, the first network device sends the first packet to the second network device according to the first route.
  • the first network device may determine, from the routing table of the first network device, a routing entry that matches the destination address of the first packet, and determines that the routing entry that matches the destination address of the first packet is: first route.
  • S105 may further include: S1054, the second network device receives the first packet; S1055, the second network device determines a third route according to the destination address of the first packet, wherein the third route corresponds to The prefix in the routing entry matches the destination address of the first packet; S1056, the second network device sends the first packet to the third network device according to the third route.
  • the first condition may be a trigger condition preconfigured on the first network device to request a detailed route, and only one first condition may be configured on the first network device, and the first condition is applicable to trigger the request to any of all other network devices.
  • a detailed route of a network device can also be configured on the first network device, and each first condition is applicable to a detailed route that triggers a request to a corresponding part of the network device, for example, the network device shown in Figure 1 On 101, (N-1) first conditions are configured, and each first condition corresponds to a network device.
  • the first condition 1 is used to trigger the detailed route of the request to the network device 102
  • the first condition 2 is used to trigger the request Detailed routing to network device 104 .
  • the first condition may include at least one of the following conditions: the first network device determines that the network status of at least one other network device satisfies the second condition; the service type from the first network device to at least one other network device exists Optimization requirements; the first network device receives an indication message, where the indication message is used to instruct the first network device to request a route to at least one other network device.
  • the first network device may include a traffic statistics module, a policy processing module and a BGP module.
  • the traffic statistics module is used to collect statistics on the traffic sent and received by the first network device
  • the policy processing module is used to determine whether to execute S101 according to the statistics result of the traffic statistics module and the preset second condition, and if necessary, to The identification information of at least one other network device to be requested is sent to the BGP module, and the BGP module is used to generate the request message in S101.
  • the identification information of the at least one network device may be the prefix of the at least one other network device, or, it may also be at least one autonomous domain (English: Autonomous System, referred to as the at least one autonomous domain that the path to the at least one other network device passes through). : AS) number.
  • the second condition may include, for example, at least one of the following conditions: the traffic from the first network device to the at least one other network device is greater than or equal to a first threshold (eg, 500 gigabytes (GB)); or, The delay from the first network device to the at least one other network device is greater than or equal to a second threshold (eg, 30 milliseconds (ms)). It should be noted that the second condition can be flexibly configured according to actual needs.
  • the first network device may include a BGP module, and the traffic statistics module and the policy processing module are integrated in other devices, and the other devices are used to monitor the traffic of the first network device and perform policy processing.
  • the device determines that the traffic sent and received by the first network device meets the preset third condition, then generates and sends an indication message to the first network device, and the BGP module of the first network device generates the request message in S101 based on the indication message.
  • the traffic monitoring module and the policy processing module in this example may be inherited in another device, or may be integrated in different devices respectively.
  • the third condition can be flexibly configured according to actual needs, and the third condition may be the same as the second condition, or may be different from the second condition.
  • the first network device may also trigger the execution of S101 when there is an optimization requirement for the service type of at least one other network device. For example, there is an important online conference between the first network device and the third network device. To ensure the quality of the online conference, the audio service needs to be optimized. Detailed routing.
  • the request message in S101 may carry the requested identification information of the at least one other network device, where the identification information includes the prefix of the at least one other network device, or, where the path to the at least one other network device is located.
  • the request message may be an outbound route filtering (English: Outbound Route Filtering, ORF for short) request message.
  • the ORF request message may include a type field, and the value of the type field is used to indicate that the type of the ORF request message is an incremental ORF request message.
  • the incremental ORF request message may further include an incremental ORF field, where the incremental ORF field is used to carry the identification information of the at least one other network device, and the incremental ORF field is used to request the first
  • the second network device incrementally sends, to the first network device, a route corresponding to the identification information reaching the at least one other network device.
  • the incremental ORF field in the ORF request message is shown in FIG.
  • the 4 may include: a type (English: Type) field, an incremental ORF type (English: Embedded ORF Type) field, and a specific corresponding to the incremental ORF type.
  • Value (English: Embedded ORF Type Specific Value) field, where the value of the type field is used to indicate that the ORF request message includes an incremental ORF field; the value of the incremental ORF type field is used to indicate the incremental ORF
  • the routes saved on the second network device are sorted according to the Sequence value. Therefore, the value of the Sequence field in the request message is used to index the routing entries on the second network device; the value of the Minlen field is used to indicate that the shortest prefix includes Bit (English: bit); the value of the Maxlen field is used to indicate the bits included in the longest prefix; the value of the Length field is used to indicate the length of the prefix; the value of the Prefix field is the prefix address of the network device used for the requested route, Such as the prefix of the third network device.
  • the second network device saves the correspondence between the sequence number and the identification information, which is used to record the situation that the second network device advertises the route.
  • the correspondence between the serial number and the identification information stored by the second network device is shown in Table 1 below:
  • the second network device determines that the value of the sequence number field in the incremental ORF field does not match the existing sequence number on the second network device, the second network device saves the incremental ORF The corresponding relationship between the value of the sequence number field in the field and the identification information of the at least one other network device carried in the incremental ORF field. For example, if the sequence number field in the incremental ORF field in the request message is 1, and the identification information is the prefix of the third network device, then, after the second network device receives the request message, the stored correspondence between the sequence number and the identification information It can be shown in Table 2 below:
  • the second network device determines that the value of the sequence number field in the incremental ORF field matches an existing sequence number on the second network device, and the incremental ORF field carries the identification information of at least one other network device
  • the second network device replaces the content corresponding to the matched existing sequence number with the identification information of the at least one other network device carried in the incremental ORF field. For example, if the sequence number field in the incremental ORF field in the request message is 3, and the identification information is the prefix of the third network device, the second network device stores the sequence number after receiving the request message based on Table 1.
  • Table 3 The corresponding relationship with the identification information can be shown in Table 3 below:
  • determining the deletion indication according to the incremental ORF field may mean that the incremental ORF field includes indication information, and the indication information is used to instruct deletion of the content corresponding to the serial number in the incremental ORF field.
  • Table 4 the sequence number and identification
  • the extended incremental ORF type field in the ORF request message does not need to fully update all routes when requesting a route, but only performs targeted processing for the requested route. , which effectively reduces the network resource overhead in the routing request process and improves the efficiency of routing publication.
  • the second network device After the second network device receives the request message sent by the first network device, it can parse the request message to determine that the first network device needs to request a route to at least one other network device, so as to provide a targeted route for the subsequent second network device.
  • the routing required to send the first network device provides the data basis.
  • the second network device In response to the request message, the second network device sends a routing message to the first network device, where the routing message carries a route to the at least one other network device.
  • the first network device receives the routing message sent by the second network device in response to the request message.
  • the routing message generated by the second network device may carry the second route of the third network device, and the routing message can be sent to the third network device.
  • the routing message is sent to the first network device.
  • the first network device obtains and saves the second route according to the routing message, for example, the first network device replaces the first route in the routing entry whose prefix matches the address of the third network device with the second route.
  • the embodiment of the present application may further include: S106, the first network device sends the second packet to the third network device according to the second route.
  • S106 may, for example, include: S1061, the first network device receives a second packet, where the second packet is a packet destined for the third network device; S1062, the first network device determines that the second packet is the same as the second packet. The second route is matched; S1063, the first network device sends the second packet to the third network device according to the second route.
  • the first network device may determine, from the routing table of the first network device, a routing entry that matches the destination address of the second packet, and determines that the routing entry that matches the destination address of the second packet is: Second route.
  • the routing message generated by the second network device may carry the third route of the AS 100, and sends the routing message to the first network device.
  • the first network device obtains and saves the third route according to the routing message, for example, the first network device replaces the first route in the routing entry whose prefix matches the address of the network device in AS 100 with the third route .
  • the embodiment of the present application may further include: S107, the first network device sends a third packet to the AS 100 according to the third route.
  • S107 may, for example, include: S1071, the first network device receives a third packet, where the third packet is a packet destined for the AS 100; S1072, the first network device determines whether the third packet is the same as the third packet. Three routes are matched; S1073, the first network device sends the third packet to the AS 100 according to the third route.
  • the border device receiving the third packet can send the third packet to the destination device of the third packet in AS 100 based on the destination address of the third packet .
  • the first network device as the traffic sender sends a request message to the second network device, requesting a route to at least one other network device; then, in response to the request message, the second network device can send a request to the second network device of the traffic sender
  • a network device sends a routing message, where the routing message carries a route to the at least one other network device.
  • an embodiment of the present application further provides a routing apparatus 600, the apparatus 600 having any function of the network device 101 in the example shown in FIG. 1 or the first network device in the method 100 shown in FIG. 2 .
  • the apparatus 600 is applied to a first network device, and may include: a first sending unit 601 and a first receiving unit 602 .
  • the first sending unit 601 is configured to send a request message to the second network device based on satisfying the first condition, where the request message is used to request a route to at least one other network device, the first network device and the All other network devices are connected to the second network device.
  • the first sending unit 601 may execute S101 shown in FIG. 2 .
  • the first receiving unit 602 is configured to receive a routing message sent by the second network device in response to the request message, where the routing message carries a route to the at least one other network device.
  • the first receiving unit 602 may perform S104 shown in FIG. 2 .
  • a border gateway protocol BGP neighbor relationship in pull mode is established between the first network device and the second network device, and the first network device is a route receiver in the pull mode , the second network device is the route sender in the pull mode, the second network device sends the first route to the second network device to the first network device, and the first route uses instructing the first network device to send traffic destined for the other network device to the second network device; the first network device sends a request message to the second network device based on the first condition, The second network device sends a route to the at least one other network device to the first network device in response to the request message.
  • the apparatus 600 may further include a second sending unit.
  • the second sending unit is configured to send a negotiation message including a role identifier to the second network device before establishing the BGP neighbor relationship in the pull mode with the second network device, and the negotiation message
  • the text is used to indicate that the role of the first network device in the BGP neighbor relationship in the pull mode will be the role indicated by the role identifier.
  • the roles in the BGP neighbor relationship in the pull mode include: the route receiver in the pull mode, the route sender in the pull mode, or the route sender and the route receiver in the pull mode.
  • the first network device before the first network device sends the request message to the second network device, the first network device saves a first route to the second network device, and the first network device saves the first route to the second network device.
  • a route is used to instruct the first network device to send traffic destined for the other network device to the second network device.
  • the first route is a default route or an aggregated route.
  • the apparatus 600 may further include: a second receiving unit, a first determining unit, and a third sending unit.
  • the second receiving unit is configured to receive a first packet, where the first packet is a packet destined for a third network device, and the third network device belongs to the at least one other network device; the first determines a unit, configured to determine that the first packet matches the first route; and a third sending unit, configured to send the first packet to the second network device according to the first route.
  • a second receiving unit is configured to receive a first packet, where the first packet is a packet destined for a third network device, and the third network device belongs to the at least one other network device; the first determines a unit, configured to determine that the first packet matches the first route; and a third sending unit, configured to send the first packet to the second network device according to the first route.
  • S105 shown in FIG. 2 .
  • the route to the at least one other network device includes a second route to the third network device
  • the apparatus 600 may further include: a third receiving unit, a second determining unit and the fourth sending unit.
  • the third receiving unit is configured to, after receiving the routing message sent by the second network device in response to the request message, receive a second packet, where the second packet is destined for the third a packet of a network device; the second determining unit is configured to determine that the second packet matches the second route; and a fourth sending unit is configured to send a message to the third network according to the second route The device sends the second packet.
  • S106 shown in FIG. 2 .
  • the first condition includes at least one of the following conditions: the first network device determines that the network status of the at least one other network device satisfies the second condition; the first There is an optimization requirement for the service type from the network device to the at least one other network device; the first network device receives an indication message, where the indication message is used to instruct the first network device to request a service from the at least one other network device. routing.
  • the second condition includes at least one of the following conditions: the traffic from the first network device to the at least one other network device is greater than or equal to a first threshold; or, the first network device to the The delay of at least one other network device is greater than or equal to the second threshold.
  • the request message may include identification information of the at least one other network device, and the identification information includes a prefix of the at least one other network device, or, reaching the at least one other network device The AS number of at least one autonomous domain that the path traverses.
  • the request message may filter ORF request messages for outbound routing.
  • the ORF request message may include a type field, and the value of the type field indicates that the ORF request message includes an incremental ORF field.
  • the above-mentioned units with the same function but different serial numbers in the naming may be a unit capable of realizing this function.
  • the above-mentioned first sending unit 601 and the second sending unit may be the same unit with sending function.
  • the routing apparatus 600 shown in FIG. 6 may be the network device 101 in the embodiment shown in FIG. 1 or the first network device in the example shown in FIG.
  • the routing apparatus 600 shown in FIG. 6 may be the network device 101 in the embodiment shown in FIG. 1 or the first network device in the example shown in FIG.
  • Embodiments of the present application further provide a routing apparatus 700, the apparatus 700 having any function of the network device 201 in the example shown in FIG. 1 or the second network device in the method 100 shown in FIG. 2 .
  • the apparatus 700 is applied to a second network device, and may include: a first receiving unit 701 and a first sending unit 702 .
  • the first receiving unit 701 is configured to receive a request message sent by a first network device, where the request message is used to request a route to at least one other network device, the first network device and the other network device are both connected to The second network device is connected.
  • the first receiving unit 701 may execute S102 shown in FIG. 2 .
  • the first sending unit 702 is configured to, in response to the request message, send a routing message to the first network device, where the routing message carries a route to the at least one other network device.
  • the first sending unit 702 may execute S103 shown in FIG. 2 .
  • the border gateway protocol BGP neighbor relationship in pull mode is between the first network device and the second network device, and the first network device is the route receiver in the pull mode, so
  • the second network device is the route sender in the pull mode, the second network device sends the first route to the second network device to the first network device, and the first route is used to indicate
  • the first network device sends traffic destined for the other network device to the second network device; the first network device sends a request message to the second network device based on the first condition, the The second network device sends a route to the at least one other network device to the first network device in response to the request message.
  • the apparatus 700 may further include a second sending unit.
  • the second sending unit is configured to send a negotiation message including a role identifier to the first network device before establishing the BGP neighbor relationship in the pull mode with the first network device, and the negotiation message
  • the text is used to indicate that the role of the second network device in the BGP neighbor relationship in the pull mode will be the role indicated by the role identifier.
  • the roles in the BGP neighbor relationship in the pull mode include: the route receiver in the pull mode, the route sender in the pull mode, or the route sender and the route receiver in the pull mode.
  • the apparatus 700 may further include a third sending unit.
  • the third sending unit is configured to, before receiving the request message sent by the first network device, send to the first network device a first route to the second network device, where the first route is used to indicate the The first network device sends traffic destined for the other network device to the second network device.
  • the first route may be a default route or an aggregated route.
  • the apparatus 700 may further include a second receiving unit and a fourth sending unit.
  • the second receiving unit is configured to receive a first packet sent by the first network device, where the first packet is a packet destined for a third network device, and the third network device belongs to the at least one one other network device; and a fourth sending unit, configured to send the first packet to the third network device.
  • S105 in the embodiment shown in FIG. 2 .
  • the request message includes identification information of the at least one other network device, and the identification information includes a prefix of the at least one other network device, or the request message includes information reaching the at least one other network device.
  • the identification information includes a prefix of the at least one other network device, or the request message includes information reaching the at least one other network device.
  • the request message may filter ORF request messages for outbound routing.
  • the ORF request message includes a type field, and the value of the type field is used to indicate that the type of the ORF request message is an incremental ORF request message.
  • the incremental ORF field carries the identification information of the at least one other network device, and the incremental ORF field is used to request the second network
  • the device increment sends a route corresponding to the identification information reaching the at least one other network device to the first network device
  • the apparatus may further include: a first processing unit configured to determine the increase If the first sequence number Sequence in the quantitative ORF field does not match all the sequence numbers in the sequence number set on the second network device, then save the first sequence number and the sequence number carried in the incremental ORF field.
  • the ORF request message includes an incremental ORF field
  • the incremental ORF field carries the identification information of the at least one other network device
  • the incremental ORF field is used to request the second
  • the network device incrementally sends, to the first network device, a route corresponding to the identification information reaching the at least one other network device
  • the apparatus may further include: a second processing unit configured to determine the The first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device, then the identifier of the at least one other network device carried in the incremental ORF field is used The information replaces the content corresponding to the second serial number.
  • the apparatus may further include: a third processing unit, the third processing unit is configured to determine whether the first sequence number Sequence in the incremental ORF field is the same as that already existing on the second network device. If the second sequence number matches and a deletion instruction is obtained according to the incremental ORF field, the content corresponding to the second sequence number is deleted.
  • matching may refer to, for example, the same, and mismatching may refer to, for example, being different.
  • the above-mentioned unit with the same function but different serial number in the name may be a unit capable of realizing the function.
  • the above-mentioned first receiving unit 701 and the second receiving unit may be the same unit with receiving function.
  • the routing apparatus 700 shown in FIG. 7 may be the network device 201 in the embodiment shown in FIG. 1 or the second network device in the example shown in FIG.
  • the routing apparatus 700 shown in FIG. 7 may be the network device 201 in the embodiment shown in FIG. 1 or the second network device in the example shown in FIG.
  • an embodiment of the present application provides a network device 800 .
  • the network device 800 may be the network device in any of the foregoing embodiments, for example, may be the network device 101 in FIG. 1 or the first network device in FIG. 2 , then the network device 800 may implement the first network in the above method 100 function of the device. For another example, it can also be the network device 201 in FIG. 1 or the second network device in FIG. 2 . Then, the network device 800 can implement the function of the second network device in the foregoing method 100 .
  • the network device 800 includes at least one processor 801 , a bus system 802 , a memory 803 and at least one transceiver 804 .
  • the network device 800 is an apparatus with a hardware structure, which can be used to implement the functional modules in the routing apparatus 600 shown in FIG. 6 , and can also be used to implement the functional modules in the routing apparatus 700 shown in FIG. 7 .
  • the first determining unit and the second determining unit in the routing apparatus 600 shown in FIG. 6 can be implemented by calling the code in the memory 803 by the at least one processor 801, and the routing shown in FIG. 6
  • the first sending unit 601 and the first receiving unit 602 in the apparatus 600 can be implemented by the transceiver 804 .
  • the network device 800 may also be used to implement the functions of the network device in any of the foregoing embodiments.
  • processor 801 may be a general-purpose central processing unit (central processing unit, CPU), network processor (network processor, NP), microprocessor, application-specific integrated circuit (application-specific integrated circuit, ASIC) , or one or more integrated circuits used to control the execution of the program of this application.
  • CPU central processing unit
  • NP network processor
  • ASIC application-specific integrated circuit
  • the bus system 802 described above may include a path to transfer information between the above described components.
  • the above transceiver 804 is used to communicate with other devices or communication networks.
  • the above-mentioned memory 803 can be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types of storage devices that can store information and instructions.
  • ROM read-only memory
  • RAM random access memory
  • Types of dynamic storage devices which can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical storage, CD-ROM storage (including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by Any other medium accessed by the computer, but not limited to this.
  • the memory can exist independently and be connected to the processor through a bus.
  • the memory can also be integrated with the processor.
  • the memory 803 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 801 .
  • the processor 801 is used for executing the application program code stored in the memory 803, so as to realize the functions in the method of the present patent.
  • the processor 801 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 8 .
  • the network device 800 may include multiple processors, for example, the processor 801 and the processor 807 in FIG. 8 .
  • Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • FIG. 9 is a schematic structural diagram of another network device 900 provided by an embodiment of the present application.
  • the network device 900 may be, for example, the network device 101 in FIG. 1 or the first network device in FIG. 2 . Then, the network device 900 may implement the above The function of the first network device in the method 100, or, for example, can also be the network device 201 in FIG. 1 or the second network device in FIG. 2, then the network device 900 Function.
  • the network device 900 includes: a main control board 910 and an interface board 930 .
  • the main control board 910 is also called a main processing unit (main processing unit, MPU) or a route processing card (route processor card).
  • the main control board 910 controls and manages each component in the network device 900 Equipment maintenance, protocol processing functions.
  • the main control board 910 includes: a central processing unit 911 and a memory 912 .
  • the interface board 930 is also referred to as a line processing unit (LPU), a line card or a service board.
  • the interface board 930 is used to provide various service interfaces and realize data packet forwarding.
  • the service interface includes, but is not limited to, an Ethernet interface, a POS (Packet over SONET/SDH) interface, etc.
  • the Ethernet interface is, for example, a flexible Ethernet service interface (Flexible Ethernet Clients, FlexE Clients).
  • the interface board 930 includes: a central processing unit 931 , a network processor 932 , a forwarding table entry storage 934 and a physical interface card (ph8sical interface card, PIC) 933 .
  • the central processing unit 931 on the interface board 930 is used to control and manage the interface board 930 and communicate with the central processing unit 911 on the main control board 910 .
  • the network processor 932 is used to implement packet forwarding processing.
  • the network processor 932 may be in the form of a forwarding chip.
  • the processing of the uplink packet includes: processing of the incoming interface of the packet, and searching of the forwarding table; processing of the downlink packet: searching of the forwarding table, and so on.
  • the physical interface card 933 is used to realize the interconnection function of the physical layer, the original traffic enters the interface board 930 through this, and the processed packets are sent from the physical interface card 933 .
  • the physical interface card 933 includes at least one physical interface, and the physical interface is also called a physical port.
  • the physical interface card 933 corresponds to the FlexE physical interface in the system architecture.
  • the physical interface card 933 is also called a daughter card, which can be installed on the interface board 930 and is responsible for converting the photoelectric signal into a message, checking the validity of the message and forwarding it to the network processor 932 for processing.
  • the central processor 931 of the interface board 930 can also perform the functions of the network processor 932 , such as implementing software forwarding based on a general-purpose CPU, so that the network processor 932 is not required in the physical interface card 933 .
  • the network device 900 includes multiple interface boards.
  • the network device 900 further includes an interface board 940 .
  • the interface board 940 includes a central processing unit 941 , a network processor 942 , a forwarding table entry storage 944 and a physical interface card 943 .
  • the network device 900 further includes a switch fabric board 920 .
  • the switch fabric 920 may also be referred to as a switch fabric unit (switch fabric unit, SFU).
  • SFU switch fabric unit
  • the switching network board 920 is used to complete data exchange between the interface boards.
  • the interface board 930 and the interface board 940 can communicate through the switch fabric board 920 .
  • the main control board 910 and the interface board 930 are coupled.
  • the main control board 910 , the interface board 930 , the interface board 940 , and the switching network board 920 are connected to the system backplane through a system bus to achieve intercommunication.
  • an inter-process communication (inter-process communication, IPC) channel is established between the main control board 910 and the interface board 930, and the main control board 910 and the interface board 930 communicate through the IPC channel.
  • IPC inter-process communication
  • the network device 900 includes a control plane and a forwarding plane
  • the control plane includes the main control board 910 and the central processing unit 931
  • the forwarding plane includes various components that perform forwarding, such as the forwarding entry storage 934, the physical interface card 933 and the network processing device 932.
  • the control plane performs functions such as routers, generating forwarding tables, processing signaling and protocol packets, and configuring and maintaining the status of devices.
  • the control plane delivers the generated forwarding tables to the forwarding plane.
  • the network processor 932 based on the The delivered forwarding table forwards the packets received by the physical interface card 933 by looking up the table.
  • the forwarding table issued by the control plane may be stored in the forwarding table entry storage 934 .
  • the control plane and forwarding plane may be completely separate and not on the same device.
  • the network processor 932 may trigger the physical interface card 933 to send a request message to the second network device based on satisfying the first condition, where the request message is used to request at least one other network device.
  • the first network device and the other network devices are connected to the second network device; receiving a routing message sent by the second network device in response to the request message, the routing message carries the Describe the route of at least one other network device.
  • the central processing unit 911 may determine that the first packet matches the first route, and determine that the second packet matches the second route.
  • the network processor 932 may trigger the physical interface card 933 to receive a request message sent by the first network device, where the request message is used to request a route to at least one other network device, the Both the first network device and the other network devices are connected to the second network device; in response to the request message, a routing message is sent to the first network device, and the routing message is carried to the at least one other network Device routing.
  • the central processing unit 911 may execute to determine that the first sequence number Sequence in the incremental ORF field matches the existing second sequence number on the second network device and obtain a deletion instruction according to the incremental ORF field, then, Delete the content corresponding to the second serial number.
  • first sending unit 601 and the first receiving unit 602 in the routing apparatus 600, the first receiving unit 701 and the first sending unit 702 in the routing apparatus 700, and the transceiver 804 in the network device 800 may be equivalent to the network The physical interface card 933 or the physical interface card 943 in the device 900; the first determination unit and the second determination unit in the routing apparatus 600, the first processing unit, the second processing unit and the third processing unit in the routing apparatus 700, and The processor 801 in the network device 800 may be equivalent to the central processing unit 911 or the central processing unit 931 in the network device 900 .
  • the operations on the interface board 940 in the embodiments of the present application are the same as the operations on the interface board 930, and for brevity, details are not repeated here.
  • the network device 900 in this embodiment may correspond to the apparatus or network device for establishing a BGP neighbor in each of the above method embodiments, and the main control board 910 , the interface board 930 and/or the interface board 940 in the network device 900 may The functions and/or various steps implemented in the routing apparatus 600 , the routing apparatus 700 , or the network device 800 in each of the above method embodiments are implemented, and are not repeated here for brevity.
  • main control boards there may be one or more main control boards, and when there are more than one main control board, it may include an active main control board and a backup main control board.
  • a network device may have at least one switching network board, and the switching network board realizes data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices in a distributed architecture are greater than those in a centralized architecture.
  • the form of the network device can also be that there is only one board, that is, there is no switching network board, and the functions of the interface board and the main control board are integrated on this board.
  • the central processing unit on the board can be combined into a central processing unit on this board to perform the functions of the two superimposed, the data exchange and processing capacity of this form of equipment is low (for example, low-end switches or routers and other networks. equipment).
  • the specific architecture used depends on the specific networking deployment scenario.
  • each of the above network devices or network devices may be implemented as virtualized devices.
  • the virtualization device may be a virtual machine (English: Virtual Machine, VM) running a program for sending a message, and the virtual machine is deployed on a hardware device (for example, a physical server).
  • a virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment.
  • the virtual machine can be configured as each network device in FIG. 1 or FIG. 2 .
  • each network device or network device may be implemented based on a general physical server combined with a Network Functions Virtualization (NFV) technology.
  • NFV Network Functions Virtualization
  • Each network device or network device is a virtual host, a virtual router or a virtual switch.
  • the embodiment of the present application also provides a chip, including a processor and an interface circuit, the interface circuit is used to receive instructions and transmit them to the processor; the processor, for example, may be a specific type of the message processing device in the embodiment of the present application
  • the implementation form can be used to execute the above packet processing method.
  • the processor is coupled to a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor, the chip system enables the method in any of the foregoing method embodiments.
  • the number of processors in the chip system may be one or more.
  • the processor can be implemented by hardware or by software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software codes stored in memory.
  • the memory may be integrated with the processor, or may be provided separately from the processor, which is not limited in this application.
  • the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip, or can be provided on different chips.
  • the setting method of the processor is not particularly limited.
  • the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), or an application specific integrated circuit (ASIC). It can be a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller). unit, MCU), it can also be a programmable logic device (PLD) or other integrated chips.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • ASIC application specific integrated circuit
  • CPU central processing unit
  • NP network processor
  • DSP digital signal processing circuit
  • microcontroller microcontroller
  • unit, MCU it can also be a programmable logic device (PLD) or other integrated chips.
  • PLD programmable logic device
  • an embodiment of the present application further provides a network system 1000, see FIG. 10 .
  • the network system 1000 may include a first network device 1001 and a second network device 1002 .
  • the first network device 1001 is configured to perform all operations performed by the first network device in the method 100 shown in FIG. 2 ;
  • the second network device 1002 is configured to perform all operations performed by the second network device in the method 100 shown in FIG. 2 . operate.
  • embodiments of the present application also provide a computer-readable storage medium, where program codes or instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer can execute any of the above embodiments shown in FIG. 2 .
  • embodiments of the present application also provide a computer program product, which, when running on a computer, enables the computer to execute the method of any one of the foregoing method 100 implementations.
  • determining B based on A does not mean that B is only determined according to A, and B can also be determined according to A and/or other information.

Abstract

本申请实施例公开了一种路由方法及相关设备,在第一网络设备确定满足预设的第一条件时,第一网络设备向第二网络设备发送请求消息,请求到至少一个其他网络设备的路由;响应于所述请求消息,第二网络设备向该流量发送方的第一网络设备发送路由消息,该路由消息中携带到所述至少一个其他网络设备的路由,上述第一网络设备和所述其他网络设备均与所述第二网络设备直接或间接的连接。这样,通过按照需求动态的发布路由,既能够解决全量路由通告的方式对接入网络设备的要求较高的问题,又能够降低缺省路由或聚合路由方式给核心网络设备带来的负载压力,实现了灵活的路由发布。

Description

一种路由方法及相关设备
本申请要求于2020年12月31日提交中国国家知识产权局、申请号为202011640118.2、申请名称为“一种路由方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种路由方法及相关设备。
背景技术
在第二网络设备下部署多个第一网络设备的网络场景中,每个第一网络设备的路由都会被扩散到其他网络设备上,即,每个第一网络设备上需要保存其他所有网络设备的路由,这样,虽然能够确保完成业务的分发,但是对于第一网络设备的硬件容量提出了较高要求。例如,对于在核心设备下部署了较多接入设备的网络场景(如大规模园区),较为低端的接入设备一般无法支撑如此高的存储能力要求。为了降低对低端的第一网络设备的要求,目前也采用缺省路由或聚合路由的方式,即,第二网络设备只向各第一网络设备发布一条到达自己的缺省路由或聚合路由,第一网络设备将匹配该缺省路由或聚合路由的所有流量均发送至该第二网络设备,进而由该第二网络设备转发至另一第一网络设备。这样,每个第一网络设备仅仅保存一条到达第二网络设备的缺省路由或聚合路由即可,无需再保存第一网络设备去往所有其他网络设备的明细路由,大大的降低了对第一网络设备的存储能力的要求。但是,该缺省路由或聚合路由的方式下,所有流量均需要从第二网络设备绕行,这样,对于流量较多的情况,会给该第二网络设备造成巨大的负载压力。
基于此,亟待提供一种路由发布机制,既能够使得第一网络设备满足要求,又不给第二网络设备带来较大的负载压力。
发明内容
本申请实施例提供了一种路由方法及相关设备,在第一网络设备上保存到达第二网络设备的缺省路由或聚合路由的基础上,在满足预设条件时,还可以向第二网络设备请求所需的到达某个或某些第一网络设备的路由,实现灵活的路由发布,不仅使得低端的第一网络设备能够支持网络的部署,还能够降低缺省路由或聚合路由方式给第二网络设备带来的负载压力。
第一方面,本申请实施例提供了一种路由方法,该方法在初始状态下,第一网络设备上仅保存到达第二网络设备的缺省路由或聚合路由,在第一网络设备确定满足预设的第一条件时,作为流量发送方的第一网络设备向第二网络设备发送请求消息,请求到至少一个其他网络设备的路由;那么,响应于所述请求消息,第二网络设备即可向该流量发送方的第一网络设备发送路由消息,该路由消息中携带到所述至少一个其他网络设备的路由,其中,所述第一网络设备和所述其他网络设备均与所述第二网络设备直接或间接的连接。这样,通过在缺省路由或聚合路由的基础上按照需求动态的发布路由,既能够解决全量路由通告的方式对第一网络设备以及与第一网络设备处于相同位置的其他网络设备的要求较高的问题,又能够降低缺省路由或聚合路由方式给第二网络设备带来的负载压力,实现了灵活的路由发布。
在一种可能的实现方式中,第一网络设备和第二网络设备之间为拉(英文:pull)模式的边界网关协议(英文:Border Gateway Protocol,简称:BGP)邻居关系,也可以称为请求模式的BGP邻居关系或订阅模式的BGP邻居关系。该pull模式的BGP邻居关系中,第一网络设备可以为pull模式下的路由接收方,第二网络设备为pull模式下的路由发送方,第二网络设备向第一网络设备发送到第二网络设备的第一路由,第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;第一网络设备基于第一条件向第二网络设备发送请求消息,第二网络设备响应于所述请求消息向第一网络设备发送到至少一个其他网络设备的路由。
作为一个示例,属于pull模式的BGP邻居关系的网络设备的角色可以通过命令行等方式进行静态配置。
作为另一个示例,属于pull模式的BGP邻居关系的网络设备的角色也可以通过协商的方式进行动态确定,例如,在第一网络设备和第二网络设备之间建立pull模式的BGP邻居关系之前,第一网络设备向所述第二网络设备发送包括第一角色标识的第一协商报文,该第一协商报文用于指示第一网络设备在pull模式的BGP邻居关系中的角色将为所述第一角色标识所指示的第一角色,并且,第二网络设备向所述第一网络设备发送包括第二角色标识的第二协商报文,该第二协商报文用于指示第二网络设备在pull模式的BGP邻居关系中的角色将为所述第二角色标识所指示的角色。例如,第一协商报文中包括的第一角色标识表明第一网络设备为pull模式下的路由接收方,第二协商报文中包括的第二角色标识表明第一网络设备为pull模式下的路由发送方,则,第一网络设备根据第一协商报文和第二协商报文,确定在与第二网络设备建立的pull模式的BGP邻居关系中,自己的角色为pull模式下的路由接收方,第二网络设备的角色为pull模式的路由发送方。其中,上述协商报文例如可以是BGP开始(英文:OPEN)报文,BGP OPEN报文是建立BGP邻居时需要发送的第一个报文,用于协商待建立BGP邻居关系的两个网络设备之间是否存在两端均可用的能力。
在一种可能的实现方式中,在第一网络设备向第二网络设备发送请求消息之前,第一网络设备上保存有到第二网络设备的第一路由,该第一路由用于指示第一网络设备将去往所述其他网络设备的流量发送到第二网络设备。该第一路由为缺省路由或聚合路由。该实现方式中,本申请实施例提供的方法还可以包括:第一网络设备接收第一报文,第一报文为去往第三网络设备的报文,所述第三网络设备属于所述至少一个其他网络设备;那么,第一网络设备确定第一报文与所述第一路由匹配;从而根据所述第一路由,向所述第二网络设备发送所述第一报文。这样,在满足第一条件之前,第一网络设备能够有效的将报文从第二网络设备转发到其他网络设备。
在一种可能的实现方式中,如果到所述至少一个其他网络设备的路由包括到所述第三网络设备的第二路由,那么,在第一网络设备接收第二网络设备响应于请求消息发送的路由消息之后,该方法还可以包括:第一网络设备接收第二报文,该第二报文为去往所述第三网络设备的报文;第一网络设备确定该第二报文与第二路由匹配后,可以根据所述第二路由,向所述第三网络设备发送所述第二报文。这样,从第一网络设备去往第三网络设备 的报文无需再经过第二网络设备转发,可以直接从第一网络设备发送到第二网络设备,一定程度上能够节约网络资源。
在一种可能的实现方式中,该第一条件可以包括但不限于下述条件中的至少一个:条件一,第一网络设备确定到所述至少一个其他网络设备的网络状况满足第二条件;条件二,第一网络设备到所述至少一个其他网络设备的业务类型存在优化需求;条件三,第一网络设备接收到指示消息,所述指示消息用于指示所述第一网络设备请求到所述至少一个其他网络设备的路由。其中,条件一中的第二条件包括但不限于下述条件中的至少一个:第一网络设备到所述至少一个其他网络设备的流量大于或等于第一阈值;或者,第一网络设备到所述至少一个其他网络设备的时延大于或等于第二阈值。
在一种可能的实现方式中,所述请求消息包括所述至少一个其他网络设备的标识信息,该标识信息可以包括所述至少一个其他网络设备的前缀,或者,到达所述至少一个其他网络设备的路径所经过的至少一个自治域(英文:Autonomous System,简称:AS)号。
其中,第一网络设备向第二网络设备发送的请求消息例如可以为出站路由过滤(英文:Outbound Route Filtering,简称:ORF)请求消息。该ORF请求消息可以包括类型(英文:Type)字段,该类型字段的取值指示ORF请求消息包括增量型ORF字段。例如,该ORF请求消息中的增量型ORF字段可以包括:类型字段、增量ORF类型(英文:Embedded ORF Type)字段、增量ORF类型对应的特定值(英文:Embedded ORF Type Specific Value)字段,其中,类型字段的取值用于指示所述ORF请求消息包括增量型ORF字段;增量ORF类型字段的取值用于指示该增量型ORF字段的具体类型,例如,增量型ORF字段的具体类型可以包括:互联网协议前缀(英文:Internet Protocol Prefix,简称:IP-Prefix)类型、AS path类型或覆盖前缀(英文:Covering Prefixes,简称:CP)ORF类型;增量ORF类型对应的特定值可以根据增量ORF类型字段确定,即,增量ORF类型对应的特定值的格式取决于增量ORF类型字段的取值,例如,增量ORF类型字段=1,表征ORF类型为IP-Prefix类型,则,增量ORF类型对应的特定值可以包括:4字节的序号(英文:Sequence)字段、1字节的最小长度(英文:Minlen)字段、1字节的最大长度(英文:Maxlen)字段、1字节的长度(英文:Length)字段和可变长度的前缀(英文:Prefix)字段。
第二方面,本申请实施例提供了一种路由方法,该方法应用于第二网络设备,该方法例如可以包括:第二网络设备接收第一网络设备发送的请求消息,该请求消息用于请求到至少一个其他网络设备的路由,其中,第一网络设备和所述其他网络设备均与所述第二网络设备连接;响应于所述请求消息,第二网络设备向第一网络设备发送路由消息,该路由消息携带到所述至少一个其他网络设备的路由。这样,通过在缺省路由或聚合路由的基础上按照需求动态的发布路由,既能够解决全量路由通告的方式对第一网络设备以及与第一网络设备处于相同位置的其他网络设备的要求较高的问题,又能够降低缺省路由或聚合路由方式给第二网络设备带来的负载压力,实现了灵活的路由发布。
在一种可能的实现方式中,第一网络设备和第二网络设备之间为拉pull模式的边界网关协议BGP邻居关系,第一网络设备为所述pull模式下的路由接收方,所述第二网络设备为所述pull模式下的路由发送方,第二网络设备向第一网络设备发送到所述第二网络设备 的第一路由,该第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;第一网络设备基于所述第一条件向第二网络设备发送请求消息,所述第二网络设备响应于所述请求消息向所述第一网络设备发送到所述至少一个其他网络设备的路由。
作为一个示例,在第一网络设备和第二网络设备之间建立所述pull模式的BGP邻居关系之前,该方法还可以包括:第二网络设备向第一网络设备发送包括角色标识的协商报文,所述协商报文用于指示所述第二网络设备在所述pull模式的BGP邻居关系中的角色将为所述角色标识所指示的角色。其中,pull模式的BGP邻居关系中的角色包括:所述pull模式下的路由接收方,pull模式下的路由发送方,或,pull模式下的路由发送方和路由接收方。
在一种可能的实现方式中,在第二网络设备接收第一网络设备发送的请求消息之前,该方法还可以包括:第二网络设备向第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备。其中,所述第一路由为缺省路由或聚合路由。
在一种可能的实现方式中,该方法还可以包括:第二网络设备接收所述第一网络设备发送的第一报文,第一报文为去往第三网络设备的报文,所述第三网络设备属于所述至少一个其他网络设备;接着,第二网络设备向所述第三网络设备发送所述第一报文。
其中,所述请求消息包括所述至少一个其他网络设备的标识信息,所述标识信息包括所述至少一个其他网络设备的前缀,或者,所述请求消息包括到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。
在一种可能的实现方式中,所述请求消息为出站路由过滤ORF请求消息,该ORF请求消息可以包括类型字段,所述类型字段的值用于指示所述ORF请求消息的类型为增量型ORF请求消息。
作为一个示例,如果该ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,本申请实施例还可以包括:第二网络设备确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有序号集合中的所有序号均不匹配,则,保存所述第一序号和所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息的对应关系。例如,所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有序号集合中的所有序号均不匹配,是指第一序号与第二网络设备上保存的所有序号均不相同。
作为另一个示例,如果该ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,那么,本申请实施例还可以包括:第二网络设备确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,则,用所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息替换所述第二序号对应的内容。例如,所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,是指第一序号与第二网络设备上保存的第二序号相同。
上述两个示例中,增量型ORF字段用于请求所述第二网络设备增量向所述第一网络设 备发送到达所述至少一个其他网络设备的标识信息对应的路由。
作为另一个示例,本申请实施例还可以包括:第二网络设备确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配且根据所述增量型ORF字段获得删除指示,则,删除所述第二序号对应的内容。其中,第二网络设备根据所述增量型ORF字段获得删除指示,一种情况下,可以是指所述增量型ORF字段中未承载任何网络设备的标识信息,所以,第二网络设备根据该增量型ORF字段确定需要删除该第一序号(或第二序号)对应的内容;另一种情况下,可以是指所述增量型ORF字段中包括指示信息,该指示信息用于指示删除该第一序号(或第二序号)对应的内容,那么,第二网络设备根据该增量型ORF字段中的指示信息确定需要删除该第一序号(或第二序号)对应的内容。所删除的内容可以包括:第二网络设备上之前保存的第二序号和对应的网络设备的标识信息。例如,所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,是指第一序号与第二网络设备上保存的第二序号相同。
第三方面,本申请实施例还提供了一种路由装置,该装置应用于第一网络设备,该装置可以包括第一发送单元和第一接收单元。其中,第一发送单元,用于基于满足第一条件,向第二网络设备发送请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备;第一接收单元,用于接收所述第二网络设备响应于所述请求消息发送的路由消息,所述路由消息中携带到所述至少一个其他网络设备的路由。
在一种可能的实现方式中,第一网络设备和所述第二网络设备之间为拉pull模式的边界网关协议BGP邻居关系,所述第一网络设备为所述pull模式下的路由接收方,所述第二网络设备为所述pull模式下的路由发送方,所述第二网络设备向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;所述第一网络设备基于所述第一条件向所述第二网络设备发送请求消息,所述第二网络设备响应于所述请求消息向所述第一网络设备发送到所述至少一个其他网络设备的路由。
作为一个示例,所述装置还可以包括第二发送单元。所述第二发送单元,用于在和所述第二网络设备之间建立所述pull模式的BGP邻居关系之前,向所述第二网络设备发送包括角色标识的协商报文,所述协商报文用于指示所述第一网络设备在所述pull模式的BGP邻居关系中的角色将为所述角色标识所指示的角色。其中,pull模式的BGP邻居关系中的角色包括:所述pull模式下的路由接收方,所述pull模式下的路由发送方,或,所述pull模式下的路由发送方和路由接收方。
在一种可能的实现方式中,在所述第一网络设备向第二网络设备发送请求消息之前,所述第一网络设备上保存有到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备。其中,所述第一路由为缺省路由或聚合路由。
作为一个示例,所述装置还可以包括:第二接收单元、第一确定单元和第三发送单元。其中,第二接收单元,用于接收第一报文,所述第一报文为去往第三网络设备的报文,所 述第三网络设备属于所述至少一个其他网络设备;第一确定单元,用于确定所述第一报文与所述第一路由匹配;第三发送单元,用于根据所述第一路由,向所述第二网络设备发送所述第一报文。
在一种可能的实现方式中,所述到所述至少一个其他网络设备的路由包括到所述第三网络设备的第二路由,所述装置还可以包括:第三接收单元、第二确定单元和第四发送单元。其中,所述第三接收单元,用于在接收所述第二网络设备响应于所述请求消息发送的路由消息之后,接收第二报文,所述第二报文为去往所述第三网络设备的报文;所述第二确定单元,用于确定所述第二报文与所述第二路由匹配;第四发送单元,用于根据所述第二路由,向所述第三网络设备发送所述第二报文。
在一种可能的实现方式中,所述第一条件包括下述条件中的至少一个:所述第一网络设备确定到所述至少一个其他网络设备的网络状况满足第二条件;所述第一网络设备到所述至少一个其他网络设备的业务类型存在优化需求;所述第一网络设备接收到指示消息,述指示消息用于指示所述第一网络设备请求到所述至少一个其他网络设备的路由。其中,所述第二条件包括下述条件中的至少一个:所述第一网络设备到所述至少一个其他网络设备的流量大于或等于第一阈值;或者,所述第一网络设备到所述至少一个其他网络设备的时延大于或等于第二阈值。
在一种可能的实现方式中,该请求消息可以包括所述至少一个其他网络设备的标识信息,所述标识信息包括所述至少一个其他网络设备的前缀,或者,到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。
作为一个示例,所述请求消息可以为出站路由过滤ORF请求消息。所述ORF请求消息可以包括类型字段,所述类型字段的取值指示所述ORF请求消息包括增量型ORF字段。
需要说明的是,该第三方面提供的路由装置用于执行上述第一方面提及的相关操作,其具体实现方式以及达到的效果,均可以参见上述第一方面的相关描述,在此不再赘述。
第四方面,本申请实施例还提供了一种路由装置,该装置应用于第二网络设备,该装置可以包括:第一接收单元和第一发送单元。其中,第一接收单元,用于接收第一网络设备发送的请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备连接;第一发送单元,用于响应于所述请求消息,向所述第一网络设备发送路由消息,所述路由消息携带到所述至少一个其他网络设备的路由。
在一种可能的实现方式中,第一网络设备和第二网络设备之间为拉pull模式的边界网关协议BGP邻居关系,所述第一网络设备为所述pull模式下的路由接收方,所述第二网络设备为所述pull模式下的路由发送方,所述第二网络设备向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;所述第一网络设备基于所述第一条件向所述第二网络设备发送请求消息,所述第二网络设备响应于所述请求消息向所述第一网络设备发送到所述至少一个其他网络设备的路由。
作为一个示例,所述装置还可以包括第二发送单元。所述第二发送单元,用于在所述和第一网络设备之间建立所述pull模式的BGP邻居关系之前,向所述第一网络设备发送包括角色标识的协商报文,所述协商报文用于指示所述第二网络设备在所述pull模式的BGP邻居关系中的角色将为所述角色标识所指示的角色。其中,pull模式的BGP邻居关系中的角色包括:所述pull模式下的路由接收方,所述pull模式下的路由发送方,或,所述pull模式下的路由发送方和路由接收方。
在一种可能的实现方式中,所述装置还可以包括第三发送单元。该第三发送单元,用于在接收第一网络设备发送的请求消息之前,向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备。其中,所述第一路由可以为缺省路由或聚合路由。
作为一个示例,该装置还可以包括第二接收单元和第四发送单元。其中,第二接收单元,用于接收所述第一网络设备发送的第一报文,所述第一报文为去往第三网络设备的报文,所述第三网络设备属于所述至少一个其他网络设备;第四发送单元,用于向所述第三网络设备发送所述第一报文。
在一种可能的实现方式中,所述请求消息包括所述至少一个其他网络设备的标识信息,所述标识信息包括所述至少一个其他网络设备的前缀,或者,所述请求消息包括到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。
作为一个示例,所述请求消息可以为出站路由过滤ORF请求消息。该ORF请求消息包括类型字段,所述类型字段的值用于指示所述ORF请求消息的类型为增量型ORF请求消息。一种情况下,如果ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,所述增量型ORF字段用于请求所述第二网络设备增量向所述第一网络设备发送到达所述至少一个其他网络设备的标识信息对应的路由,所述装置还可以包括:第一处理单元,该第一处理单元,用于确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有序号集合中的所有序号均不匹配,则,保存所述第一序号和所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息的对应关系。另一种情况下,如果ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,所述增量型ORF字段用于请求所述第二网络设备增量向所述第一网络设备发送到达所述至少一个其他网络设备的标识信息对应的路由,所述装置还可以包括:第二处理单元,该第二处理单元,用于确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,则,用所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息替换所述第二序号对应的内容。上述情况中,增量型ORF字段用于请求所述第二网络设备增量向所述第一网络设备发送到达所述至少一个其他网络设备的标识信息对应的路由。再一种情况下,所述装置还可以包括:第三处理单元,该第三处理单元,用于确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配且根据所述增量型ORF字段获得删除指示,则,删除所述第二序号对应的内容。所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,例如可以指第一序号与第二网络设备上保存 的第二序号相同;所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的所有序号匹配,例如可以指第一序号与第二网络设备上保存的所有序号均不相同。
需要说明的是,该第四方面提供的路由装置用于执行上述第二方面提及的相关操作,其具体实现方式以及达到的效果,均可以参见上述第二方面的相关描述,在此不再赘述。
第五方面,本申请实施例还提供了一种第一网络设备,包括:存储器和处理器。其中,存储器用于存储程序代码或指令;处理器用于运行程序代码或指令,使得第一网络设备执行以上第一方面提供的方法。
第六方面,本申请实施例还提供了一种第二网络设备,包括:存储器和处理器。其中,存储器用于存储程序代码或指令;处理器用于运行程序代码或指令,使得第二网络设备执行以上第二方面提供的方法。
第七方面,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有程序代码或指令,当其在计算机上运行时,使得计算机执行以上第一方面或第二方面提供的任意一种可能的实现方式中提供的方法。
第八方面,本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在网络设备上运行时,使得网络设备执行第一方面或第二方面的任意一种可能的实现方式中提供的方法。
第九方面,本申请提供了一种第一网络设备,该第一网络设备包括:主控板和接口板。主控板包括:第一处理器和第一存储器。接口板包括:第二处理器、第二存储器和接口卡。主控板和接口板耦合。
第一存储器可以用于存储程序代码,第一处理器用于调用第一存储器中的程序代码执行如下操作:确定所述第一报文与所述第一路由匹配,等。
第二存储器可以用于存储程序代码,第二处理器用于调用第二存储器中的程序代码,触发接口卡执行如下操作:基于满足第一条件,向第二网络设备发送请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备连接;接收所述第二网络设备响应于所述请求消息发送的路由消息,所述路由消息中携带到所述至少一个其他网络设备的路由。
在一种可能的实现方式中,主控板和接口板之间建立进程间通信协议(inter-process communication,IPC)通道,主控板和接口板之间通过IPC通道进行通信。
第十方面,本申请提供了一种第二网络设备,该第二网络设备包括:主控板和接口板。主控板包括:第一处理器和第一存储器。接口板包括:第二处理器、第二存储器和接口卡。主控板和接口板耦合。
第一存储器可以用于存储程序代码,第一处理器用于调用第一存储器中的程序代码执行如下操作:确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有序号集合中的所有序号均不匹配,则,保存所述第一序号和所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息的对应关系,等。
第二存储器可以用于存储程序代码,第二处理器用于调用第二存储器中的程序代码,触发接口卡执行如下操作:接收第一网络设备发送的请求消息,所述请求消息用于请求到 至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备连接;响应于所述请求消息,向所述第一网络设备发送路由消息,所述路由消息携带到所述至少一个其他网络设备的路由。
在一种可能的实现方式中,主控板和接口板之间建立进程间通信协议(inter-process communication,IPC)通道,主控板和接口板之间通过IPC通道进行通信。
第十一方面,本申请提供了一种芯片,包括存储器和处理器,存储器用于存储计算机程序,处理器用于从存储器中调用并运行该计算机程序,以执行上述第一方面或第二方面中的方法。
可选地,上述芯片仅包括处理器,处理器用于读取并执行存储器中存储的计算机程序,当计算机程序被执行时,处理器执行上述第一方面或第二方面中的方法。
第十二方面,本申请实施例还提供了一种网络系统,该网络系统可以包括第一网络设备和第二网络设备。其中,第一网络设备,用于执行上述第一方面中的方法;第二网络设备,用于执行上述第二方面中的方法。
附图说明
图1为本申请实施例中一网络场景的结构示意图;
图2为本申请实施例提供的一种路由方法100的流程示意图;
图3为本申请实施例中一种协商报文中承载角色标识的TLV字段的示意图;
图4为本申请实施例中一种增量型ORF字段的示意图;
图5为本申请实施例中一种增量ORF类型对应的特定值的示意图;
图6为本申请实施例中一种路由装置600的结构示意图;
图7为本申请实施例中一种路由装置700的结构示意图;
图8为本申请实施例中一种网络设备800的结构示意图;
图9为本申请实施例中一种网络设备900的结构示意图;
图10为本申请实施例中一种网络系统1000的结构示意图。
具体实施方式
以图1所示的网络场景为例,介绍目前的路由方法和本申请实施例提供的路由方法。如图1所示,该网络场景中包括网络设备101、网络设备102、……、网络设备10N和网络设备201,其中,N为大于1的整数。网络设备101、网络设备102、……、网络设备10N分别与网络设备201连接。其中,网络设备101、网络设备102、……、网络设备10N分别与网络设备201连接,可以是指直接连接,即这些网络设备与网络设备201通过网络链路直接连接,也可以是指间接连接,即这些网络设备与网络设备201之间还存在中间网络设备。作为一个示例,网络设备201可以为核心设备,网络设备101、网络设备102、……、网络设备10N可以为多个接入设备,每个接入设备连接用户侧设备,以网络设备101连接用户设备A,网络设备104连接用户设备B,用户设备A的流量需要到达用户设备B为例进行下文描述。
目前,在一些可能的实现方式中,为了完成业务的分发,网络设备的路由进行全量互通,即,网络设备101、网络设备102、……、网络设备10N中各个网络设备的路由都被 扩散到其他的网络设备,例如,网络设备101将自身的路由1发送给网络设备201,网络设备201将到达网络设备101的路由1分别发送给网络设备102~网络设备10N,这样,每个网络设备都要保存其他网络设备的路由,例如,网络设备101上需要保存到达网络设备102~网络设备10N的所有路由。随着组网规模的不断扩大,N的数量不断增多,即使每个网络设备仅产生一条路由,每个网络设备也需要保存海量的路由,但是,为了降低组网成本,网络设备101~网络设备10N这些接近用户侧的网络设备通常部署较为低端的设备,低端的设备的硬件容量比较小,无法在大规模网络中保存如此多的路由。
在另一些实现方式中,为了解决全量路由通告的方式对网络设备101~网络设备10N的要求较高的问题,还可以采用缺省路由或聚合路由的方式进行路由通告,即,网络设备201仅向网络设备101~网络设备10N中的各网络设备通告到达网络设备201的缺省路由或聚合路由,网络设备101~网络设备10N中的各网络设备仅维护到达网络设备201的缺省路由或聚合路由,有效的减少了网络设备101~网络设备10N中的各网络设备上需要保存的路由数量,降低了对这些低端的设备的存储需求。该实现方式下,对于用户设备A通过网络设备101向网络设备104所连接的用户设备B发送的报文1,网络设备101接收到报文1后,可以根据报文1的目的地址匹配到达网络设备201的缺省路由2(或聚合路由2),依据缺省路由2(或聚合路由2)将报文1发送给网络设备201;网络设备201接收到报文1后,可以根据报文1的目的地址匹配到达网络设备104的路由3,依据路由3将报文1发送给网络设备104,由网络设备104将报文1发送给用户设备B。可见,该实现方式下,所有流量均需要从网络设备201绕行,这样,在流量较多的情况,会给网络设备201造成巨大的负载压力。
其中,缺省路由(英文:Default Route),是一种特殊的静态路由,当网络设备接收的报文的目的地址无法匹配到路由表中的路由时,可以确定按照缺省路由发送该报文,即,网络设备按照缺省路由将该报文发往指定的位置,通常,缺省路由在路由表中路由前缀为0.0.0.0、子网掩码为0.0.0.0。聚合路由,是第二网络设备将其上保存的若干个路由进行聚合以获得聚合路由,聚合路由的前缀能够覆盖上述若干个路由的前缀,使得匹配上述若干个路由的流量也能够匹配聚合路由,这样,能够缩小各网络设备中路由表的规模、节省内存,并且能够报文转发时分析、查表等操作所需的时间,当第一网络设备接收的报文的目的地址匹配到路由表中的到达第二网络设备的聚合路由时,第一网络设备按照聚合路由将该报文发往第二网络设备。
基于此,本申请实施例提供了一种路由方法,初始状态下,第一网络设备上仅保存到达第二网络设备的缺省路由或聚合路由,在第一网络设备确定满足预设的第一条件时,作为流量发送方的第一网络设备向第二网络设备发送请求消息,请求到至少一个其他网络设备的路由;那么,响应于所述请求消息,第二网络设备即可向该流量发送方的第一网络设备发送路由消息,该路由消息中携带到所述至少一个其他网络设备的路由。这样,通过在缺省路由或聚合路由的基础上按照需求动态的发布路由,既能够解决全量路由通告的方式对第一网络设备以及与第一网络设备处于相同位置的其他网络设备的要求较高的问题,又能够降低缺省路由或聚合路由方式给第二网络设备带来的负载压力,实现了灵活的路由发 布。
仍然以图1所示的网络场景为例,本申请实施例提供的方法例如可以包括:第一阶段,网络设备201分别向网络设备101~网络设备10N中的各网络设备通告到达网络设备201的缺省路由2(或聚合路由2),此阶段中,用户设备A通过网络设备101向网络设备104所连接的用户设备B发送的报文1,网络设备101接收到报文1后,可以根据报文1的目的地址匹配到达网络设备201的缺省路由2(或聚合路由2),依据缺省路由2(或聚合路由2)将报文1发送给网络设备201;网络设备201接收到报文1后,可以根据报文1的目的地址匹配到达网络设备104的路由3,依据路由3将报文1发送给网络设备104,由网络设备104将报文1发送给用户设备B。第二阶段,当确定用户设备A通过网络设备101向网络设备104所连接的用户设备B发送的流量满足预设的第一条件(如,用户设备A通过网络设备101向网络设备104所连接的用户设备B发送的流量大于或等于第一阈值),则,网络设备101向网络设备201发送用于请求到达网络设备104的路由4的请求消息,网络设备201接收到请求消息后,作为响应,向网络设备101发送到达网络设备104的路由4;在网络设备101接收到到达网络设备104的路由4后,网络设备101可以保存到达网络设备201的缺省路由2(或聚合路由2)以及到达网络设备104的路由4;此阶段中,用户设备A通过网络设备101向网络设备104所连接的用户设备B发送的报文2,网络设备101接收到报文2后,可以根据报文2的目的地址匹配到达网络设备104的路由4,依据路由4将报文2发送给网络设备104,由网络设备104将报文1发送给用户设备B。如此,通过本申请实施例中在缺省路由或聚合路由的基础上按照需求动态的发布路由的方式,既解决了全量路由通告的方式对各网络设备的要求较高的问题,又克服了流量较多情况下缺省路由或聚合路由方式给网络设备201带来的负载压力,实现了灵活的路由发布。
需要说明的是,本申请实施例适用的网络架构可以称为集中式网络架构,例如可以包括一个中心设备和多个分布式设备,一个中心设备分别和多个分布式设备中的每个分布式设备均建立连接。其中,集中式网络架构中的中心设备,也可以称为该网络的核心设备。
图1所示的网络场景中,例如,网络设备201可以为控制器201,网络设备101~网络设备10N可以为转发设备101~转发设备10N,每个转发设备都和控制器201建立通信连接,控制器201作为中心设备负责对各转发设备进行控制或管理。又例如,网络设备201可以为中心Hub 201,网络设备101~网络设备10N可以为骨干Spine 101~Spine 10N,每个Spine都和Hub 201建立通信连接,Hub 201作为中心设备负责对各Spine进行控制、管理或对各Spine的报文进行转发。再例如,网络设备201也可以是骨干Spine 201,网络设备101~网络设备10N可以为叶子Leaf 101~Leaf 10N,每个Leaf均与Spine 201建立通信连接,Spine 201作为中心设备负责对各Leaf进行控制、管理或对各Leaf的报文进行转发。又例如,网络设备201可以为虚拟扩展局域网(英文:Virtual eXtensible Local Area Network,简称:VXLAN)网关201,网络设备101~网络设备10N可以为端点设备101~端点设备10N,每个端点设备都和VXLAN网关201建立通信连接,VXLAN网关201作为中心设备负责对各端点设备发送的报文进行转发。再例如,网络设备201可以为控制面(英文:Control Plane,简称:CP)设备201,网络设备101~网络设备10N可以为用户面(英文:User Plane,简 称:UP)设备101~UP设备10N,每个UP设备都和CP设备201建立通信连接,CP设备201作为中心设备负责对各UP设备进行控制、管理或对各UP设备的报文进行转发。
需要说明的是,本申请实施例中涉及的网络设备,可以是指能够实现报文转发功能的任意的实体设备,例如可以是交换机、路由器等;或者,也可以是网络设备内具有报文转发功能的单板,芯片等。此外,第二网络设备或网络设备201也可以是控制管理实体,即,能够对网络设备进行控制的任意设备或功能实体,例如可以是具有控制功能的网络云化引擎(英文:Network Cloud Engine,简称:NCE)、服务器或者路由器等;又例如也可以是任意一个网络设备内集成的功能实体,该功能实体可以通过硬件形式体现也可以通过软件形式体现。
下面结合附图,通过实施例来详细说明本申请实施例提供的一种路由方法的具体实现方式。
图2为本申请实施例中一种路由方法100的流程示意图。参见图2,该方法100以第一网络设备和第二网络设备之间的交互过程描述本申请实施例。其中,第一网络设备例如可以应用在图2所示的网络设备101~网络设备10N中的任意一个网络设备中,那么,第二网络设备例如可以应用在图2所示的网络设备201上。
在本申请实施例中,多个网络设备分别与第二网络设备直接或间接连接,多个网络设备中至少包括第一网络设备,多个网络设备也可以包括第三网络设备。第二网络设备与第一网络设备之间建立了边界网关协议(英文:Border Gateway Protocol,简称:BGP)邻居关系,第二网络设备上保存到所述多个网络设备的路由;多个网络设备之间可以存在物理连接,但是,未建立BGP邻居关系,无法进行报文的直接交互。
具体实现时,该方法100例如可以包括下述S101~S104:
S101,基于满足第一条件,第一网络设备向第二网络设备发送请求消息,所述请求消息用于请求到至少一个其他网络设备的路由。
S102,第二网络设备接收第一网络设备发送的请求消息。
在一些可能的实现方式,网络中的第一网络设备和第二网络设备可以配置为拉(英文:pull)模式的BGP邻居关系,也可以称为请求模式的BGP邻居关系或订阅模式的BGP邻居关系。对于属于pull模式的BGP邻居关系的网络设备,可以具有不同的角色。以本申请实施例中的第一网络设备和第二网络设备为例,第一网络设备可以为pull模式下的路由接收方,第二网络设备为pull模式下的路由发送方,那么,第二网络设备可以向第一网络设备发送到第二网络设备的第一路由,该第一路由用于指示第一网络设备将去往所述其他网络设备的流量发送到第二网络设备;第一网络设备还可以基于第一条件向第二网络设备发送请求消息,第二网络设备响应于请求消息向第一网络设备发送到所述至少一个其他网络设备的路由。
作为一个示例,属于pull模式的BGP邻居关系的网络设备的角色可以通过命令行等方式进行静态配置,例如,通过在第一网络设备上配置命令行1指定第一网络设备为pull模式下的路由接收方,通过在第二网络设备上配置命令行2指定第二网络设备为pull模式下 的路由发送方。
作为另一个示例,属于pull模式的BGP邻居关系的网络设备的角色也可以通过协商的方式进行动态确定,例如,在第一网络设备和第二网络设备之间建立pull模式的BGP邻居关系之前,第一网络设备向所述第二网络设备发送包括第一角色标识的第一协商报文,该第一协商报文用于指示第一网络设备在pull模式的BGP邻居关系中的角色将为所述第一角色标识所指示的第一角色,并且,第二网络设备向所述第一网络设备发送包括第二角色标识的第二协商报文,该第二协商报文用于指示第二网络设备在pull模式的BGP邻居关系中的角色将为所述第二角色标识所指示的角色。例如,第一协商报文中包括的第一角色标识表明第一网络设备为pull模式下的路由接收方,第二协商报文中包括的第二角色标识表明第一网络设备为pull模式下的路由发送方,则,第一网络设备根据第一协商报文和第二协商报文,确定在与第二网络设备建立的pull模式的BGP邻居关系中,自己的角色为pull模式下的路由接收方,第二网络设备的角色为pull模式的路由发送方。
其中,协商报文例如可以是BGP开始(英文:OPEN)报文,BGP OPEN报文是建立BGP邻居时需要发送的第一个报文,用于协商待建立BGP邻居关系的两个网络设备之间是否存在两端均可用的能力。本申请实施例中,可以通过BGP OPEN报文中扩展的类型长度值(英文:Type Length Value,简称:TLV)字段承载自身的角色标识,例如,BGP OPEN报文中承载角色标识的TLV字段参见图3所示,该TLV字段可以包括:1字节的能力编码(英文:Capability Code)字段、1字节的能力长度(英文:Capability Length)字段和可变长度的能力值(英文:Capability Value)字段,其中,Capability Code字段的取值可以取待国际互联网工程任务组(英文:The Internet Engineering Task Force,简称:IETF)分配的任意值,用于指示该TLV字段的类型,表明该TLV字段的Capability Value字段携带发送该BGP OPEN报文的网络设备的角色标识;Capability Length字段的取值用于指示Capability Value字段的长度;Capability Value字段的取值用于指示发送该BGP OPEN报文的网络设备的角色标识,如,Capability Value字段=1,表征发送该BGP OPEN报文的网络设备的角色为pull模式的路由发送方,Capability Value字段=2,表征发送该BGP OPEN报文的网络设备的角色为pull模式的路由接收方,Capability Value字段=3,表征发送该BGP OPEN报文的网络设备的角色既可以为pull模式的路由发送方也可以为pull模式的路由接收方。BGP OPEN报文的具体说明可以参见请求评论(英文:Request For Comments,简称:RFC)4271中的相关描述。
pull模式的BGP邻居关系中,路由接收方(也可以称为客户端Client),是指初始状态下只保存到路由发送方网络设备的缺省路由或聚合路由,在需要时通过向路由发送方网络设备请求到达另一个路由接收方网络设备的明细路由的角色。路由发送方(也可以称为服务端Server),是指保存了到所有路由接收方网络设备的明细路由,但只有接收到路由接收方网络设备的请求消息才发送明细路由的角色。网络设备在pull模式的BGP邻居关系中的角色可以根据网络设备在具体BGP邻居关系中能力而确定,在不同的BGP邻居关系中,一个网络设备可以具有两个不同的角色,也可以具有相同的一个角色。例如,第一网络设备和第二网络设备的pull模式的BGP邻居关系中,第一网络设备可以为pull模式的路由接 收方,第二网络设备可以为pull模式的路由发送方,但是,第二网络设备和第四网络设备的pull模式的BGP邻居关系中,第二网络设备可以为pull模式的路由接收方,第四网络设备可以为pull模式的路由发送方,那么,第一网络设备的角色既可以为pull模式的路由接收方,第二网络设备的角色既可以为pull模式的路由接收方也可以为pull模式的路由发送方,第四网络设备可以为pull模式的路由发送方。
在另一些可能的实现方式中,网络中的第一网络设备和第二网络设备也可以配置为常规的BGP邻居关系,通过在第一网络设备和第二网络设备上的配置实现如下流程:初始状态下,第二网络设备可以向第一网络设备发送到第二网络设备的第一路由,该第一路由用于指示第一网络设备将去往所述其他网络设备的流量发送到第二网络设备;第一网络设备还可以基于第一条件向第二网络设备发送请求消息,第二网络设备响应于请求消息向第一网络设备发送到所述至少一个其他网络设备的路由。例如,在第二网络设备上配置指令集合1,该指令集合1用于指示第二网络设备在初始状态下只向第一网络设备以及与第一网络设备属于相同位置的其他网络设备发送到第二网络设备的缺省路由或聚合路由,只有接收到第一网络设备或与第一网络设备属于相同位置的其他网络设备的请求消息才发送明细路由;在第一网络设备以及与第一网络设备属于相同位置的其他网络设备上配置指令集合2,该指令集合2用于指示第一网络设备或与第一网络设备属于相同位置的其他网络设备在初始状态下只保存到第二网络设备的缺省路由或聚合路由,在需要时通过向第二网络设备请求到达至少一个其他网络设备的明细路由。需要说明的是,该实现方式相比于建立pull模式的BGP邻居关系,不仅配置复杂,而且需要频繁的对配置进行维护,不及上述建立pull模式的BGP邻居关系的实现方式更加简单、便捷。
具体实现时,在S101之前,第二网络设备向第一网络设备发送第一路由,该第一路由用于指示第一网络设备将去往所述其他网络设备的流量发送到第二网络设备,第一网络设备接收并保存该第一路由。第一路由可以是缺省路由或聚合路由。其中,缺省路由,是一种特殊的静态路由,当第一网络设备接收的报文的目的地址无法匹配到路由表中的路由时,可以确定按照缺省路由发送该报文,即,第一网络设备按照缺省路由将该报文发往指定的位置(本申请实施例中即发往第二网络设备),通常,缺省路由在路由表中路由前缀为0.0.0.0、子网掩码为0.0.0.0。聚合路由,是第二网络设备将其上保存的若干个路由进行聚合以获得聚合路由,聚合路由的前缀能够覆盖上述若干个路由的前缀,使得匹配上述若干个路由的流量也能够匹配聚合路由,这样,能够缩小各网络设备中路由表的规模、节省内存,并且能够报文转发时分析、查表等操作所需的时间,当第一网络设备接收的报文的目的地址匹配到路由表中的到达第二网络设备的聚合路由时,第一网络设备按照聚合路由将该报文发往第二网络设备。
作为一个示例,假设第一网络设备上保存第一路由,那么,在S104之前,本申请实施例还可以包括:S105,第一网络设备按照第一路由,经过第二网络设备向第三网络设备发送第一报文,其中,第三网络设备为与第一网络设备属于相同位置的其他网络设备中的任意一个网络设备,例如可以是图1所示的网络设备104。具体实现时,S105例如可以包括:S1051,第一网络设备接收第一报文,该第一报文为去往第三网络设备的报文;S1052, 第一网络设备确定第一报文与所述第一路由匹配;S1053,第一网络设备根据所述第一路由,向第二网络设备发送所述第一报文。其中,S1052中第一网络设备可以从第一网络设备的路由表中确定与所述第一报文的目的地址匹配的路由条目,确定与所述第一报文的目的地址匹配的路由条目为第一路由。此外,S105在S1053之后,还可以包括:S1054,第二网络设备接收第一报文;S1055,第二网络设备根据所述第一报文的目的地址确定第三路由,其中,第三路由对应的路由条目中的前缀与第一报文的目的地址匹配;S1056,第二网络设备根据所述第三路由,向第三网络设备发送所述第一报文。
在第一网络设备上保存第一路由后,还可以监控是否满足预设的第一条件,以便触发第一网络设备向第二网络设备请求到至少一个其他网络设备的明细路由。其中,第一条件,可以是第一网络设备上预先配置的请求明细路由的触发条件,第一网络设备上可以仅配置一个第一条件,该第一条件适用触发请求到所有其他网络设备中任意一个网络设备的明细路由;或者,第一网络设备上也可以配置多个第一条件,各第一条件适用触发请求到对应的部分网络设备的明细路由,例如,如图1所示的网络设备101上,配置(N-1)个第一条件,每个第一条件对应一个网络设备,如,第一条件1用于触发请求到网络设备102的明细路由,第一条件2用于触发请求到网络设备104的明细路由。
其中,所述第一条件可以包括下述条件中的至少一个:第一网络设备确定到至少一个其他网络设备的网络状况满足第二条件;第一网络设备到至少一个其他网络设备的业务类型存在优化需求;第一网络设备接收到指示消息,所述指示消息用于指示第一网络设备请求到至少一个其他网络设备的路由。
作为一个示例,第一网络设备可以包括流量统计模块、策略处理模块和BGP模块。其中,流量统计模块用于对第一网络设备收发的流量进行统计,策略处理模块用于根据流量统计模块的统计结果以及预设的第二条件,确定是否要执行S101,如果需要,则,将待请求的至少一个其他网络设备的标识信息发送给BGP模块,BGP模块用于生成S101中的请求消息。至少一个网络设备的标识信息,例如可以是所述至少一个其他网络设备的前缀,或者,也可以是到达所述至少一个其他网络设备的路径所经过的至少一个自治域(英文:Autonomous System,简称:AS)号。其中,第二条件例如可以包括下述条件中的至少一个:第一网络设备到所述至少一个其他网络设备的流量大于或等于第一阈值(如500千兆字节(GB));或者,第一网络设备到所述至少一个其他网络设备的时延大于或等于第二阈值(如30毫秒(ms))。需要说明的是,第二条件可以根据实际需求进行灵活配置。
作为另一个示例,第一网络设备可以包括BGP模块,而流量统计模块以及策略处理模块集成在其他的设备中,该其他的设备用于对第一网络设备的进行流量监控以及策略处理,当其他的设备确定第一网络设备收发的流量满足预设的第三条件,则,生成并向第一网络设备发送指示消息,第一网络设备的BGP模块基于该指示消息生成S101中的请求消息。其中,该示例中的流量监控模块以及策略处理模块可以继承在一个其他的设备中,也可以分别集成在不同的设备中。需要说明的是,第三条件可以根据实际需求进行灵活配置,第三条件可以与第二条件相同,也可以与第二条件不同。
作为再一个示例,第一网络设备也可以在到至少一个其他网络设备的业务类型存在优 化需求时,触发执行S101。例如,第一网络设备到第三网络设备有重要的线上会议,为保证线上会议质量,音频业务需要优化,此时,可以确定满足第一条件,执行S101以请求到第三网络设备的明细路由。
对于S101中的请求消息,可以携带所请求的所述至少一个其他网络设备的标识信息,该标识信息包括所述至少一个其他网络设备的前缀,或者,到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。如果请求消息用于请求到第三网络设备的路由,那么,请求消息中携带的标识信息可以为第三网络设备的前缀。如果请求消息用于请求到多个其他网络设备的路由,那么,请求消息中携带的标识信息可以为到达所述多个其他网络设备的路径所经过的至少一个AS号,例如可以是AS path中的全部AS号或部分AS号。
作为一个示例,该请求消息可以为出站路由过滤(英文:Outbound Route Filtering,简称:ORF)请求消息。该ORF请求消息中可以包括类型字段,所述类型字段的值用于指示所述ORF请求消息的类型为增量型ORF请求消息。该增量型ORF请求消息中还可以包括增量型ORF字段,该增量型ORF字段用于承载所述至少一个其他网络设备的标识信息,所述增量型ORF字段用于请求所述第二网络设备增量向所述第一网络设备发送到达所述至少一个其他网络设备的标识信息对应的路由。例如,该ORF请求消息中的增量型ORF字段如图4所示,可以包括:类型(英文:Type)字段、增量ORF类型(英文:Embedded ORF Type)字段、增量ORF类型对应的特定值(英文:Embedded ORF Type Specific Value)字段,其中,类型字段的取值用于指示所述ORF请求消息包括增量型ORF字段;增量ORF类型字段的取值用于指示该增量型ORF字段的具体类型,例如,增量型ORF字段的具体类型可以包括:互联网协议前缀(英文:Internet Protocol Prefix,简称:IP-Prefix)类型、AS path类型或覆盖前缀(英文:Covering Prefixes,简称:CP)ORF类型;增量ORF类型对应的特定值可以根据增量ORF类型字段确定,即,增量ORF类型对应的特定值的格式取决于增量ORF类型字段的取值,例如,增量ORF类型字段=1,表征ORF类型为IP-Prefix类型,则,增量ORF类型对应的特定值可以如图5所示,包括:4字节的序号(英文:Sequence)字段、1字节的最小长度(英文:Minlen)字段、1字节的最大长度(英文:Maxlen)字段、1字节的长度(英文:Length)字段和可变长度的前缀(英文:Prefix)字段。其中,第二网络设备上保存的路由按照Sequence值进行排序,所以,请求消息中的Sequence字段的取值用于索引第二网络设备上的路由条目;Minlen字段的值用于指示最短前缀包括的位(英文:bit);Maxlen字段的值用于指示最长前缀包括的bit;Length字段的值用于指示前缀的长度;Prefix字段的取值为用于所请求路由的网络设备的前缀地址,如第三网络设备的前缀。
需要说明的是,第二网络设备上保存有序号和标识信息的对应关系,用于记录第二网络设备发布路由的情况。例如,第二网络设备保存的序号和标识信息的对应关系如下表1所示:
表1 序号和标识信息的对应关系
序号 标识信息
2 第四网络设备
3 第五网络设备
4 第六网络设备
8 第七网络设备
作为一个示例,当第二网络设备确定增量型ORF字段中的序号字段的取值与所述第二网络设备上已有的序号不匹配,则,第二网络设备保存所述增量型ORF字段中的序号字段的取值和所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息的对应关系。例如,请求消息中的增量型ORF字段中的序号字段=1,标识信息为第三网络设备的前缀,则,第二网络设备接收到该请求消息后,保存的序号和标识信息的对应关系可以如下表2所示:
表2 序号和标识信息的对应关系
序号 标识信息
1 第三网络设备
2 第四网络设备
3 第五网络设备
4 第六网络设备
8 第七网络设备
作为另一个示例,当第二网络设备确定增量型ORF字段中的序号字段的取值与所述第二网络设备上已有的一个序号匹配,而且,增量型ORF字段中承载有所述至少一个其他网络设备的标识信息,则,第二网络设备用所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息替换所述匹配到的已有序号对应的内容。例如,请求消息中的增量型ORF字段中的序号字段=3,标识信息为第三网络设备的前缀,则,第二网络设备在表1的基础上接收到该请求消息后,保存的序号和标识信息的对应关系可以如下表3所示:
表3 序号和标识信息的对应关系
序号 标识信息
2 第四网络设备
3 第三网络设备
4 第六网络设备
8 第七网络设备
作为再一个示例,当第二网络设备确定增量型ORF字段中的序号字段的取值与所述第二网络设备上已有的一个序号匹配,但是,根据增量型ORF字段确定删除指示,则,第二网络设备删除所述匹配到的已有序号对应的内容。其中,一种情况下,根据增量型ORF字段确定删除指示,可以是指该增量型ORF字段中包括指示信息,该指示信息用于指示删除该增量型ORF字段中序号对应的内容。或者,另一种情况下,根据增量型ORF字段确定删除指示,可以是指增量型ORF字段中未承载任何的标识信息(即,Embedded ORF Type Specific Value字段为空或取值为0),例如,请求消息中的增量型ORF字段中的序号字段=2,不承载任何的标识信息,则,第二网络设备在表1的基础上接收到该请求消息后,保 存的序号和标识信息的对应关系可以如下表4所示:
表4 序号和标识信息的对应关系
序号 标识信息
3 第五网络设备
4 第六网络设备
8 第七网络设备
相比与ORF请求消息中已有的类型,ORF请求消息中扩展的增量ORF类型字段无需在请求一条路由时对所有的路由进行全量的更新,而仅针对所请求的路由进行针对性的处理,有效的降低了路由请求过程中的网络资源开销,提高了路由发布的效率。
在第二网络设备接收到第一网络设备发送的请求消息之后,可以通过对请求消息的解析,确定第一网络设备需要请求到至少一个其他网络设备的路由,为后续第二网络设备针对性的发送第一网络设备所需的路由提供了数据基础。
S103,响应于所述请求消息,第二网络设备向第一网络设备发送路由消息,所述路由消息携带到所述至少一个其他网络设备的路由。
S104,第一网络设备接收第二网络设备响应于请求消息发送的路由消息。
作为一个示例,若第一网络设备向第二网络设备请求到达第三网络设备的第二路由,那么,第二网络设备生成的路由消息中可以携带第三网络设备的第二路由,并将该路由消息发送给第一网络设备。
该示例下,第一网络设备根据该路由消息获得并保存该第二路由,例如,第一网络设备将前缀与第三网络设备的地址匹配的路由条目中的第一路由替换为第二路由。在S104之后,本申请实施例还可以包括:S106,第一网络设备按照第二路由,向第三网络设备发送第二报文。具体实现时,S106例如可以包括:S1061,第一网络设备接收第二报文,该第二报文为去往第三网络设备的报文;S1062,第一网络设备确定第二报文与所述第二路由匹配;S1063,第一网络设备根据所述第二路由,向第三网络设备发送所述第二报文。其中,S1062中第一网络设备可以从第一网络设备的路由表中确定与所述第二报文的目的地址匹配的路由条目,确定与所述第二报文的目的地址匹配的路由条目为第二路由。
作为另一个示例,若第一网络设备向第二网络设备请求到达AS 100的第三路由,那么,第二网络设备生成的路由消息中可以携带AS 100的第三路由,并将该路由消息发送给第一网络设备。
该示例下,第一网络设备根据该路由消息获得并保存该第三路由,例如,第一网络设备将前缀与AS 100中网络设备的地址匹配的路由条目中的第一路由替换为第三路由。在S104之后,本申请实施例还可以包括:S107,第一网络设备按照第三路由,向AS 100发送第三报文。具体实现时,S107例如可以包括:S1071,第一网络设备接收第三报文,该第三报文为去往AS 100的报文;S1072,第一网络设备确定第三报文与所述第三路由匹配;S1073,第一网络设备根据所述第三路由,向AS 100发送所述第三报文。此外,当第三报文到达AS 100后,接收第三报文的边界设备可以基于该第三报文的目的地址,将该第三报文发送到AS 100中该第三报文的目的设备。
可见,通过本申请实施例提供的方法,初始状态下,第一网络设备上仅保存到达第二网络设备的缺省路由或聚合路由,在第一网络设备确定满足预设的第一条件时,作为流量发送方的第一网络设备向第二网络设备发送请求消息,请求到至少一个其他网络设备的路由;那么,响应于所述请求消息,第二网络设备即可向该流量发送方的第一网络设备发送路由消息,该路由消息中携带到所述至少一个其他网络设备的路由。这样,通过在缺省路由或聚合路由的基础上按照需求动态的发布路由,既能够解决全量路由通告的方式对第一网络设备以及与第一网络设备处于相同位置的其他网络设备的要求较高的问题,又能够降低缺省路由或聚合路由方式给第二网络设备带来的负载压力,实现了灵活的路由发布。
相应的,本申请实施例还提供了一种路由装置600,该装置600具有上述图1所示的示例中的网络设备101,或者图2所示的方法100中的第一网络设备的任意功能。如图6所示。该装置600应用于第一网络设备,可以包括:第一发送单元601和第一接收单元602。
其中,第一发送单元601,用于基于满足第一条件,向第二网络设备发送请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备。所述第一发送单元601可以执行图2所示的S101。
第一接收单元602,用于接收所述第二网络设备响应于所述请求消息发送的路由消息,所述路由消息中携带到所述至少一个其他网络设备的路由。所述第一接收单元602可以执行图2所示的S104。
在一种可能的实现方式中,第一网络设备和所述第二网络设备之间为拉pull模式的边界网关协议BGP邻居关系,所述第一网络设备为所述pull模式下的路由接收方,所述第二网络设备为所述pull模式下的路由发送方,所述第二网络设备向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;所述第一网络设备基于所述第一条件向所述第二网络设备发送请求消息,所述第二网络设备响应于所述请求消息向所述第一网络设备发送到所述至少一个其他网络设备的路由。
作为一个示例,所述装置600还可以包括第二发送单元。所述第二发送单元,用于在和所述第二网络设备之间建立所述pull模式的BGP邻居关系之前,向所述第二网络设备发送包括角色标识的协商报文,所述协商报文用于指示所述第一网络设备在所述pull模式的BGP邻居关系中的角色将为所述角色标识所指示的角色。其中,pull模式的BGP邻居关系中的角色包括:所述pull模式下的路由接收方,所述pull模式下的路由发送方,或,所述pull模式下的路由发送方和路由接收方。
在一种可能的实现方式中,在所述第一网络设备向第二网络设备发送请求消息之前,所述第一网络设备上保存有到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备。其中,所述第一路由为缺省路由或聚合路由。
作为一个示例,所述装置600还可以包括:第二接收单元、第一确定单元和第三发送单元。其中,第二接收单元,用于接收第一报文,所述第一报文为去往第三网络设备的报 文,所述第三网络设备属于所述至少一个其他网络设备;第一确定单元,用于确定所述第一报文与所述第一路由匹配;第三发送单元,用于根据所述第一路由,向所述第二网络设备发送所述第一报文。该示例的相关说明可以参见图2所示的S105。
在一种可能的实现方式中,所述到所述至少一个其他网络设备的路由包括到所述第三网络设备的第二路由,所述装置600还可以包括:第三接收单元、第二确定单元和第四发送单元。其中,所述第三接收单元,用于在接收所述第二网络设备响应于所述请求消息发送的路由消息之后,接收第二报文,所述第二报文为去往所述第三网络设备的报文;所述第二确定单元,用于确定所述第二报文与所述第二路由匹配;第四发送单元,用于根据所述第二路由,向所述第三网络设备发送所述第二报文。该实现方式的相关说明可以参见图2所示的S106。
在一种可能的实现方式中,所述第一条件包括下述条件中的至少一个:所述第一网络设备确定到所述至少一个其他网络设备的网络状况满足第二条件;所述第一网络设备到所述至少一个其他网络设备的业务类型存在优化需求;所述第一网络设备接收到指示消息,述指示消息用于指示所述第一网络设备请求到所述至少一个其他网络设备的路由。其中,所述第二条件包括下述条件中的至少一个:所述第一网络设备到所述至少一个其他网络设备的流量大于或等于第一阈值;或者,所述第一网络设备到所述至少一个其他网络设备的时延大于或等于第二阈值。
在一种可能的实现方式中,该请求消息可以包括所述至少一个其他网络设备的标识信息,所述标识信息包括所述至少一个其他网络设备的前缀,或者,到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。
作为一个示例,所述请求消息可以为出站路由过滤ORF请求消息。所述ORF请求消息可以包括类型字段,所述类型字段的取值指示所述ORF请求消息包括增量型ORF字段。
需要说明的是,上述功能相同但命名中序号不同的单元,可以是一个能够实现该功能的单元,例如,上述第一发送单元601和第二发送单元可以是同一个具有发送功能的单元。
需要说明的是,图6所示的路由装置600可以是图1所示的实施例中的网络设备101或图2所示的示例中的第一网络设备,因此,路由装置600的各种具体实施例方式,可以参见图2对应的方法100的相关介绍,本实施例不再赘述。
本申请实施例还提供了一种路由装置700,该装置700具有上述图1所示的示例中的网络设备201,或者图2所示的方法100中的第二网络设备的任意功能。如图7所示。该装置700应用于第二网络设备,可以包括:第一接收单元701和第一发送单元702。
其中,第一接收单元701,用于接收第一网络设备发送的请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备连接。所述第一接收单元701可以执行图2所示的S102。
第一发送单元702,用于响应于所述请求消息,向所述第一网络设备发送路由消息,所述路由消息携带到所述至少一个其他网络设备的路由。所述第一发送单元702可以执行图2所示的S103。
在一种可能的实现方式中,第一网络设备和第二网络设备之间为拉pull模式的边界网关协议BGP邻居关系,所述第一网络设备为所述pull模式下的路由接收方,所述第二网络设备为所述pull模式下的路由发送方,所述第二网络设备向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;所述第一网络设备基于所述第一条件向所述第二网络设备发送请求消息,所述第二网络设备响应于所述请求消息向所述第一网络设备发送到所述至少一个其他网络设备的路由。
作为一个示例,所述装置700还可以包括第二发送单元。所述第二发送单元,用于在所述和第一网络设备之间建立所述pull模式的BGP邻居关系之前,向所述第一网络设备发送包括角色标识的协商报文,所述协商报文用于指示所述第二网络设备在所述pull模式的BGP邻居关系中的角色将为所述角色标识所指示的角色。其中,pull模式的BGP邻居关系中的角色包括:所述pull模式下的路由接收方,所述pull模式下的路由发送方,或,所述pull模式下的路由发送方和路由接收方。
在一种可能的实现方式中,所述装置700还可以包括第三发送单元。该第三发送单元,用于在接收第一网络设备发送的请求消息之前,向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备。其中,所述第一路由可以为缺省路由或聚合路由。
作为一个示例,该装置700还可以包括第二接收单元和第四发送单元。其中,第二接收单元,用于接收所述第一网络设备发送的第一报文,所述第一报文为去往第三网络设备的报文,所述第三网络设备属于所述至少一个其他网络设备;第四发送单元,用于向所述第三网络设备发送所述第一报文。该示例的相关说明可以参见图2所示实施例中的S105。
在一种可能的实现方式中,所述请求消息包括所述至少一个其他网络设备的标识信息,所述标识信息包括所述至少一个其他网络设备的前缀,或者,所述请求消息包括到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。
作为一个示例,所述请求消息可以为出站路由过滤ORF请求消息。该ORF请求消息包括类型字段,所述类型字段的值用于指示所述ORF请求消息的类型为增量型ORF请求消息。一种情况下,如果ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,所述增量型ORF字段用于请求所述第二网络设备增量向所述第一网络设备发送到达所述至少一个其他网络设备的标识信息对应的路由,所述装置还可以包括:第一处理单元,该第一处理单元,用于确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有序号集合中的所有序号均不匹配,则,保存所述第一序号和所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息的对应关系。另一种情况下,如果ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,所述增量型ORF字段用于请求所述第二网络设备增量向所述第一网络设备发送到达所述至少一个其他网络设备的标识信息对应的路由,所述装置还可以包括:第二处理单元,该第二处理单元,用于确定所述增量型ORF字 段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,则,用所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息替换所述第二序号对应的内容。再一种情况下,所述装置还可以包括:第三处理单元,该第三处理单元,用于确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配且根据所述增量型ORF字段获得删除指示,则,删除所述第二序号对应的内容。上述情况中,匹配例如可以指相同,不匹配例如可以指不相同。
需要说明的是,上述功能相同但命名中序号不同的单元,可以是一个能够实现该功能的单元,例如,上述第一接收单元701和第二接收单元可以是同一个具有接收功能的单元。
需要说明的是,图7所示的路由装置700可以是图1所示的实施例中的网络设备201或图2所示的示例中的第二网络设备,因此,路由装置700的各种具体实施例方式,可以参见图2对应的方法100的相关介绍,本实施例不再赘述。
参见图8,本申请实施例提供了一种网络设备800。该网络设备800可以是上述任一实施例中的网络设备,例如可以是图1中的网络设备101或图2中的第一网络设备,那么,网络设备800可以实现上述方法100中第一网络设备的功能。又例如也可以是图1中的网络设备201或图2中的第二网络设备,那么,网络设备800可以实现上述方法100中第二网络设备的功能。该网络设备800包括至少一个处理器801,总线系统802,存储器803以及至少一个收发器804。
该网络设备800是一种硬件结构的装置,可以用于实现图6所示的路由装置600中的功能模块,也可以用于实现图7所示的路由装置700中的功能模块。例如,本领域技术人员可以想到图6所示的路由装置600中的第一确定单元和第二确定单元可以通过该至少一个处理器801调用存储器803中的代码来实现,图6所示的路由装置600中的第一发送单元601和第一接收单元602可以通过该收发器804来实现。
可选的,该网络设备800还可用于实现上述任一实施例中网络设备的功能。
可选的,上述处理器801可以是一个通用中央处理器(central processing unit,CPU),网络处理器(network processor,NP),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
上述总线系统802可包括一通路,在上述组件之间传送信息。
上述收发器804,用于与其他设备或通信网络通信。
上述存储器803可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,存储器803用于存储执行本申请方案的应用程序代码,并由处理器801来控制执行。处理器801用于执行存储器803中存储的应用程序代码,从而实现本专利方法中的功能。
在具体实现中,作为一种实施例,处理器801可以包括一个或多个CPU,例如图8中的CPU0和CPU1。
在具体实现中,作为一种实施例,该网络设备800可以包括多个处理器,例如图8中的处理器801和处理器807。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
图9是本申请实施例提供的另一种网络设备900的结构示意图,网络设备900例如可以是图1中的网络设备101或图2中的第一网络设备,那么,网络设备900可以实现上述方法100中第一网络设备的功能,或者,又例如也可以是图1中的网络设备201或图2中的第二网络设备,那么,网络设备900可以实现上述方法100中第二网络设备的功能。
网络设备900包括:主控板910和接口板930。
主控板910也称为主处理单元(main processing unit,MPU)或路由处理卡(route processor card),主控板910对网络设备900中各个组件的控制和管理,包括路由计算、设备管理、设备维护、协议处理功能。主控板910包括:中央处理器911和存储器912。
接口板930也称为线路接口单元卡(line processing unit,LPU)、线卡(line card)或业务板。接口板930用于提供各种业务接口并实现数据包的转发。业务接口包括而不限于以太网接口、POS(Packet over SONET/SDH)接口等,以太网接口例如是灵活以太网业务接口(Flexible Ethernet Clients,FlexE Clients)。接口板930包括:中央处理器931、网络处理器932、转发表项存储器934和物理接口卡(ph8sical interface card,PIC)933。
接口板930上的中央处理器931用于对接口板930进行控制管理并与主控板910上的中央处理器911进行通信。
网络处理器932用于实现报文的转发处理。网络处理器932的形态可以是转发芯片。具体而言,上行报文的处理包括:报文入接口的处理,转发表查找;下行报文的处理:转发表查找等等。
物理接口卡933用于实现物理层的对接功能,原始的流量由此进入接口板930,以及处理后的报文从该物理接口卡933发出。物理接口卡933包括至少一个物理接口,物理接口也称物理口,物理接口卡933对应于系统架构中的FlexE物理接口。物理接口卡933也称为子卡,可安装在接口板930上,负责将光电信号转换为报文并对报文进行合法性检查后转发给网络处理器932处理。在一些实施例中,接口板930的中央处理器931也可执行网络处理器932的功能,比如基于通用CPU实现软件转发,从而物理接口卡933中不需要网络处理器932。
可选地,网络设备900包括多个接口板,例如网络设备900还包括接口板940,接口板940包括:中央处理器941、网络处理器942、转发表项存储器944和物理接口卡943。
可选地,网络设备900还包括交换网板920。交换网板920也可以称为交换网板单元(switch fabric unit,SFU)。在网络设备有多个接口板930的情况下,交换网板920用于完成各接口板之间的数据交换。例如,接口板930和接口板940之间可以通过交换网板920通信。
主控板910和接口板930耦合。例如。主控板910、接口板930和接口板940,以及交换网板920之间通过系统总线与系统背板相连实现互通。在一种可能的实现方式中,主控板910和接口板930之间建立进程间通信协议(inter-process communication,IPC)通道,主控板910和接口板930之间通过IPC通道进行通信。
在逻辑上,网络设备900包括控制面和转发面,控制面包括主控板910和中央处理器931,转发面包括执行转发的各个组件,比如转发表项存储器934、物理接口卡933和网络处理器932。控制面执行路由器、生成转发表、处理信令和协议报文、配置与维护设备的状态等功能,控制面将生成的转发表下发给转发面,在转发面,网络处理器932基于控制面下发的转发表对物理接口卡933收到的报文查表转发。控制面下发的转发表可以保存在转发表项存储器934中。在一些实施例中,控制面和转发面可以完全分离,不在同一设备上。
如果网络设备900被配置为第一网络设备,网络处理器932可以触发物理接口卡933基于满足第一条件,向第二网络设备发送请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备;接收所述第二网络设备响应于所述请求消息发送的路由消息,所述路由消息中携带到所述至少一个其他网络设备的路由。中央处理器911可以确定所述第一报文与所述第一路由匹配,确定所述第二报文与所述第二路由匹配。
如果网络设备900被配置为第二网络设备,网络处理器932可以触发物理接口卡933接收第一网络设备发送的请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备连接;响应于所述请求消息,向所述第一网络设备发送路由消息,所述路由消息携带到所述至少一个其他网络设备的路由。中央处理器911可以执行确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配且根据所述增量型ORF字段获得删除指示,则,删除所述第二序号对应的内容。
应理解,路由装置600中的第一发送单元601、第一接收单元602,路由装置700中的第一接收单元701、第一发送单元702,以及网络设备800中的收发器804可以相当于网络设备900中的物理接口卡933或物理接口卡943;路由装置600中的第一确定单元、第二确定单元,路由装置700中的第一处理单元、第二处理单元和第三处理单元、以及网络设备800中的处理器801可以相当于网络设备900中的中央处理器911或中央处理器931。
应理解,本申请实施例中接口板940上的操作与接口板930的操作一致,为了简洁,不再赘述。应理解,本实施例的网络设备900可对应于上述各个方法实施例中的建立BGP邻居的装置或网络设备,该网络设备900中的主控板910、接口板930和/或接口板940可 以实现上述各个方法实施例中的路由装置600、路由装置700或网络设备800中所具有的功能和/或所实施的各种步骤,为了简洁,在此不再赘述。
应理解,主控板可能有一块或多块,有多块的时候可以包括主用主控板和备用主控板。接口板可能有一块或多块,网络设备的数据处理能力越强,提供的接口板越多。接口板上的物理接口卡也可以有一块或多块。交换网板可能没有,也可能有一块或多块,有多块的时候可以共同实现负荷分担冗余备份。在集中式转发架构下,网络设备可以不需要交换网板,接口板承担整个系统的业务数据的处理功能。在分布式转发架构下,网络设备可以有至少一块交换网板,通过交换网板实现多块接口板之间的数据交换,提供大容量的数据交换和处理能力。所以,分布式架构的网络设备的数据接入和处理能力要大于集中式架构的设备。可选地,网络设备的形态也可以是只有一块板卡,即没有交换网板,接口板和主控板的功能集成在该一块板卡上,此时接口板上的中央处理器和主控板上的中央处理器在该一块板卡上可以合并为一个中央处理器,执行两者叠加后的功能,这种形态设备的数据交换和处理能力较低(例如,低端交换机或路由器等网络设备)。具体采用哪种架构,取决于具体的组网部署场景。
在一些可能的实施例中,上述各网络设备或网络设备可以实现为虚拟化设备。例如,虚拟化设备可以是运行有用于发送报文功能的程序的虚拟机(英文:Virtual Machine,VM),虚拟机部署在硬件设备上(例如,物理服务器)。虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。可以将虚拟机配置为图1或图2中的各网络设备。例如,可以基于通用的物理服务器结合网络功能虚拟化(Network Functions Virtualization,NFV)技术来实现各网络设备或网络设备。各网络设备或网络设备为虚拟主机、虚拟路由器或虚拟交换机。本领域技术人员通过阅读本申请即可结合NFV技术在通用物理服务器上虚拟出具有上述功能的各网络设备或网络设备,此处不再赘述。
应理解,上述各种产品形态的网络设备,分别具有上述方法实施例中各网络设备或网络设备的任意功能,此处不再赘述。
本申请实施例还提供了一种芯片,包括处理器和接口电路,接口电路,用于接收指令并传输至处理器;处理器,例如可以是本申请实施例中报文处理装置的一种具体实现形式,可以用于执行上述报文处理方法。其中,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片系统实现上述任一方法实施例中的方法。
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请并不限定。示例性的,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型,以及存储器与处理器的设置方式不作具体限定。
示例性的,该芯片系统可以是现场可编程门阵列(fieldprogrammable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。
此外,本申请实施例还提供了一种网络系统1000,参见图10。该网络系统1000可以包括第一网络设备1001和第二网络设备1002。其中,第一网络设备1001,用于执行图2所示方法100中第一网络设备执行的所有操作;第二网络设备1002,用于执行图2所示方法100中第二网络设备执行的所有操作。
需要说明的是,图10所示的网络系统1000的相关说明,可以参见图2对应的方法100的相关介绍,本实施例不再赘述。
此外,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有程序代码或指令,当其在计算机上运行时,使得计算机执行以上图2所示实施例中任意一种实现方式下的方法。
此外,本申请实施例还提供了一种计算机程序产品,当其在计算机上运行时,使得计算机执行前述方法100中任意一种实现方式的方法。
本申请实施例中提到的“第一报文”、“第一网络设备”等名称中的“第一”只是用来做名字标识,并不代表顺序上的第一。该规则同样适用于“第二”等。
应理解,本申请实施例中提到的“基于根据A确定B”并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分步骤可借助软件加通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如只读存储器(英文:read-only memory,ROM)/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如路由器等网络通信设备)执行本申请各个实施例或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例和设备实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本申请的优选实施方式,并非用于限定本申请的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请的前提下,还可以作出若干改进和 润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (29)

  1. 一种路由方法,其特征在于,包括:
    基于满足第一条件,第一网络设备向第二网络设备发送请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备连接;
    所述第一网络设备接收所述第二网络设备响应于所述请求消息发送的路由消息,所述路由消息中携带到所述至少一个其他网络设备的路由。
  2. 根据权利要求1所述的方法,其特征在于,所述第一网络设备和所述第二网络设备之间为拉pull模式的边界网关协议BGP邻居关系,所述第一网络设备为所述pull模式下的路由接收方,所述第二网络设备为所述pull模式下的路由发送方,所述第二网络设备向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;所述第一网络设备基于所述第一条件向所述第二网络设备发送请求消息,所述第二网络设备响应于所述请求消息向所述第一网络设备发送到所述至少一个其他网络设备的路由。
  3. 根据权利要求2所述的方法,其特征在于,在所述第一网络设备和所述第二网络设备之间建立所述pull模式的BGP邻居关系之前,所述方法还包括:
    所述第一网络设备向所述第二网络设备发送包括角色标识的协商报文,所述协商报文用于指示所述第一网络设备在所述pull模式的BGP邻居关系中的角色将为所述角色标识所指示的角色。
  4. 根据权利要求3所述的方法,其特征在于,所述pull模式的BGP邻居关系中的角色包括:所述pull模式下的路由接收方,所述pull模式下的路由发送方,或,所述pull模式下的路由发送方和路由接收方。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,在所述第一网络设备向第二网络设备发送请求消息之前,所述第一网络设备上保存有到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备。
  6. 根据权利要求5所述的方法,其特征在于,所述第一路由为缺省路由或聚合路由。
  7. 根据权利要求5或6所述的方法,其特征在于,所述方法还包括:
    所述第一网络设备接收第一报文,所述第一报文为去往第三网络设备的报文,所述第三网络设备属于所述至少一个其他网络设备;
    所述第一网络设备确定所述第一报文与所述第一路由匹配;
    所述第一网络设备根据所述第一路由,向所述第二网络设备发送所述第一报文。
  8. 根据权利要求7所述的方法,其特征在于,所述到所述至少一个其他网络设备的路由包括到所述第三网络设备的第二路由,所述第一网络设备接收所述第二网络设备响应于所述请求消息发送的路由消息之后,所述方法还包括:
    所述第一网络设备接收第二报文,所述第二报文为去往所述第三网络设备的报文;
    所述第一网络设备确定所述第二报文与所述第二路由匹配;
    所述第一网络设备根据所述第二路由,向所述第三网络设备发送所述第二报文。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述第一条件包括下述条件中的至少一个:
    所述第一网络设备确定到所述至少一个其他网络设备的网络状况满足第二条件;
    所述第一网络设备到所述至少一个其他网络设备的业务类型存在优化需求;
    所述第一网络设备接收到指示消息,所述指示消息用于指示所述第一网络设备请求到所述至少一个其他网络设备的路由。
  10. 根据权利要求9所述的方法,其特征在于,所述第二条件包括下述条件中的至少一个:
    所述第一网络设备到所述至少一个其他网络设备的流量大于或等于第一阈值;或者,
    所述第一网络设备到所述至少一个其他网络设备的时延大于或等于第二阈值。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述请求消息包括所述至少一个其他网络设备的标识信息,所述标识信息包括所述至少一个其他网络设备的前缀,或者,到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述请求消息为出站路由过滤ORF请求消息。
  13. 根据权利要求12所述的方法,其特征在于,所述ORF请求消息包括类型字段,所述类型字段的取值指示所述ORF请求消息包括增量型ORF字段。
  14. 一种路由方法,其特征在于,包括:
    第二网络设备接收第一网络设备发送的请求消息,所述请求消息用于请求到至少一个其他网络设备的路由,所述第一网络设备和所述其他网络设备均与所述第二网络设备连接;
    响应于所述请求消息,所述第二网络设备向所述第一网络设备发送路由消息,所述路由消息携带到所述至少一个其他网络设备的路由。
  15. 根据权利要求14所述的方法,其特征在于,所述第一网络设备和所述第二网络设备之间为拉pull模式的边界网关协议BGP邻居关系,所述第一网络设备为所述pull模式下的路由接收方,所述第二网络设备为所述pull模式下的路由发送方,所述第二网络设备向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备;所述第一网络设备基于所述第一条件向所述第二网络设备发送请求消息,所述第二网络设备响应于所述请求消息向所述第一网络设备发送到所述至少一个其他网络设备的路由。
  16. 根据权利要求15所述的方法,其特征在于,在所述第一网络设备和所述第二网络设备之间建立所述pull模式的BGP邻居关系之前,所述方法还包括:
    所述第二网络设备向所述第一网络设备发送包括角色标识的协商报文,所述协商报文用于指示所述第二网络设备在所述pull模式的BGP邻居关系中的角色将为所述角色标识所指示的角色。
  17. 根据权利要求16所述的方法,其特征在于,所述pull模式的BGP邻居关系中的角色包括:所述pull模式下的路由接收方,所述pull模式下的路由发送方,或,所述pull模 式下的路由发送方和路由接收方。
  18. 根据权利要求14-17任一项所述的方法,其特征在于,在所述第二网络设备接收第一网络设备发送的请求消息之前,所述方法还包括:
    所述第二网络设备向所述第一网络设备发送到所述第二网络设备的第一路由,所述第一路由用于指示所述第一网络设备将去往所述其他网络设备的流量发送到所述第二网络设备。
  19. 根据权利要求18所述的方法,其特征在于,所述第一路由为缺省路由或聚合路由。
  20. 根据权利要求18或19所述的方法,其特征在于,所述方法还包括:
    所述第二网络设备接收所述第一网络设备发送的第一报文,所述第一报文为去往第三网络设备的报文,所述第三网络设备属于所述至少一个其他网络设备;
    所述第二网络设备向所述第三网络设备发送所述第一报文。
  21. 根据权利要求14-20任一项所述的方法,其特征在于,所述请求消息包括所述至少一个其他网络设备的标识信息,所述标识信息包括所述至少一个其他网络设备的前缀,或者,所述请求消息包括到达所述至少一个其他网络设备的路径所经过的至少一个自治域AS号。
  22. 根据权利要求14-21任一项所述的方法,其特征在于,所述请求消息为出站路由过滤ORF请求消息。
  23. 根据权利要求22所述的方法,其特征在于,所述ORF请求消息包括类型字段,所述类型字段的值用于指示所述ORF请求消息的类型为增量型ORF请求消息。
  24. 根据权利要求23所述的方法,其特征在于,所述ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,所述方法还包括:
    所述第二网络设备确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的所有序号均不匹配,则,所述第二网络设备保存所述第一序号和所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息的对应关系。
  25. 根据权利要求23所述的方法,其特征在于,所述ORF请求消息包括增量型ORF字段,所述增量型ORF字段承载所述至少一个其他网络设备的标识信息,所述方法还包括:
    所述第二网络设备确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,则,所述第二网络设备用所述增量型ORF字段中所承载的所述至少一个其他网络设备的标识信息替换所述第二序号对应的内容。
  26. 根据权利要求23所述的方法,其特征在于,所述方法还包括:
    所述第二网络设备确定所述增量型ORF字段中的第一序号Sequence与所述第二网络设备上已有的第二序号匹配,且所述第二网络设备根据所述增量型ORF字段获得删除指示,则,所述第二网络设备删除所述第二序号对应的内容。
  27. 一种网络设备,其特征在于,所述网络设备包括:处理器和存储器;
    所述存储器,用于存储指令;
    所述处理器,用于执行所述存储器中的所述指令,使得所述网络设备执行权利要求1-13或14-26任一项所述的方法。
  28. 一种网络系统,其特征在于,所述网络系统包括:第一网络设备和第二网络设备;
    其中,所述第一网络设备,用于执行权利要求1-13任一项所述的方法;
    所述第二网络设备,用于执行权利要求14-26任一项所述的方法。
  29. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码或指令,当所述程序代码或指令在计算机上运行时,使得所述计算机执行以上权利要求1-26中任意一项所述的方法。
PCT/CN2021/142797 2020-12-31 2021-12-30 一种路由方法及相关设备 WO2022143854A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21914585.1A EP4262281A1 (en) 2020-12-31 2021-12-30 Routing method and related device
US18/343,463 US20230344756A1 (en) 2020-12-31 2023-06-28 Routing method and related device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011640118.2A CN114697250A (zh) 2020-12-31 2020-12-31 一种路由方法及相关设备
CN202011640118.2 2020-12-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/343,463 Continuation US20230344756A1 (en) 2020-12-31 2023-06-28 Routing method and related device

Publications (1)

Publication Number Publication Date
WO2022143854A1 true WO2022143854A1 (zh) 2022-07-07

Family

ID=82136036

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/142797 WO2022143854A1 (zh) 2020-12-31 2021-12-30 一种路由方法及相关设备

Country Status (4)

Country Link
US (1) US20230344756A1 (zh)
EP (1) EP4262281A1 (zh)
CN (1) CN114697250A (zh)
WO (1) WO2022143854A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577875A (zh) * 2009-06-08 2009-11-11 中兴通讯股份有限公司 路由请求消息前转方法和装置
US20100146038A1 (en) * 2008-12-05 2010-06-10 At&T Corp. System and Method for Assigning Requests in a Content Distribution Network
CN107070790A (zh) * 2016-12-16 2017-08-18 浙江宇视科技有限公司 一种路由学习方法及路由设备
CN110611614A (zh) * 2019-07-31 2019-12-24 贵阳忆联网络有限公司 一种抑制bgp邻居震荡的方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100146038A1 (en) * 2008-12-05 2010-06-10 At&T Corp. System and Method for Assigning Requests in a Content Distribution Network
CN101577875A (zh) * 2009-06-08 2009-11-11 中兴通讯股份有限公司 路由请求消息前转方法和装置
CN107070790A (zh) * 2016-12-16 2017-08-18 浙江宇视科技有限公司 一种路由学习方法及路由设备
CN110611614A (zh) * 2019-07-31 2019-12-24 贵阳忆联网络有限公司 一种抑制bgp邻居震荡的方法及系统

Also Published As

Publication number Publication date
US20230344756A1 (en) 2023-10-26
CN114697250A (zh) 2022-07-01
EP4262281A1 (en) 2023-10-18

Similar Documents

Publication Publication Date Title
US10534601B1 (en) In-service software upgrade of virtual router with reduced packet loss
WO2019223447A1 (zh) 一种生成路由的方法和设备
US10812394B2 (en) Virtual network device and related method
US10237179B2 (en) Systems and methods of inter data center out-bound traffic management
US8694654B1 (en) Host side protocols for use with distributed control plane of a switch
US8943490B1 (en) Intelligent non-stop software upgrade
EP2399369B1 (en) Distributed data center access switch
US20150200808A1 (en) Method and system for virtual machine aware policy management
WO2017032300A1 (zh) 一种数据传输方法、虚拟网络管理装置及数据传输系统
US10404773B2 (en) Distributed cluster processing system and packet processing method thereof
WO2016146077A1 (zh) 一种动态路由配置方法、装置及系统
US11336570B1 (en) Layer three multi-homing for virtual networks
CN114697252A (zh) 计算机网络方法、软件定义网络控制器及存储介质
EP3588875B1 (en) Web services across virtual routing and forwarding
US20210320865A1 (en) Flow-based local egress in a multisite datacenter
CN111638957A (zh) 一种集群共享式公有云负载均衡的实现方法
WO2021179718A1 (zh) 一种报文传输方法、装置和网络设备
EP3038296A1 (en) Pool element status information synchronization method, pool register and pool element
JP7388533B2 (ja) ゲートウェイ装置、方法及びプログラム
CN106789523B (zh) 一种逻辑隧道的创建方法及装置
WO2022143854A1 (zh) 一种路由方法及相关设备
WO2022063065A1 (zh) 一种路由信息传输方法及装置
CN115665026A (zh) 一种集群组网的方法和装置
WO2021083228A1 (zh) 报文转发方法、装置及计算机存储介质
WO2018112835A1 (zh) 选择网关的方法、设备和系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21914585

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021914585

Country of ref document: EP

Effective date: 20230712

NENP Non-entry into the national phase

Ref country code: DE