CN116566899A - Routing processing method and device - Google Patents
Routing processing method and device Download PDFInfo
- Publication number
- CN116566899A CN116566899A CN202310631991.2A CN202310631991A CN116566899A CN 116566899 A CN116566899 A CN 116566899A CN 202310631991 A CN202310631991 A CN 202310631991A CN 116566899 A CN116566899 A CN 116566899A
- Authority
- CN
- China
- Prior art keywords
- route
- host
- network device
- address information
- host route
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title abstract description 16
- 238000000034 method Methods 0.000 claims abstract description 57
- 230000002776 aggregation Effects 0.000 claims description 48
- 238000004220 aggregation Methods 0.000 claims description 48
- 238000001514 detection method Methods 0.000 claims description 21
- 230000004044 response Effects 0.000 claims description 12
- 230000000977 initiatory effect Effects 0.000 claims description 7
- 230000006855 networking Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 239000000523 sample Substances 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
- H04L45/748—Address table lookup; Address filtering using longest matching prefix
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/54—Organization of routing tables
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a routing processing method and device, wherein the method comprises the following steps: receiving a first route announcement sent by second network equipment, wherein the first route announcement comprises a first host route and a first serial number; storing the first host route and the first sequence number in a second RIB included in the BGP protocol module; according to the address information included in the first host route, acquiring all second host routes including the address information and second serial numbers of the second host routes from the second RIB; selecting a third serial number from all the second serial numbers, wherein the third serial number is the largest serial number in all the second serial numbers; if the third host route corresponding to the third serial number is sent by the third network device in the same area as the first network device, the third host route is added to the first RIB, and the added route table item is issued to the forwarding table FIB.
Description
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a routing processing method and device.
Background
At present, a Spine-Leaf networking architecture is a basic networking mode for forming a region, and if a plurality of regions exist, the regions can be interconnected through a convergence switch. Each Leaf in each area is three layers of gateway equipment of an access user, and the IP addresses and the MAC addresses of gateway interfaces of all gateway equipment are configured to be the same value, so that a distributed gateway is formed.
After the user terminal accesses Leaf1 in area 1 in the Spine-Leaf networking, leaf1 generates a user entry (e.g., ARP entry or IPv6 ND entry) directed to the user terminal and converts the user entry into a user host route indicating arrival at the user terminal. By BGP protocol, leaf1 advertises subscriber host routes to Spine1 within zone 1. The Spine1 in turn advertises the subscriber host routes to other Leaf and aggregation switches in the area. The aggregation switch advertises the subscriber host route to Spine2 of zone 2. After receiving the user host route, the Spine2 announces the user host route to all the Leaf in the area.
Similarly, the host routes of the user terminals in the area 2 will be announced to the area 1, so that the Spine and Leaf in each area store the host routes of the user terminals in all areas.
The process of each network device advertising the host route to each other in the Spine-Leaf networking exposes the following problems: 1) And the routing table and forwarding table resource consumption problem. The Leaf in this area will receive the user host routes of all user terminals that are on-line in other areas, which will cause the number of user host routes to exceed the capacity of the routing table, and even exceed the number of software entries that the memory can accommodate. Existing Leaf is typically a medium-low access switch, and the amount of hardware resources allocated to the forwarding table is small, e.g., thousands.
Disclosure of Invention
In view of this, the present application provides a route processing method and apparatus, which are used to solve the problem of resource consumption of a routing table and a forwarding table in the existing Spine-Leaf networking for advertising the route of a user host.
In a first aspect, the present application provides a routing processing method, where the method is applied to a first network device, where the first network device is in a Spine-Leaf network, and the first network device includes a BGP protocol module and a first routing information base RIB, and the method includes:
receiving a first route announcement sent by second network equipment, wherein the first route announcement comprises a first host route and a first serial number of the first host route;
storing a first sequence number of the first host route in a second RIB included in the BGP protocol module;
obtaining all second host routes comprising the address information and second serial numbers of the second host routes from the second RIB according to the address information included in the first host routes, wherein the second host routes comprise the first host routes, the second serial numbers comprise the first serial numbers, and each second host route is sent by a BGP peer of the first network equipment;
Selecting a third serial number from all the second serial numbers, wherein the third serial number is the largest serial number in all the second serial numbers;
if the third host route corresponding to the third serial number is sent by a third network device in the same area as the first network device, adding the third host route into the first RIB, and issuing an added route table item into a forwarding table FIB;
and the third network equipment is accessed to the user terminal, and the network equipment of the third host route is initially generated.
In a second aspect, the present application provides a routing processing apparatus, where the apparatus is applied to a first network device, where the first network device is in a Spine-Leaf network, and the first network device includes a BGP protocol module and a first routing information base RIB, and the apparatus includes:
a receiving unit, configured to receive a first route advertisement sent by a second network device, where the first route advertisement includes a first host route and a first sequence number of the first host route; adding the first serial number of the first host route to a second RIB included in the BGP protocol module;
A storage unit, configured to store the first host route and the first sequence number in a second RIB included in the BGP protocol module;
an obtaining unit, configured to obtain, from the second RIB, second sequence numbers of all host routes including the address information and second host routes including the first host route according to address information included in the first host route, where the second sequence numbers include the first sequence number, and each second host route is sent by a BGP peer of the first network device;
a selecting unit, configured to select a third sequence number from all the second sequence numbers, where the third sequence number is a maximum sequence number in all the second sequence numbers;
an adding unit, configured to add a third host route corresponding to the third sequence number to the first RIB if the third host route is sent by a third network device that is in the same area as the first network device, and send an added routing table entry to a forwarding table FIB;
and the third network equipment is accessed to the user terminal, and the network equipment of the third host route is initially generated.
In a third aspect, the present application provides a network device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to cause the processor to perform the method provided in the first aspect of the present application.
Therefore, by applying the route processing method and device provided by the application, the first network equipment receives the first route notification sent by the second network equipment, wherein the first route notification comprises the first host route and the first serial number of the first host route; the first network device storing a first host route and a first sequence number of the first host route in a second RIB included in the BGP protocol module; according to the address information included in the first host route, the first network device acquires all second host routes including the address information and second serial numbers of the second host routes from the second RIB, the second host routes include the first host routes, the second serial numbers include the first serial numbers, and each second host route is sent by a BGP peer of the first network device; the first network equipment selects a third sequence number from all the second sequence numbers, wherein the third sequence number is the largest sequence number in all the second sequence numbers; if the third host route corresponding to the third serial number is sent by the third network equipment in the same area as the first network equipment, the first network equipment adds the third host route into the first RIB, and issues the added route list item into a forwarding list FIB; and the third network equipment is accessed to the user terminal and initially generates network equipment of a third host route.
Thus, the Spine and Leaf under the multi-area scene only store the user host routes of the user terminals on line in the area by judging the mode of comparing the host route source areas with the serial numbers, thereby saving the resources of the routing table and the forwarding table. The method solves the problem of resource consumption of a routing table and a forwarding table which are used for notifying a user host of routing in the existing Spine-Leaf networking.
Drawings
Fig. 1 is a flowchart of a routing processing method provided in an embodiment of the present application;
FIG. 2 is an extended community attribute format diagram provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a host route advertised by each network device in a Spine-Leaf networking when a user terminal provided in an embodiment of the present application is online;
fig. 4 is a diagram illustrating a host route advertised by each network device in a Spine-Leaf network when a user terminal provided in an embodiment of the present application roams across regions;
fig. 5 is a block diagram of a communication device according to an embodiment of the present application;
fig. 6 is a hardware structure of a network device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the corresponding listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The following describes the routing processing method provided in the embodiment of the present application in detail. Referring to fig. 1, fig. 1 is a flowchart of a routing processing method provided in an embodiment of the present application. The method is applied to the first network device, and the routing processing method provided by the embodiment of the application can comprise the following steps.
Step 110, receiving a first route announcement sent by a second network device, wherein the first route announcement comprises a first host route and a first serial number of the first host route;
specifically, a first network device is within a Spine-Leaf networking, the first network device including a BGP protocol module and a first routing information base, RIB. The Spine-Leaf networking further comprises second network equipment, and all the network equipment in the Spine-Leaf networking are BGP peers.
After the user terminal accesses the second network device, the second network device generates a first host route of the user terminal. At the same time, the second network device also generates a first route advertisement that includes the first host route and a first sequence number of the first host route.
The second network device advertises host routing for the user terminal within the Spine-Leaf network. The first network device receives the first route advertisement and obtains therefrom a first host route and a first sequence number.
The process of generating the first route advertisement by the second network device is described in the following embodiments, and will not be described here.
It will be appreciated that if there is a user terminal accessing the first network device, the first network device also performs the process of generating the first host route, the first route advertisement, and the advertisement within the Spine-Leaf network by the second network device.
Step 120, storing the first sequence number of the first host route in a second route information base RIB included in the BGP protocol module;
specifically, according to the description of step 110, after receiving the first host route and the first sequence number, the first network device stores the first host route and the first sequence number in a second RIB included in the BGP protocol module.
In this embodiment, the host route and the sequence number sent by the BGP peer of the first network device are stored in the second RIB. The stored host route and sequence number may be referred to as a second host route and a second sequence number. The second host route includes the first host route and the second sequence number includes the first sequence number.
Step 130, according to the address information included in the first host route, obtaining all second host routes including the address information and second sequence numbers of the second host routes from the second RIB, where the second host routes include the first host route, the second sequence numbers include the first sequence numbers, and each second host route is sent by a BGP peer of the first network device;
Specifically, according to the description of step 110, after the first network device acquires the first host route and the first serial number, the address information of the user terminal is acquired from the first host route.
And according to the address information of the user terminal, the first network equipment acquires all second host routes comprising the address information of the user terminal and second serial numbers of the second host routes from the second RIB. Step 140, selecting a third serial number from all the second serial numbers, wherein the third serial number is the largest serial number in all the second serial numbers;
specifically, according to the description of step 120, after the first network device obtains all the second host routes and the second sequence numbers, the first network device compares the sizes of the second sequence numbers.
The first network device selects a third sequence number from the plurality of sequence numbers, wherein the third sequence number is the largest sequence number in all the second sequence numbers.
In embodiments of the present application, the serial number of the host route may be represented by a number. E.g., 0,1,2,3, etc.
And 150, if the third host route corresponding to the third serial number is sent by a third network device in the same area as the first network device, adding the third host route to the first RIB, and issuing the added route table entry to a forwarding table FIB.
Specifically, according to the description of step 130, after the first network device obtains the third sequence number, if the third host route corresponding to the third sequence number is sent by the third network device in the same area as the first network device, the first network device adds the third host route to the first RIB, and issues the added route table entry to the forwarding table FIB.
The third network device is a network device that is accessed by the user terminal and initially generates a third host route, that is, a network device that converts the user table entry into a user host route that indicates the user host route to reach the user terminal.
Optionally, in the embodiment of the present application, another case is further included, where if the third host route corresponding to the third sequence number is sent by a third network device that is in a different area with the first network device, the first network device maintains the third host route in the second RIB.
Optionally, after the first network device obtains the third serial number, it may further determine whether to add the third host route to the first RIB by determining whether the third host route sent by the third network device includes an identifier of an autonomous system where the network device connected to the different area is located, and send the added route table entry to the FIB.
Further, the first network device identifies whether the third host route sent by the third network device includes an identifier of an autonomous system (English: autonomous System, abbreviated: AS) where the network device connected to the different area is located; if the third host route does not comprise the identifier of the AS where the network equipment connected with the different areas is located, the first network equipment determines that the third network equipment is located in the same area AS the first host route; if the third host route includes an identifier of an AS where the network device connected to the different area is located, the first network device determines that the third network device is located in the different area from itself.
In summary, the first network device only adds the host route of the user terminal in the same area as the first network device to the first RIB, and issues the added route table item to the FIB; and host routes of user terminals in different areas from the host routes are stored in the second RIB, are not added to the RIB, and are not issued to the FIB. Thus, the software and hardware resources of the first RIB and the FIB table are saved.
Therefore, by applying the route processing method provided by the application, the first network device receives the first route notification sent by the second network device, wherein the first route notification comprises the first host route and the first serial number of the first host route; the first network device storing a first host route and a first sequence number of the first host route in a second RIB included in the BGP protocol module; according to the address information included in the first host route, the first network device acquires all second host routes including the address information and second serial numbers of the second host routes from the second RIB, the second host routes include the first host routes, the second serial numbers include the first serial numbers, and each second host route is sent by a BGP peer of the first network device; the first network equipment obtains a third serial number from all the second serial numbers, wherein the third serial number is the maximum serial number in all the second serial numbers; if the third host route corresponding to the third serial number is sent by the third network equipment in the same area as the first network equipment, the first network equipment adds the third host route into the first RIB, and issues the added route list item into a forwarding list FIB; and the third network equipment is accessed to the user terminal and initially generates network equipment of a third host route.
Thus, the Spine and Leaf under the multi-area scene only store the user host routes of the user terminals on line in the area by comparing the serial numbers, thereby saving the resources of the routing table and the forwarding table. The method solves the problem of resource consumption of a routing table and a forwarding table which are used for notifying a user host of routing in the existing Spine-Leaf networking.
Optionally, in the embodiment of the present application, a process of generating a host route, a route announcement and an announcement in the Spine-Leaf network by the first network device after the user terminal accesses the first network device is further included.
Specifically, when the user terminal is directly connected to the first network device or the user terminal accesses the first network device through the access point, the first network device learns a user table entry (for example, ARP table entry) corresponding to the user terminal. The first network device converts the user entry into a user host route and adds the user host route to the first RIB.
It can be understood that, since the ue is directly connected to the first network device or is not directly connected to the first network device, the type of the route of the user host is identified as a specific type, that is, ARP type, which is used to indicate that the route of the user host is generated by advertising ARP table entry.
The first network device injects the subscriber host route in the first RIB into the second RIB, and generates a fourth host route corresponding to the subscriber terminal in the second RIB.
And judging whether a fifth host route comprising the address information exists in the second RIB according to the address information (namely, the address information of the user terminal) included in the fourth host route, wherein the fifth host route is sent by a BGP peer of the first network device.
If the fifth host route is not present in the second RIB, the first network device sets a fourth sequence number of the fourth host route to an initial sequence number (e.g., 0) and sends a second route advertisement to the BGP peer, the second route advertisement including the fourth host route and the fourth sequence number.
If the fifth host route exists in the second RIB, the first network equipment acquires a fifth serial number of the fifth host route, and takes the sum of the fifth serial number and 1 as a fourth serial number; the first network device still sends a second route advertisement to the BGP peer, the second route advertisement including a fourth host route and a fourth sequence number.
Wherein the fifth sequence number is the largest sequence number in a fifth host route including address information existing in the second RIB.
In this embodiment of the present application, the first route advertisement and the second route advertisement are BGP UPDATE messages, where the BGP UPDATE messages include a Path attribute (Path Attributes) field. The path attributes field includes an extended community attribute that is used to carry the serial number of the host route. As shown in fig. 2, fig. 2 is an extended community attribute format diagram provided in an embodiment of the present application.
In fig. 2, the extended community attribute includes a Type (Type, value 0x 07), a subtype (Sub-Type, value 0x 00), a Reserved (value 0), and a Sequence Number (Sequence Number).
Optionally, in the embodiment of the present application, when the first network device is further included as a network device accessed before roaming of the user terminal, after the first network device receives the host route of the user terminal sent by the BGP peer again (including being in the same area as the first network device and being in a different area as the first network device), the process of ARP detection is performed.
In one implementation, after receiving a first route announcement sent by a BGP peer, if it is identified that the first route announcement includes a first sequence number of a first host route, the first network device determines whether an ARP entry matching address information included in the first host route exists in a local ARP table.
If the local ARP table has an ARP table entry matched with the address information included in the first host route, the first network equipment deletes the ARP table entry; the first network device initiates an ARP probe towards the user terminal indicated by the address information.
If the first network equipment receives the ARP response sent by the user terminal, the first network equipment determines that the user terminal still accesses the first network equipment according to the ARP response and roaming does not occur. And the first network equipment generates an ARP (address resolution protocol) table entry corresponding to the user terminal again, and then generates a host route according to the ARP table entry and synchronizes the host route in the Spine-Leaf networking.
If the first network device does not receive the ARP reply sent by the user terminal, the first network device waits for a preset time period (for example, 200 ms) and initiates ARP detection again. After several ARP detections (e.g. 3 times), the first network device has not received the ARP reply sent by the user terminal, and the first network device determines that roaming of the user terminal has occurred.
In another implementation, after receiving the first route advertisement sent by the BGP peer, if it is identified that the first route advertisement includes the first sequence number of the first host route, the first network device determines whether an ARP entry matching address information included in the first host route exists in the local ARP table.
If the local ARP table contains an ARP table item matched with the address information included in the first host route, the first network equipment initiates ARP detection to the user terminal indicated by the address information.
If the first network device does not receive the ARP reply sent by the user terminal, the first network device waits for a preset time period (for example, 200 ms) and initiates ARP detection again. After multiple ARP detections (for example, 3 times), the first network device still does not receive an ARP reply sent by the user terminal, and then the first network device determines that roaming has occurred in the user terminal, deletes an ARP entry, and at the same time deletes a user host route corresponding to the ARP entry in the first RIB, and makes the BGP protocol module start to cancel the host route.
If the first network equipment receives the ARP response sent by the user terminal, the first network equipment determines that the user terminal still accesses the first network equipment according to the ARP response and roaming does not occur.
Optionally, in an embodiment of the present application, a procedure of updating the host route in the local first RIB by the first network device is further included.
Specifically, the user terminal roams in an area where the first network device is located and accesses the second network device in the area. At this time, through the description of the foregoing embodiment, the maximum sequence number selected by the first network device is the first sequence number of the first route advertisement message sent by the second network device.
The first network device should add the first host route to the first RIB and issue the added route entry to the FIB. However, since the user terminal has been previously accessed to the first network device, the routing table entry and forwarding table entry of the user terminal are already stored in the first RIB and FIB.
In the above scenario, the first network device may update the routing table entry and forwarding table entry of the user terminal according to the first host route. For example, the outgoing interface, next hop, included in the routing table entry is updated.
Optionally, in the embodiment of the present application, a process of automatically generating the network segment route by using the received host route when the first network device is used as the aggregation switch is further included.
Specifically, when the first network device is used as the aggregation switch, the network segment route needs to be issued to its BGP peer. The first network device generates a corresponding network segment route according to the first host route.
The first network device sends a third route advertisement to the BGP peer, the third route advertisement including the segment route. And the BGP peer receives the third route announcement and acquires the network segment route from the third route announcement. The BGP peer adds the network segment route to the first RIB of the BGP peer and issues the added route table item to the forwarding table FIB. At the same time, BGP peers may also advertise the segment routes to their other BGP peers.
Optionally, in this embodiment of the present application, a specific process of generating, by the first network device, a corresponding network segment route according to the first host route is:
according to different address types, the first network equipment acquires the prefix length of the configured aggregation route; if the number of the first host routes is one, the first network equipment uses the prefix length to acquire the default mask length for the address information included in the first host routes, and acquires the address information after the operation of acquiring the default mask length; if the number of the first host routes is multiple, the first network equipment performs AND operation on address information included in the multiple first host routes by utilizing the prefix length to obtain the address information after operation; the first network device uses the address information after the operation of the default mask length or the address information after the operation as the address information included in the network segment route; the first network device configures an interface and a next hop for the address information after the operation of taking the default mask length or the address information after the operation, and obtains the network segment route.
Further, before the first network device performs the generation of the network segment route, a manager configures a prefix length of the aggregate route for the first network device according to the address family. For example, aiming at BGP IPv4 unicast address family, configuring prefix length value range of aggregation route corresponding to the address family to be 0-32; and aiming at the BGP IPv6 unicast address family, configuring the prefix length value range of the aggregation route corresponding to the address family to be 0-128. The prefix length of the aggregate route is the same as the network mask length.
The following describes the routing processing method provided in the embodiment of the present application in detail. Referring to fig. 3 and fig. 4, fig. 3 is a schematic diagram of a host route advertised by each network device in a Spine-Leaf network when a user terminal provided in an embodiment of the present application is online; fig. 4 is a schematic diagram of a host route advertised by each network device in a Spine-Leaf network when a user terminal provided in an embodiment of the present application roams across regions.
In FIG. 3, comprising zone 1, zone 2, each zone is implemented by a Spine-Leaf networking. Each Spine-Leaf network includes 1 Spine and 3 leaves. Each Spine is connected with a convergence switch to achieve interconnection between the regions.
The following description will take an example in which the terminal 1 is brought up at the AP3 hanging under the Leaf3 in the area 1.
After the terminal 1 comes online at the AP3, leaf3 learns the ARP entry of the terminal 1. As shown in table 1.
Table 1ARP entry
| IP address | MAC address | VLAN | Interface |
| 10.1.1.2 | 02e0-f102-0023 1 | 100 | XGE1/0/1 |
Leaf3 converts the ARP entry into a subscriber host route, and adds the subscriber host route to its own first RIB, the type of which is identified as a specific type, the ARP type. As shown in table 2.
Table 2 subscriber host routing table entries
| Destination/Mask | Proto/Sub Proto | Pre | Cost | NextHop | Interface |
| 10.1.1.2/32 | Direct/ARP | 0 | 0 | 10.1.1.2 | VLAN100 |
Wherein, proto/Sub Proto is all called: protocol/Sub Protocol (Protocol/Sub-Protocol); pre is collectively referred to as reference (priority).
Leaf3 injects subscriber host routes in the first RIB into a second RIB comprised by the own BGP protocol module. The BGP protocol module determines whether a host route exists in the second RIB that includes 10.1.1.2/32, the sequence number, and is sent by the BGP peer.
In the embodiment of the present application, the terminal 1 accesses the network from Leaf3 for the first time. At this point, there is no host route within the second RIB that includes 10.1.1.2/32, the sequence number, and is sent by the BGP peer. The BGP protocol module sets the sequence number of the host route 1 to be the initial sequence number, generates a route advertisement 1, and sends the route advertisement 1 to the Spine1 through BGP protocol. The route advertisement 1 includes the host route 1 and an initial sequence number.
Wherein, the host route 1 and the initial sequence number can be expressed as Rt1:0, rt1 is expressed as the host route of the destination IP address/mask; the initial sequence number may be defined as 0, or may be defined as another value, and the embodiment of the present application is described with the initial sequence number being 0.
After receiving the route announcement 1, the Spine1 obtains Rt1:0 from the route announcement 1; and stores Rt1:0 into a second RIB comprised by the own BGP protocol module. And according to the address information included in Rt1, acquiring all host routes and serial numbers including the address information from a second RIB included in the own BGP protocol module. Each host route is sent by a BGP peer.
And selecting the host route with the serial number being the maximum value from the serial numbers of the host routes. In the embodiment of the present application, since the terminal 1 accesses the network from the Leaf3 for the first time, only the sequence number 0 of the route advertisement 1 is present as the maximum value.
The BGP protocol module continues to identify whether the route advertisement 1 contains an identification of the AS in which the aggregation switch connecting the different areas is located. In this embodiment of the present application, the route announcement 1 does not include an identifier of the AS in which the aggregation switch is located, and the BGP protocol module determines that the route announcement 1 comes from a network device in the present area. The BGP protocol module adds Rt1 to the first RIB of Spine1 itself and issues the added routing table entry to the FIB.
It will be appreciated that Spine1 will continue to advertise host routes for terminal 1 to BGP peers (Leaf 1, leaf2, aggregation switches). For ease of illustration, the host route for terminal 1 is still identified as Rt1, however, spine1 will update the next hop and egress interface prior to advertising, and Spine1 generates route advertisement 2, which route advertisement 2 includes Rt1:0.
. Leaf1, leaf2 adds Rt1:0 to the respective first RIB of Leaf1, leaf2 and issues the added routing table entry to the FIB. At this point, leaf1, leaf2 no longer advertises the host route of terminal 1 to other BGP peers.
The aggregation switch will continue to advertise the host route of the terminal 1 to BGP peers (Spine 2). The aggregation switch generates a route advertisement 3, the route advertisement 3 comprising Rt1:0.
In practical application, the aggregation switch will receive route advertisements 2 from 1 to a plurality of different terminals sent by the Spine 1. The aggregation switch may generate segment routes from 1 to a plurality of route advertisements 2.
And the manager configures the prefix length of the aggregation route for the aggregation switch according to the address family. For example, aiming at BGP IPv4 unicast address family, configuring prefix length value range of aggregation route corresponding to the address family to be 0-32; and aiming at the BGP IPv6 unicast address family, configuring the prefix length value range of the aggregation route corresponding to the address family to be 0-128.
In one example, the address information included in the host route received by the aggregation switch is specifically: 10.99.152.255/32, 10.99.152.204/32.. 10.99.152.3/32, 10.99.152.2/32. At this time, the aggregation switch determines that the address type of the address information belongs to BGP IPv4 unicast address families. The aggregation switch obtains the prefix length of the aggregation route corresponding to the configured BGP IPv4 unicast address family from the local place to be 24.
Utilizing prefix length, the aggregation switch performs AND operation on the plurality of address information to obtain address information after AND operation, namely 10.99.152.0/24; the aggregation switch takes 10.99.152.0/24 as address information of the network segment where each terminal is located. The aggregation switch configures an interface and a next hop for the address information and generates a network segment route 1.
In another example, the host route received by the aggregation switch includes address information, specifically 10.99.152.255/32. At this time, the aggregation switch determines that the address type of the address information belongs to BGP IPv4 unicast address families. The aggregation switch obtains the prefix length of the aggregation route corresponding to the configured BGP IPv4 unicast address family from the local place to be 24.
Utilizing the prefix length, the convergence switch takes the default mask length for the address information to obtain the address information after the operation of taking the default mask length, namely 10.99.152.0/24; the aggregation switch takes 10.99.152.0/24 as address information of the network segment where each terminal is located. The aggregation switch configures an interface and a next hop for the address information and generates a network segment route 1.
It can be appreciated that the aggregation switch needs to synchronize the segment routes to the spines 1 and Spine2, so that the spines 1 and Spine2 add the segment routes to their own first RIB, and issue the added route entries to the FIB.
After the added routing table entries are issued to the FIB by the spines 1 and 2, the network segment routes are synchronized with the connected and accessed Leaf respectively, so that the Leaf adds the network segment routes to the first RIB of the Leaf and issues the added routing table entries to the FIB.
The aggregation switch can also route to the Spine1 and Spine2 synchronous network segments in a mode of sending route advertisements. The Spine1 and Spine2 can also route to the Leaf synchronous network segment accessed by each connection in a mode of sending route notification.
Since each device performs the same procedure after receiving the network segment route, the procedure is not repeated in subsequent steps.
After receiving the route announcement 3, the Spine2 acquires Rt1:0 from the route announcement; and Rt1:0 is added to a second RIB comprised by the own BGP protocol module. And according to the address information included in Rt1, acquiring all host routes and serial numbers including the address information from a second RIB included in the own BGP protocol module. Each host route is sent by a BGP peer.
And selecting the host route with the serial number being the maximum value from the serial numbers of the host routes. In the embodiment of the present application, since the terminal 1 is the first terminal to access the Leaf3, only the sequence number 0 of the route advertisement 3 is the maximum value at this time.
The BGP protocol module continues to identify whether the route advertisement 3 contains an identification of the AS in which the aggregation switch connecting the different areas is located. In this embodiment of the present application, the route advertisement 3 includes an identifier of the AS in which the aggregation switch is located, and the BGP protocol module determines that the route advertisement 3 is from a network device in a non-home area. The BGP protocol module stores Rt1 only in the second RIB, but not in the first RIB of the Spine2 itself, and also in the FIB, thereby saving the resources of the RIB and the FIB.
It will be appreciated that Spine2 will continue to advertise host routes for terminal 1 to BGP peers (Leaf 4, leaf5, leaf 6). For ease of illustration, the host route for terminal 1 is still identified as Rt1, and Spine2 generates route advertisement 4, which route advertisement 4 includes Rt1:0.
After the Leaf4, leaf5 and Leaf6 receive the route advertisement 4, the Leaf4, leaf5 and Leaf6 store Rt1 only in the second RIB included in the BGP protocol, but not in the first RIB and FIB, thereby saving resources of the RIB and FIB.
It should be noted that, after receiving the route notification including the sequence number, leaf1, leaf2, leaf4, leaf5, leaf6 will first determine whether there is an ARP entry in the local ARP table that matches the address information of terminal 1. If not, the subsequent steps are not executed, if yes, the process of executing ARP detection is initiated, or the process of executing ARP detection is initiated after the ARP list item is deleted.
In fig. 4, terminal 1 roams from AP3, which is under Leaf3 in zone 1, to AP4, which is under Leaf4 in zone 2.
After the terminal 1 comes online at the AP4, the Leaf4 learns the ARP entry of the terminal 1. As shown in table 3.
Table 3ARP entry
Leaf4 converts the ARP entry into a subscriber host route, and adds the subscriber host route to its own first RIB, the type of which is identified as a specific type, the ARP type. As shown in table 4.
Table 4 user host routing table entries
| Destination/Mask | Proto/Sub Proto | Pre | Cost | NextHop | Interface |
| 10.1.1.2/32 | Direct/ARP | 0 | 0 | 10.1.1.2 | VLAN100 |
Wherein, proto/Sub Proto is all called: protocol/Sub Protocol (Protocol/Sub-Protocol); pre is collectively referred to as reference (priority).
Leaf4 injects subscriber host routes in the first RIB into a second RIB comprised by the own BGP protocol module. The BGP protocol module determines whether a host route exists in the second RIB that includes 10.1.1.2/32, the sequence number, and is sent by the BGP peer.
In one case of the embodiment of the present application, it can be seen from the foregoing embodiment shown in fig. 3 that the host route rt1:0 when the terminal 1 hangs down at the AP3 is already stored in the second RIB. The host route includes 10.1.1.2/32 and sequence number 0 and the host route is sent by BGP peer (Spine 2). At this time, the BGP protocol module sets the sequence number of the host route 2 to 1 (the sum of the maximum sequence numbers of 0 and 1), generates a route advertisement 5, and transmits the route advertisement 5 to the Spine2 via BGP protocol. The route advertisement 5 includes the host route 2 and the sequence number 1.
Wherein, the host route 2 and the serial number 1 can be expressed as Rt1:1. Since host route 2 is still represented as a route to terminal 1, rt1 continues to be used to represent a route to terminal 1 in the embodiment of the present application. Rt1 represents host routing for destination IP address/mask.
It should be noted that, in another case of the embodiment of the present application, if Leaf4 does not receive Rt1:0 sent by Spine2 (i.e., terminal 1 quickly roams to AP4 immediately after coming online at AP 3), rt1:0 is not stored in the second RIB. The BGP protocol module determines that there is no host route in the second RIB that includes 10.1.1.2/32, the sequence number, and that is sent by the BGP peer. In this implementation, the BGP protocol module sets the sequence number of the injected host route 2 to the initial sequence number 0 and generates a route advertisement 5, and sends the route advertisement 5 to the Spine2 via the BGP protocol. The route advertisement 5 includes host route 2 and initial sequence number 0.
Wherein, the host route 2 and the initial serial number 0 are still expressed as Rt1:0, rt1 is expressed as the host route of the destination IP address/mask, and the host route also comprises information such as an outbound interface, a next hop and the like.
It can be appreciated that, after the route announcement 5 is received by the Spine2, rt1:1 is obtained therefrom; and stores Rt1:1 into a second RIB comprised by the own BGP protocol module. And according to the address information included in Rt1, acquiring all host routes and serial numbers including the address information from a second RIB included in the own BGP protocol module. Each host route is sent by a BGP peer.
And selecting the host route with the serial number being the maximum value from the serial numbers of the host routes. In the embodiment of the present application, as can be seen from the foregoing embodiment shown in fig. 3, the host route rt1:0 when the terminal 1 hangs down at the AP3 is already stored in the second RIB. The host route includes 10.1.1.2/32 and sequence number 0 and the host route is sent by the BGP peer (aggregation switch).
At this time, the BGP protocol module selects the host route Rt1:1 corresponding to sequence number 1. The BGP protocol module continues to identify whether the route advertisement 5 contains an identification of the AS in which the aggregation switch connecting the different areas is located. In this embodiment of the present application, the route advertisement 5 does not include an identifier of the AS in which the aggregation switch is located, and the BGP protocol module determines that the route advertisement 5 is from a network device in the local area. The BGP protocol module adds Rt1 to the first RIB of Spine2 itself and issues the added routing table entry to the FIB.
It will be appreciated that Spine2 will continue to advertise host routes for terminal 1 to BGP peers (Leaf 5, leaf6, aggregation switches). For ease of illustration, the host route for terminal 1 is still identified as Rt1, and Spine2 generates a route advertisement 6, the route advertisement 6 comprising Rt1:1.
In the above implementation, the host route rt1:0 when the terminal 1 hangs down at the AP3 is already stored in the second RIB, and the host route rt1:0 may be revoked by withdrawing the host route after the Leaf3 determines that the terminal 1 roams.
In the second case of the embodiment of the present application, as can be seen from the foregoing embodiment shown in fig. 3, the Spine2 own BGP protocol module includes a second RIB in which the host route Rt1:0 when the terminal 1 hangs down at the AP3 is already stored. The host route includes 10.1.1.2/32 and sequence number 0 and the host route is sent by the BGP peer (aggregation switch).
After receiving the route announcement 5, the Spine2 acquires Rt1:0 from the route announcement; and Rt1:0 is added to a second RIB comprised by the own BGP protocol module. And according to the address information included in Rt1, acquiring all host routes and serial numbers including the address information from a second RIB included in the own BGP protocol module. Each host route is sent by a BGP peer.
And selecting the host route with the serial number being the maximum value from the serial numbers of the host routes. In this case, the BGP protocol module obtains the host route with sequence number equal to 0 and reaching terminal 1. At this time, the BGP protocol module may select a route from the aggregation switch according to the existing route preference rule, and this may cause a temporary routing error, where the routing error may be corrected after route reselection by sending an ARP probe according to the subsequent Leaf4, determining that the terminal 1 accesses itself, and sending a route advertisement including the updated sequence number.
After the Leaf5, leaf6 receives the route advertisement 6, in a normal case (the first case described above), the Leaf5, leaf6 adds Rt1:1 to the respective first RIB of the Leaf5, leaf6, and issues the added route entries to the FIB. At this point, leaf5, leaf6 no longer advertises the host routes of terminal 1 to other BGP peers.
Host route Rt1:0 when terminal 1 hangs down at AP3 is already stored in the respective second RIB in Leaf5, leaf6, and this host route Rt1:0 can be withdrawn by withdrawing the host route after Leaf3 has determined that terminal 1 has roamed.
In special cases (second case above), leaf5, leaf6 performs the same procedure as previously described for Spine2 and will not be repeated here.
After receiving the route advertisement 6, the aggregation switch performs the same procedure as the previous step of Spine2, and will not be repeated here. The aggregation switch will continue to advertise the host route of terminal 1 to BGP peers (Spine 1). The aggregation switch generates a route advertisement 7, the route advertisement 7 comprising Rt1:1.
After receiving the route advertisement 7, the Spine1 performs the same procedure as the aggregation switch described above, and will not be repeated here. Spine1 will continue to advertise host routes for terminal 1 to BGP peers (Leaf 1, leaf2, leaf 3). Spine1 generates a route advertisement 8, which route advertisement 8 includes Rt1:1.
After the Leaf1, leaf2 and Leaf3 receive the route advertisement 8, the Leaf1, leaf2 and Leaf3 store Rt1 only in the second RIB included in the BGP protocol module, but not in the first RIB and FIB, so that resources of the RIB and FIB are saved.
It should be noted that, after receiving the route notification including the sequence number, leaf1, leaf2, leaf3, leaf5, leaf6 will first determine whether there is an ARP entry in the local ARP table that matches the address information of terminal 1. If not, the subsequent steps are not executed, if yes, the process of executing ARP detection is initiated, or the process of executing ARP detection is initiated after the ARP list item is deleted.
In summary, in the Spine-Leaf networking shown in fig. 3 and fig. 4, after each BGP protocol module included in the Leaf receives a route advertisement including a sequence number sent by a BGP peer, the BGP protocol module triggers the ARP protocol module included in the Leaf to execute a process of determining whether an ARP entry matching address information included in a received host route (e.g., route advertisement 8) exists in a local ARP table.
In the following, leaf3 is taken as an example.
In one implementation, if an ARP entry matching the address information exists in the local ARP table, the ARP protocol module deletes the ARP entry; the ARP protocol module initiates ARP probing to the terminal 1 indicated by the address information.
And the ARP protocol module deletes the ARP list item and simultaneously informs the first RIB to delete the user host route Rt1:0 corresponding to the ARP list item from the first RIB. The first RIB informs the BGP protocol module to initiate a revocation host route rt1:0. The BGP protocol module issues a message of canceling host route Rt1:0 to the BGP peer, and each network device deletes Rt1:0 stored in the local first RIB and the second RIB according to the canceling host route.
If the ARP protocol module receives the ARP reply sent by the terminal 1, the ARP protocol module determines that the terminal 1 is still connected to itself according to the ARP reply, and roaming does not occur. The ARP protocol module generates an ARP table entry corresponding to the terminal 1 again. Subsequently, in generating host routes according to the ARP entries, the BGP protocol module also repeatedly executes the foregoing process of issuing route advertisements to BGP peers in fig. 3.
In the embodiment of the present application, if the ARP protocol module does not receive the ARP reply sent by the terminal 1, the ARP protocol module waits for a preset time period (for example, 200 ms) and initiates ARP detection again. After several ARP detections (for example, 3 times), the ARP protocol module still does not receive the ARP reply sent by the terminal 1, and then the ARP protocol module determines that roaming of the terminal 1 has occurred.
In another implementation, after receiving the route announcement 8, if it is identified that the route announcement 8 includes the serial number 1, then it is determined whether an ARP entry matching the address information exists in the local ARP table.
If the local ARP table has an ARP table item matched with the address information, the Leaf3 initiates ARP detection to the terminal 1 indicated by the address information.
In the embodiment of the present application, if the Leaf3 does not receive the ARP reply sent by the terminal 1, the Leaf3 waits for a preset time period (for example, 200 ms), and initiates ARP detection again. After multiple ARP detections (for example, 3 times), if Leaf3 has not received an ARP reply sent by terminal 1, leaf3 determines that terminal 1 has roamed, deletes the ARP entry, and deletes the user host route Rt1:0 corresponding to the ARP entry in the first RIB. The first RIB informs the BGP protocol module to initiate a revocation host route. The BGP protocol module issues a message of canceling host route Rt1:0 to the BGP peer, and each network device deletes Rt1:0 stored in the local first RIB and the second RIB according to the canceling host route.
If the Leaf3 receives the ARP reply sent by the terminal 1, according to the ARP reply, the Leaf3 determines that the terminal 1 still accesses itself, and roaming does not occur.
It should be noted that, the routing processing method provided in the embodiment of the present application is also suitable for a scenario where the ue roams in the present area, for example, the terminal 1 roams from the AP3 suspended from the Leaf3 in the area 1 to the AP1 suspended from the Leaf1 in the area 1. When the terminal roams in the present area, the processing procedure of each network device is similar to that of each network device in fig. 4, and will not be repeated here.
Based on the same inventive concept, the embodiment of the application also provides a route processing device corresponding to the route processing method. Referring to fig. 5, fig. 5 is a routing processing apparatus provided in an embodiment of the present application, where the apparatus is applied to a first network device, where the first network device is in a Spine-Leaf network, and the first network device includes a BGP protocol module and a first routing information base RIB, and the apparatus includes:
a receiving unit 510, configured to receive a first route advertisement sent by a second network device, where the first route advertisement includes a first host route and a first sequence number of the first host route;
a storage unit 520, configured to store the first host route and the first sequence number of the first host route into a second RIB included in the BGP protocol module;
an obtaining unit 530, configured to obtain, from the second RIB, all second host routes including the address information and second sequence numbers of second host routes including the first host route according to the address information included in the first host route, where the second sequence numbers include the first sequence number, and each second host route is sent by a BGP peer of the first network device;
A selecting unit 540, configured to select a third sequence number from all second sequence numbers, where the third sequence number is a maximum sequence number in all second sequence numbers;
an adding unit 550, configured to add the third host route to the first RIB if the third host route corresponding to the third sequence number is sent by a third network device that is in the same area as the first network device, and issue the added route table entry to a forwarding table FIB;
and the third network equipment is accessed to the user terminal, and the network equipment of the third host route is initially generated.
Optionally, the storage unit 520 is further configured to, if a third host route corresponding to the third sequence number is sent by a third network device that is in a different area with the first network device, maintain the third host route in the second RIB.
Optionally, the apparatus further comprises: an identifying unit (not shown in the figure) for identifying whether the third host route sent by the third network device includes an identifier of an autonomous system where the network device connected to the different area is located;
a first determining unit (not shown in the figure) configured to determine that the third network device is in the same area as the first network device if not included;
And if so, determining that the third network equipment and the first network equipment are in different areas.
Optionally, the apparatus further comprises: a first generation unit (not shown in the figure) configured to generate a fourth host route corresponding to a user terminal when the user terminal accesses the first network device;
a first determining unit (not shown in the figure) configured to determine, according to address information included in the fourth host route, whether a fifth host route including the address information exists in the second RIB, where the fifth host route is sent by a BGP peer of the first network device;
a sending unit (not shown in the figure) configured to set, if not, a fourth sequence number of the fourth host route to an initial sequence number, and send a second route advertisement to the BGP peer, where the second route advertisement includes the fourth host route and the fourth sequence number.
Optionally, the apparatus further comprises: a processing unit (not shown in the figure) configured to obtain a fifth sequence number of a fifth host route, and take a sum of the fifth sequence number and 1 as the fourth sequence number, if the fifth sequence number exists;
the sending unit (not shown in the figure) is further configured to send a second route advertisement to the BGP peer, where the second route advertisement includes the fourth host route and the fourth sequence number;
Wherein the fifth sequence number is the largest sequence number in a fifth host route including the address information existing in the second RIB.
Optionally, the apparatus further comprises: a second judging unit (not shown in the figure) for judging whether an ARP entry matching the address information included in the first host route exists in the local ARP table;
a deleting unit (not shown in the figure) for deleting the ARP table entry if present;
an initiating unit (not shown in the figure) for initiating ARP detection to the user terminal indicated by the address information;
the second generating unit (not shown in the figure) is further configured to, if an ARP reply sent by the user terminal is received, generate, according to the ARP reply, an ARP entry corresponding to the user terminal again;
a second determining unit (not shown in the figure) configured to determine that roaming has occurred in the user terminal if an ARP reply sent by the user terminal is not received.
Optionally, the second determining unit (not shown in the figure) is further configured to determine whether an ARP entry matching address information included in the first host route exists in a local ARP table;
the initiating unit (not shown in the figure) is further configured to initiate ARP detection to the user terminal indicated by the address information if the address information exists;
The deleting unit (not shown in the figure) is further configured to delete the ARP entry if the ARP reply sent by the user terminal is not received;
the second determining unit (not shown in the figure) is further configured to determine that roaming does not occur in the user terminal if an ARP reply sent by the user terminal is received.
Optionally, the apparatus further comprises:
a third generating unit (not shown in the figure) configured to generate a corresponding segment route according to the first host route;
the sending unit (not shown in the figure) is further configured to send a third route advertisement to the BGP peer, where the third route advertisement includes the segment route, so that the BGP peer adds the segment route to the first RIB, and issues the added routing table entry to a forwarding table FIB.
Optionally, the third generating unit (not shown in the figure) is specifically configured to obtain, according to different address types, a prefix length of the configured aggregation route;
if the number of the first host routes is one, using the prefix length to obtain default mask length for address information included in the first host routes, and obtaining address information after the operation of obtaining the default mask length; if the number of the first host routes is multiple, performing AND operation on address information included in the multiple first host routes by utilizing the prefix length to obtain the address information after operation; taking the address information after the default mask length operation or the address information after the operation as the address information included in the network segment route;
And configuring an interface and a next hop for the address information after the operation of taking the default mask length or the address information after the operation to obtain the network segment route.
Therefore, with the route processing device provided by the application, the first network device receives the first route notification sent by the second network device, wherein the first route notification comprises the first host route and the first serial number of the first host route; the first network device stores a first host route and a first serial number of the first host route into a second RIB included in the BGP protocol module; according to the address information included in the first host route, the first network device acquires all second host routes including the address information and second serial numbers of the second host routes from the second RIB, the second host routes include the first host routes, the second serial numbers include the first serial numbers, and each second host route is sent by a BGP peer of the first network device; the first network equipment selects a third sequence number from all the second sequence numbers, wherein the third sequence number is the largest sequence number in all the second sequence numbers; if the third host route corresponding to the third serial number is sent by the third network equipment in the same area as the first network equipment, the first network equipment adds the third host route into the first RIB, and issues the added route list item into a forwarding list FIB; and the third network equipment is accessed to the user terminal and initially generates network equipment of a third host route.
Thus, the Spine and Leaf under the multi-area scene only store the user host routes of the user terminals on line in the area by comparing the serial numbers, thereby saving the resources of the routing table and the forwarding table. The method solves the problem of resource consumption of a routing table and a forwarding table which are used for notifying a user host of routing in the existing Spine-Leaf networking.
Based on the same inventive concept, the present embodiment also provides a network device, as shown in fig. 6, including a processor 610, a transceiver 620, and a machine-readable storage medium 630, where the machine-readable storage medium 630 stores machine executable instructions capable of being executed by the processor 610, and the processor 610 is caused by the machine executable instructions to perform the routing processing method provided by the present embodiment. The route processing device shown in fig. 5 may be implemented by using a hardware structure of a network device as shown in fig. 6.
The computer readable storage medium 630 may include a random access Memory (in english: random Access Memory, abbreviated as RAM) or a nonvolatile Memory (in english: non-volatile Memory, abbreviated as NVM), such as at least one magnetic disk Memory. Optionally, the computer readable storage medium 630 may also be at least one storage device located remotely from the aforementioned processor 610.
The processor 610 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (English: digital Signal Processor; DSP; for short), an application specific integrated circuit (English: application Specific Integrated Circuit; ASIC; for short), a Field programmable gate array (English: field-Programmable Gate Array; FPGA; for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In this embodiment, processor 610, by reading machine-executable instructions stored in machine-readable storage medium 630, is caused by the machine-executable instructions to implement processor 610 itself and invoke transceiver 620 to perform the routing methods described in the embodiments of the present application previously.
In addition, the present embodiments provide a machine-readable storage medium 630, the machine-readable storage medium 630 storing machine-executable instructions that, when invoked and executed by the processor 610, cause the processor 610 itself and the invoking transceiver 620 to perform the routing methods described in the foregoing embodiments of the present application.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present application. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
For the route processing device and the machine-readable storage medium embodiments, since the method content related thereto is substantially similar to the method embodiments described above, the description is relatively simple, and the relevant points are referred to in the description of the method embodiments.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.
Claims (18)
1. A method of route processing, the method being applied to a first network device, the first network device being within a Spine-Leaf network, the first network device comprising a BGP protocol module and a first routing information base, RIB, the method comprising:
receiving a first route announcement sent by second network equipment, wherein the first route announcement comprises a first host route and a first serial number of the first host route;
storing the first host route and the first sequence number in a second RIB included in the BGP protocol module;
obtaining all second host routes comprising the address information and second serial numbers of the second host routes from the second RIB according to the address information included in the first host routes, wherein the second host routes comprise the first host routes, the second serial numbers comprise the first serial numbers, and each second host route is sent by a BGP peer of the first network equipment;
selecting a third serial number from all the second serial numbers, wherein the third serial number is the largest serial number in all the second serial numbers;
if the third host route corresponding to the third serial number is sent by a third network device in the same area as the first network device, adding the third host route into the first RIB, and issuing an added route table item into a forwarding table FIB;
And the third network equipment is accessed to the user terminal, and the network equipment of the third host route is initially generated.
2. The method according to claim 1, wherein the method further comprises:
and if the third host route corresponding to the third serial number is sent by a third network device which is in a different area with the first network device, the third host route is kept in the second RIB.
3. The method of claim 2, wherein after the selecting the third sequence number, the method further comprises:
identifying whether a third host route sent by the third network device contains an identifier of an autonomous system where the network device connected to a different area is located;
if not, determining that the third network device and the first network device are in the same area;
and if so, determining that the third network equipment and the first network equipment are in different areas.
4. The method according to claim 1, wherein the method further comprises:
when a user terminal accesses the first network equipment, generating a fourth host route corresponding to the user terminal;
judging whether a fifth host route comprising the address information exists in the second RIB according to the address information comprising the fourth host route, wherein the fifth host route is sent by a BGP peer of the first network device;
If not, setting the fourth sequence number of the fourth host route as an initial sequence number, and sending a second route announcement to the BGP peer, wherein the second route announcement comprises the fourth host route and the fourth sequence number.
5. The method according to claim 4, wherein the method further comprises:
if yes, a fifth serial number of a fifth host route is obtained, and the sum value of the fifth serial number and 1 is used as the fourth serial number;
sending a second route advertisement to the BGP peer, the second route advertisement including the fourth host route and the fourth sequence number;
wherein the fifth sequence number is the largest sequence number in a fifth host route including the address information existing in the second RIB.
6. The method according to claim 1, wherein the method further comprises:
judging whether an ARP table item matched with address information included in the first host route exists in a local ARP table;
if yes, deleting the ARP table entry;
initiating ARP detection to the user terminal indicated by the address information;
if the ARP response sent by the user terminal is received, generating an ARP table entry corresponding to the user terminal again according to the ARP response;
And if the ARP response sent by the user terminal is not received, determining that the user terminal has roamed.
7. The method of claim 6, wherein the method further comprises:
judging whether an ARP table item matched with address information included in the first host route exists in a local ARP table;
if yes, initiating ARP detection to the user terminal indicated by the address information;
if the ARP response sent by the user terminal is not received, deleting the ARP list item;
and if the ARP response sent by the user terminal is received, determining that the user terminal does not roam.
8. The method according to claim 1, wherein the method further comprises:
generating a corresponding network segment route according to the first host route;
and sending a third route announcement to the BGP peer, wherein the third route announcement comprises the network segment route, so that the BGP peer adds the network segment route to the first RIB and issues the added route table item to a forwarding table FIB.
9. The method according to claim 8, wherein the generating a corresponding network segment route according to the first host route specifically includes:
Acquiring the prefix length of the configured aggregation route according to different address types;
if the number of the first host routes is one, using the prefix length to obtain default mask length for address information included in the first host routes, and obtaining address information after the operation of obtaining the default mask length; if the number of the first host routes is multiple, performing AND operation on address information included in the multiple first host routes by utilizing the prefix length to obtain address information after AND operation;
taking the address information after the default mask length operation or the address information after the operation as the address information included in the network segment route;
and configuring an interface and a next hop for the address information after the operation of taking the default mask length or the address information after the operation to obtain the network segment route.
10. A route processing apparatus, the apparatus being applied to a first network device, the first network device being within a Spine-Leaf network, the first network device comprising a BGP protocol module and a first routing information base RIB, the apparatus comprising:
a receiving unit, configured to receive a first route advertisement sent by a second network device, where the first route advertisement includes a first host route and a first sequence number of the first host route;
A storage unit, configured to store the first host route and the first sequence number in a second RIB included in the BGP protocol module;
an obtaining unit, configured to obtain, from the second RIB, all second host routes including the address information and second sequence numbers of second host routes including the first host route according to address information included in the first host route, where the second sequence numbers include the first sequence numbers, and each second host route is sent by a BGP peer of the first network device;
the selecting unit is used for selecting a third serial number from all the second serial numbers, wherein the third serial number is the largest serial number in all the second serial numbers;
an adding unit, configured to add a third host route corresponding to the third sequence number to the first RIB if the third host route is sent by a third network device that is in the same area as the first network device, and send an added routing table entry to a forwarding table FIB;
and the third network equipment is accessed to the user terminal, and the network equipment of the third host route is initially generated.
11. The apparatus of claim 10, wherein the storage unit is further configured to maintain a third host route in the second RIB if the third host route corresponding to the third sequence number is transmitted by a third network device in a different area than the first network device.
12. The apparatus of claim 11, wherein the apparatus further comprises: the identifying unit is used for identifying whether the third host route sent by the third network device contains an identifier of an autonomous system where the network device connected with the different area is located;
a first determining unit, configured to determine that the third network device and the first network device are in the same area if the first network device does not include the third network device;
and if so, determining that the third network equipment and the first network equipment are in different areas.
13. The apparatus of claim 10, wherein the apparatus further comprises: a first generation unit, configured to generate a fourth host route corresponding to a user terminal when the user terminal accesses the first network device;
a first judging unit, configured to judge, according to address information included in the fourth host route, whether a fifth host route including the address information exists in the second RIB, where the fifth host route is sent by a BGP peer of the first network device;
And the sending unit is used for setting the fourth serial number of the fourth host route as an initial serial number and sending a second route notice to the BGP peer, wherein the second route notice comprises the fourth host route and the fourth serial number.
14. The apparatus of claim 13, wherein the apparatus further comprises: the processing unit is used for acquiring a fifth serial number of a fifth host route if the fifth serial number exists, and taking the sum of the fifth serial number and 1 as the fourth serial number;
the sending unit is further configured to send a second route advertisement to the BGP peer, where the second route advertisement includes the fourth host route and the fourth sequence number;
wherein the fifth sequence number is the largest sequence number in a fifth host route including the address information existing in the second RIB.
15. The apparatus of claim 10, wherein the apparatus further comprises: a second judging unit, configured to judge whether an ARP entry matching address information included in the first host route exists in a local ARP table;
a deleting unit, configured to delete the ARP table entry if the ARP table entry exists;
An initiating unit, configured to initiate ARP detection to the user terminal indicated by the address information;
the second generating unit is used for generating an ARP table entry corresponding to the user terminal again according to the ARP response if the ARP response sent by the user terminal is received;
and the second determining unit is used for determining that the user terminal has roamed if the ARP response sent by the user terminal is not received.
16. The apparatus according to claim 15, wherein the second judging unit is further configured to judge whether an ARP entry matching address information included in the first host route exists in a local ARP table;
the initiating unit is further configured to initiate ARP detection to the user terminal indicated by the address information if the address information exists;
the deleting unit is further configured to delete the ARP entry if the ARP reply sent by the user terminal is not received;
the second determining unit is further configured to determine that roaming does not occur in the user terminal if an ARP reply sent by the user terminal is received.
17. The apparatus of claim 13, wherein the apparatus further comprises:
a third generating unit, configured to generate a corresponding network segment route according to the first host route;
The sending unit is further configured to send a third route advertisement to a BGP peer, where the third route advertisement includes the network segment route, so that the BGP peer adds the network segment route to the first RIB, and issues an added routing table entry to a forwarding table FIB.
18. The apparatus of claim 17, wherein the third generating unit is specifically configured to obtain a prefix length of the configured aggregation route according to different address types;
if the number of the first host routes is one, using the prefix length to obtain default mask length for address information included in the first host routes, and obtaining address information after operation; if the number of the first host routes is multiple, performing AND operation on address information included in the multiple first host routes by utilizing the prefix length to obtain the address information after operation; taking the address information after the AND operation as the address information included in the network segment route;
and configuring an interface and a next hop for the address information after the AND operation to obtain the network segment route.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310631991.2A CN116566899A (en) | 2023-05-30 | 2023-05-30 | Routing processing method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310631991.2A CN116566899A (en) | 2023-05-30 | 2023-05-30 | Routing processing method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116566899A true CN116566899A (en) | 2023-08-08 |
Family
ID=87500048
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310631991.2A Pending CN116566899A (en) | 2023-05-30 | 2023-05-30 | Routing processing method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116566899A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119420689A (en) * | 2025-01-02 | 2025-02-11 | 阿里云飞天(杭州)云计算技术有限公司 | Network communication system and method, device, storage medium and program product |
-
2023
- 2023-05-30 CN CN202310631991.2A patent/CN116566899A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119420689A (en) * | 2025-01-02 | 2025-02-11 | 阿里云飞天(杭州)云计算技术有限公司 | Network communication system and method, device, storage medium and program product |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9420518B2 (en) | Layer-3 mesh connectivity of wireless local networks | |
| CN101534238B (en) | Method, node and system for notifying agent update in wireless Mesh network | |
| KR100886433B1 (en) | IP6 support method in wireless communication system using extended bridge | |
| US9628435B2 (en) | Duplicate address detection based on distributed bloom filter | |
| CN110798403B (en) | Communication method, communication device and communication system | |
| CN106412142B (en) | Resource equipment address obtaining method and device | |
| CN101133596A (en) | Method and device for accelerating border gateway protocol convergence | |
| CN111541616A (en) | Flow control method and device | |
| CN102143164B (en) | Message relaying method, message relaying device and base station | |
| CN108306825B (en) | Equivalent forwarding table item generation method and VTEP device | |
| CN107968750A (en) | Message transmitting method, device and node | |
| JP2002335281A (en) | Multicast packet distribution method and system, packet address structure, and mobile station | |
| US20240348636A1 (en) | Flood attack defense method and related apparatus | |
| CN106982163A (en) | Method and Gateway for Obtaining Routes on Demand | |
| CN108494701B (en) | Load sharing method and device | |
| US20220263794A1 (en) | Method, apparatus, and system for generating forwarding information | |
| CN107911495B (en) | MAC address synchronization method and VTEP | |
| CN111953607B (en) | Method and device for updating route | |
| WO2021179935A1 (en) | Route determination method, apparatus and network device | |
| CN116566899A (en) | Routing processing method and device | |
| CN105813055A (en) | Roaming method based on IP and roaming device | |
| US10333830B2 (en) | Passive routing in mesh network | |
| CN109510751B (en) | Message forwarding method and routing equipment | |
| CN109873764B (en) | Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation | |
| CN112688940A (en) | Message processing method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |