Communication method, communication device and communication system

By using the Ethernet segment identifier ESI in EVPN to determine whether the source address of the data packet matches the storage address, the formation of traffic loops is avoided, and the problems of waste of network resources and performance impact of PE devices when sending data packets are solved. An efficient communication process is realized.

CN113055295BActive Publication Date: 2024-11-19HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110212698.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-01
Publication Date
2024-11-19
Estimated Expiration
2038-08-01

AI Technical Summary

Technical Problem

In Ethernet Virtual Private Network (EVPN), service provider edge PE devices are prone to form traffic loops when sending data packets, resulting in waste of network resources and performance impacts.

Method used

By receiving and processing a message containing the Ethernet segment identifier ESI in the PE device, when determining that the source address of the data packet is the same as the stored address, data packets are avoided to be sent to the corresponding PE device, thereby preventing the formation of a traffic loop.

Benefits of technology

It effectively avoids the occurrence of traffic loops, saves network resources, improves the performance of PE equipment, and ensures the efficiency of the communication process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113055295B_ABST
    Figure CN113055295B_ABST
Patent Text Reader

Abstract

The present application provides a communication method and a service provider edge PE device, so that a loop will not be formed when forwarding traffic, avoiding the waste of network resources. The method includes: a first PE device receives a message sent by a second PE device, the message includes a first ESI and the address of the second PE device, the first ESI is used to identify the Ethernet segment between the second PE device and the CE device; the first PE device determines that the first ESI is the same as the second ESI stored by the first PE device, the second ESI is used to identify the Ethernet segment between the first PE device and the CE device; the first PE device generates an entry when determining that the first ESI is the same as the second ESI, the entry includes the address of the second PE device; the first PE device receives a data packet; when the first PE device determines that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the second PE device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and more specifically, to a communication method, a communication device and a communication system. Background Art

[0002] In an Ethernet Virtual Private Network (EVPN), a Provider Edge (PE) device is prone to forming a traffic loop when sending data packets. This loop process causes a waste of network resources and affects the performance of the PE device. Summary of the invention

[0003] The present application provides a communication method and a service provider edge PE device, so that a loop will not be formed when forwarding traffic, thereby avoiding the waste of network resources.

[0004] In a first aspect, a communication method is provided, the method comprising: a first service provider edge PE device receives a message sent by a second PE device, the message comprising a first Ethernet segment identifier ESI and an address of the second PE device, the first ESI being used to identify the Ethernet segment to which the connection between the second PE device and a user edge CE device belongs; the first PE device determines that the first ESI is the same as the second ESI stored by the first PE device, the second ESI being used to identify the Ethernet segment to which the connection between the first PE device and the CE device belongs; in response to the first PE device determining that the first ESI is the same as the second ESI, the first PE device generates an entry, the entry comprising the address of the second PE device; the first PE device receives a data packet sent by the second PE device; the first PE device determines that the source address of the data packet is the same as the address of the second PE device in the entry; in response to the first PE device determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the second PE device.

[0005] In the prior art, the first device does not store an entry including the address of the second PE device, and when the second PE device sends a data packet to the first PE device, the source address included in the data packet is not the address of the second PE device. When the first PE device receives the data packet, it may send the data packet to the second PE device again, causing a traffic loop. In an embodiment of the present application, when the first PE device receives the data packet, it can avoid sending the data packet to the second PE device based on the entry including the address of the second PE device stored on the first device and the source address included in the data packet, so as to avoid forming a traffic loop, avoid wasting network resources, and avoid affecting the performance of the PE device.

[0006] In combination with the first aspect, in certain implementations of the first aspect, before the first PE device determines that the source address of the data packet is the same as the address of the second PE device, the method also includes: the first PE device determines that the interface of the first PE device used to connect to the CE device is in a faulty state.

[0007] At this time, after the first PE device determines that the interface of the first PE device used to connect to the CE device is in a faulty state, if the data packet is sent to the CE via the second PE device, a loop problem may occur. Therefore, the first PE device determines whether the source address of the data packet is the same as the address of the second PE device to avoid the loop. If the first PE device determines that the interface of the first PE device used to connect to the CE device is in a normal state, the first PE device can send the data packet through the interface used to connect to the CE device. At this time, there will be no traffic loop problem, so there is no need to determine whether the source address of the data packet is the same as the address of the second PE device. This can improve the efficiency of the first PE device in sending the data packet during the communication process.

[0008] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: in response to the first PE device determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the CE device.

[0009] In the prior art, there is also a situation where the data packet is first sent by the CE device to the second PE device, and the second PE device then sends the data packet to the first PE device. When the second PE device sends the data packet to the first PE device, the source address included in the data packet is not the address of the second PE device. When the first PE device receives the data packet, it may send the data packet to the CE device, causing a traffic loop. In an embodiment of the present application, when the first PE device receives the data packet, it can determine that the source address of the data packet is the same as the address of the second PE device in the entry based on the entry including the address of the second PE device stored on the first device and the source address included in the data packet, and avoid sending the data packet to the CE device, avoid forming a traffic loop, avoid wasting network resources, and avoid affecting the performance of the PE device.

[0010] In combination with the first aspect, in some implementations of the first aspect, the first PE device stores interface information, the second ESI stored by the first PE device is included in the interface information, the interface information also includes an interface identifier, the interface identifier is used to identify the interface used by the first PE device to connect to the CE device, and the entry also includes the interface identifier; in response to the first PE device determining that the first ESI is the same as the second ESI, the first PE device generates an entry, including: the first PE device determines the interface identifier in the interface information according to the second ESI;

[0011] The first PE device avoids sending the data packet to the CE device, including:

[0012] The first PE device determines the interface identifier in the entry according to the entry and the source address of the data packet; the first PE device avoids sending the data packet to the interface of the first PE device identified by the interface for connecting to the CE device.

[0013] At this time, when the first ESI is the same as the second ESI, the entry generated by the first PE device includes the interface identifier of the interface used by the first PE device to connect to the CE device. Therefore, the first PE device avoids sending the data packet to the interface of the first PE device used to connect to the CE device with the interface identifier, thereby achieving the goal of the first PE device avoiding sending the data packet to the CE device.

[0014] In combination with the first aspect, in certain implementations of the first aspect, the method is applied to an Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, and the message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

[0015] The method is applied to an Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, so that a traffic loop is not formed in the Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, thereby avoiding the waste of network resources and avoiding affecting the performance of PE equipment.

[0016] In a second aspect, a communication device is provided, where the communication device is a first service provider edge PE device, including:

[0017] A receiving module, configured to receive a message sent by a second PE device, wherein the message includes a first Ethernet segment identifier ESI and an address of the second PE device, wherein the first ESI is used to identify an Ethernet segment to which a connection between the second PE device and a user edge CE device belongs;

[0018] a determination module, configured to determine that the first ESI is the same as a second ESI stored in the first PE device, the second ESI being used to identify an Ethernet segment to which a connection between the first PE device and the CE device belongs;

[0019] a processing module, configured to generate an entry in response to determining that the first ESI is the same as the second ESI, the entry including an address of the second PE device;

[0020] The receiving module is also used to receive a data packet sent by the second PE device;

[0021] The determining module is further configured to determine that the source address of the data packet is the same as the address of the second PE device in the entry;

[0022] The processing module is further configured to avoid sending the data packet to the second PE device in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry.

[0023] In combination with the second aspect, in certain implementations of the second aspect, the determination module is also used to: before the determination module determines that the source address of the data packet is the same as the address of the second PE device, determine that the interface of the first PE device used to connect to the CE device is in a faulty state.

[0024] In combination with the second aspect, in some implementations of the second aspect, the processing module is further used to: in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, avoid sending the data packet to the CE device.

[0025] In combination with the second aspect, in certain implementations of the second aspect, the first PE device stores interface information, the second ESI stored by the first PE device is included in the interface information, the interface information also includes an interface identifier, the interface identifier is used to identify the interface used by the first PE device to connect to the CE device, and the entry also includes the interface identifier; the processing module is specifically used to: in response to determining that the first ESI is the same as the second ESI, determine the interface identifier in the interface information according to the second ESI to generate the entry; the processing module is specifically used to: determine the interface identifier in the entry according to the entry and the source address of the data packet; avoid sending the data packet to the interface used by the first PE device identified by the interface identifier to connect to the CE device.

[0026] In combination with the second aspect, in certain implementations of the second aspect, the communication device is applied to an Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, and the message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

[0027] In a third aspect, a communication device is provided, where the communication device is a first service provider edge PE device, including:

[0028] a memory, used to store a second Ethernet segment identifier ESI, where the second ESI is used to identify the Ethernet segment to which the connection between the first PE device and the customer edge CE device belongs;

[0029] a processor, configured to receive a message sent by a second PE device, the message including a first Ethernet segment identifier ESI and an address of the second PE device, the first ESI being used to identify an Ethernet segment to which a connection between the second PE device and the CE device belongs;

[0030] The processor is further configured to determine that the first ESI is the same as the second ESI;

[0031] The processor is further configured to generate an entry in response to determining that the first ESI is the same as the second ESI, the entry including the address of the second PE device;

[0032] The processor is further configured to receive a data packet sent by the second PE device;

[0033] The processor is further configured to determine that a source address of the data packet is the same as an address of the second PE device in the entry;

[0034] The processor is further configured to avoid sending the data packet to the second PE device in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry.

[0035] In combination with the third aspect, in certain implementations of the third aspect, the communication device also includes an interface, which is used to connect the CE device; the processor is also used to determine that the interface of the first PE device used to connect the CE device is in a faulty state before determining that the source address of the data packet is the same as the address of the second PE device.

[0036] In combination with the third aspect, in certain implementations of the third aspect, the processor is further used to: in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the CE device.

[0037] In combination with the third aspect, in certain implementations of the third aspect, the memory stores interface information, the second ESI stored in the memory is included in the interface information, the interface information also includes an interface identifier, the interface identifier is used to identify the interface used by the first PE device to connect to the CE device, and the entry also includes the interface identifier; the processor is specifically used to: determine the interface identifier in the interface information according to the second ESI to generate the entry; the processor is specifically used to: the first PE device determines the interface identifier in the entry according to the entry and the source address of the data packet; the first PE device avoids sending the data packet to the interface of the first PE device identified by the interface identifier used to connect to the CE device.

[0038] In combination with the third aspect, in certain implementations of the third aspect, the communication device is applied to an Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, and the message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

[0039] In a fourth aspect, a communication system is provided, the communication system comprising a first service provider edge PE device and a second PE device;

[0040] The first PE device is used for:

[0041] receiving a message sent by the second PE device, the message including a first Ethernet segment identifier ESI and an address of the second PE device, the first ESI being used to identify an Ethernet segment to which a connection between the second PE device and a customer edge CE device belongs;

