Routing processing method and apparatus, and electronic device

By maintaining MAC-ESI and Local-ESI tables on PE devices to determine route availability and recording only useful routes and virtual outgoing interfaces, the problem of memory waste in EVPN VXLAN VLAN AWARE networking is solved, achieving efficient memory utilization.

CN119697107BActive Publication Date: 2025-11-07NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411910054.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-11-07
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In EVPN VXLAN VLAN AWARE networking scenarios, configuring multiple EVPN instances on a PE device results in a large number of useless routing and virtual outgoing interface records, consuming a lot of memory and causing memory waste.

Method used

By maintaining MAC-ESI and Local-ESI tables on the PE device, the availability of routes is determined, and only useful routes and virtual outgoing interfaces are recorded in the routing table of the target EVPN instance, avoiding useless records.

Benefits of technology

It effectively avoids the recording of useless routes and virtual outgoing interfaces, reduces memory usage, and avoids increased resource consumption and performance degradation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697107B_ABST
    Figure CN119697107B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a routing processing method and device and electronic equipment. In the embodiments of the present application, if the received route is a type of route and there is a target EVPN instance matching the route locally, the route is recorded in the routing table of the target EVPN instance when the ESI carried by the route is contained in the MAC-ESI table corresponding to the target EVPN instance, or when the ESI is not contained in the MAC-ESI table and the local Local-ESI table corresponding to the target EVPN instance contains the ESI; and the route is not recorded in the routing table of the target EVPN instance when the ESI is not contained in the MAC-ESI table and the local Local-ESI table. In this way, the recording of too many useless type routes and virtual out interfaces can be effectively avoided, the memory occupation is reduced, and the waste of memory is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication technology, in particular to a routing processing method and device and electronic equipment. BACKGROUND

[0002] In the EVPN VXLAN VLAN AWARE networking scenario, a network device such as a PE device is usually configured with multiple different EVPN instances; here, the different EVPN instances can be configured with different RTs or the same RT. Among them, 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 type of route received, if there are multiple EVPN instances on the PE device that match the RT carried by the type of route, then the type of route and the virtual out interface generated based on the type of route are recorded in the routing table of the above-mentioned multiple matching EVPN instances. However, in actual application, for some of the above-mentioned multiple matching EVPN instances, it is useless to record a type of route and a virtual out interface in these EVPN instances, and it should not be recorded; therefore, the processing method of the above-mentioned type of route will cause excessive recording of useless types of routes and virtual out interfaces, thereby occupying a large amount of memory and causing waste of memory. SUMMARY

[0004] Therefore, the present application provides a routing processing method, device and electronic equipment to avoid waste of memory.

[0005] The present application provides a routing processing method, which is applied to a network device, and the method comprises the following steps:

[0006] receiving a route;

[0007] If the route is a type 1 route in the EVPN, when it is determined that there is a target EVPN instance matching the route locally, if a Media Access Control (MAC)-Ethernet Segment Identifier (ESI) table corresponding to the target EVPN instance contains an ESI carried by the route, the route is recorded in a type 1 route table of the target EVPN instance, and a type 2 route matching the route is found from a type 2 route table of the target EVPN instance, a virtual out interface generated based on the type 1 route is used as an out interface corresponding to a MAC address of the found type 2 route; the MAC-ESI table corresponding to any EVPN instance is used for recording an ESI carried by a type 2 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 a local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the type 1 route table of the target EVPN instance, and a MAC address matching the ESI carried by the route is found from the type 2 route table of the target EVPN instance, the virtual out interface generated based on the type 1 route is used as an out interface corresponding to the MAC address.

[0009] 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, the route is prohibited from being recorded in the type 1 route table of the target EVPN instance.

[0010] Embodiments of the present application also provide a route processing device, which is applied to a network device, and the device comprises:

[0011] a receiving module, configured to receive a route;

[0012] a processing module, configured to, if the route is a type 1 route in the EVPN, when it is determined that there is a target EVPN instance matching the route locally, if a MAC-ESI table corresponding to the target EVPN instance contains an ESI carried by the route, record the route in a type 1 route table of the target EVPN instance matching the route, and find a type 2 route matching the route from a type 2 route table of the target EVPN instance, and use a virtual out interface generated based on the type 1 route as an out interface corresponding to a MAC address of the found type 2 route; the MAC-ESI table corresponding to any EVPN instance is used for recording an ESI carried by a type 2 route matching the EVPN instance;

[0013] If the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance, and the ESI carried by the route is contained in the local Local-ESI table corresponding to the target EVPN instance, the route is recorded in a class A routing table of the target EVPN instance, and a MAC address matching the ESI carried by the route is found from a class B routing table of the target EVPN instance, and a virtual out interface generated based on the class A routing is taken as an out interface corresponding to the MAC address;

