Communication method and device
By configuring a shared ESI label for each ES in the EVPN network and carrying the label in flood forwarding, the problem of wasted label resources caused by PE devices allocating ESI labels to each interface is solved, and efficient utilization of label resources is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-03-13
AI Technical Summary
In EVPN networking, the PE device assigns an ESI label to each interface, which leads to excessive consumption of label resources, especially in fine-grained control schemes where label resources are squeezed out.
By using a shared ESI label, the PE device configures a shared ESI label for each ES and floods forwarding the label by carrying it through horizontal split table entries, thereby reducing label usage.
This allows each ES within a PE device to share the same ESI tag, reducing the use of ESI tags and solving the problem of excessive tag resource consumption.
Smart Images

Figure CN121664720A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Technology
[0002] In a multi-homed Ethernet Virtual Private Network (EVPN) network, horizontal segmentation is achieved through Ethernet Segment Identifier (ESI) labels.
[0003] RFC 7432 defines a split-horizon scheme based on ESI labels. Through EAD per ES routing (also known as AD routing), the ESI labels of the local Provider Edge (PE) devices are advertised to other peer PE devices connected to the same Ethernet Segment (ES). When the peer PE device (acting as an ingress node) floods packets, it carries the ESI label in the packet to mark the packet's originating ES. When the egress PE device receives the packet and floods it again, it filters the outgoing interface using the ESI label.
[0004] In existing solutions, if a PE device has a large number of multi-homed interfaces, the PE device assigns an ESI label to each interface, which consumes a lot of label resources. Especially in some more granular control solutions, where the PE device specifies different ESI values for each sub-interface, a large number of labels are needed for ESI labels, thus crowding out label resources originally used for forwarding. Summary of the Invention
[0005] In view of this, this application provides a communication method and apparatus to solve the problem that the existing PE equipment will consume a lot of tag resources by assigning an ESI tag to each interface.
[0006] In a first aspect, this application provides a communication method applied to a first PE device, the first PE device including a first interface and connected to a first CE device through the first interface, the method comprising: Receive the first service message sent by the first CE device; If it is determined that the first service message is flooded and the second interface used to forward the first service message is a logical port, then check if there is a matching horizontal partition table entry in the local horizontal partition table. If it exists, a second service message is sent to the second PE device through the logic port. The second service message includes a first ESI tag. The first ESI tag is stored in the horizontal segmentation table entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
[0007] Secondly, this application provides a communication device applied to a first PE device, the first PE device including a first interface and connected to a first CE device through the first interface, the device comprising: The receiving unit is used to receive the first service message sent by the first CE device; The lookup unit is used to check if there is a matching horizontal partition table entry in the local horizontal partition table if it is determined that the first service message is flooded and the second interface used to forward the first service message is a logical port. The sending unit is configured to send a second service message to the second PE device through the logic port if the service message exists, wherein the second service message includes a first ESI tag. The first ESI tag is stored in the horizontal segmentation table entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
[0008] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.
[0009] Therefore, using the communication method and apparatus provided in this application, the first PE device receives a first service message sent by the first CE device; if it is determined that the second interface used for flooding and forwarding the first service message is a logical port, the first PE device searches its local horizontal segmentation table for a matching horizontal segmentation entry; if it does, the first PE device sends a second service message to the second PE device through the logical port, the second service message including a first ESI tag; wherein, the first ESI tag is stored in the horizontal segmentation entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
[0010] In this way, the sending end of the flood message carries the shared label of each ES on the receiver's local machine, which is included in the horizontal segmentation table, in the flood message, so that the receiver can determine the outgoing interface to forward the flood message based on the shared label. This enables each ES within the PE device to share the same ESI label, reducing the use of ESI labels; at the same time, it also solves the problem that the existing PE device would consume a lot of label resources by allocating an ESI label for each interface. Attached Figure Description
[0011] Figure 1 This application provides a schematic diagram of an EVPN home network configuration as described in its embodiments. Figure 2 A flowchart illustrating the communication method provided in the embodiments of this application; Figure 3 This is another EVPN-to-home network diagram provided in the embodiments of this application; Figure 4 A schematic diagram of a communication device provided in an embodiment of this application; Figure 5 The network device hardware structure provided in the embodiments of this application. Detailed Implementation
[0012] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0013] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the corresponding listed items.
[0014] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0015] Figure 1 This is a schematic diagram of an EVPN home network provided in an embodiment of this application. Figure 1 The network consists of PE1, PE2, PE3, and CE1-CE6. PE1, PE2, and PE3 form an EVPN point-to-multipoint network, providing Layer 2 communication between Customer Edge (CE) 1-CE6. The forwarding plane between PE1, PE2, and PE3 uses MPLS encapsulation. CE1, CE2, and CE3 are multihomed to the same EVPN instance via ES1, ES2, and ES3, respectively. On PE1 and PE2, the corresponding interfaces connecting to CE1, CE2, and CE3 need to be marked with the corresponding ESI. CE5, when connected to PE1 alone, does not require ESI marking on its interface; similarly, CE6, when connected to PE2 alone, also does not require ESI marking on its interface.
[0016] The aforementioned CE1-CE6 can be virtual machines or Ethernet switches. If CE1-CE6 is an Ethernet switch, then the virtual machine accesses the EVPN network through CE1-CE6.
[0017] In the existing scheme, for multi-homed access EVPN instances, the multi-homed devices (i.e., PE1 and PE2) assign an ESI label to each ES and advertise it through a corresponding number of EVPN AD routes (existing EVPN Class 1 routes, each EVPN AD route includes one ESI and one ESI label). All PE devices within the same EVPN instance can receive this EVPN AD route. Simultaneously, PE1 and PE2 elect one interface for each ES as the Designated Forwarder (DF) role through the EVPN protocol's election process, while the remaining interfaces of that ES are non-DF roles. Subsequently, when PE devices flood packets, they will no longer flood the interfaces with non-DF roles.
[0018] For any PE device in a multi-homed group, when the PE device receives an EVPN AD route, the PE device checks the ESI included in the EVPN AD route. If the ESI is the same as the ESI marked by a certain local interface, the PE device generates a corresponding split-horizon entry. The split-horizon entry includes an in-interface, an out-interface, and an ESI label. The specific format is: <in-interface, out-interface, ESI label>. The above in-interface is usually a certain local interface (which may be an actual physical interface, or an actual physical sub-interface, or an aggregated interface, or an aggregated sub-interface, or a VLAN under a physical interface); the above out-interface is usually a tunnel interface, for example, an MPLS tunnel; the above ESI label is carried and advertised through the EVPN AD route.
[0019] After the PE device receives a data packet sent by the CE device, it determines whether to flood the data packet according to the destination MAC address included in the data packet. If the data packet is to be flooded, the PE device floods it to all other out-interfaces after excluding the in-interface. For example, in Figure 1 , when PE1 receives a data packet sent by CE1 and floods the data packet, PE1 floods it through the following out-interfaces: the interface connected to CE2, the interface connected to CE5, the interface connected to PE2, and the interface connected to PE3.
[0020] When the PE device floods, if the out-interface is a tunnel interface, the PE device looks up the split-horizon table. If the in-interface for receiving the data packet and the out-interface for flooding correspond and match the in-interface and out-interface included in a certain split-horizon entry, the PE device embeds the ESI label included in the split-horizon entry in the data packet. For example, when PE1 floods to PE2 and its out-interface is an MPLS tunnel interface, if PE1 finds a split-horizon entry that corresponds and matches both the in-interface and the out-interface, PE1 embeds the ESI label included in the split-horizon entry in the data packet and sends the processed data packet to PE2 through the MPLS tunnel. It can be understood that this ESI label is the ESI label of ES1 published by PE2 and is carried and advertised through the EVPN AD route.
[0021] If the PE device receives a data packet through an MPLS tunnel, the PE device processes the label stack included in the data packet according to the existing MPLS label forwarding rules. When processing a certain label, if the PE device determines that the label is the same as the ESI label of a certain local ES, then when forwarding the data packet subsequently, the PE device prohibits sending from the out-interface of this ES.
[0022] Subsequently, if the PE device continues to forward data packets, it continues to check the role of the outgoing interface. If the outgoing interface is a non-DF role, the PE device will not flood it. For example, after PE2 receives the data packet flooded by PE1, it continues to flood all outgoing interfaces connected to the CE. For the outgoing interface connected to CE1, since the tag included in the data packet is the same as the ESI tag of that outgoing interface, PE2 will not send data packets to CE1; for the outgoing interface connected to CE2, since the role of that outgoing interface is non-BDF, PE2 will not send data packets to CE2; for the outgoing interfaces connected to CE3 and CE6, PE2 will send data packets to CE3 and CE6 respectively.
[0023] Therefore, in the existing schemes described above, if the PE device has a large number of multi-homed interfaces, the PE device will assign an ESI label to each interface, which will result in the consumption of a large number of label resources. Especially in some more granular control schemes, the PE device specifies different ESI values for each sub-interface, which requires a large number of labels for ESI labels, thus crowding out the label resources originally used for forwarding.
[0024] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 2 , Figure 2 This is a flowchart illustrating a communication method provided in an embodiment of this application. The method is applied to a first PE device, which is located within an EVPN network. The EVPN network also includes a second PE device. The communication method provided in this application may include the following steps.
[0025] Step 210: Receive the first service message sent by the first CE device; Specifically, the EVPN network includes a first PE device and a second PE device. The first PE device and the second PE device form a multi-homed group. The first CE device connects to the first PE device and the second PE device through different links. A tunnel, such as an MPLS tunnel, has been established between the first PE device and the second PE device.
[0026] The first PE device includes a first interface and is connected to the first CE device through the first interface.
[0027] The first CE device sends a first service message to the first PE device, the first service message including the destination MAC address. After receiving the first service message, the first PE device obtains the destination MAC address from it.
[0028] Step 220: If it is determined that the first service message is flooded and the second interface used to forward the first service message is a logical port, then check whether there is a matching horizontal partition table entry in the local horizontal partition table. Specifically, according to the description of step 210, after the first PE device obtains the destination MAC address, it determines whether to flood the first service packet based on the destination MAC address. In this embodiment, if the destination MAC is a broadcast MAC, or a multicast MAC, and the destination MAC is not found in the MAC table, that is, the destination MAC is a broadcast MAC, a multicast MAC, or an unknown unicast MAC, then the first PE device determines to flood the first service packet.
[0029] If it is determined that the first service message will be flooded, the first PE device will exclude the first interface that received the first service message and flood it to all other outgoing interfaces.
[0030] In this embodiment, the first PE device further includes multiple other interfaces and is connected to the CE device and the PE device through these other interfaces. In this embodiment, the other outgoing interfaces include a second interface. If the second interface used to forward the first service packet is a logical port, for example, an MPLS tunnel port, then the first PE device checks whether a matching horizontal partition table entry exists in its local horizontal partition table.
[0031] If a horizontal split table entry exists, the first PE device executes step 230; if no horizontal split table entry exists, the first PE device floods the first service message to the peer device (e.g., the remote PE device of the peer device) through the tunnel entrance.
[0032] In this embodiment, the horizontal segmentation entry includes an ingress interface, an egress interface, and an ESI label. The ingress interface is any ingress interface, the egress interface is the tunnel entrance, and the ESI label is advertised by other PE devices via EVPN AD routing.
[0033] The format of a horizontally split table entry is as follows: <*, out-interface ESI LABEL>, where * is a wildcard indicating any in-interface.
[0034] Step 230: If it exists, send a second service message to the second PE device through the logic port. The second service message includes the first ESI tag. Specifically, according to the description of step 220, if a horizontal segmentation entry exists, the first PE device carries the first ESI tag included in the horizontal segmentation entry in the first service message and generates a second service message, which includes the first ESI tag.
[0035] It should be noted that the first ESI label is a shared label (usually 20 bits) allocated by the second PE device from the local MPLS LABEL pool for each local ES. That is, the second PE device reserves one ESI label and assigns that ESI label to each local ES.
[0036] The first PE device floods the second service message. Through this logical port, that is, through this tunnel port, the first PE device sends the second service message to the second PE device connected through the tunnel.
[0037] After receiving the second service packet, the second PE device processes the label stack included in the second service packet according to the existing MPLS label forwarding rules. When processing a certain label (e.g., label 1), the second PE device determines that label 1 is the same as the locally reserved ESI label (that is, the same as the ESI label allocated to the local ES). Therefore, when forwarding the second service packet in subsequent calls, the second PE device prohibits sending the second service packet to all local interfaces with configured ESIs (usually a ten-byte number, for example, 0001.0001.0001.0001), and sends the second service packet to all local interfaces without configured ESIs.
[0038] Optionally, in this embodiment of the application, the first PE device will also perform the following process.
[0039] Furthermore, in this embodiment, other interfaces also include a third interface. If the third interface used for forwarding the first service message is a normal port, that is, if the third interface is an interface for connecting other CE devices besides the first CE device, then the first PE device sends the first service message to other CE devices through the third interface.
[0040] Optionally, in this embodiment of the application, the first PE device will also perform the following process before performing step 210.
[0041] Furthermore, the second PE device reserves one ESI label, for example, a first ESI label, and assigns this first ESI label to each local ES. Then, it generates a first EVPN AD route with the same number of local ESs. Each first EVPN AD route includes an ESI and a first ESI label. The second PE device sends the first EVPN AD route to the first PE device through the established tunnel.
[0042] The first PE device receives the first EVPN AD route and obtains the first ESI label from it. The first PE device generates a split horizon entry, which includes the ingress interface identifier, the egress interface identifier, and the first ESI label.
[0043] The ingress interface is identified by the wildcard *, and the egress interface is identified by the tunnel port that receives the first EVPN AD route.
[0044] Optionally, in this embodiment of the application, the first PE device will also perform the following process.
[0045] Furthermore, the first PE device reserves one ESI label, for example, a second ESI label, and assigns this second ESI label to each local ES. The first PE device generates the same number of second EVPN AD routes as the number of local ESs. Each second EVPN AD route includes an ESI and a second ESI label, which is a shared label for each local ES.
[0046] The first PE device sends a second EVPN AD route to the second PE device through the established tunnel, enabling the second PE device to generate a corresponding split horizon entry locally. The process, format, and stored content of the second PE device in generating the split horizon entry are the same as those of the first PE device, and will not be repeated here.
[0047] Optionally, in this embodiment of the application, the first PE device will also perform the following process.
[0048] Furthermore, the EVPN network also includes a third PE device. This third PE device can receive service packets sent by the CE device connected to it, following the steps performed by the first PE device. When it is determined that the service packet is being flooded and the outgoing interface is a logical interface, it searches the local split horizon table. If a matching split horizon entry exists, a third service packet is generated, which includes a first tag.
[0049] It is understandable that the first label mentioned above is the ESI label of a certain ES published by the first PE device and advertised through the EVPNAD route. That is, the third PE device can specifically be the second PE device, which receives the second EVPN AD route sent by the first PE device and generates the corresponding split horizon entry locally.
[0050] The third PE device sends a third service message to the first PE device through the tunnel already established with the first PE device.
[0051] After receiving the third service packet, the first PE device processes the label stack included in the third service packet according to the existing MPLS label forwarding rules. When processing the first label, the first PE device determines that the first label is the same as the locally reserved ESI label (that is, the same as the ESI label allocated to the local ES). Therefore, when forwarding the third service packet in subsequent transactions, the first PE device prohibits sending the third service packet to all local interfaces with configured ESIs, and sends the third service packet to all local interfaces without configured ESIs.
[0052] Optionally, in this embodiment of the application, each PE device in the EVPN network will also announce its local ESI label mode to each other, so that each PE device can determine the ESI label mode of the peer PE.
[0053] Furthermore, in this embodiment, a first PE device is used as an example for explanation. The first PE device has locally enabled the ESI tag sharing mode.
[0054] The first PE device synchronizes the ESI tag allocation rules with the second and third PE devices respectively, so that the second and third PE devices can determine whether the first PE device has started the ESI tag sharing mode.
[0055] Furthermore, in the embodiments of this application, each PE device can communicate its local ESI tag mode to each other in a variety of ways.
[0056] In one implementation, PE devices can advertise their local ESI label patterns to each other via EVPN AD routing. The aforementioned EVPN AD routing includes the EVPN ESI Label ExtendedCommunity attribute, which includes a Flags field. This Flags field occupies 8 bits.
[0057] In this embodiment, bits 2-5 of the flag field are extended to indicate whether the PE device has activated the ESI tag sharing mode. For example, setting any one of bits 2-5 to "ON" indicates that the PE device has activated the ESI tag sharing mode.
[0058] It is understandable that this can also be achieved by adding other extended community attributes in the EVPN AD route, which will not be repeated here.
[0059] In another implementation, administrators or users configure and enable ESI label sharing mode on each PE device via command line. Subsequently, the network controller can detect each PE device to ensure that all PE devices have ESI label sharing mode enabled.
[0060] In another implementation, the local ESI tag mode can be announced between PE devices by extending other communication protocols. For example, the Inter-Chassis Communication Protocol (ICCP) can be used. Each PE device can send ICCP protocol messages to each other before receiving service messages from the CE device to announce its local ESI tag mode.
[0061] Therefore, using the communication method and apparatus provided in this application, the first PE device receives a first service message sent by the first CE device; if it is determined that the second interface used for flooding and forwarding the first service message is a logical port, the first PE device searches its local horizontal segmentation table for a matching horizontal segmentation entry; if it does, the first PE device sends a second service message to the second PE device through the logical port, the second service message including a first ESI tag; wherein, the first ESI tag is stored in the horizontal segmentation entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
[0062] In this way, the sending end of the flood message carries the shared label of each ES on the receiver's local machine, which is included in the horizontal segmentation table, in the flood message, so that the receiver can determine the outgoing interface to forward the flood message based on the shared label. This enables each ES within the PE device to share the same ESI label, reducing the use of ESI labels; at the same time, it also solves the problem that the existing PE device would consume a lot of label resources by allocating an ESI label for each interface.
[0063] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 1 The above has already been addressed. Figure 1 The connection relationships of the EVPN network shown are explained below and will not be repeated here.
[0064] For ES multi-homed access EVPN instances, PE1 and PE2 each reserve an ESI label and assign the ESI label to each local ES. For example, PE1 reserves ESI label 1 and assigns ESI label 1 to local ES1, ES2, and ES3; PE2 reserves ESI label 2 and assigns ESI label 2 to local ES1, ES2, and ES3.
[0065] PE1 can advertise the ESI labels for each local Elastic Community (ES) to PE2 via EVPN AD routes (existing EVPN Category 1 routes). Simultaneously, PE1 also indicates in the EVPN AD routes that it has enabled ESI label sharing mode. Upon receiving the EVPN AD routes, PE2 retrieves the ESIs from them and, based on the EVPN ESI label extended community attribute, obtains ESI label 1 and confirms that PE1 has enabled ESI label sharing mode.
[0066] If the ESI is the same as an ESI marked on a local interface of PE2 (for example, the same as ES1 on PE2), then PE2 generates Horizontal Partition 1. Horizontal Partition 1 includes the in-interface, the out-interface, and the ESI label. The specific format is: <*,Tunnel Port 1,ESI Label 1>.
[0067] Similarly, PE2 can advertise the ESI labels for each local Elastic Community (ES) to PE1 via EVPN AD routes (existing EVPN Category 1 routes). Simultaneously, PE2 also indicates in the EVPN AD routes that it has enabled ESI label sharing mode. Upon receiving the EVPN AD routes, PE1 retrieves the ESI from them and, based on the EVPN ESI label extended community attribute, obtains ESI label 2 and confirms that PE2 has enabled ESI label sharing mode.
[0068] If the ESI is the same as the ESI of a local interface on PE1 (for example, the same as the local ES1 on PE1), then PE1 generates a horizontal split table entry 2. Horizontal split table entry 2 includes the in-interface, the out-interface, and the ESI label. The specific format is: <*, Tunnel Port 1, ESI Label 2>.
[0069] When PE1 receives service packet 1 from CE1, it determines whether to flood service packet 1 based on the destination MAC address included in the service packet. If service packet 1 is to be flooded, PE1 will exclude the inbound interface and flood it to all other outbound interfaces.
[0070] In this embodiment of the application, after excluding the input interface, PE1 determines all other output interfaces, including the interface connected to CE2, the interface connected to CE3, the interface connected to CE5, the interface connected to PE2, and the interface connected to PE3.
[0071] After PE1 identifies other outgoing interfaces, it determines that there are logical ports among these outgoing interfaces, namely the interface connecting PE2 (i.e., tunnel port 1) and the interface connecting PE3 (i.e., tunnel port 2). Then, PE1 searches its local horizontal partition table to see if there is a matching horizontal partition table entry.
[0072] For example, based on tunnel entrance 1, PE1 finds horizontal split table entry 2. PE1 then carries the ESI tag 2 included in horizontal split table entry 2 in service message 1, generating service message 2. PE1 sends service message 2 to PE2 through tunnel entrance 1.
[0073] For example, if PE2 does not find a horizontal split table entry based on tunnel port 2, then PE1 performs MPLS encapsulation on service packet 1 (at least encapsulating the private network label). The encapsulated service packet 1 is then sent to PE3 through tunnel port 1.
[0074] After receiving service packet 2, PE2 processes the label stack included in service packet 2 according to the existing MPLS label forwarding rules. When processing ESI label 2, PE2 determines that ESI label 2 is the same as the locally reserved ESI label 2 (that is, the same as the ESI label 2 allocated to the local ES). Therefore, when forwarding service packet 2 in subsequent calls, PE2 prohibits sending service packet 2 to all local interfaces with configured ESI (i.e., interfaces connecting CE1, CE2, and CE3) and sends service packet 2 to all local interfaces without configured ESI (i.e., interfaces connecting CE6).
[0075] It should be noted that, due to EVPN's anti-multiple-copy mechanism, flooded packets received by the PE device from the public network will not be flooded to the public network side. Therefore, PE2 will no longer flood to PE1 and PE3.
[0076] After receiving the encapsulated service message 1, PE3 first decapsulates it to obtain service message 1. Since service message 1 does not carry the ESI tag, PE3 continues to flood it to CE4. Similarly, PE3 no longer floods it to PE1 and PE2.
[0077] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 3 , Figure 3 This is another EVPN home network topology diagram provided for embodiments of this application. Figure 3 The network consists of PE1-PE4, P, and CE1-CE3. PE1, PE2, PE3, P, and PE4 form an EVPN point-to-multipoint network, providing Layer 2 communication between CE1 and CE3. The forwarding plane between PE1, PE2, PE3, and PE4 uses MPLS encapsulation. CE1 and CE2 are triple-homed to the same EVPN instance via ES1 and ES2, respectively. On PE1, PE2, and PE3, the interfaces connecting to CE1, CE2, and CE3 must be marked with the corresponding ESI.
[0078] The aforementioned CE1-CE3 can be virtual machines or Ethernet switches. If CE1-CE3 is an Ethernet switch, then the virtual machine accesses the EVPN network through CE1-CE3.
[0079] For ES multi-homed access EVPN instances, PE1, PE2, and PE3 each reserve an ESI label and assign this ESI label to each local ES. For example, PE1 reserves ESI label 1 and assigns ESI label 1 to local ES1 and ES2; PE2 reserves ESI label 2 and assigns ESI label 2 to local ES1 and ES2; PE3 reserves ESI label 3 and assigns ESI label 3 to local ES1 and ES2.
[0080] Let's take PE1 and PE2 as examples for explanation.
[0081] PE1 can advertise the ESI labels for each local Elastic Community (ES) to PE2 via EVPN AD routes (existing EVPN Category 1 routes). Simultaneously, PE1 also indicates in the EVPN AD routes that it has enabled ESI label sharing mode. Upon receiving the EVPN AD routes, PE2 retrieves the ESIs from them and, based on the EVPN ESI label extended community attribute, obtains ESI label 1 and confirms that PE1 has enabled ESI label sharing mode.
[0082] If the ESI is the same as an ESI marked on a local interface of PE2 (for example, the same as ES1 on PE2), then PE2 generates Horizontal Partition 1. Horizontal Partition 1 includes the in-interface, the out-interface, and the ESI label. The specific format is: <*,Tunnel Port 1,ESI Label 1>.
[0083] Similarly, PE1 generates horizontally partitioned table entry 2 locally, with the format: <*,Tunnel Entrance 1,ESI Label 2>; PE1 also generates horizontally partitioned table entry 3 locally, with the format: <*,Tunnel Entrance 1,ESI Label 3>. PE3 also generates a corresponding horizontally partitioned table entry locally, which will not be repeated here.
[0084] When PE1 receives service packet 1 from CE1, it determines whether to flood the data packet based on the destination MAC address included in the service packet. If service packet 1 is to be flooded, PE1 will exclude the inbound interface and flood it to all other outbound interfaces.
[0085] In this embodiment of the application, after excluding the input interface, PE1 determines all other output interfaces, including the interface connected to CE2, the interface connected to PE2, and the interface connected to PE3.
[0086] After PE1 identifies other outgoing interfaces, it determines that there are logical ports among these outgoing interfaces, namely, the interface connecting PE2 (i.e., tunnel port 1), the interface connecting PE3 (i.e., tunnel port 2), and the interface connecting PE4 (i.e., tunnel port 3). Then, PE1 searches its local horizontal partition table to see if there is a matching horizontal partition table entry.
[0087] For example, based on tunnel entrance 1, PE1 finds horizontal split table entry 2. PE1 then carries the ESI tag 2 included in horizontal split table entry 2 in service message 1, generating service message 2. PE1 sends service message 2 to PE2 through tunnel entrance 1.
[0088] For example, based on tunnel entrance 2, PE1 finds horizontal segmentation entry 3. PE1 then carries the ESI tag 3 included in horizontal segmentation entry 3 in service message 1, generating service message 3. PE1 sends service message 3 to PE3 through tunnel entrance 2.
[0089] For example, if PE1 does not find a horizontal split table entry based on tunnel port 3, then PE1 performs MPLS encapsulation on service message 1. The encapsulated service message 1 is then sent to PE4 through tunnel port 3 and P.
[0090] After receiving service packet 2, PE2 processes the label stack included in service packet 2 according to the existing MPLS label forwarding rules. When processing ESI label 2, PE2 determines that ESI label 2 is the same as the locally reserved ESI label 2 (that is, the same as the ESI label 2 allocated to the local ES). Therefore, when forwarding service packet 2 in subsequent calls, PE2 prohibits sending service packet 2 to all local interfaces that have configured ESI (i.e., the interfaces connecting CE1 and CE2).
[0091] Similarly, after receiving service packet 3, PE3 processes the label stack included in service packet 2 according to the existing MPLS label forwarding rules. When processing ESI label 3, PE3 determines that ESI label 3 is the same as the locally reserved ESI label 3 (that is, the same as the ESI label 3 allocated for the local ES). Therefore, when forwarding service packet 3 in the future, PE3 prohibits sending service packet 3 to all interfaces with configured ESI (i.e., the interfaces connecting CE1 and CE2).
[0092] After receiving the encapsulated service message 1, PE4 first decapsulates it to obtain service message 1. Since service message 1 does not carry an ESI tag, PE4 continues to flood it to CE3.
[0093] It should be noted that, due to the anti-multiple-copy mechanism of EVPN networking, flooded packets received by PE devices from the public network will not be flooded to the public network side. Therefore, PE devices will no longer flood other PE devices in the EVPN network.
[0094] Based on the same inventive concept, embodiments of this application also provide a communication device corresponding to the communication method. See also Figure 4 , Figure 4 The communication device provided in this application embodiment is applied to a first PE device, the first PE device including a first interface and connected to a first CE device through the first interface, the device including: The receiving unit 410 is used to receive the first service message sent by the first CE device; The lookup unit 420 is used to look up whether there is a matching horizontal partition table entry in the local horizontal partition table if it is determined that the first service message is flooded and the second interface used to forward the first service message is a logical port. The sending unit 430 is used to send a second service message to the second PE device through the logic port if the first service message exists. The second service message includes a first ESI tag. The first ESI tag is stored in the horizontal segmentation table entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
[0095] Optionally, the sending unit 430 is further configured to, if it is determined that the first service message is flooded and the third interface used to forward the first service message is a CE device connected to another CE device besides the first CE device, then send the first service message to the other CE device through the third interface.
[0096] Optionally, the receiving unit 410 is further configured to receive a first EVPN AD route sent by the second PE device, wherein the first EVPN AD route includes the first ESI label; The apparatus further includes a generation unit (not shown in the figure) for generating the horizontal segmentation entry, wherein the horizontal segmentation entry includes an ingress interface identifier, an egress interface identifier, and the first ESI tag.
[0097] Optionally, the device further includes: The allocation unit (not shown in the figure) is used to allocate a second ESI label to each local ES; The sending unit 430 is further configured to send a second EVPN AD route to the second PE device, the second EVPN AD route including the second ESI label; The second ESI label is a shared label for each local ES.
[0098] Optionally, the receiving unit 410 is further configured to receive a third service message sent by a third PE device, the third service message including a first tag; The sending unit 430 is further configured to, if the first tag is the same as the second ESI tag, send the third service message through all interfaces without ESI and prohibit sending the third service message through all interfaces with ESI.
[0099] Optionally, the device further includes: The synchronization unit (not shown in the figure) is used to synchronize the ESI tag allocation rules with the second PE device and the third PE device respectively, so that the second PE device and the third PE device can determine whether the first PE device has started the ESI tag sharing mode.
[0100] Therefore, using the communication device provided in this application, the first PE device receives a first service message sent by the first CE device; if it is determined that the second interface used for flooding and forwarding the first service message is a logical port, the first PE device searches its local horizontal segmentation table for a matching horizontal segmentation entry; if it does, the first PE device sends a second service message to the second PE device through the logical port, the second service message including a first ESI tag; wherein, the first ESI tag is stored in the horizontal segmentation entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
[0101] In this way, the sending end of the flood message carries the shared label of each ES on the receiver's local machine, which is included in the horizontal segmentation table, in the flood message, so that the receiver can determine the outgoing interface to forward the flood message based on the shared label. This enables each ES within the PE device to share the same ESI label, reducing the use of ESI labels; at the same time, it also solves the problem that the existing PE device would consume a lot of label resources by allocating an ESI label for each interface.
[0102] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 5 As shown, the system includes a processor 510, a transceiver 520, and a machine-readable storage medium 530. The machine-readable storage medium 530 stores machine-executable instructions that can be executed by the processor 510. The processor 510 is prompted by the machine-executable instructions to execute the communication method provided in the embodiments of this application. (The foregoing...) Figure 4 The communication device shown can be used as follows: Figure 5 The hardware structure of the network device shown is implemented.
[0103] The aforementioned computer-readable storage medium 530 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 530 may also be at least one storage device located remotely from the aforementioned processor 510.
[0104] The processor 510 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0105] In this embodiment, the processor 510 reads the machine-executable instructions stored in the machine-readable storage medium 530, and is prompted by the machine-executable instructions to enable the processor 510 itself and the transceiver 520 to execute the communication method described in the foregoing embodiment.
[0106] In addition, this application provides a machine-readable storage medium 530 that stores machine-executable instructions. When called and executed by the processor 510, the machine-executable instructions cause the processor 510 itself and the transceiver 520 to execute the communication method described in the aforementioned application.
[0107] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0108] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0109] For the embodiments of communication devices and machine-readable storage media, since the methods involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.
[0110] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A communication method, characterized in that, The method, applied to a first PE device, the first PE device including a first interface and connected to a first CE device via the first interface, includes: Receive the first service message sent by the first CE device; If it is determined that the first service message is flooded and the second interface used to forward the first service message is a logical port, then check if there is a matching horizontal partition table entry in the local horizontal partition table. If it exists, a second service message is sent to the second PE device through the logic port. The second service message includes a first ESI tag. The first ESI tag is stored in the horizontal segmentation table entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
2. The method according to claim 1, characterized in that, The method further includes: If it is determined that the first service message is flooded and forwarded and the third interface used to forward the first service message is a CE device connected to another CE device besides the first CE device, then the first service message is sent to the other CE device through the third interface.
3. The method according to claim 1, characterized in that, Before receiving the first service message sent by the first CE device, the method further includes: Receive a first EVPN AD route sent by the second PE device, wherein the first EVPN AD route includes the first ESI label; Generate the horizontal segmentation entry, which includes an ingress interface identifier, an egress interface identifier, and the first ESI tag.
4. The method according to claim 1, characterized in that, The method further includes: Assign a second ESI label to each local Elasticsearch instance; Send a second EVPN AD route to the second PE device, the second EVPN AD route including the second ESI label; The second ESI label is a shared label for each local ES.
5. The method according to claim 4, characterized in that, The method further includes: Receive a third service message sent by a third PE device, wherein the third service message includes a first tag; If the first tag is the same as the second ESI tag, the third service message is sent through all interfaces without ESI and the sending of the third service message is prohibited through all interfaces with ESI.
6. The method according to any one of claims 1 or 5, characterized in that, The method further includes: The allocation rules for ESI tags are synchronized with the second PE device and the third PE device respectively, so that the second PE device and the third PE device can determine whether the first PE device has started the ESI tag sharing mode.
7. A communication device, characterized in that, Applied to a first PE device, the first PE device including a first interface and connected to a first CE device through the first interface, the device includes: The receiving unit is used to receive the first service message sent by the first CE device; The lookup unit is used to check if there is a matching horizontal partition table entry in the local horizontal partition table if it is determined that the first service message is flooded and the second interface used to forward the first service message is a logical port. The sending unit is configured to send a second service message to the second PE device through the logic port if the service message exists, wherein the second service message includes a first ESI tag. The first ESI tag is stored in the horizontal segmentation table entry, and the first ESI tag is a shared tag configured by the second PE device for each local ES.
8. The apparatus according to claim 7, characterized in that, The sending unit is further configured to, if it is determined that the first service message is flooded and forwarded and the third interface used to forward the first service message is a CE device connected to another CE device besides the first CE device, then send the first service message to the other CE device through the third interface.
9. The apparatus according to claim 7, characterized in that, The receiving unit is further configured to receive a first EVPN AD route sent by the second PE device, wherein the first EVPN AD route includes the first ESI label; The apparatus further includes a generation unit for generating the horizontally segmented table entry, wherein the horizontally segmented table entry includes an ingress interface identifier, an egress interface identifier, and the first ESI tag.
10. The apparatus according to claim 7, characterized in that, The device further includes: The allocation unit is used to assign a second ESI label to each local Elasticsearch instance. The sending unit is further configured to send a second EVPN AD route to the second PE device, the second EVPN AD route including the second ESI label; The second ESI label is a shared label for each local ES.
11. The apparatus according to claim 10, characterized in that, The receiving unit is further configured to receive a third service message sent by a third PE device, the third service message including a first tag; The sending unit is further configured to, if the first tag is the same as the second ESI tag, send the third service message through all interfaces without ESI and prohibit sending the third service message through all interfaces with ESI.
12. The apparatus according to any one of claims 7 or 11, characterized in that, The device further includes: The synchronization unit is used to synchronize the ESI tag allocation rules with the second PE device and the third PE device respectively, so that the second PE device and the third PE device can determine whether the first PE device has started the ESI tag sharing mode.