[0042] Determine that the first ESI is the same as a second ESI stored in the first PE device, where the second ESI is used to identify an Ethernet segment to which a connection between the first PE device and the CE device belongs;

[0043] In response to the first PE device determining that the first ESI is the same as the second ESI, generating an entry, the entry including an address of the second PE device;

[0044] receiving a data packet sent by the second PE device;

[0045] Determining that the source address of the data packet is the same as the address of the second PE device in the entry;

[0046] In response to the first PE device determining that the source address of the data packet is the same as the address of the second PE device in the entry, avoiding sending the data packet to the second PE device;

[0047] The second PE device is used for:

[0048] Sending the message to the first PE device;

[0049] Send the data packet to the first PE device.

[0050] In combination with the fourth aspect, in certain implementations of the fourth aspect, the first PE device is also used to: before determining that the source address of the data packet is the same as the address of the second PE device, the method also includes: the first PE device determines that the interface of the first PE device used to connect the CE device is in a faulty state.

[0051] In combination with the fourth aspect, in some implementations of the fourth aspect, the second PE device is further used to: before sending the data packet to the first PE device, determine that the interface of the second PE device used to connect to the CE device is in a faulty state.

[0052] Therefore, when the interfaces of the second PE device and the first PE device connected to the CE device are both in a fault state, a continuous loop of traffic between the first PE device and the second PE device is avoided.

[0053] In combination with the fourth aspect, in certain implementations of the fourth aspect, the first PE device is also used to: in response to the first PE device determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the CE device.

[0054] In combination with the fourth aspect, in some implementations of the fourth aspect, the first PE device stores interface information, the second ESI stored by the first PE device is included in the interface information, the interface information also includes an interface identifier, the interface identifier is used to identify the interface used by the first PE device to connect to the CE device, and the entry also includes the interface identifier; the first PE device is used to: in response to the first PE device determining that the first ESI is the same as the second ESI, the first PE device generates an entry, including: the first PE device determines the interface identifier in the interface information according to the second ESI to generate the entry;

[0055] The first PE device avoids sending the data packet to the CE device, including: the first PE device determines the interface identifier in the entry based on the entry and the source address of the data packet; the first PE device avoids sending the data packet to the interface of the first PE device identified by the interface identifier and used to connect to the CE device.

[0056] In combination with the fourth aspect, in certain implementations of the fourth aspect, the communication system is applied to an Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, and the message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

[0057] In a fifth aspect, a communication device is provided, characterized in that it includes: a processor and a memory, the memory is used to store instructions, and the processor is used to execute the instructions, so that the communication device can execute the method in the first aspect or any optional implementation of the first aspect.

[0058] In a sixth aspect, a computer storage medium is provided, characterized in that the computer storage medium stores program instructions, and when the instructions are executed, the communication device can execute the method in the first aspect or any optional implementation of the first aspect.

[0059] In a seventh aspect, a computer program product is provided, wherein the computer program product comprises instructions, and when the instructions are executed by a communication device, the communication device can execute the method in the first aspect or any optional implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a schematic diagram of an SRv6 EVPN active-active scenario provided in an embodiment of the present application.

[0061] Figure 2 It is a schematic flow chart of a communication method provided by the present application.

[0062] Figure 3This is another schematic diagram of an SRv6 EVPN active-active scenario provided in an embodiment of the present application.

[0063] Figure 4 It is a schematic diagram of entries in a MAC forwarding table provided in an embodiment of the present application.

[0064] Figure 5 It is a schematic flow chart of a communication method provided by the present application.

[0065] Figure 6 This is another schematic diagram of an SRv6 EVPN active-active scenario provided in an embodiment of the present application.

[0066] Figure 7 It is a schematic flow chart of a communication method provided by the present application.

[0067] Figure 8 It is a schematic block diagram of the communication device provided in this application.

[0068] Fig. 9 It is a schematic block diagram of the communication device provided in this application.

[0069] Fig.10 It is a schematic block diagram of the communication device provided in this application.

[0070] Fig.11 It is a schematic block diagram of a communication system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0072] For the sake of clarity, the terms used in this application are first explained.

[0073] Internet Protocol version 6 segment routing (SRv6) inserts a segment routing header (SRH) into the IPv6 data packet. The SRH includes an IPv6 address list and an index pointing to the IPv6 address list. The segment end point node on the data packet forwarding path searches for the IPv6 address one by one according to the index, and uses the found IPv6 address to update the destination address of the data packet to achieve forwarding. The destination address of the data packet is an IPv6 address, and the IPv6 address in SRv6 can be used as a segment identifier (SID).

[0074] SRv6 EVPN refers to EVPN based on SRv6.

[0075] Virtual private wire service (VPWS) is a point-to-point Layer 2 virtual private network (VPN) service. EVPN VPWS is VPWS implemented in EVPN. EVPNVPWS can provide single-active multi-homing or all-active multi-homing capabilities.

[0076] An attachment circuit (AC) is a physical or logical link used to connect CE devices and PE devices.

[0077] Ethernet virtual private line (EVPL) is used to provide point-to-point Ethernet connection between a pair of ACs. VPWS is implemented based on EVPL.

[0078] Ethernet segment (ES), if a CE belongs to two or more PEs, the group of Ethernet links used by the CE to access PEs, such as multiple ACs, belongs to one ES, and the identifier used to uniquely identify the ES is the Ethernet segment identifier (ESI).

[0079] Ethernet tag identifier (Ethernet Tag ID) is used to identify a specific broadcast domain.

[0080] A broadcast domain (BD) corresponds to a virtual local area network (VLAN).

[0081] A local interface is an interface on a PE device that connects to a CE device or AC without passing through other PE devices. For example Figure 1 Interfaces 104 and 105 are local interfaces, and interfaces 107 and 108 are not local interfaces.

[0082] In this application, the interface of the PE device connected to the CE device or AC refers to the interface connected to the CE device or AC without passing through other PE devices. In this application, the interface used by the PE device to send data packets to other PE devices or CE devices can also be called an outbound interface, and the local interface on the PE device used to send data packets to the CE device or AC can also be called a local outbound interface. In this application, the interface can be a physical port or a logical port on a physical port.

[0083] EVPN provides an all-active mode. In the all-active mode, when a device is multi-homed to multiple provider edge (PE) devices, the multiple PE devices can forward traffic to the device. When the multiple PE devices refer to two PE devices, the multi-active mode can also be called dual-active mode, and the multi-homing can also be called dual-homed.

[0084] In order to understand the present application more clearly, the present application is further described below in combination with different scenarios in SRv6 EVPN. It should be understood that the present application can be applied in the scenario of SRv6 EVPN, and of course can also be applied in other communication scenarios, and the embodiments of the present application are not limited here.

[0085] Figure 1 This is a schematic diagram of an SRv6 EVPN active-active scenario provided in an embodiment of the present application. Figure 1 The network shown can provide a virtual private wire service VPWS. Figure 1 The network shown includes CE devices CE1 and CE2, and PE devices PE1, PE2 and PE3. PE1, PE2 and PE3 are connected to CE1, CE1 and CE2 through access links AC101, AC102 and AC103 respectively, and PE1, PE2 and PE3 are connected to AC101, AC102 and AC103 through interfaces 104, 105 and 106 respectively. Interfaces 104, 105 and 106 are all local interfaces, and interfaces 107 and 108 are non-local interfaces. PE1 is connected to PE2 through interface 107, and PE2 is connected to PE1 through interface 108. AC101 and AC102 belong to the same Ethernet segment, and the identifier of the Ethernet segment can be ESI1. AC103 belongs to another Ethernet segment, and the identifier of the other Ethernet segment can be ESI2. In an example, PE1, PE2 and PE3 are configured as follows:

[0086] PE1: The ESI attribute value of interface 104 is ESI1, the values ​​of the local and peer Ethernet Tag IDs associated with interface 104 are 1 and 2 respectively, and the SID associated with EVPL is 1::1. The specific configuration process is, for example: configure the ESI attribute value of interface 104 to be ESI1, configure the EVPL processing module associated with interface 104 to be EVPL1, configure the values ​​of the local and peer EthernetTag IDs associated with EVPL1 to be 1 and 2 respectively, configure the SID associated with EVPL1 to be 1::1, and configure the SID associated with the processing module EVPL1 for processing EVPL-related data on PE1 to be 1::1, which is equivalent to configuring the SID associated with EVPL on PE1 to be 1::1, that is, the SID associated with the EVPL service on PE1 is configured to be 1::1.

[0087] PE2: The ESI attribute value of interface 105 is ESI1, the values ​​of the local and peer Ethernet Tag IDs associated with interface 205 are 1 and 2 respectively, and the SID associated with EVPL is 2::1. The specific configuration process is, for example: configure the ESI attribute value of interface 105 to be ESI1, configure the EVPL processing module associated with interface 105 to be EVPL2, configure the values ​​of the local and peer EthernetTag IDs associated with EVPL2 to be 1 and 2 respectively, configure the SID associated with EVPL2 to be 2::1, and configure the SID associated with the processing module EVPL1 on PE2 for processing EVPL-related data to be 2::1, which is equivalent to configuring the SID associated with EVPL on PE2 to be 2::1, that is, the SID associated with the EVPL service on PE2 is configured to be 2::1.

[0088] PE3: The ESI attribute value of interface 106 is ESI2, the values ​​of the local and peer Ethernet Tag IDs associated with interface 106 are 2 and 1 respectively, and the SID associated with EVPL is 3::1. The specific configuration process is, for example: configure the ESI attribute value of interface 106 to be ESI2, configure the EVPL processing ES module associated with interface 106 to be EVPL3, configure the values ​​of the local and peer Ethernet Tag IDs associated with EVPL3 to be 2 and 1 respectively, configure the SID associated with EVPL3 to be 3::1, and configure the SID associated with the processing module EVPL3 for processing EVPL-related data on PE3 to be 3::1, which is equivalent to configuring the SID associated with EVPL on PE3 to be 3::1, that is, the SID associated with the EVPL service on PE3 is configured to be 3::1.

[0089] In this scenario, to provide VPWS and active-active mode, PE1, PE2, and PE3 send routing messages to each other. The routing message can be a Border Gateway Protocol (BGP) message, and the BGP message can include an Ethernet auto-discovery route (ethernet AD route) and an SRv6-VPN SID attribute. Ethernet auto-discovery route, referred to as AD route, can include an ESI field and an Ethernet Tag ID field. The SRv6-VPN SID attribute is an attribute in type / length / value (TLV) format, including a type field, a length field, and a value field, where type (type) can be 1 or 2. Figure 2 In the scenario shown, the value in the SRv6-VPNSID attribute of type 2 is called the EVPL attribute value, and the EVPL attribute value can be used to notify the peer device of the SID associated with the EVPL configured on the local device. For Ethernet automatic discovery routing, see the description in the Internet Engineering Task Force (IETF) Request for Comments (RFC) 7432. For SRv6-VPN SID, see the description in the IETF draft "BGPSignaling of IPv6-Segment-Routing-based VPNNetworks, draft-dawra-idr-srv6-vpn-03".