[0014] If the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance, and the ESI carried by the route is contained in the local Local-ESI table corresponding to the target EVPN instance, the route is recorded in a class A routing table of the target EVPN instance, and a MAC address matching the ESI carried by the route is found from a class B routing table of the target EVPN instance, and a virtual out interface generated based on the class A routing is taken as an out interface corresponding to the MAC address;

[0015] The embodiment of the present application further provides an electronic device, which comprises:

[0016] a processor; and

[0017] A computer readable storage medium, in which computer program instructions are stored, the computer program instructions, when executed by a processor, causing the processor to perform the steps of the above method.

[0018] The embodiment of the present application further provides a computer readable storage medium, in which computer program instructions are stored, the computer program instructions, when executed by a processor, causing the processor to perform the steps of the above method.

[0019] From the above technical solution can be seen, in the embodiment of the application, when it is determined that a route is received, if the route is a type one route in the EVPN, and there is a target EVPN instance matching the route locally, then when the ESI carried by the route is contained in the MAC-ESI table corresponding to the target EVPN instance, or when the ESI is not contained in the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table corresponding to the target EVPN instance contains the ESI, it indicates that the type two route matching the ESI or the MAC address matching the ESI is contained in the routing table of the target EVPN instance, in this case, the type one route is available, at this time, the type one route and the virtual out interface based on the type one route can be recorded to the routing table of the target EVPN instance; and when the ESI is not contained in the MAC-ESI table and the local Local-ESI table corresponding to the target EVPN instance, it indicates that the type two route matching the ESI and the MAC address matching the ESI are not contained in the routing table of the target EVPN instance, in this case, the type one route is useless and does not need to be recorded, therefore, at this time, the type one route and the virtual out interface are prohibited to be recorded to the routing table of the target EVPN instance. In this way, not only can the recording of too many useless type one routes and virtual out interfaces be effectively avoided, the occupation of memory is greatly reduced, thereby avoiding the waste of memory, but also the problem that the increase of resource occupation and the reduction of performance caused by the refreshing of a large number of virtual out interfaces can be avoided. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0021] Figure 1 A method flowchart is provided for the embodiments of the application.

[0022] Figure 2 Another method flowchart is provided for the embodiments of the application.

[0023] Figure 3 Still another method flowchart is provided for the embodiments of the application.

[0024] Figure 4 An apparatus structure diagram is provided for the embodiments of the application.

[0025] Figure 5 An electronic device structure diagram is provided for the embodiments of the application. DETAILED DESCRIPTION

[0026] In order 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 apparent and easy to understand, the technical solutions in the embodiments of the present application will be further described in detail below with reference to the drawings.

[0027] Referring to Figure 1 , Figure 1 A method flowchart is provided in the embodiments of the present application. As an embodiment, the method is applied to a network device. In the embodiment, the network device can be, for example, a PE device in an EVPN, and the embodiment is not specifically limited thereto. Here, the EVPN is a kind of Layer 2 VPN technology, which uses a designated protocol such as a Border Gateway Protocol (BGP) to advertise route information on a control plane, and uses a VXLAN encapsulation manner to forward packets on a data plane; the PE device can be a kind of edge router or switch device located between a service provider network and a user network.

[0028] As shown in Figure 1 , the flowchart can include the following steps:

[0029] Step 101, receiving a route.

[0030] Step 102, if the route is a kind of route in an EVPN, when it is determined that there is a target EVPN instance matching the route locally, if the ESI carried by the route is contained in a MAC-ESI table corresponding to the target EVPN instance, the route is recorded in a kind of route table of the target EVPN instance, and a kind of route matching the route is found from a kind of route table of the target EVPN instance, and a virtual out interface generated based on the kind of route is used as an out interface corresponding to a MAC address of the found kind of route.

[0031] In the embodiment, a Candidate-ESI table is used to record all the received kind of routes, where Candidate means candidate. Based on this, as an embodiment, if the received route is a kind of route in an EVPN, the route is first recorded in the Candidate-ESI table, and then all the local EVPN instances are traversed to check whether there is a target EVPN instance matching the route locally; where the RT of the target EVPN instance is the same as the RT carried by the route. Here, the kind of route is also called an Ethernet automatic discovery route, which is used to generate a virtual out interface; the virtual out interface is a virtual interface used for data forwarding in the EVPN. The EVPN instance is a logical entity used for defining and managing a virtual local area network, which can also be called a VXLAN network. The RT is a kind of BGP extended community attribute in the EVPN, which is used to indicate which EVPN instance the route belongs to.

