Route processing method and device and electronic equipment
By checking on the PE device whether the ESI carried by the route is in the MAC-ESI table and the local Local-ESI table of the target EVPN instance, and determining whether to record routes to the target EVPN instance, the useless routing logging problem caused by too many EVPN instances is solved, and the memory footprint and performance improvement are achieved.
Patent Information
- Application Number
- CN202411910054.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-23
AI Technical Summary
In the EVPN VXLAN VLAN AWARE networking scenario, when there are too many EVPN instances on the PE device, it will cause useless recording of the received routes, occupying a large amount of memory, and causing waste.
By receiving the route and when determining that there is a target EVPN instance that matches the route, check whether the MAC-ESI table and the local Local-ESI table of the target EVPN instance contain the ESI carried by the route. If included, the record is routed to the Class I routing table of the target EVPN instance, and the matching virtual outgoing interface is found from the Class II routing table; if not included, the record is prohibited to avoid useless records.
It effectively avoids too many useless routing and virtual outgoing interface records, greatly reduces memory usage, and avoids the problems of memory waste, increased resource usage and reduced performance.
Smart Images

Figure CN119697107A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a routing processing method, device and electronic device. Background Art
[0002] In the EVPN VXLAN VLAN AWARE networking scenario, network devices such as PE devices are usually configured with multiple different EVPN instances; here, different EVPN instances can be configured with different RTs or the same RT. EVPN is the abbreviation of Ethernet Virtual Private Network; VXLAN is the abbreviation of Virtual Extensible LAN; VLAN AWARE is the abbreviation of Virtual Local Area Network AWARE; PE is the abbreviation of Provider Edge; RT is the abbreviation of Route Target.
[0003] Based on this, if there are too many EVPN instances on the PE device, for a received class of routes, if there are multiple EVPN instances on the PE device that match the RT carried by the class of routes, the class of routes and the virtual outbound interfaces generated based on the class of routes are recorded in the routing tables of the multiple EVPN instances that match. However, in actual applications, for some of the multiple EVPN instances that match, the class of routes and virtual outbound interfaces recorded in these EVPN instances are useless and should not be recorded; therefore, the processing method of the class of routes above will result in too many useless class of routes and virtual outbound interfaces being recorded, thereby occupying a large amount of memory and causing memory waste. Summary of the invention
[0004] In view of this, the present application provides a routing processing method, device and electronic device to avoid wasting memory.
[0005] The present application provides a routing processing method, which is applied to a network device and includes:
[0006] Receive routing;
[0007] If the route is a class I route in EVPN, when it is determined that there is a target EVPN instance matching the route locally, if the Media Access Control (MAC)-Ethernet Segment Identifier (ESI) table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the class I route table of the target EVPN instance, and a class II route matching the route is found from the class II route table of the target EVPN instance, and a virtual outbound interface generated based on the class I route is used as the outbound interface corresponding to the MAC address of the found class II route; the MAC-ESI table corresponding to any EVPN instance is used to record the ESI carried by the class II route matching the EVPN instance;
[0008] If the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and the local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the first-class routing table of the target EVPN instance, and the MAC address matching the ESI carried by the route is found in the second-class routing table of the target EVPN instance. The virtual outbound interface generated based on the first-class route is used as the outbound interface corresponding to the MAC address;
[0009] If the MAC-ESI table and the local-ESI table corresponding to the target EVPN instance do not contain the ESI carried by the route, the route is prohibited from being recorded in the first-class routing table of the target EVPN instance.
[0010] The embodiment of the present application further provides a routing processing device, which is applied to a network device, and includes:
[0011] A receiving module, used for receiving routes;
[0012] A processing module, for, if the route is a class I route in EVPN, when it is determined that there is a target EVPN instance matching the route locally, if the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, then the route is recorded in the class I routing table of the target EVPN instance matching the route, and a class II route matching the route is found from the class II routing table of the target EVPN instance, and a virtual outbound interface generated based on the class I route is used as the outbound interface corresponding to the MAC address of the found class II route; the MAC-ESI table corresponding to any EVPN instance is used to record the ESI carried by the class II route matching the EVPN instance;
[0013] If the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and the local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the first-class routing table of the target EVPN instance, and the MAC address matching the ESI carried by the route is found in the second-class routing table of the target EVPN instance. The virtual outbound interface generated based on the first-class route is used as the outbound interface corresponding to the MAC address;
[0014] If the MAC-ESI table and the local-ESI table corresponding to the target EVPN instance do not contain the ESI carried by the route, the route is prohibited from being recorded in the first-class routing table of the target EVPN instance.
[0015] The present application also provides an electronic device, the electronic device comprising:
[0016] Processor; and
[0017] A computer-readable storage medium stores computer program instructions, which, when executed by a processor, cause the processor to execute the steps of the above method.
[0018] An embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the above method.
[0019] It can be seen from the above technical solution that in the embodiment of the present application, when it is determined that a route is received, if the route is a Class I route in EVPN and there is a target EVPN instance matching the route locally, then the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, or, the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI, and the local Local-ESI table corresponding to the target EVPN instance contains the ESI, then it means that the routing table of the target EVPN instance contains a Class II route matching the ESI or contains a Class II route matching the ESI. If the MAC address is matched, the first-class route is available, and the first-class route and the virtual outbound interface generated based on the first-class route can be recorded in the routing table of the target EVPN instance; if the MAC-ESI table and the local-ESI table corresponding to the target EVPN instance do not contain the ESI, it means that the routing table of the target EVPN instance does not contain the second-class route matching the ESI and the MAC address matching the ESI. In this case, the first-class route is useless, that is, it does not need to be recorded, so it is forbidden to record the first-class route and the virtual outbound interface in the routing table of the target EVPN instance. This can not only effectively avoid the recording of too many useless first-class routes and virtual outbound interfaces, greatly reduce memory usage, thereby avoiding memory waste, but also avoid the problem of increased resource usage and reduced performance due to the refresh of a large number of virtual outbound interfaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0021] Figure 1 A schematic diagram of the method flow provided in an embodiment of the present application.
[0022] Figure 2 Another method flow chart provided in the embodiment of the present application.
[0023] Figure 3 A flowchart of another method provided in an embodiment of the present application.
[0024] Figure 4 A schematic diagram of the device structure provided in an embodiment of the present application.
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0027] See also Figure 1 , Figure 1 A flow chart of a method provided for an embodiment of the present application. As an embodiment, the method is applied to a network device. In this embodiment, the network device may be, for example, a PE device in an EVPN, etc., which is not specifically limited in this embodiment. Here, EVPN is a layer 2 VPN technology that uses a specified protocol such as the Border Gateway Protocol (Border Gateway Protocol, BGP) on the control plane to announce routing information, and uses VXLAN encapsulation on the data plane to forward messages; a PE device may refer to an edge router or switch located between a service provider network and a user network.
[0028] like Figure 1 As shown, the process may include the following steps:
[0029] Step 101: Receive a route.
[0030] Step 102, if the above route is a class I route in EVPN, then when it is determined that there is a target EVPN instance matching the route locally, if the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the class I routing table of the target EVPN instance, and a class II route matching the route is found from the class II routing table of the target EVPN instance, and the virtual outbound interface generated based on the class I route is used as the outbound interface corresponding to the MAC address of the found class II route.
[0031] In this embodiment, a Candidate-ESI table is used to record all received Class I routes, where Candidate refers to a candidate. Based on this, as an embodiment, if the received route is a Class I route in EVPN, the route is first recorded in the Candidate-ESI table, and then all local EVPN instances are traversed to check whether there is a target EVPN instance matching the route locally; wherein the RT configured for the target EVPN instance is the same as the RT carried by the route. Here, a Class I route is also called an Ethernet auto-discovery route, which is used to generate a virtual outbound interface; a virtual outbound interface refers to a virtual interface used for data forwarding in EVPN. An EVPN instance refers to a logical entity used to define and manage a virtual local area network, and may also be referred to as a VXLAN network. RT is a BGP extended community attribute in EVPN, which is used to indicate which EVPN instance the route belongs to.
[0032] In this embodiment, for any ESI, if the second-class routing table of the EVPN instance that matches the ESI contains a second-class route that matches the ESI, or the second-class routing table of the EVPN instance that matches the ESI contains a MAC address that matches the ESI, it means that the EVPN instance that matches the ESI has learned the MAC address that matches the ESI, and the EVPN instance will need to use the first-class route that matches the ESI and the virtual outbound interface generated based on the first-class route; on the contrary, if the second-class routing table of the EVPN instance that matches the ESI does not contain the second-class route that matches the ESI and the MAC address that matches the ESI, it means that the EVPN instance that matches the ESI has not learned the MAC address that matches the ESI, and the first-class route that matches the ESI and the virtual outbound interface generated based on the first-class route are useless for the EVPN instance.
[0033] Here, the EVPN instance that matches the ESI means that the ESI configured for the EVPN instance is the same as the ESI. The Class 2 route that matches the ESI means that the ESI of the Class 2 route is the same as the ESI carried by the route. The MAC address that matches the ESI refers to the MAC address corresponding to the ESI in the ESI-MAC correspondence. Class 2 routing is also called MAC / IP address announcement routing, which is used to announce MAC / IP addresses; IP is the abbreviation of Internet Protocol. ESI refers to the identifier of the Ethernet segment, that is, ES; ES refers to the set of Ethernet links between the same CE device and at least one PE device to which it belongs, and CE is the abbreviation of Customer Edge.
[0034] Based on the above description, when it is determined that a target EVPN instance matching the route exists locally, the number of the target EVPN instances is one or more, then for each target EVPN instance:
[0035] If the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, here, the MAC-ESI table corresponding to any EVPN instance is used to record the ESI carried by the second-class route matching the EVPN instance; it means that a second-class route matching the ESI carried by the route has been received, and the second-class route has been recorded in the second-class routing table of the target EVPN instance. At this time, the route can be recorded in the first-class routing table of the target EVPN instance; and the second-class route matching the route is found in the second-class routing table of the target EVPN instance, and the virtual outbound interface generated based on the first-class route is used as the outbound interface corresponding to the MAC address of the found second-class route.
[0036] In this embodiment, the above-mentioned second-class route matching the EVPN instance means that the RT configured for the EVPN instance is the same as the RT of the second-class route. The outbound interface corresponding to the MAC address of the above-mentioned second-class route is used to forward data matching the MAC address; the data matching the MAC address here refers to data carrying the same destination MAC address as the MAC address.
[0037] Step 103, if the above route is a class I route in EVPN, then when it is determined that there is a target EVPN instance matching the route locally, if the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and the local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, then the route is recorded in the class I routing table of the target EVPN instance, and the MAC address matching the ESI carried by the route is found from the class II routing table of the target EVPN instance, and the virtual outbound interface generated based on the class I route is used as the outbound interface corresponding to the MAC address.
[0038] In this embodiment, the local-ESI table corresponding to any EVPN instance is used to record the ESI configured for the EVPN instance.
[0039] Based on the above description of step 102, when it is determined that a target EVPN instance matching the route exists locally, and the number of the target EVPN instances is one or more, then for each target EVPN instance:
[0040] If the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and the local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, it means that the second-class routing table of the target EVPN instance contains a MAC address that matches the ESI. In this case, the route can be recorded in the first-class routing table of the target EVPN instance, and the MAC address that matches the ESI carried by the route can be found in the second-class routing table of the target EVPN instance, and the virtual outbound interface generated based on the first-class route is used as the MAC outbound interface corresponding to the MAC address.
[0041] Step 104, if the above route is a class I route in EVPN, then when it is determined that there is a target EVPN instance matching the route locally, if the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table do not contain the ESI carried by the route, it is prohibited to record the route into the class I route table of the target EVPN instance.
[0042] In this embodiment, if the above-mentioned route is a class I route in EVPN, then when it is determined that there is a target EVPN instance matching the route locally, if the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table do not contain the ESI carried by the route, then based on the above description, it can be seen that at this time, the class II routing table of the target EVPN instance does not contain a class II route matching the ESI and a MAC address matching the ESI, and the route is useless for the target EVPN instance. Therefore, in order to avoid unnecessary memory usage, it is prohibited to record the route in the class I routing table of the target EVPN instance.
[0043] It should be noted that, in this embodiment, step 102, step 103 and step 104 are parallel solutions and there is no order of execution. The numbers of step 102, step 103 and step 104 in this embodiment are only for the convenience of description.
[0044] So far, completed Figure 1 The process shown.
[0045] pass Figure 1 It can be seen from the process shown that in the embodiment of the present application, when it is determined that a route is received, if the route is a Class I route in EVPN and there is a target EVPN instance matching the route locally, then the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, or, the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI, and the local Local-ESI table corresponding to the target EVPN instance contains the ESI, then it means that the routing table of the target EVPN instance contains a Class II route matching the ESI or contains a Class II route matching the ESI. MAC address, in this case, the first-class route is available, and it is allowed to record the first-class route and the virtual outbound interface generated based on the first-class route into the routing table of the target EVPN instance; when the MAC-ESI table and the local-ESI table corresponding to the target EVPN instance do not contain the ESI, it means that the routing table of the target EVPN instance does not contain the second-class route matching the ESI and the MAC address matching the ESI. In this case, the first-class route is useless, that is, it does not need to be recorded, so it is forbidden to record the first-class route and the virtual outbound interface into the routing table of the target EVPN instance. This can not only effectively avoid the recording of too many useless first-class routes and virtual outbound interfaces, greatly reduce memory usage, thereby avoiding memory waste, but also avoid the problem of increased resource usage and reduced performance due to the refresh of a large number of virtual outbound interfaces.
[0046] The following describes the specific processing method of the route when the received route is a Class II route:
[0047] In this embodiment, as an embodiment, if the received route is a Class II route in EVPN, then when it is determined that there is a target EVPN instance matching the route locally, the number of target EVPN instances is one or more, and the route is first recorded in the Class II routing table of all target EVPN instances;
[0048] Then, for each target EVPN instance:
[0049] When it is determined that there is a class-one route matching the ESI carried by the route in the class-one routing table of the target EVPN instance, a class-one route is selected from the class-one routes matching the ESI carried by the route, so that a virtual outbound interface generated based on the selected class-one route is used as the outbound interface corresponding to the MAC address of the class-two route; here, the class-one route matching the ESI carried by the route means that the ESI corresponding to the class-one route is the same as the ESI carried by the route.
[0050] When it is determined that there is no class-one route matching the ESI carried by the route in the class-one routing table of the target EVPN instance, a class-one route matching the ESI carried by the route is found from the Candidate-ESI table, the found class-one route is recorded in the class-one routing table of the target EVPN instance, and a class-one route is selected from the found class-one routes, so that a virtual outbound interface generated based on the selected class-one route is used as the outbound interface corresponding to the MAC address of the class-two route.
[0051] In this embodiment, as an embodiment, there are many specific implementation methods for selecting a class of routes from the class of routes that match the ESI carried by the route; for example, randomly selecting a class of routes from the class of routes that match the ESI carried by the route; for another example, selecting the class of routes with the earliest time of recording to the class of routing table of the target EVPN instance from the class of routes that match the ESI carried by the route; and so on, which are not specifically limited in this embodiment.
[0052] In this embodiment, as an embodiment, there are many specific implementation methods for selecting a class of routes from the found class of routes; for example, selecting a class of routes that matches the Ethernet Tag ID carried by the route from the found class of routes; here, the class of routes that matches the Ethernet Tag ID carried by the route means that the Ethernet Tag ID corresponding to the class of routes is the same as the Ethernet Tag ID carried by the route; and so on, which are not specifically limited in this embodiment. Among them, Ethernet Tag ID is an Ethernet tag identifier, which is used to indicate which VLAN it belongs to; ID is the abbreviation of identification.
[0053] This completes the description of the specific processing method for the received route when the route is a Class II route.
[0054] The following describes the route processing method when a route withdrawal indication is received:
[0055] First, the routing processing method when receiving a type of routing withdrawal indication is described:
[0056] In this embodiment, as an embodiment, when it is determined that a class of route withdrawal indication is received, if a first EVPN instance matching the class of route withdrawal indication exists locally, the class of routes matching the class of route withdrawal indication in the Candidate-ESI table and the class of route table of the first EVPN instance are deleted.
[0057] In this embodiment, a type of route withdrawal indication at least indicates information such as ESI, RD, Ethernet Tag ID, and the IP address of the device that issues the type of route withdrawal indication, which is not specifically limited in this embodiment. Among them, RD is the abbreviation of route identifier (Route Distinguisher), which is a BGP extended community attribute in EVPN and is used to identify routes. Based on this, the first EVPN instance matching the type of route withdrawal indication refers to the EVPN instance matching the information indicated by the type of route withdrawal indication.
[0058] Next, the routing processing method when receiving a Class II routing withdrawal indication is described:
[0059] In this embodiment, as an embodiment, if the route is a Class II route in EVPN, when it is determined that there is a target EVPN instance matching the route locally, if there is a Class I route matching the ESI carried by the route in a Class I routing table of the target EVPN instance, it indicates that the MAC-ESI table corresponding to the target EVPN instance contains the ESI, and at this time, the number count of the ESI in the MAC-ESI table corresponding to the target EVPN instance can be updated according to the sum of the number count and the set value;
[0060] If there is no class of route matching the ESI carried by the route in the class of routing table of the target EVPN instance, it indicates that the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI. In this case, the ESI can be recorded in the MAC-ESI table corresponding to the target EVPN instance, and the number count of the ESI in the MAC-ESI table corresponding to the target EVPN instance is set to the set value.
[0061] In this embodiment, as an embodiment, the updating of the quantity count according to the sum of the quantity count and the set value may include, for example, updating the quantity count to the sum of the quantity count and the set value. The setting of the set value is not specifically limited here, for example, the set value may be 1.
[0062] Based on the above description, as an embodiment, when it is determined that a second-class route withdrawal indication is received, if a second EVPN instance matching the second-class route withdrawal indication exists locally, and there are one or more second EVPN instances, the second-class route matching the second-class route withdrawal indication in the second-class route table of the second EVPN instance is first deleted;
[0063] Afterwards, for each second EVPN instance, the number of ESIs matching the class-2 route withdrawal indication in the MAC-ESI table corresponding to the second EVPN instance is counted, and the number count is updated according to the difference between the number count and the set value; after the number count is updated, if the number count is 0, and there is no ESI matching the class-2 route withdrawal indication in the local Local-ESI table corresponding to the second EVPN instance, it means that there is no class-2 route matching the ESI indicated by the class-2 route withdrawal indication and a MAC address matching the ESI in the routing table of the second EVPN instance. At this time, as described above, the class-1 route matching the class-2 route withdrawal indication in the Candidate-ESI table and the class-1 routing table of the second EVPN instance can be deleted.
[0064] In this embodiment, similar to the above-mentioned first-class route withdrawal indication, the second-class route withdrawal indication at least indicates information such as ESI, RD, Ethernet Tag ID, and the IP address of the device that issues the first-class route withdrawal indication, and this embodiment is not specifically limited. Based on this, the second EVPN instance matching the second-class route withdrawal indication refers to the EVPN instance matching the information indicated by the second-class route withdrawal indication.
[0065] In this embodiment, as an embodiment, updating the quantity count according to the difference between the quantity count and the set value is similar to updating the quantity count according to the sum of the quantity count and the set value as mentioned above. For example, in the specific implementation, it can be: updating the quantity count to the difference between the quantity count and the set value.
[0066] This completes the description of the routing processing method when a routing withdrawal indication is received.
[0067] The following describes the routing processing method when receiving the ESI configuration indication and the ESI deconfiguration indication:
[0068] In this embodiment, as an embodiment, when it is determined that an ESI configuration indication is received, the ESI configuration indication at least indicates the ESI to be configured and the EVPN instance to be configured; first, the ESI to be configured is recorded in the local Local-ESI table corresponding to the EVPN instance to be configured;
[0069] Afterwards, if the MAC-ESI table corresponding to the EVPN instance to be configured does not contain the ESI to be configured, it means that the class of routes matching the ESI to be configured has not been recorded in the class of routing table of the EVPN instance to be configured. At this time, the class of routes matching the ESI to be configured can be found from the Candidate-ESI table, and the found class of routes can be recorded in the class of routing table of the EVPN instance to be configured.
[0070] In this embodiment, as an embodiment, when it is determined that an ESI deconfiguration indication is received, the ESI deconfiguration indication at least indicates the ESI to be deleted and the EVPN instance to be deconfigured; first, the ESI matching the ESI to be deleted in the local Local-ESI table corresponding to the EVPN instance to be deconfigured is deleted;
[0071] Afterwards, if the number of ESIs matching the ESI to be deleted in the MAC-ESI table corresponding to the EVPN instance to be deconfigured is counted as 0, as described above, it means that the second-class routing table of the EVPN instance to be deconfigured does not contain the second-class routes matching the ESI and the MAC address matching the ESI. At this time, the first-class routes matching the ESI to be deleted in the first-class routing table of the EVPN instance to be deconfigured can be deleted.
[0072] This completes the description of the routing processing method when receiving the ESI configuration indication and the ESI deconfiguration indication.
[0073] In order to facilitate understanding of the specific implementation process of the above-mentioned routing processing method, a specific embodiment is described below by way of example in conjunction with the accompanying drawings.
[0074] First, the specific implementation process of a type of routing processing method is described.
[0075] See also Figure 2 , Figure 2 A schematic diagram of a flow chart of a routing processing method provided in this embodiment. Figure 2 As shown, the method comprises the following steps:
[0076] Step 201: When it is determined that a class-one route is received, the class-one route is recorded in a Candidate-ESI table.
[0077] Step 202, check whether there is a target EVPN instance matching the type of route locally; if yes, execute step 203; if no, end.
[0078] Step 203 , checking whether the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the first type of routes; if yes, executing step 204 ; if not, executing step 205 .
[0079] Step 204: record the class I route into the class I routing table of the target EVPN instance, and find a class II route that matches the class I route from the class II routing table of the target EVPN instance, and use the virtual outbound interface generated based on the class I route as the outbound interface corresponding to the MAC address of the found class II route.
[0080] Step 205 , checking whether the local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by the first type of routes; if yes, executing step 206 ; if not, executing step 207 .
[0081] Step 206: record the first-class route into the first-class routing table of the target EVPN instance, and find the MAC address that matches the ESI carried by the first-class route from the second-class routing table of the target EVPN instance, and use the virtual outbound interface generated based on the first-class route as the outbound interface corresponding to the MAC address.
[0082] Step 207: prohibit recording the first-class route into the first-class routing table of the target EVPN instance.
[0083] Next, the specific implementation process of the second type of routing processing method is described.
[0084] See also Figure 3 , Figure 3 The flowchart of the second type of routing processing method provided in this embodiment is as follows. Figure 3 As shown, the method comprises the following steps:
[0085] Step 301, when it is determined that a Class II route is received, check whether there is a target EVPN instance matching the Class II route locally; if yes, execute step 302; if no, end.
[0086] Step 302: record the second-class route into the second-class routing table of the target EVPN instance. Continue to step 303.
[0087] Step 303 , checking whether there is a class-one route matching the ESI carried by the class-two route in the class-one routing table of the target EVPN instance; if yes, executing step 304 ; if not, executing step 305 .
[0088] Step 304: update the quantity count of the ESI in the MAC-ESI table corresponding to the target EVPN instance according to the sum of the quantity count and the set value; and select a class-one route from the class-one routes that match the ESI carried by the class-two routes, so as to use the virtual outbound interface generated based on the selected class-one route as the outbound interface corresponding to the MAC address of the class-two route.
[0089] Step 305, record the ESI into the MAC-ESI table corresponding to the target EVPN instance, and set the number count of the ESI in the MAC-ESI table corresponding to the target EVPN instance to a set value; and, find a class-one route that matches the ESI carried by the class-two route from the Candidate-ESI table, record the found class-one route into the class-one routing table of the target EVPN instance, and select a class-one route from the found class-one routes, so that the virtual outbound interface generated based on the selected class-one route is used as the outbound interface corresponding to the MAC address of the class-two route.
[0090] At this point, the description of the method provided in the embodiment of the present application is completed. The following is a description of the device provided in the embodiment of the present application:
[0091] As an embodiment, this embodiment also provides a routing processing device. For example, see Figure 4 As shown, Figure 4 A schematic diagram of the structure of a routing processing device provided in an embodiment of the present application. Figure 4 As shown, the device 400 is applied to a network device. The device 400 includes a receiving module 401 and a processing module 402;
[0092] Wherein, the receiving module 401 is used to receive a route;
[0093] Processing module 402 is used for, if the route is a class I route in EVPN, then when it is determined that there is a target EVPN instance matching the route locally, if the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, then the route is recorded in the class I routing table of the target EVPN instance, and a class II route matching the route is found from the class II routing table of the target EVPN instance, and a virtual outbound interface generated based on the class I route is used as the outbound interface corresponding to the MAC address of the found class II route; the MAC-ESI table corresponding to any EVPN instance is used to record the ESI carried by the class II route matching the EVPN instance;
[0094] If the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and the local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the first-class routing table of the target EVPN instance, and the MAC address matching the ESI carried by the route is found in the second-class routing table of the target EVPN instance. The virtual outbound interface generated based on the first-class route is used as the outbound interface corresponding to the MAC address;
[0095] If the MAC-ESI table and the local-ESI table corresponding to the target EVPN instance do not contain the ESI carried by the route, the route is prohibited from being recorded in the first-class routing table of the target EVPN instance.
[0096] As an embodiment, the processing module 402 is further configured to:
[0097] If the route is a Class II route in EVPN, when it is determined that a target EVPN instance matching the route exists locally, the route is recorded in the Class II routing table of the target EVPN instance;
[0098] When it is determined that a class-one route matching the ESI carried by the route exists in the class-one routing table of the target EVPN instance, a class-one route is selected from the class-one routes matching the ESI carried by the route, so that a virtual outbound interface generated based on the selected class-one route is used as an outbound interface corresponding to the MAC address of the class-two route;
[0099] When it is determined that there is no class-one route matching the ESI carried by the route in the class-one routing table of the target EVPN instance, a class-one route matching the ESI carried by the route is found from the Candidate-ESI table, the found class-one route is recorded in the class-one routing table of the target EVPN instance, and a class-one route is selected from the found class-one routes, so that a virtual outbound interface generated based on the selected class-one route is used as the outbound interface corresponding to the MAC address of the class-two route; wherein the Candidate-ESI table is used to record all received class-one routes.
[0100] As an embodiment, the processing module 402 is further configured to:
[0101] When it is determined that a class-one route withdrawal indication is received, if a first EVPN instance matching the class-one route withdrawal indication exists locally, the class-one route matching the class-one route withdrawal indication is deleted from the Candidate-ESI table and the class-one route table of the first EVPN instance.
[0102] As an embodiment, the processing module 402 is further configured to:
[0103] If the route is a Class II route in EVPN, when it is determined that there is a target EVPN instance matching the route locally, if there is a Class I route matching the ESI carried by the route in the Class I routing table of the target EVPN instance, the number count of the ESI in the MAC-ESI table corresponding to the target EVPN instance is updated according to the sum of the number count and the set value;
[0104] If there is no class-one route matching the ESI carried by the route in the class-one routing table of the target EVPN instance, the ESI is recorded in the MAC-ESI table corresponding to the target EVPN instance, and the number count of the ESI in the MAC-ESI table corresponding to the target EVPN instance is set to a set value.
[0105] As an embodiment, the processing module 402 is further configured to:
[0106] When it is determined that a class-2 route withdrawal indication is received, if a second EVPN instance matching the class-2 route withdrawal indication exists locally, deleting the class-2 route matching the class-2 route withdrawal indication from the class-2 routing table of the second EVPN instance;
[0107] For the number count of ESIs matching the class-2 route withdrawal indication in the MAC-ESI table corresponding to the second EVPN instance, the number count is updated according to the difference between the number count and the set value; after the number count is updated, if the number count is 0 and there is no ESI matching the class-2 route withdrawal indication in the local Local-ESI table corresponding to the second EVPN instance, the class-1 route matching the class-2 route withdrawal indication in the Candidate-ESI table and the class-1 route table of the second EVPN instance is deleted.
[0108] As an embodiment, the processing module 402 is further configured to:
[0109] When it is determined that an ESI configuration indication is received, the ESI configuration indication at least indicates the ESI to be configured and the EVPN instance to be configured; the ESI to be configured is recorded in a local Local-ESI table corresponding to the EVPN instance to be configured;
[0110] After the ESI to be configured is recorded in the local Local-ESI table corresponding to the EVPN instance to be configured, if the MAC-ESI table corresponding to the EVPN instance to be configured does not contain the ESI to be configured, a class of routes matching the ESI to be configured is searched from the Candidate-ESI table, and the found class of routes is recorded in a class of routing table of the EVPN instance to be configured.
[0111] As an embodiment, the processing module 402 is further configured to:
[0112] When it is determined that an ESI deconfiguration indication is received, the ESI deconfiguration indication at least indicates the ESI to be deleted and the EVPN instance to be deconfigured; deleting the ESI matching the ESI to be deleted in the local Local-ESI table corresponding to the EVPN instance to be deconfigured;
[0113] After deleting the ESI that matches the ESI to be deleted in the local Local-ESI table corresponding to the EVPN instance to be configured, if the number of ESIs that match the ESI to be deleted in the MAC-ESI table corresponding to the EVPN instance to be configured is 0, a class of routes that matches the ESI to be deleted in a class of routing tables of the EVPN instance to be configured is deleted.
[0114] So far, completed Figure 4 Structural description of the device shown.
[0115] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0116] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0117] See also Figure 5 , is a schematic diagram of the hardware structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device may include a processor 501, a communication interface 502, a computer-readable storage medium 503 and a communication bus 504. The processor 501, the communication interface 502 and the computer-readable storage medium 503 communicate with each other through the communication bus 504. Among them, computer program instructions are stored on the computer-readable storage medium 503; the processor 501 can execute the steps of the method described in the above embodiment by executing the computer program instructions stored on the computer-readable storage medium 503. The electronic device may also include other hardware according to the actual function of the electronic device, which will not be described in detail.
[0118] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a number of computer program instructions are stored. When the computer program instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.
[0119] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the computer-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof. The processor and memory may be supplemented by or incorporated into a dedicated logic circuit.
[0120] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A routing processing method, characterized in that: The method is applied to a network device, and the method comprises: Receive routing; If the route is a class I route in an Ethernet virtual private network EVPN, when it is determined that a target EVPN instance matching the route exists locally, if the Multimedia Access Control-Ethernet Segment Identifier MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the class I route table corresponding to the target EVPN instance, and a class II route matching the route is found from the class II route table of the target EVPN instance, and a virtual outbound interface generated based on the class I route is used as the outbound interface corresponding to the MAC address of the found class II route; the MAC-ESI table corresponding to any EVPN instance is used to record the ESI carried by the class II route matching the EVPN instance; If the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and the local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the first-class routing table of the target EVPN instance, and a MAC address matching the ESI carried by the route is found from the second-class routing table of the target EVPN instance, and a virtual outbound interface generated based on the first-class route is used as the outbound interface corresponding to the MAC address; If the MAC-ESI table corresponding to the target EVPN instance and the local-ESI table do not include the ESI carried by the route, recording the route into a class-one routing table of the target EVPN instance is prohibited.
2. The method according to claim 1, characterized in that The method further comprises: If the route is a Class II route in the EVPN, when it is determined that a target EVPN instance matching the route exists locally, the route is recorded in the Class II routing table of the target EVPN instance; When it is determined that a class-one route matching the ESI carried by the route exists in the class-one routing table of the target EVPN instance, a class-one route is selected from the class-one routes matching the ESI carried by the route, so as to use a virtual outbound interface generated based on the selected class-one route as the outbound interface corresponding to the MAC address of the class-two route; When it is determined that there is no class-one route matching the ESI carried by the route in the class-one routing table of the target EVPN instance, find a class-one route matching the ESI carried by the route from a candidate-Ethernet segment identifier Candidate-ESI table, record the found class-one route in the class-one routing table of the target EVPN instance, and select a class-one route from the found class-one routes, so as to use a virtual outbound interface generated based on the selected class-one route as the outbound interface corresponding to the MAC address of the class-two route; wherein the Candidate-ESI table is used to record all received class-one routes.
3. The method according to claim 1, characterized in that The method further comprises: When it is determined that a class of route withdrawal indication is received, if a first EVPN instance matching the class of route withdrawal indication exists locally, a class of routes matching the class of route withdrawal indication is deleted from the Candidate-ESI table and the class of route table of the first EVPN instance.
4. The method according to claim 2, characterized in that: If the route is a Class II route in EVPN, the method further includes: When it is determined that a target EVPN instance matching the route exists locally, if a class of routes matching the ESI carried by the route exists in a class of routing table of the target EVPN instance, then updating the number count of the ESI in the MAC-ESI table corresponding to the target EVPN instance according to the sum of the number count and a set value; If a class of routes matching the ESI carried by the route does not exist in a class of routing table of the target EVPN instance, the ESI is recorded in a MAC-ESI table corresponding to the target EVPN instance, and the quantity count of the ESI in the MAC-ESI table corresponding to the target EVPN instance is set to a set value.
5. The method according to claim 4, characterized in that The method further comprises: When it is determined that a second-class route withdrawal indication is received, if a second EVPN instance matching the second-class route withdrawal indication exists locally, deleting the second-class route matching the second-class route withdrawal indication from the second-class route table of the second EVPN instance; For the number count of ESIs matching the second-class route withdrawal indication in the MAC-ESI table corresponding to the second EVPN instance, the number count is updated according to the difference between the number count and a set value; after the number count is updated, if the number count is 0 and there is no ESI matching the second-class route withdrawal indication in the local Local-ESI table corresponding to the second EVPN instance, the first-class route matching the second-class route withdrawal indication in the Candidate-ESI table and the first-class route table of the second EVPN instance is deleted.
6. The method according to claim 4, characterized in that The method further comprises: When it is determined that an ESI configuration indication is received, the ESI configuration indication at least indicates an ESI to be configured and an EVPN instance to be configured; recording the ESI to be configured into a local Local-ESI table corresponding to the EVPN instance to be configured; After recording the ESI to be configured into the local Local-ESI table corresponding to the EVPN instance to be configured, if the MAC-ESI table corresponding to the EVPN instance to be configured does not contain the ESI to be configured, a class of routes matching the ESI to be configured is searched from the Candidate-ESI table, and the found class of routes is recorded in a class of routing table of the EVPN instance to be configured.
7. The method according to claim 4, characterized in that The method further comprises: When it is determined that an ESI deconfiguration indication is received, the ESI deconfiguration indication at least indicates an ESI to be deleted and an EVPN instance to be deconfigured; deleting an ESI matching the ESI to be deleted in a local Local-ESI table corresponding to the EVPN instance to be deconfigured; After deleting the ESI that matches the ESI to be deleted in the local Local-ESI table corresponding to the EVPN instance to be deconfigured, if the number of ESIs that match the ESI to be deleted in the MAC-ESI table corresponding to the EVPN instance to be deconfigured is counted as 0, a class of routes that matches the ESI to be deleted in a class of routing table of the EVPN instance to be deconfigured is deleted.
8. A routing processing device, characterized in that: The device is applied to a network device, and comprises: A receiving module, used for receiving routes; A processing module, for, if the route is a class I route in an Ethernet virtual private network EVPN, when it is determined that there is a target EVPN instance matching the route locally, if the Multimedia Access Control-Ethernet Segment Identifier MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, then the route is recorded in the class I routing table of the target EVPN instance, and a class II route matching the route is found from the class II routing table of the target EVPN instance, and a virtual outbound interface generated based on the class I route is used as the outbound interface corresponding to the MAC address of the found class II route; a MAC-ESI table corresponding to any EVPN instance is used to record the ESI carried by the class II route matching the EVPN instance; If the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and the local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the first-class routing table of the target EVPN instance, and a MAC address matching the ESI carried by the route is found from the second-class routing table of the target EVPN instance, and a virtual outbound interface generated based on the first-class route is used as the outbound interface corresponding to the MAC address; If the MAC-ESI table corresponding to the target EVPN instance and the local-ESI table do not include the ESI carried by the route, recording the route into a class-one routing table of the target EVPN instance is prohibited.
9. An electronic device, characterized in that: The electronic device includes: Processor; and A computer-readable storage medium, wherein computer program instructions are stored in the computer-readable storage medium, and when the computer program instructions are executed by the processor, the processor is caused to execute the steps in any one of the methods according to claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to perform the steps of any one of the methods of claims 1 to 7.
Citation Information
Patent Citations
Method and device for connecting Ethernet virtual private network (EVPN) with public network
CN107733795A
Routing information transmission method and device, and data center Internet
CN112751758A
Routing system, routing method and routing device of virtual network
CN115277550A
Multicast load balancing in multihoming EVPN networks
EP3396897A1
Local-bias forwarding of L2 multicast, unknown unicast, and broadcast traffic for an ethernet VPN
US10841216B1