[0090] In one example, PE1 generates AD route E1, the value of the ESI field in E1 is the ESI attribute value ESI1 of interface 104 configured on PE1, the value of the Ethernet Tag ID field is the local Ethernet Tag ID value 1 associated with interface 104 configured on PE1, PE1 sends a routing message R1 carrying E1 and EVPL attribute values ​​to PE2 and PE3, the EVPL attribute value is 1::1, and the EVPL attribute value can be used to notify PE2 and PE3 that the SID value associated with EVPL on PE1 is 1::1. Similarly, PE2 generates AD route E2, the value of the ESI field in E2 is the ESI attribute value ESI1 of interface 105 configured on PE2, the value of the Ethernet Tag ID field is the local Ethernet Tag ID value 1 associated with interface 105 configured on PE2, PE2 sends a routing message R2 carrying E2 and EVPL attribute values ​​to PE1 and PE3, the EVPL attribute value is 2::1. PE3 generates AD route E3. The value of the ESI field in E3 is the ESI attribute value ESI2 of interface 106 configured on PE3. The value of the Ethernet Tag ID field is the local Ethernet Tag ID value 2 associated with interface 106 configured on PE3. PE3 sends a routing message R3 carrying E3 and an EVPL attribute value to PE1 and PE2. The EVPL attribute value is 3::1.

[0091] After PE1 receives the routing message R2 sent by PE2, it can be determined that the value of the ESI field in the routing message R2 is the same as the value of the ESI field in the AD routing E1 generated by itself, both of which are ESI1, and both belong to the same Ethernet segment. It can be determined that PE2 is the backup device of PE1 and the repair path can be determined according to the routing message R2, that is, PE1 can determine that the repair path from PE1 to CE1 is from PE1 through PE2 to CE1. There are two paths from PE1 to CE1, one is the main path to CE1 via the local interface 104, and the other is the repair path to CE1 via the interface 107 and PE2. When the interface 104 connecting PE1 to CE1 is in a faulty state, a data packet can be sent to PE2 via the interface 107, so that the data packet is sent to CE1 via PE2 to realize fast reroute (FRR). The repair path in this application may also be referred to as a bypass path. Similarly, after PE2 receives the routing message R1 sent by PE1, it can determine that PE1 is the backup device of PE2 and can determine the repair path according to the routing message R1, that is, PE2 can determine that the repair path from PE2 to CE1 is from PE2 through PE1 to CE1. Therefore, there are two paths from PE2 to CE1, one is the main path to CE1 via the local interface 105, and the other is the repair path to CE1 via the interface 108 and PE1. When the interface 105 connecting PE2 to CE1 is in a faulty state, a data packet can be sent to PE1 via the interface 108, so that the data packet is sent to CE1 via PE1 to implement FRR.

[0092] After PE3 receives the routing message R2 sent by PE2, it determines that the peer Ethernet Tag ID value 1 configured by itself is the same as the Ethernet Tag ID value 1 in the routing message R2. Similarly, after PE2 receives the routing message R3 sent by PE3, it determines that the peer Ethernet Tag ID value 2 configured by itself is the same as the Ethernet Tag ID value 2 in the routing message R3. In other words, the local and peer Ethernet Tag IDs of PE2 are the same as the peer and local Ethernet Tag IDs of PE3, respectively. Then, an EVPL is established between PE2 and PE3, and the two ends of the EVPL are connected to the access links AC202 and AC203, respectively, so that the data packets sent by CE2 can reach CE1 via AC103, the EVPL, and AC102. PE3 can obtain the EVPL attribute value 2::1 from the routing message R2. After the EVPL between PE2 and PE3 is established, when there is a data packet on PE3 to be sent to CE1, PE3 can use 2::1 as the destination address of the data packet to send the data packet to PE2, so that the data packet is sent to PE2 via the EVPL between PE2 and PE3. The destination address of the data packet in this application can be the destination address in the IPv6 header of the data packet, which is an IPv6 address, and the IPv6 address in SRv6 can be a segment identifier SID. After receiving the data packet, PE2 identifies that the destination address 2::1 of the data packet is the SID value associated with the EVPL, and performs an operation associated with the SID value 2::1 associated with the EVPL, wherein the associated operation includes: determining an entry y2 associated with the SID value 2::1 on PE2, wherein the entry y2 includes the SID value 2::1, the identifier of the local interface 105, and the identifier of the interface 108, determining whether the local interface 105 in the entry y2 is in a faulty state, and when the local interface 105 is not in a faulty state, sending the data packet to CE1 via the local interface 105; and when the local interface 105 is in a faulty state, sending the data packet to PE1 via the interface 108.

[0093] In SRv6, the SID value can be associated with a series of instructions, which can also be referred to as a function. In this application, a function can also be referred to as an operation. The operation associated with each SID value on each PE device can be pre-configured. For example, to implement the operation associated with the SID value 1::1 on PE1, PE1 pre-saves entry y1, which includes the SID value 1::1 and all interfaces on PE1 that can be used to send data packets to CE1, including local interface 104 and interface 107, and interface 107 is used to send data packets to PE2 to implement FRR. For another example, to implement the operation associated with the SID value 2::1 on PE2, PE2 pre-saves entry y2, which includes the SID value 2::1 and all interfaces on PE2 that can be used to send data packets to CE1, including local interface 105 and interface 108, and interface 108 is used to send data packets to PE1 to implement FRR. The IETF draft "SRv6 Network Programming, draft-filsfils-spring-srv6-network-programming-04" defines SID-associated functions. The operations associated with the SID value associated with EVPL in this scenario can refer to the End.DX2 function described in Section 4.4 of the draft. The End.DX2 function includes forwarding data packets via the outbound interface associated with the SID. According to the End.DX2 function, the function associated with the SID value 1::1 on the aforementioned PE1 includes sending data packets via the local interface 104 or interface 107, and the function associated with the SID value 2::1 on the aforementioned PE2 includes sending data packets via the local interface 105 or interface 108.

[0094] Similarly, PE3 receives the routing message R1 sent by PE1, and PE1 receives the routing message R3 sent by PE3. The local and peer Ethernet Tag IDs of PE1 are respectively the same as the peer and local Ethernet Tag IDs of PE3. Then, an EVPL is established between PE1 and PE3, and the two ends of the EVPL are respectively connected to the access links AC101 and AC103, so that the data packet sent by CE2 can reach CE1 via AC103, the EVPL, and AC101. PE3 can obtain the EVPL attribute value 1::1 from the routing message R1. After the EVPL between PE1 and PE3 is established, when there is a data packet on PE3 to be sent to CE1, PE3 can use 1::1 as the destination address of the data packet to send the data packet to PE1, so that the data packet is sent to PE1 via the EVPL between PE1 and PE3. After receiving the data packet, PE1 identifies that the destination address 1::1 of the data packet is the SID value associated with the EVPL, and performs an operation associated with the SID value 1::1 associated with the EVPL, wherein the associated operation includes: determining an entry y1 associated with the SID value 1::1 on PE1, wherein the entry y1 includes the SID value 1::1, the identifier of the local interface 204, and the identifier of the interface 107, determining whether the local interface 104 in the entry y1 is in a fault state, and when the local interface 104 is not in a fault state, sending the data packet to CE1 via the local interface 104, and when the local interface 104 is in a fault state, sending the data packet to PE2 via the interface 107.

[0095] In the above scenario, when PE1 and PE2 determine the repair path based on the routing message sent by the other party in order to achieve FRR, they are based on the EVPL attribute value, that is, the value associated with EVPL on the other party's device. In this way, when PE2 receives a data packet sent by PE3 to be sent to CE1, if PE2 determines that the local interface 105 is in a faulty state, PE2 can use the value 1::1 associated with EVPL on PE1 as the destination address of the data packet to send the data packet to PE1 via interface 108, in an attempt to trigger PE1 to forward the data packet to the local interface 104 to achieve FRR. After receiving the data packet, PE1 performs the operation associated with the SID value 1::1 associated with the EVPL, including determining the entry y1 associated with the SID value 1::1, and determining whether the local interface 104 of PE1 is in a faulty state according to the entry y1. When the local interface 104 is not in a faulty state, the data packet is sent to CE1 via the local interface 104 to complete the forwarding and implement FRR. However, when the local interface 104 is also in a faulty state, if PE1 also uses the value 2::1 associated with the EVPL on PE2 as the destination address of the data packet, and sends a data packet to PE2 in an attempt to trigger PE2 to forward the data packet to the local interface 205, then PE2 will change the destination address of the data packet to 1::1 again, and return the data packet with the destination address 1::1 to PE1 again, thereby causing a loop in the data packet transmission. The loop can only be stopped when PE3 receives the route withdrawal notification and stops sending new data packets to PE2. The loop that has been caused can only be eliminated when PE1 or PE2 receives the route withdrawal notification and withdraws the route to the other party. The loop problem will cause a waste of network resources and affect the performance of PE devices.

[0096] In order to solve the loop problem, before PE1 and PE2 start normal data services, PE1 and PE2 send routing messages to each other. The routing messages can be Border Gateway Protocol (BGP) messages, and the BGP messages can be Ethernet Auto-discovery routes carrying the ESI label extended community attribute Label Extended Community. The Ethernet Auto-discovery routes carrying the ESI label extended community attribute Label Extended Community are referred to as per-ES Ethernet Auto-Discovery routes (ES AD) routes, including the ESI field and the address of the service provider's edge device.

[0097] It should be understood that the ES AD route can be sent simultaneously with the Ethernet automatic discovery route that does not carry the ESI tag extended community attribute, and the ES AD route can also be sent before or after the Ethernet automatic discovery route that does not carry the ESI tag extended community attribute.

[0098] Combine the following Figure 2 A communication method 200 provided in this application is described in detail. The method 200 can be applied to Figure 2 The scenario shown can of course also be applied to other communication scenarios, and the present application embodiment does not limit this. The method 200 includes the following contents.

[0099] S201, PE2 sends a message to PE1.

[0100] The message may be a BGP message, such as the aforementioned ES AD, and the message includes a first Ethernet segment identifier ESI and an address of PE2. The address of PE2 may be an IPv6 address of PE2, such as an address used by PE2 when PE2 establishes a BGP neighbor relationship with PE1, such as 2::100. The first ESI may identify the Ethernet segment to which the connection between PE2 and CE1 belongs. The first ESI may be, for example, ESI1, and the connection between PE2 and CE1 may be, for example, AC102. The Ethernet segment also includes a connection between PE1 and CE1, such as AC101.

[0101] S202, PE1 receives a message sent by PE2, and PE1 determines that the first ESI is the same as the second ESI stored in PE1.