[0032] In the embodiment, for any ESI, if the ESI-matching EVPN instance contains the ESI-matching second-class route in the second-class route table of the EVPN instance or contains the ESI-matching MAC address in the second-class route table of the EVPN instance, it indicates that the ESI-matching EVPN instance has learned the ESI-matching MAC address, and at this time, the ESI-matching first-class route and the virtual out interface generated based on the first-class route are needed by the EVPN instance; on the contrary, if the ESI-matching EVPN instance does not contain the ESI-matching second-class route in the second-class route table of the EVPN instance or does not contain the ESI-matching MAC address in the second-class route table of the EVPN instance, it indicates that the ESI-matching EVPN instance has not learned the ESI-matching MAC address, and at this time, the ESI-matching first-class route and the virtual out interface generated based on the first-class route are useless for the EVPN instance.

[0033] Here, the ESI-matching EVPN instance refers to that the ESI configured for the EVPN instance is the same as the ESI. The ESI-matching second-class route refers to that the ESI of the second-class route is the same as the ESI carried by the route. The ESI-matching MAC address refers to the MAC address corresponding to the ESI in the ESI-MAC correspondence. The second-class route is also called MAC / IP address advertisement route, which is used to advertise MAC / IP address; IP is the abbreviation of Internet Protocol. ESI refers to the identification of Ethernet segment, i.e., ES. ES refers to the set of Ethernet links between the same CE device and at least one PE device to which the CE device belongs, and CE is the abbreviation of Customer Edge.

[0034] Based on the above description, when it is determined that the target EVPN instance matching the route exists locally, the number of target EVPN instances is one or more, and for each target EVPN instance:

[0035] If the ESI carried by the route is contained in the MAC-ESI table corresponding to the target EVPN instance, 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 indicates that the second-class route matching the ESI has been received and recorded in the second-class route table of the target EVPN instance, at this time, the route can be recorded in the first-class route table of the target EVPN instance; and the virtual out interface generated based on the first-class route is found as the out interface corresponding to the MAC address of the found second-class route from the second-class route table of the target EVPN instance.

[0036] In the embodiment, the second type route matched with the EVPN instance refers to that the RT of the EVPN instance is the same as the RT of the second type route. The out interface corresponding to the MAC address of the second type route is used to forward data matched with the MAC address. Here, the data matched with the MAC address refers to data carrying the same destination MAC address as the MAC address.

[0037] In step 103, if the route is a first type route in the EVPN, when it is determined that the target EVPN instance matched with the route exists locally, if the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance, and the ESI carried by the route is contained in the local Local-ESI table corresponding to the target EVPN instance, the route is recorded in the first type route table of the target EVPN instance, and the MAC address matched with the ESI carried by the route is found from the second type route table of the target EVPN instance, and the virtual out interface generated based on the first type route is used as the out interface corresponding to the MAC address.

[0038] In the embodiment, the local Local-ESI table corresponding to any EVPN instance is used to record the ESI configured for the EVPN instance.

[0039] Based on the description of step 102, when it is determined that the target EVPN instance matched with the route exists locally, the number of target EVPN instances is one or more, and for each target EVPN instance:

[0040] If the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance, and the ESI carried by the route is contained in the local Local-ESI table corresponding to the target EVPN instance, it indicates that the MAC address matched with the ESI is contained in the second type route table of the target EVPN instance, the route can be recorded in the first type route table of the target EVPN instance, and the MAC address matched with the ESI carried by the route is found from the second type route table of the target EVPN instance, and the virtual out interface generated based on the first type route is used as the MAC out interface corresponding to the MAC address.

[0041] In step 104, if the route is a first type route in the EVPN, when it is determined that the target EVPN instance matched with the route exists locally, if the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table, the route is prohibited to be recorded in the first type route table of the target EVPN instance.

[0042] In the embodiment, if the route is a type-1 route in the EVPN, and it is determined that there is a target EVPN instance matching the route locally, if the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table, it is known based on the above description that at this time the type-2 route matching the ESI and the MAC address matching the ESI are not contained in the type-2 route table of the target EVPN instance, and the route is useless for the target EVPN instance. Therefore, in order to avoid unnecessary memory occupation, the route is prohibited from being recorded in the type-1 route table of the target EVPN instance.

[0043] It should be noted that in the embodiment, the steps 102, 103 and 104 are parallel schemes and have no execution sequence. The labels of the steps 102, 103 and 104 in the embodiment are only for the convenience of description.

[0044] So far, the process shown in Figure 1 is completed.

[0045] As can be seen from the process shown in Figure 1 , in the embodiment, when it is determined that a route is received, if the route is a type-1 route in the EVPN and there is a target EVPN instance matching the route locally, if the ESI carried by the route is contained in the MAC-ESI table corresponding to the target EVPN instance, or if the ESI is not contained in the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table corresponding to the target EVPN instance contains the ESI, it indicates that the type-2 route matching the ESI or the MAC address matching the ESI is contained in the route table of the target EVPN instance. In this case, the type-1 route is useful, and at this time the type-1 route and the virtual out interface generated based on the type-1 route can be allowed to be recorded in the route table of the target EVPN instance. If the ESI is not contained in the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table, it indicates that the type-2 route matching the ESI and the MAC address matching the ESI are not contained in the route table of the target EVPN instance. In this case, the type-1 route is useless and does not need to be recorded, and therefore the type-1 route and the virtual out interface are prohibited from being recorded in the route table of the target EVPN instance. In this way, not only can the recording of too many useless type-1 routes and virtual out interfaces be effectively avoided, the occupation of memory can be greatly reduced, thereby avoiding the waste of memory, but also the problem that the occupation of resources is increased and the performance is reduced due to the refreshing of a large number of virtual out interfaces can be avoided.