[0102] The second ESI can identify the Ethernet segment to which the connection between PE1 and CE1 belongs. For example, the second ESI is ESI1, and the connection between PE1 and CE1 is AC101. PE1 can determine whether the first ESI is the same as the second ESI stored in itself. The Ethernet segment to which the connection between PE1 and CE1 belongs is ESI1, and the Ethernet segment to which the connection between PE2 and CE1 belongs is ESI1. Therefore, PE1 can determine that the first ESI is the same as the second ESI, which means that the connection between PE1 and CE1 and the connection between PE1 and CE1 belong to the same Ethernet segment, and CE1 is mostly attributed to PE1 and PE2.

[0103] S203: In response to the PE1 device determining that the first ESI is the same as the second ESI, PE1 generates a first entry, where the first entry includes an address of PE2.

[0104] When PE1 determines that the first ESI is the same as the second ESI, PE1 generates a first entry, the first entry including the address of PE2, the address of PE2 included in the message sent by PE2 to PE1. The first entry may also include: the identifier of the interface 104 through which PE1 connects CE1, for searching the interface 104. The first entry may be called a multi-homing neighbor table. The first entry may also include ESI1 for subsequent searching.

[0105] It should be understood that, as described above, in order to solve the loop problem, before PE1 and PE2 start normal data services, PE1 and PE2 send routing messages to each other. Therefore, through the same process, S201-S203 can be referred to accordingly, and a second entry is generated on PE2, and the second entry includes the address of PE1, for example, 1::100. The second entry can also include: the identifier of the interface 105 of PE2 connected to CE1, for searching the interface 105. The second entry can be called a multi-homing neighbor table. The second entry can also include ESI1 for subsequent searching.

[0106] S204, PE2 sends a data packet to PE1.

[0107] The source address of the data packet may be the address of PE2, such as the IPv6 address of PE2, for example, the address used when PE2 and PE1 establish a BGP neighbor relationship, referred to as the PE2 neighbor establishment address. The data packet sent by PE2 to PE1 may be a data packet received by PE2 from PE3 to be sent to CE1. When PE2 receives the data packet sent by PE3 to be sent to CE1, it can parse the data packet to find that the destination address is 2::1.

[0108] Optionally, after receiving the data packet sent by PE3, PE2 can determine whether the local interface 105 is in a faulty state. When the local interface 105 is not in a faulty state, PE2 can send the data packet to CE1 via the local interface 105. When the local interface 105 is in a faulty state, PE2 can send the data packet to PE1 via the non-local interface 108 to try to send the data packet to CE1 via PE1. For example, after receiving the data packet sent by PE3, PE2 performs the operation associated with the SID value 2::1 associated with the EVPL, including determining the entry y2 associated with the SID value 2::1, the entry y2 includes the SID value 2::1 and all interfaces on PE2 that can be used to send data packets to CE1, and determines that the local interface 105 of PE2 is in a faulty state according to the entry y2. PE2 can use the value 1::1 associated with the EVPL on PE1 as the destination address of the data packet to send the data packet to PE1 via the interface 108 to try to trigger PE1 to forward the data packet to the local interface 104 to achieve FRR. PE2 sets the source address of the data packet to the address of PE2, such as the neighbor address of PE2, for example, 2::100.

[0109] Optionally, after receiving the data packet, PE2 does not determine whether the PE2 local interface 105 is in a faulty state, but directly uses the value 1::1 associated with EVPL on PE1 as the destination address of the data packet to send the data packet to CE1 to PE1 via interface 108, in an attempt to trigger PE1 to forward the data packet to the local interface 104 to implement FRR. The source address of the data packet can be 2::100 and the destination address can be 1::1.

[0110] S205, PE1 receives the data packet sent by PE2.

[0111] S206, PE1 determines that the source address of the data packet is the same as the address of PE2 in the first entry.

[0112] PE1 receives the data packet sent by PE2, obtains the source address 2::100 of the data packet, and can determine whether the source address is the same as the address of PE2 stored in the first entry. For example, PE1 can determine that the source address 2::100 of the data packet is the same as the address 2::100 included in the first entry on PE1.

[0113] S207 , in response to PE1 determining that the source address of the data packet is the same as the address of PE2 in the first entry, PE1 avoids sending the data packet to PE2 .

[0114] When PE1 determines that the source address of the data packet is the same as the address of PE2 in the first entry, PE1 avoids forwarding the data packet to be sent to CE1 to PE2, that is, avoids sending the data packet to the non-local interface 108, for example, marking the data packet and filtering out the marked data packet when PE1 subsequently sends multiple data packets to the interface 108. Further, PE1 can send the data packet to CE1 via the primary path to CE1 stored on PE1, that is, the local interface 104. If the local interface 104 is in a faulty state, that is, the primary path fails, PE1 discards the data packet.

[0115] Optionally, when the source address of the data packet is different from the address of PE2 in the first entry, PE1 performs the operation associated with the SID value 1::1 associated with the EVPL as described above according to the destination address 1::1 of the data packet.

[0116] Therefore, in S204, if PE2 determines that the local interface 105 is in a faulty state, the data packet is forwarded to PE1. After PE1 receives the data packet, it can determine the state of the local interface 104. When the local interface 104 is not in a faulty state, the data packet can be sent through the local interface 104 to complete the forwarding. When the local interface 104 is in a faulty state, it can avoid sending the data packet to PE2, specifically including determining that the source address of the data packet is the same as the address of PE2, avoiding sending the data packet to the interface 108, such as discarding the data packet. Therefore, when the local interfaces 104 and 105 of PE1 and PE2 are both in a faulty state, a continuous loop of traffic between PE1 and PE2 is avoided.

[0117] In an embodiment of the present application, when PE1 receives a data packet sent by PE2, it can avoid sending the data packet to PE2 based on the first entry including the address of the second PE device saved on PE1 and the source address included in the data packet, thereby preventing a traffic loop from being formed, avoiding waste of network resources, and avoiding affecting the performance of the PE device.

[0118] It should be understood that in the present application, the interface being in a faulty state may be a fault in the interface itself, such as damage to the interface function, or a fault in the AC connected to the interface, such as a link interruption. Interface status information can be saved on the PE device. When the PE device detects that an interface has failed, such as an interruption of the physical signal received by the physical port where the interface is located or the bit error rate of the data packet received by the interface is greater than a threshold, the PE device can update the interface status information saved on the PE device, such as marking the interface as being in a faulty state. The PE device can determine whether a local interface or a non-local interface is in a faulty state based on the saved interface status information. The above method for PE to determine whether an interface is in a faulty state is only an example.

[0119] After PE1 determines that the interface used by PE1 to connect to CE1 is in a faulty state, PE1 further determines that the source address of the data packet is the same as the address of PE2 in the first entry. If PE1 determines that the interface used by PE1 to connect to CE1 is in a normal state, that is, the main path from PE1 to CE1 has not failed, PE1 can send the data packet through the interface used to connect to CE1. There is no need to determine whether the source address of the data packet is the same as the address of PE2 in the first entry. This can improve the efficiency of PE1 in sending the data packet during the communication process, thereby saving network resources.

[0120] Figure 3 This is another schematic diagram of an SRv6 EVPN active-active scenario provided in an embodiment of the present application. Figure 3 The network shown can provide unicast service in multipoint to multipoint (MP2MP) service. Figure 3 The network shown includes host 1, host 2, host 3, host 4, host 5 and host 6, CE devices CE1 and CE2, and PE devices PE1, PE2 and PE3. Host 1, host 2 and host 3 are connected to CE1, host 4, host 5 and host 6 are connected to CE2, PE1, PE2 and PE3 are connected to CE1, CE1 and CE3 through access links AC301, AC302 and AC303 respectively, and PE1, PE2 and PE3 are connected to AC301, AC302 and AC303 through interfaces 304, 305 and 406 respectively. Interfaces 304, 305 and 306 are all local interfaces, and interfaces 307 and 308 are non-local interfaces. PE1 is connected to PE2 through interface 307, PE2 is connected to PE1 through interface 308, PE3 is connected to PE1 through interface 309, and PE3 is connected to PE2 through interface 310. AC101 and AC102 belong to the same Ethernet segment, and the identifier of the Ethernet segment may be ESI1. AC103 belongs to another Ethernet segment, and the identifier of the other Ethernet segment may be ESI2. In an example, PE1, PE2, and PE3 are configured as follows:

[0121] PE1: The ESI attribute value of interface 304 is ESI1, and the SID associated with the unicast service is 1::1. The specific configuration process is, for example: configure the ESI attribute value of interface 304 to be ESI1, configure the processing module associated with interface 304 to be BD1, configure the SID associated with BD1 to be 1::1, and configure the SID associated with the processing module BD1 for processing unicast service-related data on PE1 to be 1::1, which is equivalent to configuring the SID associated with the unicast service on PE1 to be 1::1.

[0122] PE2: The ESI attribute value of interface 305 is ESI1, and interface 305 is associated with processing module BD2. The data packet processing function on PE2 can be completed by BD2. The specific configuration process is, for example: configure the ESI attribute value of interface 305 to be ESI1, configure the processing module associated with interface 305 to be BD2, configure the SID associated with BD2 to be 2::1, and configure the SID associated with processing module BD2 for processing unicast service-related data on PE2 to be 2::1, which is equivalent to configuring the SID associated with the unicast service on PE2 to be 2::1.

[0123] PE3: The ESI attribute value of interface 306 is ESI2, and interface 306 is associated with processing module BD3. The data packet processing function on PE3 can be completed by BD3. The specific configuration process is, for example: configure the ESI attribute value of interface 306 to be ESI2, configure the processing module associated with interface 306 to be BD3, configure the SID associated with BD3 to be 3::1, and configure the SID associated with processing module BD3 for processing unicast service-related data on PE3 to be 3::1, which is equivalent to configuring the SID associated with the unicast service on PE3 to be 3::1.

[0124] In this scenario, unicast services and active-active mode are provided. PE1, PE2, and PE3 send routing messages to each other, and the routing messages can be BGP messages. See the IETF draft "EVPN All Active Usage Enhancement, draft-eastlake-bess-enhance-evpn-all-active-00.txt", which describes how to support a CE device in EVPN to be multi-homed to multiple PE devices and multiple PE devices in multi-active mode, which can also be called multi-active redundancy mode.

[0125] Figure 4It is a schematic diagram of an entry in a MAC forwarding table provided in an embodiment of the present application. PE1, PE2 and PE3 can all store a MAC forwarding table. In an example, PE1 can learn the MAC address MAC1 of host 1 from CE1 via the local interface 304, and generate an entry 401 in the MAC forwarding table on PE1, and the entry 401 includes MAC1, an identifier of the local interface 304, and an ESI attribute value ESI1 of the local interface 304. PE1 sends a routing message Rm1 to PE2 and PE3, and the routing message Rm1 includes the entry 401 and the virtual LAN redirection extended community "VLAN-Redirect-ExtendedCommunity" attribute described in the aforementioned draft "EVPN All Active Usage Enhancement, draft-eastlake-bess-enhance-evpn-all-active-00.txt".

[0126] In one example, after PE2 receives the routing message Rm1, it can find the local interface of PE2, that is, the interface 305 through which PE2 connects to CE1, according to ESI1 in entry 401, and generate a fast reroute (FRR) entry 402, that is, entry 402 in the MAC forwarding table on PE2. Entry 402 includes MAC1, an identifier of the local interface 305 for sending data packets to CE1 via the primary path, ESI1, and an identifier of the interface 308 for sending data packets to CE1 via the repair path. The primary path on PE2 reaches CE1 via the local interface 305, and the repair path reaches CE1 via the interface 308 and PE1. The repair path is the path from PE2 to CE1 via PE1. The repair path in this application may also be referred to as a standby path.

[0127] PE2 can send a routing message Rb2 to PE1 and PE3. The routing message Rb2 includes an AD route A2 and an SRv6-VPN SID attribute of type 2. The AD route A2 includes an ESI field. The value of the ESI field in the AD route A2 is the ESI attribute value ESI1 of the interface 305 configured on PE2. Figure 3 In the scenario, the value in the SRv6-VPN SID attribute of type 2 is called the unicast attribute value. The unicast attribute value can be used to notify the peer device of the SID associated with the unicast service configured on the local device. The unicast attribute value in the routing message Rb2 is the SID value 2::1 associated with the unicast service configured on PE2.

[0128] PE1 receives the routing message Rb2 sent by PE2 via interface 307, and determines that the ESI1 in the routing message Rb2 is the same as the ESI1 in the entry 401 generated by PE1. PE1 determines that PE2 is the backup device of PE1, see Figure 4 PE1 generates entry 403 according to entry 401, interface 307 that receives routing message Rb2, and unicast attribute value 2::1 in routing message Rb2. Entry 403 includes MAC1, the identifier of local interface 304, ESI1, the identifier of interface 307, and 2::1.

[0129] Similarly, PE1 can send a routing message Rb1 to PE2 and PE3. The routing message Rb1 includes AD routing A1 and unicast attributes. AD routing A1 includes an ESI field. The value of the ESI field in AD routing A1 is the ESI attribute value ESI1 of the interface 304 configured on PE1. The unicast attribute value in the routing message Rb1 is the SID value 1::1 associated with the unicast service configured on PE1. PE2 receives the routing message Rb1 sent by PE1 via interface 308, and determines that the ESI1 in the routing message Rb1 is the same as the ESI1 in the entry 402 generated by PE2. PE2 determines that PE1 is the backup device of PE2, see Figure 3 PE2 generates entry 404 according to entry 402 and the unicast attribute value 1::1 in routing message Rb1. Entry 404 includes MAC1, the identifier of local interface 305, ESI1, the identifier of interface 308, and 1::1.

[0130] After receiving the routing message Rm1 sent by PE1 via the interface 309 , PE3 may generate an entry 405 in the MAC forwarding table on PE3 . The entry 405 includes MAC1 , ESI1 , and the identifier of the interface 309 .

[0131] After PE3 receives the routing message Rb1 sent by PE1 via interface 309, it can determine that the ESI in the routing message Rb1 is the same as the ESI in the entry 405 generated by PE3, and can generate entry 406 according to entry 505 and the unicast attribute value 1::1 in the routing message Rb1. Entry 406 includes MAC1, ESI1, the identifier of interface 309, and 1::1. After PE3 receives the routing message Rb2 sent by PE2 via interface 310, it can determine that the ESI in the routing message Rb2 is the same as the ESI in entry 406, that is, the ESI in the routing message Rb1 received from PE1. Therefore, PE3 can determine that the local interface of PE2 and the local interface of PE1 belong to the same Ethernet segment, that is, the connection between PE2 and CE1 and the connection between PE1 and CE1 belong to the same Ethernet segment, that is, it can be determined that PE2 is the backup device of PE1. PE3 can generate entry 409 according to entry 506 and the unicast attribute value 2::1 in the routing message Rb2. Entry 409 includes MAC1, ESI1, the identifier of interface 309, 1::1, the identifier of interface 310, and 2::1. When PE3 receives a data packet with a destination MAC address of MAC1 forwarded by CE2, it can search the MAC forwarding table according to MAC1 and choose to send the data packet to PE1 or PE2 according to entry 409. PE3 can set the destination address of the data packet to 1::1 and send a data packet with a destination address of 1::1 to PE1 via interface 309 to trigger PE1 to provide unicast service, that is, to trigger PE1 to forward the data packet to CE1. PE3 can also set the destination address of the data packet to 2::1 and send a data packet with a destination address of 2::1 to PE2 via interface 310 to trigger PE2 to provide unicast service, that is, to trigger PE2 to forward the data packet to CE1.

[0132] When PE2 receives a data packet with a destination address of 2::1 and a destination MAC address of MAC1 forwarded by PE3, it performs the operation associated with the SID value 2::1. For the operation associated with the SID value in this scenario, refer to the End.DT2U function described in Section 4.6 of the IETF draft "SRv6 NetworkProgramming, draft-filsfils-spring-srv6-network-programming-04". The End.DT2U function includes forwarding the data packet via the interface in the entry that matches the destination MAC address. According to the End.DT2U function, the operation associated with the SID value 2::1 on PE2 includes sending the data packet via the local interface 305 and interface 308 in the entry 404 that matches MAC1. The operation associated with the SID value 1::1 on PE1 includes sending the data packet via the local interface 304 and interface 307 in the entry 403 that matches MAC1. See Figure 4, entry 404 includes the identifier of the local interface 305, the identifier of the interface 308 and 1::1. PE2 first determines whether the local interface 305 is in a faulty state. When the local interface 305 is not in a faulty state, it sends a data packet to CE1 via the local interface 305. When the local interface 305 is in a faulty state, it sends a data packet with a destination address of 1::1 to PE1 via interface 308 to trigger PE1 to forward the data packet to CE1.

[0133] After PE1 receives a data packet with a destination address of 1::1 and a destination MAC address of MAC1 from PE2, it performs an operation associated with the SID value 1::1, which may include sending the data packet via the local interface 304 and the interface 307 in the entry 403 matching MAC1, see Figure 4 , Entry 403 includes the identifier of local interface 304, the identifier of interface 307, and 2::1. PE1 first determines whether local interface 304 is in a faulty state. When local interface 304 is not in a faulty state, it sends a data packet to CE1 via local interface 304. When local interface 304 is in a faulty state, it sends a data packet with a destination address of 2::1 to PE2 via interface 307 to trigger PE2 to forward the data packet to CE1. Thus, PE1 sends the data packet sent by PE2 back to PE2, causing a loop in data packet transmission. The loop can only be stopped when PE3 receives a route withdrawal notification and stops sending new data packets to PE2. The loop that has been caused can only be eliminated when PE1 or PE2 receives a route withdrawal notification and withdraws the route to the other party.

[0134] In order to solve the loop problem, the present application sends routing messages to each other before PE1 and PE2 start normal data services. The routing messages may be BGP messages, and the BGP messages may be the aforementioned ES AD routes, including the ESI field and the address of the service provider's edge device.

[0135] It should be understood that the ES AD route can be sent simultaneously with the Ethernet automatic discovery route that does not carry the ESI tag extended community attribute, and the ES AD route can also be sent before or after the Ethernet automatic discovery route that does not carry the ESI tag extended community attribute.

[0136] Combine the following Figure 5 A communication method 500 provided in this application is described in detail. The method 500 can be applied to Figure 3 The scenario shown can of course also be applied to other communication scenarios, and the present application embodiment does not limit this. The method 500 includes the following contents.

[0137] S501, PE2 sends a message to PE1.

[0138] The message includes, for example, the first ESI and the address of PE2. S501 is similar to S201, and the description of S201 may be referred to. The first ESI may identify the Ethernet segment to which the connection between PE2 and CE1 belongs, and the first ESI is, for example, ESI1, and the connection between PE2 and CE1 is, for example, AC302. The Ethernet segment also includes the connection between PE1 and CE1, for example, AC301.

[0139] S502, PE1 receives a message sent by PE2, and PE1 determines that the first ESI is the same as the second ESI stored in PE1.

[0140] The second ESI may identify the Ethernet segment to which the connection between PE1 and CE1 belongs, and the second ESI is, for example, ESI 1. S502 is similar to S202, and the description of S202 may be referred to.

[0141] S503: In response to the PE1 device determining that the first ESI is the same as the second ESI, PE1 generates a first entry, where the first entry includes an address of PE2.

[0142] S503 is similar to S203, and the description of S203 can be referred to.

[0143] S504, PE2 sends a data packet to PE1.

[0144] The source address of the data packet may be the address of PE2, such as the IPv6 address of PE2, for example, the address used when PE2 and PE1 establish a BGP neighbor relationship. The data packet sent by PE2 to PE1 may be a data packet received by PE2 from PE3 to be sent to CE1. When PE2 receives the data packet sent by PE3 to be sent to CE1, it can parse the destination address of the data packet to be 2::1 and the destination MAC address to be MAC1.

[0145] Optionally, after receiving the data packet sent by PE3, PE2 may determine whether the local interface 105 is in a faulty state. When the local interface 105 is not in a faulty state, PE2 may send the data packet to CE1 via the local interface 105. When the local interface 105 is in a faulty state, PE2 may send the data packet to PE1 via the non-local interface 108 to try to send the data packet to CE1 via PE1. For example, after PE2 receives the data packet with the destination address 2::1, it performs the operation associated with the SID value 2::1, which includes sending the data packet via the local interface 305 and the interface 308 in the entry 404 that matches MAC1. The entry 404 includes the identifier of the local interface 305, the identifier of the interface 308, and 1::1. PE2 determines that the local interface 305 is in a faulty state, and sends a data packet with the destination address 1::1 to PE1 via the interface 308 to try to trigger PE1 to forward the data packet to CE1. The source address of the data packet sent by PE2 to PE1 may be 2:100, the destination address 1::1, and the destination MAC address MAC1.

[0146] Optionally, after receiving the data packet, PE2 does not determine that the local interface 305 is in a faulty state, but directly sends the data packet to PE1 through interface 308 according to the interface identifier of interface 308 in entry 404 to trigger PE1 to forward the data packet to CE1. The source address of the data packet sent by PE2 to PE1 may be 2::100, the destination address may be 1::1, and the destination MAC address may be MAC1.

[0147] S505, PE1 receives the data packet sent by PE2.

[0148] S506, PE1 determines that the source address of the data packet is the same as the address of PE2 in the first entry.

[0149] PE1 receives the data packet sent by PE2, obtains the source address 2::100 of the data packet, and can determine whether the source address is the same as the address of PE2 stored in the first entry. For example, PE1 can determine that the source address 2::100 of the data packet is the same as the address 2::100 included in the first entry on PE1.