[0046] The specific processing method of the received route when the route is a type-2 route will be described below.

[0047] In this embodiment, as an example, if the received route is a type-2 route in EVPN, 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, the route is recorded in the type-2 route table of all target EVPN instances first;

[0048] Then, for each target EVPN instance:

[0049] When it is determined that there is a type-1 route matching the ESI carried by the route in the type-1 route table of the target EVPN instance, a type-1 route matching the ESI carried by the route is selected from the type-1 route table, and a virtual out interface generated based on the selected type-1 route is used as the out interface corresponding to the MAC address of the type-2 route; here, the type-1 route matching the ESI carried by the route means that the ESI corresponding to the type-1 route is the same as the ESI carried by the route.

[0050] When it is determined that there is no type-1 route matching the ESI carried by the route in the type-1 route table of the target EVPN instance, a type-1 route matching the ESI carried by the route is found from the Candidate-ESI table, the found type-1 route is recorded in the type-1 route table of the target EVPN instance, and a type-1 route is selected from the found type-1 route, and a virtual out interface generated based on the selected type-1 route is used as the out interface corresponding to the MAC address of the type-2 route.

[0051] In this embodiment, as an example, there are many specific implementation manners for selecting a type-1 route from the type-1 routes matching the ESI carried by the route; for example, a type-1 route is randomly selected from the type-1 routes matching the ESI carried by the route; for example, a type-1 route recorded in the type-1 route table of the target EVPN instance for the earliest time is selected from the type-1 routes matching the ESI carried by the route; and the like, which are not specifically limited in this embodiment.

[0052] In the embodiment, as an example, there are many specific implementation manners of selecting one class A route from the found class A routes; for example, selecting one class A route matching the Ethernet Tag ID carried by the route from the found class A routes; here, the class A route matching the Ethernet Tag ID carried by the route refers to that the Ethernet Tag ID corresponding to the class A route is the same as the Ethernet Tag ID carried by the route; and the like, which are not limited in the embodiment. Wherein, the Ethernet Tag ID is an Ethernet tag identifier, which is used to indicate the identifier of a VLAN; and the ID is the abbreviation of Identification.

[0053] The specific processing method of the route when the received route is a class B route is described.

[0054] The route processing method when a route withdrawal indication is received is described as follows:

[0055] Firstly, the route processing method when a class A route withdrawal indication is received is described as follows:

[0056] In the embodiment, as an example, when it is determined that a class A route withdrawal indication is received, if there is a first EVPN instance matching the class A route withdrawal indication locally, the Candidate-ESI table and the class A route in the class A route table of the first EVPN instance matching the class A route withdrawal indication are deleted.

[0057] In the embodiment, the class A route withdrawal indication at least indicates the ESI, RD, Ethernet Tag ID, and the IP address of the device issuing the class A route withdrawal indication, which are not limited in the embodiment. Wherein, the RD is the abbreviation of Route Distinguisher, which is a BGP extended community attribute in the EVPN, and is used to identify a route. Based on this, the first EVPN instance matching the class A route withdrawal indication refers to the EVPN instance matching the information indicated by the class A route withdrawal indication.

[0058] The route processing method when a class B route withdrawal indication is received is described as follows:

[0059] In the embodiment, as an example, if the route is a second-type route in the EVPN, when it is determined that there is a target EVPN instance matching the route locally, if there is a first-type route matching the ESI carried by the route in the first-type route table of the target EVPN instance, it indicates that the ESI is contained in the MAC-ESI table corresponding to the target EVPN instance, at this time, the quantity count of the ESI in the MAC-ESI table corresponding to the target EVPN instance is updated according to the sum of the quantity count and a set value.

[0060] If there is no first-type route matching the ESI carried by the route in the first-type route table of the target EVPN instance, it indicates that the ESI is not contained in the MAC-ESI table corresponding to the target EVPN instance, at this time, the ESI can be recorded in the 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 the set value.

[0061] In the embodiment, as an example, the above updating the quantity count according to the sum of the quantity count and the set value may, for example, include 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, for example, the set value can be 1.

[0062] Based on the above description, as an example, when it is determined that the second-type route revocation indication is received, if there is a second EVPN instance matching the second-type route revocation indication locally, the second EVPN instance has one or more, the second-type route matching the second-type route revocation indication in the second-type route table of the second EVPN instance is deleted first;