[0150] S507 , in response to PE1 determining that the source address of the data packet is the same as the address of PE2 in the first entry, PE1 avoids sending the data packet to PE2 .

[0151] When PE1 determines that the source address of the data packet is the same as the address of PE2 in the first entry, PE1 avoids forwarding the data packet to be sent to CE1 to PE2, that is, avoids sending the data packet to the non-local interface 308, for example, marking the data packet and filtering out the marked data packet when PE1 subsequently sends multiple data packets to the interface 308. Further, when PE1 determines that the local interface 304 has not failed based on the identifier of the local interface 304 in the entry 403 that matches the destination MAC address MAC1, it can send the data packet to CE1 through the local interface 304. If the local interface 304 fails and is in a failed state, PE1 discards the data packet.

[0152] Optionally, when the source address of the data packet is different from the address of PE2 in the first entry, PE1 performs an operation associated with the SID value according to the destination address 1::1 of the data packet, including PE1 first determining whether the local interface 304 is in a faulty state, and when the local interface 304 is not in a faulty state, sending a data packet to CE1 via the local interface 304; when the local interface 304 is in a faulty state, sending a data packet with a destination address of 2::1 to PE2 via interface 307 to trigger PE2 to forward the data packet to CE1.

[0153] Therefore, in S504, if PE2 determines that the local interface 305 is in a faulty state, the data packet is forwarded to PE1. After PE1 receives the data packet, it can determine the state of the local interface 304. When the local interface 304 is not in a faulty state, the data packet can be sent through the local interface 304 to complete the forwarding. When the local interface 304 is in a faulty state, it can avoid sending the data packet to PE2, specifically including determining that the source address of the data packet is the same as the address of PE2, avoiding sending the data packet to the interface 308, such as discarding the data packet. Therefore, when the local interfaces 304 and 305 of PE1 and PE2 are both in a faulty state, a continuous loop of traffic between PE1 and PE2 is avoided.

[0154] In an embodiment of the present application, when PE1 receives a data packet sent by PE2, it can avoid sending the data packet to PE2 based on the first entry including the address of the second PE device saved on PE1 and the source address included in the data packet, thereby preventing a traffic loop from being formed, avoiding waste of network resources, and avoiding affecting the performance of the PE device.

[0155] Figure 6 This is another schematic diagram of an SRv6 EVPN active-active scenario provided in an embodiment of the present application. Figure 6The network shown can provide broadcast, unknown unicast and multicast (BUM) traffic forwarding in multipoint to multipoint (MP2MP) services. Figure 6 The network shown includes CE devices CE1, CE2 and CE3, and PE devices PE1, PE2 and PE3.

[0156] PE1, PE2 and PE3 are connected to CE1, CE1 and CE2 through access links AC601, AC602 and AC603 respectively, and PE1 is connected to CE3 through access link AC609. PE1, PE2 and PE3 are connected to AC 601, AC 602 and AC 603 through interfaces 604, 605 and 606 respectively, and PE1 is connected to AC interface 609 through interface 610. Interfaces 604, 605, 606 and 610 are all local interfaces, and interfaces 607 and 608 are non-local interfaces. PE1 is connected to PE2 through interface 607, and PE2 is connected to PE1 through interface 608. AC601 and AC602 belong to the first Ethernet segment, and the identifier of the first Ethernet segment can be ESI1. AC603 belongs to the second Ethernet segment, and the identifier of the second Ethernet segment can be ESI2. AC609 belongs to the third Ethernet segment, and the identifier of the third Ethernet segment can be ESI3. In an example, PE1, PE2 and PE3 are configured as follows:

[0157] PE1: The ESI attribute value of interface 604 is ESI1, and the SID associated with the BUM service is 1::3. The specific configuration process is, for example: configure the ESI attribute value of interface 604 to be ESI1, configure the processing module associated with interface 604 to be BUM1, configure the SID associated with BUM1 to be 1::3, and configure the SID associated with the processing module BUM1 on PE1 for processing BUM service-related data to be 1::3, which is equivalent to configuring the SID associated with the BUM service on PE1 to be 1::3. In addition, the ESI attribute value of interface 610 is ESI3, and the processing module associated with interface 610 can also be BUM3.

[0158] PE2: The ESI attribute value of interface 605 is ESI1, and the interface 605 is associated with the processing module BUM2. The data packet processing function on PE2 can be completed by BUM2. The specific configuration process is, for example: configure the ESI attribute value of interface 605 to be ESI1, configure the processing module associated with interface 605 to be BUM2, configure the SID associated with BUM2 to be 2::3, and configure the SID associated with the processing module BUM2 for processing unicast service-related data on PE2 to be 2::3, which is equivalent to configuring the SID associated with the unicast service on PE2 to be 2::3.

[0159] PE3: The ESI attribute value of interface 606 is ESI2, and interface 606 is associated with processing module BUM3. The data packet processing function on PE3 can be completed by BUM3. The specific configuration process is, for example: configure the ESI attribute value of interface 606 to be ESI2, configure the processing module associated with interface 606 to be BUM3, configure the SID associated with BUM3 to be 3::3, and configure the SID associated with processing module BUM3 for processing unicast service-related data on PE3 to be 3::3, which is equivalent to configuring the SID associated with the unicast service on PE3 to be 3::3.

[0160] In this scenario, to provide BUM service and active-active mode, PE1, PE2 and PE3 send routing messages to each other, and the routing messages can be BGP messages. The BGP messages can include the Inclusive Multicast Ethernet Tag Route (IMET) and SRv6-VPN SID attributes. Figure 6 In the scenario, the value in the SRv6-VPNSID attribute of type 2 is called a BUM attribute value. The BUM attribute value can be used to notify the peer device of the SID associated with the BUM service configured on the local device.

[0161] In one example, PE1 generates IMET route I1, and PE1 sends a routing message R4 carrying I1 and a BUM attribute value to PE2 and PE3, where the BUM attribute value is 1::3, and the BUM attribute value can be used to notify PE2 and PE3 that the SID value associated with BUM on PE1 is 1::3. Similarly, PE2 generates IMET route I2, and PE2 sends a routing message R5 carrying I2 and a BUM attribute value to PE1 and PE3, where the BUM attribute value is 2::3. PE3 generates IMET route I3, and PE3 sends a routing message R6 carrying I3 and a BUM attribute value to PE1 and PE2, where the BUM attribute value is 3::3.

[0162] After PE1 receives the routing message R5 sent by PE2, it creates entry t1, which includes SID2::3. When PE1 receives the routing message R6 sent by PE3, it adds SID3::3 to the entry t1. When PE1 receives a data packet sent by CE1, it can forward it to PE2 and PE3. This entry is used to forward data packets during BUM traffic forwarding, and can also be called a BUM forwarding table. Data packets during BUM traffic forwarding can also be called BUM data packets. Similarly, entries t2 and t3 are created on PE2 and PE3 respectively. Entry t2 on PE2 includes SID1::3 and SID3::3, and entry t3 on PE3 includes SID1::3 and SID2::3.

[0163] It should be understood that in this scenario, the network can provide unicast services in multipoint-to-multipoint services, that is, the PE device can simultaneously have a processing module BD for processing unicast service-related data and a processing module BUM for processing BUM service-related data. For details on the configuration process of the processing module BD for processing unicast service-related data, please refer to Figure 4 and Figure 5 The relevant description will not be given here.

[0164] The characteristics of BUM traffic forwarding are that when a PE device receives BUM traffic sent by other PE devices from a non-local interface, it can forward it to all local interfaces. When a PE device receives BUM traffic sent by a CE device from a local interface, it can forward it to all other local interfaces and non-local interfaces.

[0165] In the above scenario, when PE1 and PE2 determine data packet forwarding based on the routing message sent by the other party, it is assumed that the basis is the BUM attribute value, that is, the value associated with the BUM on the other party's device.

[0166] In this way, when PE2 receives the data packet sent by CE1 from the local interface 602, it performs the operation associated with the SID value 2::3 associated with the BUM, including determining the entry t2 associated with the SID value 2::3, determining the forwarding destination address SID value 1::3 and SID value 3::3 of the data packet according to the entry t2, and PE2 uses the values ​​1::3 and 3::3 associated with the BUM on PE2 as the destination address of the data packet, respectively, and sends the data packet to PE1 and PE3. After PE1 receives the data packet sent by PE2 from the non-local interface 607, it sends the data packet to the local interfaces 607 and 610, that is, to the CE devices CE1 and CE3, that is, it sends the data packet sent by CE1 back to CE1, thereby causing a loop in data packet transmission. The loop problem will cause a waste of network resources and affect the performance of CE devices.

[0167] In order to solve the loop problem, the present application sends routing messages to each other before PE1 and PE2 start normal data services. The routing messages may be BGP messages, and the BGP messages may be the aforementioned ES AD routes, including the ESI field and the address of the service provider's edge device.

[0168] It should be understood that the ES AD route can be sent simultaneously with the Ethernet automatic discovery route that does not carry the ESI tag extended community attribute, and the ES AD route can also be sent before or after the Ethernet automatic discovery route that does not carry the ESI tag extended community attribute.

[0169] Combine the following Figure 7 A communication method 700 provided in this application is described in detail. The method 700 can be applied in Figure 7The scenario shown can of course also be applied to other communication scenarios, and the present application embodiment does not limit this. The method 700 includes the following contents.

[0170] S701, PE2 sends a message to PE1.

[0171] The message includes, for example, the first ESI and the address of PE2. S701 is similar to S201, and the description of S201 may be referred to.

[0172] S702, PE1 receives a message sent by PE2, and PE1 determines that the first ESI is the same as the second ESI stored in PE1.

[0173] The second ESI may identify the Ethernet segment to which the connection between PE1 and CE1 belongs, and the second ESI is, for example, ESI 1. S702 is similar to S202, and the description of S202 may be referred to.

[0174] S703: In response to the PE1 device determining that the first ESI is the same as the second ESI, PE1 generates a first entry, where the first entry includes an address of PE2.

[0175] S703 is similar to S203, and the description of S203 can be referred to.

[0176] It should be understood that ESI3 is not included in the message, so PE1 does not create a third entry including ESI3.

[0177] S704, PE2 sends a data packet to PE1.

[0178] The source address of the data packet may be the address of PE2, for example, the address of PE2, for example, the address used when PE2 establishes a BGP neighbor relationship with PE1. The data packet sent by PE2 to PE1 may be the data packet sent by CE1 and received by PE2. When PE2 receives the BUM data packet sent by CE1, it performs operations associated with the SID value 2::3 associated with the BUM, including determining the entry t2 associated with the SID value 2::3, the entry t2 includes SID1::3 and SID3::3, and PE2 forwards the data packet to PE1 and PE3 respectively according to the SID in the entry, wherein the source address of the data packet forwarded by PE2 to PE1 is 2::100, and the destination address is 1::3, and the source address of the data packet forwarded by PE2 to PE3 is 2::100, and the destination address is 3::3.

[0179] S705, PE1 receives the data packet sent by PE2.

[0180] S706, PE1 determines that the source address of the data packet is the same as the address of PE2 in the first entry.

[0181] When PE1 receives a data packet sent by PE2, it obtains the source address 2::100 of the data packet and can determine whether the source address is the same as the address of PE2 stored in the first entry. For example, PE1 can determine that the source address 2::100 of the data packet is the same as the address 2::100 included in the first entry on PE1.

[0182] S707 , in response to PE1 determining that the source address of the data packet is the same as the address of PE2 in the first entry, PE1 avoids sending the data packet to CE1 .

[0183] When PE1 determines that the source address of the data packet is the same as the address of PE2 in the first entry, PE1 avoids sending the data packet to CE1, that is, avoids sending the data packet to the local interface 604, for example, marking the data packet and filtering out the marked data packet when PE1 subsequently sends multiple data packets to the interface 604. Furthermore, PE1 can still forward the data packet to the interface 610, that is, to CE3, that is, while blocking the loop of the Ethernet segment identified by ESI1, it can not affect the forwarding of BUM traffic of other Ethernet segments. In this way, traffic loops are avoided.

[0184] Optionally, when the source address of the data packet is different from the address of PE2 in the first entry, PE1 performs the operation associated with the SID value 1::3, including sending the data packet to all local interfaces, such as interface 604 and interface 610.

[0185] In an embodiment of the present application, when PE1 receives the BUM data packet, it can avoid sending the BUM data packet to the CE1 device when it is determined that the source address of the BUM data packet is the same as the address of PE2 in the entry stored on PE1, thereby preventing a traffic loop from being formed, avoiding a waste of network resources, and avoiding affecting the performance of the CE device.

[0186] Optionally, PE1 stores interface information, which may include an interface identifier for identifying a local interface and an ESI attribute value of the local interface, and the interface identifier corresponds to the ESI attribute value, so that the interface identifier can be found according to the ESI attribute value. The second ESI stored by PE1 may be the ESI attribute value in the interface information. For example, the interface identifier of the local interface is, for example, the identifier of interface 604, and the second ESI stored by PE1 is, for example, the ESI attribute value ESI1 of interface 604. After PE1 determines that the first ESI in the message sent by PE2 is the same as the second ESI stored by itself, it can find the corresponding interface identifier in the interface information according to the value ESI1 of the second ESI, that is, the interface identifier of interface 604. Therefore, the first entry generated by PE1 may include the interface identifier in addition to the address of PE2. After PE1 receives a data packet whose source address is the address of PE2, it can find the interface identifier of interface 604 according to the source address of the data packet in the first entry, thereby determining the interface identifier of interface 604, and thus avoiding sending the data packet to interface 604 identified by the interface identifier. The first entry generated by PE1 saves the correspondence between the address of PE2 and the identifier of interface 604. PE1 does not save the correspondence between the address of PE2 and the identifier of interface 610, so PE1 can still forward the data packet to interface 610, that is, to CE3, that is, while blocking the loop of the Ethernet segment identified by ESI1, it can not affect the BUM traffic forwarding of other Ethernet segments, such as the Ethernet segment identified by ESI3. The first entry can also include: Ethernet segment identifier ESI1, for easy search.

[0187] Figure 8 8 is a schematic block diagram of a communication device 800 according to the present application. Figure 8 As shown, the communication device 800 includes the following modules.

[0188] The receiving module 810 is used to receive a message sent by a second PE device, the message including a first Ethernet segment identifier ESI and an address of the second PE device, the first ESI being used to identify the Ethernet segment to which the connection between the second PE device and the customer edge CE device belongs.

[0189] The determination module 820 is used to determine that the first ESI is the same as the second ESI stored in the first PE device, where the second ESI is used to identify the Ethernet segment to which the connection between the first PE device and the CE device belongs.

[0190] The processing module 830 is configured to generate an entry in response to determining that the first ESI is the same as the second ESI, where the entry includes the address of the second PE device.

[0191] The receiving module 810 is further configured to receive a data packet sent by the second PE device.

[0192] The determination module 820 is further configured to determine that the source address of the data packet is the same as the address of the second PE device in the entry.

[0193] The processing module 830 is further configured to avoid sending the data packet to the second PE device in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry.

[0194] Optionally, the receiving module 810, the determining module 820 and the processing module 830 are used to perform various operations of a communication method 200, method 500 and method 700 of the present application, which will not be described in detail here for the sake of brevity.

[0195] The communication device 800 completely corresponds to the PE1 in the method embodiment, and the corresponding modules execute the corresponding steps. For details, please refer to the corresponding method embodiment.

[0196] Fig. 9 is a schematic block diagram of a communication device 900 according to the present application. Fig. 9 As shown, the communication device 900 includes:

[0197] The memory 910 is used to store a second Ethernet segment identifier ESI, where the second ESI is used to identify the Ethernet segment to which the connection between the first PE device and the customer edge CE device belongs;

[0198] Processor 920 is configured to receive a message sent by a second PE device, where the message includes a first Ethernet segment identifier ESI and an address of the second PE device, where the first ESI is used to identify an Ethernet segment to which a connection between the second PE device and the CE device belongs;

[0199] The processor 920 is further configured to determine that the first ESI is the same as the second ESI;

[0200] The processor 920 is further configured to generate an entry in response to determining that the first ESI is the same as the second ESI, the entry including the address of the second PE device;

[0201] The processor 920 is further configured to receive a data packet sent by the second PE device;

[0202] The processor 920 is further configured to determine that the source address of the data packet is the same as the address of the second PE device in the entry;

[0203] The processor 920 is further configured to avoid sending the data packet to the second PE device in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry.

[0204] The communication device 900, the second PE device, and the CE device may be PE1, PE2, and CE1 in a communication method 200, method 500, or method 700 of the present application, respectively. The value of the first ESI is, for example, ESI1, and the entry is, for example, the first entry. The communication device 900 completely corresponds to the PE1 in the executable method embodiment, and the corresponding steps are executed by the corresponding modules, and the corresponding method embodiments may be referred to for details.

[0205] Optionally, the communication device 900 further includes an interface 930, and the interface 930 is used to connect to the CE device;

[0206] The processor 920 is further configured to determine that the interface 930 is in a fault state before determining that the source address of the data packet is the same as the address of the second PE device.

[0207] The interface 930 may be the local interface 104, the local interface 304, and the local interface 604 of the communication method 200, the method 500, or the method 700 of the present application, through which PE1 connects CE1.

[0208] When the processor 920 receives a data packet sent by the second PE device (i.e., PE2), the processor 920 determines that the interface 930 is in a faulty state. If the data packet is sent to CE1 via the second PE device, it may cause a loop problem. Therefore, the processor 920 determines whether the source address of the data packet is the same as the address of the second PE device to avoid a loop.

[0209] Optionally, if the processor 920 determines that the interface 930 is in a normal state, the first PE device can send the data packet through the interface 930. At this time, there will be no traffic loop problem, and there is no need to determine whether the source address of the data packet is the same as the address of the second PE device.

[0210] It should be understood that, in addition to the interface 930 used to connect to the CE device, the communication device may also include multiple interfaces, and the multiple interfaces are used to connect to other PE devices or CE devices.

[0211] Optionally, the processor 920 is further configured to: in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, avoid sending the data packet to the CE device.

[0212] At this time, the method 700 in the method embodiment can be referred to to understand the relevant functions of the communication device 900. The method 700 is mainly used to solve the loop problem that may be generated when forwarding BUN traffic. However, the communication device 900 may also have a processing module BD for processing unicast service related data.

[0213] The entry may be the first entry, and the first entry may include the address of PE2, and the address of PE2 is included in the message sent by PE2 to PE1. The first entry may be called a multi-homing neighbor table. The first entry may also include ESI1 for subsequent search.

[0214] Optionally, the memory 910 stores interface information, the second ESI stored in the memory is included in the interface information, the interface information further includes an interface identifier, the interface identifier is used to identify an interface used by the first PE device to connect to the CE device, and the entry further includes the interface identifier;

[0215] The processor 920 is specifically configured to: determine the interface identifier in the interface information according to the second ESI to generate the entry;

[0216] The processor 920 is specifically configured to:

[0217] Determine the interface identifier in the entry according to the entry and the source address of the data packet;

[0218] Avoid sending the data packet to the interface of the first PE device identified by the interface identifier and used to connect to the CE device.

[0219] The interface information may be information of multiple interfaces on the communication device, such as local interface information and non-local interface information, etc. The interface information may record information such as whether the interface is in a fault state, etc. The interface information includes an interface identifier, which is used to identify the interface used by the communication device 900 to connect to the CE device, such as the identifier of the interface 604 for PE1 to connect to CE1.

[0220] When the processor 920 generates the first entry in response to determining that the first ESI is the same as the second ESI, the first entry includes not only the address of the second PE device, but also includes the identifier of the interface 604 that connects PE1 to CE1, so as to facilitate the search for interface 604. When the processor 920 receives a data packet sent by PE2, the processor 920 determines the interface identifier in the first entry according to the first entry and the source address of the data packet, such as determining interface 604; the processor avoids sending the data packet to the interface 604. For example, the data packet is marked and when PE1 subsequently sends multiple data packets to the interface 604, the marked data packet is filtered out.

[0221] Optionally, when the source address of the data packet is different from the address of PE2 in the first entry, the processor 920 sends the data packet to all local interfaces, for example, the processor 920 sends the data packet to the interface 604 and the interface 610 .

[0222] Optionally, the communication device 900 is applied to an Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, and the message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

[0223] Fig.10 A schematic block diagram of a communication device 1000 provided in the present application is shown, and the communication device 1000 includes:

[0224] A memory 1010, used for storing a program, wherein the program includes codes;

[0225] The processor 1020 is configured to execute the program code in the memory 1010 .

[0226] Interface 1030, used to communicate with other devices;

[0227] Optionally, when the code is executed, the processor 1020 may implement various operations of PE1 in method 200, method 500 and method 700, which will not be described in detail for the sake of brevity.

[0228] The interface 1030 is used to perform specific signal transmission and reception with other devices under the drive of the processor 1020. The interface information can be stored in the memory 1010 or in other memories in the communication device.

[0229] Interface 1030 is a general term for interfaces, which may include local interfaces and non-local interfaces.

[0230] Fig.11 1 is a schematic block diagram of a communication system 1100 provided in an embodiment of the present application. Fig.11 As shown, the communication system 1100 includes a first service provider edge device and a second service provider edge device. The communication system 1100 may also include other PE devices, and CE devices connected to the PE devices. The communication system 1100 may be the above-mentioned SRv6 EVPN active-active communication system, which may provide a virtual private line service VPWS, a unicast service in a multipoint-to-multipoint MP2MP service, and a BUM traffic forwarding service in a multipoint-to-multipoint MP2MP service.