[0063] Then, for each second EVPN instance, for the quantity count of the ESI matching the second-type route revocation indication in the MAC-ESI table corresponding to the second EVPN instance, the quantity count is updated according to the difference between the quantity count and a set value; after updating the quantity count, if the quantity count is 0, and there is no ESI matching the second-type route revocation indication in the local Local-ESI table corresponding to the second EVPN instance, it indicates that there is no second-type route matching the ESI indicated by the second-type route revocation indication in the route table of the second EVPN instance, and no MAC address matching the ESI, at this time, as described above, the Candidate-ESI table and the first-type route matching the second-type route revocation indication in the first-type route table of the second EVPN instance can be deleted.

[0064] In the embodiment, similar to the first type route withdrawal indication, the second type route withdrawal indication at least indicates the ESI, the RD, the Ethernet Tag ID, and the IP address of the device issuing the second type route withdrawal indication, and the embodiment is not limited in particular. Based on this, the second EVPN instance matched with the second type route withdrawal indication refers to the EVPN instance matched with the information indicated by the second type route withdrawal indication.

[0065] In the embodiment, as an example, the quantity counter is updated according to the difference between the quantity counter and the set value, which is similar to updating the quantity counter according to the sum of the quantity counter and the set value. For example, in the specific implementation, the quantity counter can be updated to the difference between the quantity counter and the set value.

[0066] Thus, the route processing method when the route withdrawal indication is received is completed.

[0067] The route processing method when the ESI configuration indication and the ESI deconfiguration indication are received is described as follows.

[0068] In the embodiment, as an example, when it is determined that the ESI configuration indication is received, the ESI configuration indication at least indicates the ESI to be configured and the EVPN instance to be configured; and the ESI to be configured is recorded in the local Local-ESI table corresponding to the EVPN instance to be configured.

[0069] Then, if the ESI to be configured is not included in the MAC-ESI table corresponding to the EVPN instance to be configured, it indicates that the first type route matched with the ESI to be configured has not been recorded in the first type route table of the EVPN instance to be configured. At this time, the first type route matched with the ESI to be configured can be found from the Candidate-ESI table, and the found first type route is recorded in the first type route table of the EVPN instance to be configured.

[0070] In the embodiment, as an example, when it is determined that the ESI deconfiguration indication is received, the ESI deconfiguration indication at least indicates the ESI to be deleted and the EVPN instance to be configured; and the ESI matched with the ESI to be deleted in the local Local-ESI table corresponding to the EVPN instance to be configured is deleted.

[0071] Subsequently, if the count of the number of ESIs matching the ESI to be deleted in the MAC-ESI table corresponding to the EVPN instance to be configured is 0, then as described above, it means that the Type II routing table of the EVPN instance to be configured does not contain a Type II route matching the ESI or a MAC address matching the ESI. At this time, the Type I route matching the ESI to be deleted in the Type I routing table of the EVPN instance to be configured can be deleted.

[0072] This concludes the description of the routing processing methods when receiving ESI configuration instructions and ESI deconfiguration instructions.

[0073] To facilitate understanding of the specific implementation process of the above routing processing method, the following description, in conjunction with the accompanying drawings, provides specific examples.

[0074] First, we will describe the specific implementation process of one type of routing processing method.

[0075] See Figure 2 , Figure 2 This is a flowchart illustrating a type of routing processing method provided in this embodiment. Figure 2 As shown, the method includes the following steps:

[0076] Step 201: When it is determined that a certain type of route has been received, record the route in the Candidate-ESI table.

[0077] Step 202: Check if a target EVPN instance matching this type of route exists locally; if yes, proceed to step 203; otherwise, end.

[0078] Step 203: Check whether the MAC-ESI table corresponding to the target EVPN instance contains the ESI carried by this type of route; if yes, proceed to step 204; if no, proceed to step 205.

[0079] Step 204: Record the Class I route in the Class I routing table of the target EVPN instance, and find the Class II route that matches the Class I route from the Class II routing table of the target EVPN instance. Use the virtual outgoing interface generated based on the Class I route as the outgoing interface corresponding to the MAC address of the found Class II route.

[0080] Step 205: Check whether the local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by this type of route; if yes, proceed to step 206; if no, proceed to step 207.

[0081] Step 206, record the class A route to the class A route table of the target EVPN instance, and find the MAC address matching the ESI carried by the class A route from the class B route table of the target EVPN instance, and take the virtual out interface generated based on the class A route as the out interface corresponding to the MAC address.

[0082] Step 207, prohibit the class A route from being recorded to the class A route table of the target EVPN instance.

[0083] Next, the specific implementation process of the class B route processing method is described.

[0084] Referring to Figure 3 , Figure 3 The flowchart of the class B route processing method provided by the embodiment is shown. As shown in the figure, the method comprises the following steps: Figure 3

[0085] Step 301, when it is determined that the class B route is received, check whether there is a target EVPN instance matching the class B route in the local; if yes, execute step 302; if no, end.

[0086] Step 302, record the class B route to the class B route table of the target EVPN instance. Continue to execute step 303.

[0087] Step 303, check whether there is a class A route matching the ESI carried by the class B route in the class A route table of the target EVPN instance; if yes, execute step 304; if no, execute step 305.

[0088] Step 304, count the number of the ESI in the MAC-ESI table corresponding to the target EVPN instance, update the number according to the sum of the number and a set value, and select a class A route from the class A route matching the ESI carried by the class B route, so as to take the virtual out interface generated based on the selected class A route as the out interface corresponding to the MAC address of the class B route.

[0089] Step 305, record the ESI to the MAC-ESI table corresponding to the target EVPN instance, set the number of the ESI in the MAC-ESI table corresponding to the target EVPN instance to the set value, find the class A route matching the ESI carried by the class B route from the Candidate-ESI table, record the found class A route to the class A route table of the target EVPN instance, and select a class A route from the found class A route, so as to take the virtual out interface generated based on the selected class A route as the out interface corresponding to the MAC address of the class B route.

[0090] ​Thus far, the method provided by the embodiments of the present application is described, and the device provided by the embodiments of the present application is described as follows.

[0091] As an embodiment, the embodiments also provide a routing processing device. For example, referring to Figure 4 , Figure 4 a structural schematic diagram of a routing processing device provided by the embodiments of the present application is shown. As Figure 4 shown, the device 400 is applied to a network device. The device 400 includes a receiving module 401 and a processing module 402.

[0092] The receiving module 401 is configured to receive a route.

[0093] The processing module 402 is configured to, if the route is a type-1 route in an EVPN, when it is determined that a target EVPN instance matching the route exists locally, if an ESI carried by the route is contained in a MAC-ESI table corresponding to the target EVPN instance, record the route in a type-1 route table of the target EVPN instance, and find a type-2 route matching the route from a type-2 route table of the target EVPN instance, and use a virtual out interface generated based on the type-1 route as an out interface corresponding to a MAC address of the found type-2 route; the MAC-ESI table corresponding to any EVPN instance is configured to record an ESI carried by a type-2 route matching the EVPN instance.

[0094] If the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance, and the ESI carried by the route is contained in a local Local-ESI table corresponding to the target EVPN instance, record the route in the type-1 route table of the target EVPN instance, and find a MAC address matching the ESI carried by the route from the type-2 route table of the target EVPN instance, and use a virtual out interface generated based on the type-1 route as an out interface corresponding to the MAC address.

[0095] If the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance and the local Local-ESI table, the route is prohibited from being recorded in the type-1 route table of the target EVPN instance.

[0096] As an embodiment, the processing module 402 is further configured to:

[0097] If the route is a type-2 route in an EVPN, when it is determined that a target EVPN instance matching the route exists locally, record the route in a type-2 route table of the target EVPN instance.

[0098] and in determining that there is a class route matching the ESI carried by the route in the class route table of the target EVPN instance, selecting a class route from the class routes matching the ESI carried by the route to take a virtual out interface generated based on the selected class route as the out interface corresponding to the MAC address of the class route;

[0099] and in determining that there is no class route matching the ESI carried by the route in the class route table of the target EVPN instance, searching for a class route matching the ESI carried by the route from the Candidate-ESI table, recording the searched class route into the class route table of the target EVPN instance, and selecting a class route from the searched class route to take a virtual out interface generated based on the selected class route as the out interface corresponding to the MAC address of the class route; wherein the Candidate-ESI table is used to record all received class routes.

[0100] As an embodiment, the processing module 402 is further configured to:

[0101] and in determining that the class route withdrawal indication is received, if there is a first EVPN instance matching the class route withdrawal indication locally, deleting the Candidate-ESI table and a class route matching the class route withdrawal indication in the class route table of the first EVPN instance.

[0102] As an embodiment, the processing module 402 is further configured to:

[0103] and in determining that there is a class route matching the ESI carried by the route in the class route table of the target EVPN instance, counting the number of the ESI in the MAC-ESI table corresponding to the target EVPN instance, and updating the number according to the sum of the number and a set value;

[0104] and in determining that there is no class route matching the ESI carried by the route in the class route table of the target EVPN instance, recording the ESI into the MAC-ESI table corresponding to the target EVPN instance, and setting the number of the ESI in the MAC-ESI table corresponding to the target EVPN instance as the set value.

[0105] As an embodiment, the processing module 402 is further configured to:

[0106] and in determining that the class route withdrawal indication is received, if there is a first EVPN instance matching the class route withdrawal indication locally, deleting the Candidate-ESI table and a class route matching the class route withdrawal indication in the class route table of the first EVPN instance.