[0231] The above PE1 and PE2 completely correspond to PE1 and PE2 in method embodiments such as method 200, method 500 and method 700, and corresponding steps are performed by corresponding modules. For details, please refer to the corresponding method embodiments.

[0232] It should be understood that the communication system 1100 may also include other network elements or communication devices, which is not limited in the embodiments of the present application.

[0233] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0234] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0235] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0236] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0237] The various embodiments of the present application can refer to and draw lessons from each other, and the same or similar steps and nouns will not be repeated one by one.

[0238] The embodiments of the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a digital video disc (DVD), or a semiconductor medium (such as a solid-state hard disk), etc.

Claims

1. A communication method applied to an Ethernet virtual private network EVPN, characterized in that: The EVPN includes a first service provider edge PE device, a second PE device and a user edge CE device, the CE device accesses the first PE device and the second PE device through a first connection and a second connection respectively in a multi-home and multi-active manner, the first connection and the second connection belong to the same Ethernet segment, and the method includes: The first PE device receives a data packet sent by the second PE device, where a source address of the data packet is the same as an address of the second PE device in an entry stored by the first PE device; In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the second PE device.

2. The method according to claim 1, characterized in that Before receiving the data packet, the method further includes: The first PE device receives a message sent by the second PE device, the message including a first Ethernet segment identifier ESI and an address of the second PE device, the first ESI is used to identify the Ethernet segment, and the first ESI is the same as a second ESI stored by the first PE device and used to identify the Ethernet segment; The first PE device generates the entry, where the entry includes the address of the second PE device.

3. The method according to claim 1 or 2, characterized in that: The data packet is a unicast message. When the local interface of the first PE device used to connect to the CE device is in a fault state, the first PE device discards the data packet.

4. The method according to claim 1 or 2, characterized in that: The data packet is a unicast message, and when the local interface of the first PE device used to connect to the CE device is in a normal state, the data packet is forwarded to the CE device through the local interface.

5. The method according to claim 1, characterized in that The data packet is an unknown unicast multicast BUM message, and the method further includes: In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the CE device.

6. The method according to claim 2, characterized in that The data packet is an unknown unicast multicast BUM message, and the method further includes: In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the CE device.

7. The method according to claim 6, characterized in that The first PE device stores interface information, the second ESI stored by the first PE device is included in the interface information, the interface information further includes an interface identifier, the interface identifier is used to identify a local interface of the first PE device used to connect to the CE device, and the entry further includes the interface identifier; The first PE device avoids sending the data packet to the CE device, including: The first PE device determines the interface identifier in the entry according to the entry and the source address of the data packet; The first PE device avoids sending the data packet to a local interface of the first PE device identified by the interface identifier and used to connect to the CE device.

8. The method according to claim 1 or 2, characterized in that: The method is applied to EVPN based on Internet Protocol version 6 segment routing SRv6, and the source address of the data packet and the address of the second PE device are both Internet Protocol version 6 IPv6 addresses.

9. The method according to claim 2, characterized in that: The message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

10. A communication device, wherein the communication device is a first service provider edge PE device used in an Ethernet virtual private network EVPN, characterized in that: The EVPN includes the first PE device, the second PE device and a user edge CE device, the CE device accesses the first PE device and the second PE device through a first connection and a second connection respectively in a multi-home and multi-active manner, the first connection and the second connection belong to the same Ethernet segment, and the communication device includes: a receiving module, configured to receive a data packet sent by the second PE device, wherein a source address of the data packet is the same as an address of the second PE device in an entry stored by the first PE device; The processing module is configured to avoid sending the data packet to the second PE device in response to determining that the source address of the data packet is the same as the address of the second PE device in the entry.

11. The communication device according to claim 10, characterized in that The receiving module is further used to receive a message sent by the second PE device, the message including a first Ethernet segment identifier ESI and an address of the second PE device, the first ESI is used to identify the Ethernet segment, and the first ESI is the same as a second ESI stored by the first PE device and used to identify the Ethernet segment; The processing module is further configured to generate the entry, wherein the entry includes the address of the second PE device.

12. The communication device according to claim 10 or 11, characterized in that: The data packet is a unicast message. When the local interface of the first PE device used to connect to the CE device is in a fault state, the first PE device discards the data packet.

13. The communication device according to claim 10 or 11, characterized in that: The data packet is a unicast message, and when the local interface of the first PE device used to connect to the CE device is in a normal state, the data packet is forwarded to the CE device through the local interface.

14. The communication device according to claim 10, characterized in that The data packet is an unknown unicast multicast BUM message, and the processing module is further used for: In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, avoiding sending the data packet to the CE device.

15. The communication device according to claim 11, characterized in that The data packet is an unknown unicast multicast BUM message, and the processing module is further used for: In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, avoiding sending the data packet to the CE device.

16. The communication device according to claim 15, characterized in that The first PE device stores interface information, the second ESI stored by the first PE device is included in the interface information, the interface information further includes an interface identifier, the interface identifier is used to identify an interface used by the first PE device to connect to the CE device, and the entry further includes the interface identifier; The first PE device avoids sending the data packet to the CE device, including: The first PE device determines the interface identifier in the entry according to the entry and the source address of the data packet; The first PE device avoids sending the data packet to a local interface of the first PE device identified by the interface identifier and used to connect to the CE device.

17. The communication device according to claim 10 or 11, characterized in that: The communication device is applied to an Ethernet virtual private network EVPN based on Internet Protocol version 6 segment routing SRv6, and the source address of the data packet and the address of the second PE device are both Internet Protocol version 6 IPv6 addresses.

18. The communication device according to claim 11, characterized in that The message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

19. A communication device, wherein the communication device is a first service provider edge PE device used in an Ethernet virtual private network EVPN, characterized in that: The EVPN includes the first PE device, the second PE device and a user edge CE device, the CE device accesses the first PE device and the second PE device through a first connection and a second connection respectively in a multi-home and multi-active manner, the first connection and the second connection belong to the same Ethernet segment, and the communication device includes: A memory storing instructions; The processor is configured to execute the instruction so that the first PE device performs the following operations: receiving a data packet sent by the second PE device, wherein a source address of the data packet is the same as an address of the second PE device in the entry stored by the first PE device; In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, avoiding sending the data packet to the second PE device.

20. The communication device according to claim 19, characterized in that The processor executes the instruction, further causing the first PE device to perform the following operations before receiving the data packet: receiving a message sent by the second PE device, the message including a first Ethernet segment identifier ESI and an address of the second PE device, the first ESI being used to identify the Ethernet segment, and the first ESI being the same as a second ESI stored by the first PE device and used to identify the Ethernet segment; The entry is generated, where the entry includes the address of the second PE device.

21. The communication device according to claim 19 or 20, characterized in that: The data packet is a unicast message. When the local interface of the first PE device used to connect to the CE device is in a fault state, the first PE device discards the data packet.

22. The communication device according to claim 19 or 20, characterized in that: The data packet is a unicast message, and when the local interface of the first PE device used to connect to the CE device is in a normal state, the data packet is forwarded to the CE device through the local interface.

23. The communication device according to claim 19, characterized in that The data packet is an unknown unicast multicast BUM message, and the processor executes the instruction, further causing the first PE device to perform the following operations after receiving the data packet: In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the CE device.

24. The communication device according to claim 20, characterized in that The data packet is an unknown unicast multicast BUM message, and the processor executes the instruction, further causing the first PE device to perform the following operations after receiving the data packet: In response to determining that the source address of the data packet is the same as the address of the second PE device in the entry, the first PE device avoids sending the data packet to the CE device.

25. The communication device according to claim 24, characterized in that The first PE device stores interface information, the second ESI stored by the first PE device is included in the interface information, the interface information further includes an interface identifier, the interface identifier is used to identify an interface used by the first PE device to connect to the CE device, and the entry further includes the interface identifier; The first PE device avoids sending the data packet to the CE device, including: The first PE device determines the interface identifier in the entry according to the entry and the source address of the data packet; The first PE device avoids sending the data packet to a local interface of the first PE device identified by the interface identifier and used to connect to the CE device.

26. The communication device according to claim 19 or 20, characterized in that: The communication device is applied to EVPN based on Internet Protocol version 6 segment routing SRv6, and the source address of the data packet and the address of the second PE device are both Internet Protocol version 6 IPv6 addresses.

27. The communication device according to claim 20, characterized in that The message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

28. A communication method applied to an Ethernet virtual private network EVPN, characterized in that: The EVPN includes a first service provider edge PE device, a second PE device and a user edge CE device, the CE device accesses the first PE device and the second PE device through a first connection and a second connection respectively in a multi-home and multi-active manner, the first connection and the second connection belong to the same Ethernet segment, and the method includes: The first PE device receives a message sent by the second PE device, the message including a first Ethernet segment identifier ESI and an Internet Protocol version 6 IPv6 address of the second PE device, the first ESI is used to identify the Ethernet segment, and the first ESI is the same as a second ESI stored by the first PE device and used to identify the Ethernet segment; The first PE device generates an entry, where the entry includes an address of the second PE device; When the first PE device receives a data packet whose source address is the same as the address of the second PE device, the first PE device avoids forwarding the data packet to the second PE device according to the entry.

29. The method according to claim 28, characterized in that The entry also includes a first interface identifier, where the first interface identifier is used to identify a local interface of the first PE device connected to the CE device.

30. The method according to claim 28 or 29, characterized in that The entry also includes an identification of the Ethernet segment.

31. The method according to claim 28 or 29, characterized in that The method is applied to EVPN based on Internet Protocol version 6 segment routing SRv6.

32. The method according to claim 28 or 29, characterized in that The message is an Ethernet automatic discovery route carrying an ESI label extended community attribute.

33. A communication device, the communication device being a first service provider edge PE device applied in an Ethernet virtual private network EVPN, characterized in that: The EVPN includes the first PE device, the second PE device and a user edge CE device, the CE device accesses the first PE device and the second PE device through a first connection and a second connection respectively in a multi-home and multi-active manner, the first connection and the second connection belong to the same Ethernet segment, and the communication device includes: A memory storing instructions; A processor is used to execute the instructions so that the communication device executes the method according to any one of claims 28 to 32.

34. An Ethernet virtual private network EVPN communication system, comprising a first service provider edge PE device, a second PE device and a user edge CE device, wherein the CE device respectively accesses the first PE device and the second PE device through a first connection and a second connection multi-home multi-active, wherein the first connection and the second connection belong to the same Ethernet segment, characterized in that: The first PE device is the communication device described in any one of claims 10-27 or claim 33.

35. A computer program product, characterized in that The computer program product comprises a program, which, when executed by a processor, causes a communication device to perform a method according to any one of claims 1 to 9 and claims 28 to 32.