[0107] counting the number of ESIs in the MAC-ESI table corresponding to the second EVPN instance that match the second-type route withdrawal indication, updating the number according to the difference between the number and a set value; after updating the number, if the number is 0 and there is no ESI in the local Local-ESI table corresponding to the second EVPN instance that matches the second-type route withdrawal indication, deleting the Candidate-ESI table and the first-type route in the first-type route table of the second EVPN instance that matches the second-type route withdrawal indication.

[0108] As an embodiment, the processing module 402 is further configured to:

[0109] Upon determining that the ESI configuration indication is received, the ESI configuration indication at least indicates the ESI to be configured and the EVPN instance to be configured; and record the ESI to be configured in the local Local-ESI table corresponding to the EVPN instance to be configured.

[0110] After recording the ESI to be configured in the local Local-ESI table corresponding to the EVPN instance to be configured, if the ESI to be configured is not included in the MAC-ESI table corresponding to the EVPN instance to be configured, find the first-type route matching the ESI to be configured from the Candidate-ESI table, and record the found first-type route in the first-type route table of the EVPN instance to be configured.

[0111] As an embodiment, the processing module 402 is further configured to:

[0112] Upon determining that the ESI deconfiguration indication is received, the ESI deconfiguration indication at least indicates the ESI to be deleted and the EVPN instance to be deconfigured; and delete 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 matching the ESI to be deleted in the local Local-ESI table corresponding to the EVPN instance to be deconfigured, 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 0, delete the first-type route matching the ESI to be deleted in the first-type route table of the EVPN instance to be deconfigured.

[0114] Thus, the following is completed Figure 4 The structure of the apparatus is described.

[0115] The implementation processes of the functions and roles of each module in the apparatus are specifically described in the implementation processes of the corresponding steps in the above method, and will not be repeated here.

[0116] For the device embodiment, since it basically corresponds to the method embodiment, the relevant part can be referred to the part of the method embodiment. The device embodiment described above is only illustrative, wherein the modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, i.e., can be located in one place or distributed to multiple network modules. Part or all of the modules can be selected to achieve the purpose of the present application according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0117] Please refer to Figure 5 A hardware structure schematic diagram of an electronic device is provided for an exemplary embodiment of the present application. The electronic device can 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 complete the communication among each other through the communication bus 504. Among them, the computer readable storage medium 503 stores computer program instructions; the processor 501 can execute the steps of the method described in the above embodiment by executing the computer program instructions stored in the computer readable storage medium 503. The electronic device can also include other hardware according to the actual function of the electronic device, which will not be described here.

[0118] Correspondingly, the present application also provides a computer readable storage medium, which stores a plurality of computer program instructions, and the computer program instructions can implement the method disclosed in the above exemplary embodiments of the present application when executed by a processor.

[0119] Exemplarily, the above computer readable storage medium can be any electronic, magnetic, optical or other physical storage device, which can contain or store information such as executable instructions, data, etc. For example, the computer readable storage medium can be RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard drive), solid state disk, any type of storage disk (such as optical disk, dvd, etc.), or similar storage medium, or combination thereof. The processor and the memory can be supplemented by or incorporated into special logic circuit.

[0120] The above is only a preferred embodiment of the present application, and is not used to limit the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A routing processing method, characterized by, The method is applied to a network device, and the method comprises: receiving a route; if the route is a type 1 route in an Ethernet Virtual Private Network (EVPN), when it is determined that a target EVPN instance matching the route exists locally, if an ESI carried by the route is contained in a multi-media access control-Ethernet segment identifier (MAC-ESI) table corresponding to the target EVPN instance, the route is recorded in a type 1 route table of the target EVPN instance, a type 2 route matching the route is found from a type 2 route table of the target EVPN instance, and a virtual out interface generated based on the type 1 route is used as an out interface corresponding to a MAC address of the type 2 route; the MAC-ESI table corresponding to any EVPN instance is used for recording an ESI carried by a type 2 route matching the EVPN instance; if the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance and the ESI carried by the route is contained in a local ESI (Local-ESI) table corresponding to the target EVPN instance, the route is recorded in the type 1 route table of the target EVPN instance, and a MAC address matching the ESI carried by the route is found from the type 2 route table of the target EVPN instance, and a virtual out interface generated based on the type 1 route is used as an out interface corresponding to the MAC address; if the ESI carried by the route is not contained in the MAC-ESI table corresponding to the target EVPN instance and the Local-ESI table, the route is prohibited from being recorded in the type 1 route table of the target EVPN instance.

2. The method of claim 1, wherein, The method further comprises: if the route is a type 2 route in the EVPN, when it is determined that a target EVPN instance matching the route exists locally, the route is recorded in a type 2 route table of the target EVPN instance; when it is determined that a type 1 route matching an ESI carried by the route exists in a type 1 route table of the target EVPN instance, one type 1 route is selected from the type 1 route matching the ESI carried by the route, a virtual out interface generated based on the selected type 1 route is used as an out interface corresponding to a MAC address of the type 2 route; and when it is determined that the type 1 route matching the ESI carried by the route does not exist in the type 1 route table of the target EVPN instance, a type 1 route matching the ESI carried by the route is found from a Candidate-ESI table, the found type 1 route is recorded in the type 1 route table of the target EVPN instance, and one type 1 route is selected from the found type 1 route, a virtual out interface generated based on the selected type 1 route is used as an out interface corresponding to a MAC address of the type 2 route; the Candidate-ESI table is used for recording all received type 1 routes.

3. The method of claim 2, wherein, The method further comprises: Upon determining that a first EVPN instance matching the route withdrawal indication exists locally, the Candidate-ESI table and a route matching the route withdrawal indication in a route table of the first EVPN instance are deleted.

4. The method of claim 2, wherein, If the route is a second type route in the EVPN, the method further comprises: Upon determining that a target EVPN instance matching the route exists locally, if a route matching an ESI carried by the route exists in a route table of the target EVPN instance, a quantity count of the ESI in a MAC-ESI table corresponding to the target EVPN instance is updated according to a sum of the quantity count and a set value; If the route carried by the route does not match a route in the route table of the target EVPN instance, the ESI is recorded in the 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 the set value.

5. The method of claim 4, wherein, The method further comprises: Upon determining that a second EVPN instance matching the second type route withdrawal indication exists locally, a second type route matching the second type route withdrawal indication in a route table of the second EVPN instance is deleted; A quantity count of an ESI matching the second type route withdrawal indication in a MAC-ESI table corresponding to the second EVPN instance is updated according to a difference between the quantity count and a set value; after the quantity count is updated, if the quantity count is 0 and an ESI matching the second type route withdrawal indication does not exist in a local Local-ESI table corresponding to the second EVPN instance, the Candidate-ESI table and a route matching the second type route withdrawal indication in a route table of the second EVPN instance are deleted.

6. The method of claim 4, wherein, The method further comprises: Upon determining 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; the ESI to be configured is recorded in a local Local-ESI table corresponding to the EVPN instance to be configured; After the ESI to be configured is recorded in the local Local-ESI table corresponding to the EVPN instance to be configured, if the ESI to be configured is not included in a MAC-ESI table corresponding to the EVPN instance to be configured, a route matching the ESI to be configured is found from the Candidate-ESI table, and the found route is recorded in a route table of the EVPN instance to be configured.

7. The method of claim 4, wherein, The method further comprises: In a case that it is determined that the ESI de-configuration indication is received, the ESI de-configuration indication at least indicates an ESI to be deleted and an EVPN instance to be de-configured; and an ESI in a local Local-ESI table corresponding to the EVPN instance to be de-configured and matching the ESI to be deleted is deleted; After the ESI in the local Local-ESI table corresponding to the EVPN instance to be de-configured and matching the ESI to be deleted is deleted, in a case that a quantity of ESIs in a MAC-ESI table corresponding to the EVPN instance to be de-configured and matching the ESI to be deleted is counted as 0, a class A route in a class A route table of the EVPN instance to be de-configured and matching the ESI to be deleted is deleted.

8. A routing processing device, characterized by, The device is applied to a network equipment, and the device comprises: A receiving module is configured to receive a route; In a case that the route is a class A route in an Ethernet Virtual Private Network (EVPN), in a case that it is determined that a target EVPN instance matching the route exists locally, in a case that a Multimedia Access Control-Ethernet Segment Identifier (MAC-ESI) table corresponding to the target EVPN instance contains an ESI carried by the route, the route is recorded in a class A route table of the target EVPN instance, a class B route matching the route is found from a class B route table of the target EVPN instance, and a virtual out interface generated based on the class A route is used as an out interface corresponding to a MAC address of the found class B route; the MAC-ESI table corresponding to any EVPN instance is configured to record an ESI carried by a class B route matching the EVPN instance; In a case that the MAC-ESI table corresponding to the target EVPN instance does not contain the ESI carried by the route, and a local Local-ESI table corresponding to the target EVPN instance contains the ESI carried by the route, the route is recorded in the class A route table of the target EVPN instance, and a MAC address matching the ESI carried by the route is found from the class B route table of the target EVPN instance, and a virtual out interface generated based on the class A route is used as an out interface corresponding to the MAC address; In a case that 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, the route is prohibited from being recorded in the class A route table of the target EVPN instance.

9. An electronic device, comprising: The electronic device comprises: a processor; and A computer readable storage medium has computer program instructions stored therein, and the computer program instructions, when executed by the processor, cause the processor to perform steps in the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer readable storage medium has computer program instructions stored therein, and the computer program instructions, when executed by the processor, cause the processor to perform steps in the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for connecting Ethernet virtual private network (EVPN) with public network

    CN107733795A

  • Routing system, routing method and routing device of virtual network

    CN115277550A