Communication method and apparatus
The communication method and apparatus address the interconnection challenge between VXLAN and SRv6 networks by converting EVPN MAC routes to include SRv6 SIDs, enabling efficient packet transmission and network management, thus improving interoperability and operational efficiency.
Patent Information
- Application Number
- JP2023117777
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-07-21
- Filing Date
- 2023-07-19
- Publication Date
- 2025-09-25
- Estimated Expiration
- 2043-07-19
AI Technical Summary
The challenge of implementing interconnection between data centers using Segment Routing over IPv6 (SRv6) networks has arisen as more networks transition away from Multi-Protocol Label Switching (MPLS) networks, particularly in the context of Virtual Extensible Local Area Networks (VXLANs).
A communication method and apparatus that enables interconnection between VXLAN and SRv6 networks by converting Ethernet Virtual Private Network (EVPN) MAC routes to include segment routing over IPv6 segment identifiers (SRv6 SIDs) and vice versa, allowing for the decapsulation and re-encapsulation of packets to facilitate seamless communication across different network types.
This approach facilitates load balancing, network management, and maintenance by utilizing SRv6 SIDs to transmit Layer 2 packets efficiently and determine destination addresses, thereby enhancing the interoperability and operational efficiency of VXLAN and SRv6 networks.
Smart Images

Figure 0007744103000001 
Figure 0007744103000002 
Figure 0007744103000003
Abstract
Description
[Technical Field]
[0001] The present application relates to the field of communications, and more particularly to communications methods and devices. [Background technology]
[0002] 2. Description of the Related Art With the development of information technology, in order to cope with the rapid increase in the amount of data of various types, more and more organizations have begun to build data centers for transmitting, displaying, calculating and storing data.
[0003] Currently, data exchange is mainly performed within data centers through virtual extensible local area networks (VXLANs), and different data centers can be interconnected through multi-protocol label switching (MPLS) networks.
[0004] However, as more and more networks start to use segment routing over IPv6 (SRv6) networks for networking, how to implement interconnection between data centers through SRv6 networks has now become a pressing problem to be solved. Summary of the Invention
[0005] The present application provides a communication method and apparatus for implementing interconnection between VXLAN and SRv6 networks.
[0006] According to a first aspect, a communication method is provided. The method includes: a first communication device receiving a first Ethernet Virtual Private Network (EVPN) MAC route from a second communication device, where the first EVPN MAC route carries a first MAC address and a first Virtual Extensible Local Area Network (VNI). The first communication device generates a second EVPN MAC route based on the first EVPN MAC route, where the second EVPN MAC route carries the first MAC address and a first segment routing over IPv6 segment identifier (SRv6 SID) that belongs to the first communication device and corresponds to the first VNI. The first communication device transmits the second EVPN MAC route to a third communication device.
[0007] In the communication method, when a first communication device receives a first EVPN MAC route that is of a corresponding VXLAN and carries a first MAC address and a first VNI, the first communication device may convert the first EVPN MAC route to a second EVPN MAC route that corresponds to the SRv6 network and carries the first MAC address and a first SRv6 SID (corresponding to the first VNI), and may send the second EVPN MAC route to a third communication device. Thus, when the first communication device receives an SRv6 packet that carries the first SRv6 SID from the SRv6 network, the first communication device may decapsulate the SRv6 packet to obtain a Layer 2 packet, and re-encapsulate the Layer 2 packet as a VXLAN packet including the first VNI, thereby implementing forwarding of the Layer 2 packet using VXLAN. In this way, interconnection between a VXLAN and an SRv6 network is implemented.
[0008] In a possible design, the method further includes the first communication device determining a first SRv6 SID corresponding to the first VNI according to an SRv6 SID allocation policy, wherein the SRv6 SID allocation policy includes at least one of: allocating different SRv6 SIDs based on different EVPN instances corresponding to EVPN MAC routes; allocating different SRv6 SIDs based on different MAC addresses carried in the EVPN MAC routes; or allocating different SRv6 SIDs based on EVPN MAC routes from different communication devices.
[0009] In the above design, a corresponding SRv6 SID allocation policy may be used to facilitate load sharing and network operation and maintenance by determining the first SRv6 SID needed.
[0010] In a possible design, the first SRv6 SID is an SRv6 SID assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0011] According to the foregoing design, when the first communication device receives an SRv6 packet carrying a first SRv6 SID from the SRv6 network, it may first determine a first EVPN instance based on the first SRv6 SID, and then determine a forwarding entry corresponding to the Layer 2 packet by using the first EVPN instance to complete forwarding the Layer 2 packet.
[0012] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first VNI.
[0013] According to the aforementioned design, when the first communication device receives an SRv6 packet carrying a first SRv6 SID from the SRv6 network, it may determine a first EVPN instance based on the first SRv6 SID, and then find a correspondence between the first MAC address and a first VNI from a MAC table corresponding to the first EVPN instance to determine the first VNI, and encapsulate the Layer 2 packet into a VXLAN packet carrying the first VNI for forwarding, thereby completing forwarding of the Layer 2 packet.
[0014] In one possible design, the method further includes the first communication device receiving a third EVPN MAC route, where the third EVPN MAC route carries a second MAC address and a second VNI, and the third EVPN MAC route corresponds to a second EVPN instance of the first communication device. The first communication device generates a fourth EVPN MAC route based on the third EVPN MAC route, where the fourth EVPN MAC route carries the second MAC address and a second SRv6 SID, and the second SRv6 SID is an SRv6 SID assigned to the second EVPN instance. The first communication device transmits the fourth EVPN MAC route to the third communication device.
[0015] In the above design, after receiving EVPN MAC routes corresponding to different EVPN instances (i.e., a first EVPN MAC route corresponding to the first EVPN instance and a third EVPN MAC route corresponding to the second EVPN instance), the first communication device separately generates EVPN MAC routes carrying different SRv6 SIDs (i.e., a second EVPN MAC route carrying the first SRv6 SID and a fourth EVPN MAC route carrying the second SRv6 SID) and sends the EVPN MAC routes to the third communication device. Therefore, after receiving an SRv6 packet from the SRv6 network, the first communication device may first determine an EVPN instance based on the SRv6 SID carried in the SRv6 packet (e.g., determine a first EVPN instance based on the first SRv6 SID, or determine a second EVPN instance based on the second SRv6 SID), and then determine a forwarding entry for the Layer 2 packet by using the corresponding EVPN instance, thereby completing VXLAN encapsulation and forwarding of the Layer 2 packet.
[0016] In a possible design, the method further includes the first communication device recording a correspondence between the first SRv6 SID and the first VNI.
[0017] In the above design, the correspondence between the first SRv6 SID and the first VNI is recorded, so that the first communication device can quickly determine the first VNI corresponding to the first SRv6 SID. Furthermore, after receiving an SRv6 packet from the SRv6 network, the first communication device may first quickly determine the first VNI based on the first SRv6 SID carried in the SRv6 packet, and complete encapsulation of the VXLAN packet for forwarding based on the first VNI.
[0018] In a possible design, the first SRv6 SID is associated with a first operation, and the first operation is performing a Virtual Extensible Local Area Network (VXLAN) encapsulation.
[0019] According to the aforementioned design, after receiving an SRv6 packet including a first SRv6 SID, the first communication device may directly determine, based on the first SRv6 SID, that VXLAN encapsulation needs to be performed, and then be directly triggered to search for a correspondence between the first SRv6 SID and the first VNI to perform VXLAN encapsulation.
[0020] In one possible design, the method further includes receiving a fifth EVPN MAC route by the first communication device, the fifth EVPN MAC route carrying the third MAC address and the first VNI. The first communication device generates a sixth EVPN MAC route based on the fifth EVPN MAC route, the sixth EVPN MAC route carrying the third MAC address and a third SRv6 SID corresponding to the first VNI. The first communication device transmits the sixth EVPN MAC route to the third communication device.
[0021] According to the above design, after receiving EVPN MAC routes corresponding to different MAC addresses (i.e., the first EVPN MAC route corresponding to the first MAC address and the fifth EVPN MAC route corresponding to the third MAC address), the first communication device separately generates EVPN MAC routes carrying different SRv6 SIDs (i.e., the second EVPN MAC route carrying the first SRv6 SID and the sixth EVPN MAC route carrying the third SRv6 SID) and sends the EVPN MAC routes to the third communication device. Thus, different MAC addresses in the same VNI may correspond to different SIDs. In this way, on the one hand, on an SRv6 network, different SIDs may be used to transmit Layer 2 packets from different MAC addresses to facilitate load balancing; and on the other hand, on an SRv6 network, a destination address of an SRv6 packet may be determined based on the SID carried in the SRv6 packet, which may facilitate network management and maintenance.
[0022] In one possible design, the method further includes the first communication device receiving a seventh EVPN MAC route from the fourth communication device, the seventh EVPN MAC route carrying the first MAC address and the first VNI. The first communication device generates an eighth EVPN MAC route based on the seventh EVPN MAC route, the eighth EVPN MAC route carrying the first MAC address and a fourth SRv6 SID corresponding to the first VNI. The first communication device transmits the eighth EVPN MAC route to the third communication device.
[0023] According to the above design, after receiving EVPN MAC routes corresponding to different next hop information (i.e., the first EVPN MAC route whose corresponding next hop is the second communication device and the seventh EVPN MAC route whose corresponding next hop is the fourth communication device), the first communication device separately generates EVPN MAC routes carrying different SRv6 SIDs (i.e., the second EVPN MAC route carrying the first SRv6 SID and the eighth EVPN MAC route carrying the fourth SRv6 SID) and sends the EVPN MAC routes to the third communication device. Thus, different next hop nodes in the same VNI may correspond to different SIDs. In this way, on the one hand, on an SRv6 network, different SIDs can be used to transmit Layer 2 packets to different next-hop nodes to facilitate load balancing; and on the other hand, on an SRv6 network, the next-hop node of a Layer 2 packet after the SRv6 packet is transmitted to a first communication device can be determined based on the SID carried in the SRv6 packet, thereby facilitating network management and maintenance.
[0024] In one possible design, the method further includes the first communication device receiving, from the third communication device, a first SRv6 packet having a destination address of the first SRv6 SID, the SRv6 packet including a first Layer 2 packet having a destination address of the first MAC address. The first communication device determines a first VNI based on the first SRv6 SID. The first communication device performs VXLAN encapsulation on the first Layer 2 packet to obtain a first VXLAN packet. The first VXLAN packet includes the first VNI. The first communication device forwards the first VXLAN packet to the second communication device.
[0025] In this design, when the first communication device receives an SRv6 packet carrying a first SRv6 SID from the SRv6 network, the first communication device may decapsulate the SRv6 packet to obtain a Layer 2 packet, and re-encapsulate the Layer 2 packet as a VXLAN packet including the first VNI, thereby implementing forwarding of the Layer 2 packet using VXLAN. In this manner, interconnection between the VXLAN and the SRv6 network is implemented.
[0026] In one possible design, the first communication device determining the first VNI based on the first SRv6 SID includes the first communication device determining a first EVPN instance based on the first SRv6 SID. The first communication device determines the first VNI from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first VNI.
[0027] According to the aforementioned design, when the first communication device receives an SRv6 packet carrying a first SRv6 SID from the SRv6 network, it may determine a first EVPN instance based on the first SRv6 SID, and then find a correspondence between the first MAC address and a first VNI from a MAC table corresponding to the first EVPN instance to determine the first VNI, and encapsulate the Layer 2 packet into a VXLAN packet carrying the first VNI for forwarding, thereby completing forwarding of the Layer 2 packet.
[0028] In one possible design, the method further includes the first communication device receiving, from the third communication device, a second SRv6 packet having a destination address of the second SRv6 SID, the second SRv6 packet including a second Layer 2 packet having a destination address of the second MAC address. The first communication device determines a second EVPN instance based on the second SRv6 SID. The first communication device determines a second VNI from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second VNI. The first communication device performs VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet, the second VXLAN packet including the second VNI. The first communication device forwards the second VXLAN packet.
[0029] In the above design, after receiving SRv6 packets carrying different SRv6 SIDs (e.g., a first SRv6 packet whose destination address is the first SRv6 SID and a second SRv6 packet whose destination address is the second SRv6 SID) from the SRv6 network, the first communication device may first determine an EVPN instance based on the SRv6 SID carried in the SRv6 packets (e.g., determine the first EVPN instance based on the first SRv6 SID or determine the second EVPN instance based on the second SRv6 SID), determine a forwarding entry for the Layer 2 packet by using the corresponding EVPN instance, and complete VXLAN encapsulation and forwarding of the Layer 2 packet.
[0030] In a possible design, the first communications device determining the first VNI based on the first SRv6 SID includes the first communications device determining the first VNI based on the first SRv6 SID and a correspondence between the first SRv6 SID and the first VNI, recorded in the first communications device.
[0031] According to the above design, the first communication device can quickly determine a first VNI corresponding to the first SRv6 SID. Furthermore, after receiving an SRv6 packet from the SRv6 network, the first communication device may first quickly determine a first VNI based on the first SRv6 SID carried in the SRv6 packet, and complete encapsulation of the VXLAN packet for forwarding based on the first VNI.
[0032] In one possible design, the method further includes the first communication device receiving, from the third communication device, a third SRv6 packet having a destination address of the third SRv6 SID, the third SRv6 packet including a third Layer 2 packet having a destination address of the third MAC address. The first communication device determines the first VNI based on the third SRv6 SID and a correspondence between the third SRv6 SID and the first VNI recorded in the first communication device. The first communication device performs VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet, the third VXLAN packet including the first VNI. The first communication device forwards the third VXLAN packet to the second communication device.
[0033] According to the above design, after receiving SRv6 packets corresponding to different MAC addresses and different SRv6 SIDs (i.e., a first SRv6 packet corresponding to a first MAC address and a third SRv6 packet corresponding to a third MAC address, where the different MAC addresses correspond to different SIDs), the first communication device may separately determine a first VNI based on the different SRv6 SIDs carried in the SRv6 packets and encapsulate a VXLAN packet. The different MAC addresses correspond to different SIDs. Thus, on the one hand, on the SRv6 network, different SIDs may be used to transmit Layer 2 packets from different MAC addresses to facilitate load balancing; and on the other hand, on the SRv6 network, the destination address of an SRv6 packet may be determined based on the SID carried in the SRv6 packet, which may facilitate network management and maintenance.
[0034] In one possible design, the method further includes the first communication device receiving a fourth SRv6 packet from the third communication device, the fourth SRv6 packet having a destination address of the fourth SRv6 SID, the fourth SRv6 packet including a fourth Layer 2 packet having a destination address of the first MAC address. The first communication device determines the first VNI based on the fourth SRv6 SID and a correspondence between the fourth SRv6 SID and the first VNI recorded in the first communication device. The first communication device performs VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet, the fourth VXLAN packet including the first VNI. The first communication device forwards the fourth VXLAN packet to the fourth communication device.
[0035] According to the above design, after receiving SRv6 packets corresponding to different next hop nodes and different SRv6 SIDs (i.e., a first SRv6 packet corresponding to a second communication device and a third SRv6 packet corresponding to a fourth communication device, where different next hop nodes correspond to different SIDs), the first communication device may separately determine a first VNI based on the different SRv6 SIDs carried in the SRv6 packets and encapsulate a VXLAN packet. The different next hops correspond to different SIDs. Thus, on the one hand, different SIDs may be used to transmit Layer 2 packets on the SRv6 network to facilitate load balancing; and on the other hand, on the SRv6 network, the next hop node of a Layer 2 packet after the SRv6 packet is transmitted to the first communication device may be determined based on the SID carried in the SRv6 packet, which may facilitate network management and maintenance.
[0036] In a possible design, both the first communication device and the second communication device are each data center gateways.
[0037] According to a second aspect, a communication method is provided. The method includes a first communication device receiving a first SRv6 packet from a second communication device, the first SRv6 packet having a destination address set to a first segment routing over IPv6 segment identifier (SRv6 SID), the first SRv6 packet including a first Layer 2 packet having a destination address set to a first medium access control (MAC) address. The first communication device determines a first virtual extensible local area network identifier (VNI) based on the first SRv6 SID. The first communication device performs virtual extensible local area network (VXLAN) encapsulation on the first Layer 2 packet to obtain a first VXLAN packet. The first VXLAN packet includes the first VNI. The first communication device forwards the first VXLAN packet to a third communication device.
[0038] In this communication method, when the first communication device receives an SRv6 packet carrying a first SRv6 SID from the SRv6 network, the first communication device decapsulates the SRv6 packet to obtain a Layer 2 packet, and re-encapsulates the Layer 2 packet as a VXLAN packet including the first VNI, thereby implementing forwarding of the Layer 2 packet by using VXLAN. In this way, interconnection between the VXLAN and the SRv6 network is implemented.
[0039] In a possible design, the first SRv6 SID is an SRv6 SID assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0040] According to the foregoing design, when the first communication device receives an SRv6 packet carrying a first SRv6 SID from the SRv6 network, it may first determine a first EVPN instance based on the first SRv6 SID, and then determine a forwarding entry corresponding to the Layer 2 packet by using the first EVPN instance to complete forwarding the Layer 2 packet.
[0041] In one possible design, the first communication device determining the first VNI based on the first SRv6 SID includes the first communication device determining a first EVPN instance based on the first SRv6 SID. The first communication device determines the first VNI from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first VNI.
[0042] According to the aforementioned design, when the first communication device receives an SRv6 packet carrying a first SRv6 SID from the SRv6 network, it may determine a first EVPN instance based on the first SRv6 SID, and then find a correspondence between the first MAC address and a first VNI from a MAC table corresponding to the first EVPN instance to determine the first VNI, and encapsulate the Layer 2 packet into a VXLAN packet carrying the first VNI for forwarding, thereby completing forwarding of the Layer 2 packet.
[0043] In one possible design, the method further includes the first communication device receiving, from the second communication device, a second SRv6 packet having a destination address of the second SRv6 SID, the second SRv6 packet including a second Layer 2 packet having a destination address of the second MAC address. The first communication device determines a second EVPN instance based on the second SRv6 SID. The first communication device determines a second VNI from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second VNI. The first communication device performs VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet, the second VXLAN packet including the second VNI. The first communication device forwards the second VXLAN packet.
[0044] In the above design, after receiving SRv6 packets carrying different SRv6 SIDs (e.g., a first SRv6 packet whose destination address is the first SRv6 SID and a second SRv6 packet whose destination address is the second SRv6 SID) from the SRv6 network, the first communication device may first determine an EVPN instance based on the SRv6 SID carried in the SRv6 packets (e.g., determine the first EVPN instance based on the first SRv6 SID or determine the second EVPN instance based on the second SRv6 SID), determine a forwarding entry for the Layer 2 packet by using the corresponding EVPN instance, and complete VXLAN encapsulation and forwarding of the Layer 2 packet.
[0045] In a possible design, the first communications device determining the first VNI based on the first SRv6 SID includes the first communications device determining the first VNI based on the first SRv6 SID and a correspondence between the first SRv6 SID and the first VNI, recorded in the first communications device.
[0046] According to the above design, the first communication device can quickly determine a first VNI corresponding to the first SRv6 SID. Furthermore, after receiving an SRv6 packet from the SRv6 network, the first communication device may first quickly determine a first VNI based on the first SRv6 SID carried in the SRv6 packet, and complete encapsulation of the VXLAN packet for forwarding based on the first VNI.
[0047] In a possible design, the first SRv6 SID is associated with a first operation, and the first operation is performing VXLAN encapsulation.
[0048] According to the aforementioned design, after receiving an SRv6 packet including a first SRv6 SID, the first communication device may directly determine, based on the first SRv6 SID, that VXLAN encapsulation needs to be performed, and then be directly triggered to search for a correspondence between the first SRv6 SID and the first VNI to perform VXLAN encapsulation.
[0049] In one possible design, the method further includes the first communication device receiving, from the second communication device, a third SRv6 packet having a destination address of a third SRv6 SID, the third SRv6 packet including a third Layer 2 packet having a destination address of a third MAC address. The first communication device determines the first VNI based on the third SRv6 SID and a correspondence between the third SRv6 SID and the first VNI recorded in the first communication device. The first communication device performs VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet, the third VXLAN packet including the first VNI. The first communication device forwards the third VXLAN packet to the third communication device.
[0050] According to the above design, after receiving SRv6 packets corresponding to different MAC addresses and different SRv6 SIDs (i.e., a first SRv6 packet corresponding to a first MAC address and a third SRv6 packet corresponding to a third MAC address, where the different MAC addresses correspond to different SIDs), the first communication device may separately determine a first VNI based on the different SRv6 SIDs carried in the SRv6 packets and encapsulate a VXLAN packet. The different MAC addresses correspond to different SIDs. Thus, on the one hand, on the SRv6 network, different SIDs may be used to transmit Layer 2 packets from different MAC addresses to facilitate load balancing; and on the other hand, on the SRv6 network, the destination address of an SRv6 packet may be determined based on the SID carried in the SRv6 packet, which may facilitate network management and maintenance.
[0051] In one possible design, the method further includes the first communication device receiving a fourth SRv6 packet from the second communication device, the fourth SRv6 packet having a destination address of the fourth SRv6 SID, the fourth SRv6 packet including a fourth Layer 2 packet having a destination address of the first MAC address. The first communication device determines the first VNI based on the fourth SRv6 SID and a correspondence between the fourth SRv6 SID and the first VNI recorded in the first communication device. The first communication device performs VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet, the fourth VXLAN packet including the first VNI. The first communication device forwards the fourth VXLAN packet to the fourth communication device.
[0052] According to the above design, after receiving SRv6 packets corresponding to next hop nodes and different SRv6 SIDs (i.e., a first SRv6 packet corresponding to a third communication device and a third SRv6 packet corresponding to a fourth communication device, where different next hop nodes correspond to different SIDs), the first communication device may separately determine a first VNI based on the different SRv6 SIDs carried in the SRv6 packets and encapsulate a VXLAN packet. The different next hops correspond to different SIDs. Thus, on the one hand, on the SRv6 network, different SIDs may be used to transmit Layer 2 packets from different MAC addresses to facilitate load balancing; and on the other hand, on the SRv6 network, the next hop node of a Layer 2 packet after the SRv6 packet is transmitted to the first communication device may be determined based on the SID carried in the SRv6 packet, which may facilitate network management and maintenance.
[0053] In a possible design, both the first communication device and the third communication device are each a data center gateway.
[0054] According to a third aspect, there is provided a communication method, the method including: a first communication device receiving a first Ethernet Virtual Private Network Medium Access Control (EVPN) MAC route from a second communication device, the first EVPN MAC route carrying a first MAC address and a first SRv6 SID; the first communication device generating a second EVPN MAC route based on the first EVPN MAC route, the second EVPN MAC route carrying the first MAC address and a first Virtual Extensible Local Area Network Identifier (VNI) corresponding to the first SRv6 SID; and the first communication device transmitting the second EVPN MAC route to a third communication device.
[0055] In the communication method, when a first communication device is of a corresponding SRv6 network and receives a first EVPN MAC route carrying a first MAC address and a first SRv6 SID, the first communication device may convert the first EVPN MAC route to a second EVPN MAC route corresponding to a VXLAN and carrying the first MAC address and a first VNI (corresponding to the first SRv6 SID), and may send the second EVPN MAC route to a third communication device. Thus, when the first communication device receives a VXLAN packet carrying the first VNI from a VXLAN, the first communication device may decapsulate the VXLAN packet to obtain a Layer 2 packet, and re-encapsulate the Layer 2 packet as an SRv6 packet including the first SRv6 SID, thereby implementing forwarding of the Layer 2 packet using the SRv6 network. In this way, interconnection between a VXLAN and an SRv6 network is implemented.
[0056] In one possible design, the method further includes the first communication device determining a first VNI corresponding to the first SRv6 SID according to a VNI allocation policy, wherein the SRv6 SID allocation policy includes at least one of: allocating different VNIs based on different EVPN instances corresponding to EVPN MAC routes, allocating different VNIs based on different MAC addresses carried in the EVPN MAC routes, or allocating different VNIs based on EVPN MAC routes from different communication devices.
[0057] In the above design, a corresponding SRv6 SID allocation policy may be used to facilitate load sharing and network operation and maintenance by determining the first SRv6 SID needed.
[0058] In a possible design, the first VNI is a VNI assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0059] According to the above design, when the first communication device receives a VXLAN packet carrying a first VNI from a VXLAN, it may first determine a first EVPN instance based on the first VNI, and then determine a forwarding entry corresponding to the Layer 2 packet by using the first EVPN instance to complete forwarding of the Layer 2 packet.
[0060] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first SRv6 SID.
[0061] According to the above design, when the first communication device receives a VXLAN packet carrying a first VNI from a VXLAN, the first communication device may determine a first EVPN instance based on the first VNI, and then find a correspondence between the first MAC address and a first SRv6 SID from a MAC table corresponding to the first EVPN instance to determine the first SRv6 SID, and encapsulate the Layer 2 packet into an SRv6 packet carrying the first SRv6 SID for forwarding, thereby completing forwarding of the Layer 2 packet.
[0062] In one possible design, the method further includes the first communication device receiving a third EVPN MAC route, where the third EVPN MAC route carries a second MAC address and a second SRv6 SID, and the third EVPN MAC route corresponds to the second EVPN instance. The first communication device generates a fourth EVPN MAC route based on the third EVPN MAC route, where the fourth EVPN MAC route carries the second MAC address and a second VNI, and the second VNI is a VNI assigned to the second EVPN instance. The first communication device transmits the fourth EVPN MAC route to the third communication device.
[0063] In the above design, after receiving EVPN MAC routes corresponding to different EVPN instances (i.e., the first EVPN MAC route corresponding to the first EVPN instance and the third EVPN MAC route corresponding to the second EVPN instance), the first communication device separately generates EVPN MAC routes carrying different VNIs (i.e., the second EVPN MAC route carrying the first VNI and the fourth EVPN MAC route carrying the second VNI) and sends the EVPN MAC routes to the third communication device. Thus, after receiving a VXLAN packet from a VXLAN, the first communication device may first determine an EVPN instance based on the VNI carried in the VXLAN packet (e.g., determine the first EVPN instance based on the first VNI or determine the second EVPN instance based on the second VNI), and determine a forwarding entry for the Layer 2 packet by using the corresponding EVPN instance, and complete VXLAN encapsulation and forwarding of the Layer 2 packet.
[0064] In a possible design, the method further includes the first communication device recording a correspondence between the first VNI and the first SRv6 SID.
[0065] In the above design, the correspondence between the first VNI and the first SRv6 SID is recorded, so that the first communication device can quickly determine the first SRv6 SID corresponding to the first VNI. Furthermore, after receiving a VXLAN packet from the VXLAN, the first communication device may first quickly determine the first SRv6 SID based on the first VNI carried in the VXLAN packet, and complete encapsulation of the VXLAN packet for forwarding based on the first VNI.
[0066] In one possible design, the method further includes receiving a fifth EVPN MAC route by the first communication device, the fifth EVPN MAC route carrying the third MAC address and the first SRv6 SID. The first communication device generates a sixth EVPN MAC route based on the fifth EVPN MAC route, the sixth EVPN MAC route carrying the third MAC address and a third VNI corresponding to the first SRv6 SID. The first communication device transmits the sixth EVPN MAC route to the third communication device.
[0067] According to the above design, after receiving EVPN MAC routes corresponding to different MAC addresses (i.e., the first EVPN MAC route corresponding to the first MAC address and the fifth EVPN MAC route corresponding to the third MAC address), the first communication device separately generates EVPN MAC routes carrying different VNIs (i.e., the second EVPN MAC route carrying the first VNI and the sixth EVPN MAC route carrying the third VNI) and sends the EVPN MAC routes to the third communication device. Thus, different MAC addresses may correspond to different SIDs. In this way, on the one hand, on an SRv6 network, different SIDs may be used to transmit Layer 2 packets from different MAC addresses to facilitate load balancing; and on the other hand, on an SRv6 network, a destination address of an SRv6 packet may be determined based on the SID carried in the SRv6 packet, which may facilitate network management and maintenance.
[0068] In one possible design, the method further includes the first communication device receiving a seventh EVPN MAC route from the fourth communication device, the seventh EVPN MAC route carrying the first MAC address and the first SRv6 SID. The first communication device generates an eighth EVPN MAC route based on the seventh EVPN MAC route, the eighth EVPN MAC route carrying the first MAC address and a fourth VNI corresponding to the first SRv6 SID. The first communication device transmits the eighth EVPN MAC route to the third communication device.
[0069] According to the above design, after receiving EVPN MAC routes corresponding to different next hop information (i.e., the first EVPN MAC route whose corresponding next hop is the second communication device and the seventh EVPN MAC route whose corresponding next hop is the fourth communication device), the first communication device separately generates EVPN MAC routes carrying different SRv6 SIDs (i.e., the second EVPN MAC route carrying the first SRv6 SID and the eighth EVPN MAC route carrying the fourth SRv6 SID) and sends the EVPN MAC routes to the third communication device. Thus, different next hop nodes may correspond to different SIDs. In this way, on the one hand, on an SRv6 network, different SIDs can be used to transmit Layer 2 packets to different next-hop nodes to facilitate load balancing; and on the other hand, on an SRv6 network, the next-hop node of a Layer 2 packet after the SRv6 packet is transmitted to a first communication device can be determined based on the SID carried in the SRv6 packet, thereby facilitating network management and maintenance.
[0070] In one possible design, the method further includes receiving, by the first communication device, a first VXLAN packet from the third communication device, the first VXLAN packet including the first VNI, the first VXLAN packet including a first Layer 2 packet whose destination address is the first MAC address. The first communication device determines a first SRv6 SID based on the first VNI. The first communication device performs SRv6 encapsulation on the first Layer 2 packet to obtain a first SRv6 packet, the first SRv6 packet including the first SRv6 SID. The first communication device forwards the first SRv6 packet to the second communication device.
[0071] In this design, when the first communication device receives a VXLAN packet carrying a first VNI from the VXLAN, the first communication device may decapsulate the VXLAN packet to obtain a Layer 2 packet, and re-encapsulate the Layer 2 packet as an SRv6 packet including the first SRv6 SID, thereby implementing forwarding of the Layer 2 packet using the SRv6 network. In this way, interconnection between the VXLAN and the SRv6 network is implemented.
[0072] In one possible design, the step of the first communication device determining the first SRv6 SID based on the first VNI includes the first communication device determining a first EVPN instance based on the first VNI, and the first communication device determining the first SRv6 SID from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first SRv6 SID.
[0073] According to the above design, when the first communication device receives a VXLAN packet carrying a first VNI from a VXLAN, the first communication device may determine a first EVPN instance based on the first VNI, and then find a correspondence between the first MAC address and a first SRv6 SID from a MAC table corresponding to the first EVPN instance to determine the first SRv6 SID, and encapsulate the Layer 2 packet into an SRv6 packet carrying the first SRv6 SID for forwarding, thereby completing forwarding of the Layer 2 packet.
[0074] In one possible design, the method further includes the first communication device receiving, from the third communication device, a second VXLAN packet including a second VNI, the second VXLAN packet including a second Layer 2 packet whose destination address is a second MAC address. The first communication device determines a second EVPN instance based on the second VNI. The first communication device determines a second SRv6 SID from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second SRv6 SID. The first communication device performs SRv6 encapsulation on the second Layer 2 packet to obtain a second SRv6 packet, the second SRv6 packet including the second SRv6 SID. The first communication device forwards the second SRv6 packet.
[0075] In the above design, after receiving SRv6 packets carrying different VNIs (e.g., a first VXLAN packet carrying a first VNI and a second VXLAN packet carrying a second VNI) from VXLAN, the first communication device may first determine an EVPN instance based on the VNIs carried in the VXLAN packets (e.g., determine the first EVPN instance based on the first VNI or determine the second EVPN instance based on the second VNI), determine a forwarding entry for the Layer 2 packet by using the corresponding EVPN instance, and complete VXLAN encapsulation and forwarding of the Layer 2 packet.
[0076] In one possible design, the first communications device determining the first SRv6 SID based on the first VNI includes the first communications device determining the first SRv6 SID based on the first VNI and a correspondence between the first VNI and the first SRv6 SID, recorded in the first communications device.
[0077] According to the above design, the first communication device can quickly determine a first SRv6 SID corresponding to a first VNI. Furthermore, after receiving a VXLAN packet from a VXLAN, the first communication device may first quickly determine a first SRv6 SID based on the first VNI carried in the VXLAN packet, and complete encapsulation of the SRv6 packet for forwarding based on the first SRv6 SID.
[0078] In one possible design, the method further includes receiving, by the first communication device, a third VXLAN packet from the third communication device, the third VXLAN packet including a third Layer 2 packet whose destination address is the third MAC address. The first communication device determines the first SRv6 SID based on the third VNI and a correspondence between the third VNI and the first SRv6 SID recorded in the first communication device. The first communication device performs SRv6 encapsulation on the third Layer 2 packet to obtain a third SRv6 packet, the third SRv6 packet including the first SRv6 SID. The first communication device forwards the third SRv6 packet to the second communication device.
[0079] According to the above design, after receiving VXLAN packets corresponding to different MAC addresses and different VNIs (i.e., a first VXLAN packet corresponding to a first MAC address and a third VXLAN packet corresponding to a third MAC address, where the different MAC addresses correspond to different VNIs), the first communication device may separately determine SRv6 SIDs based on the different VNIs carried in the VXLAN packets and encapsulate the SRv6 packets. The different MAC addresses correspond to different VNIs. Thus, on the one hand, on VXLAN, the different VNIs may be used to transmit Layer 2 packets from different MAC addresses to facilitate load balancing; and on the other hand, on VXLAN, the destination address of the VXLAN packet may be determined based on the VNI carried in the VXLAN packet, which may facilitate network management and maintenance.
[0080] In one possible design, the method further includes receiving, by the first communication device, a fourth VXLAN packet from the third communication device, the fourth VXLAN packet including a fourth VNI, the fourth VXLAN packet including a fourth Layer 2 packet whose destination address is the first MAC address. The first communication device determines the first SRv6 SID based on the fourth VNI and a correspondence between the fourth VNI and the first SRv6 SID recorded in the first communication device. The first communication device performs SRv6 encapsulation on the fourth Layer 2 packet to obtain a fourth SRv6 packet, the fourth SRv6 packet including the first SRv6 SID. The first communication device forwards the fourth SRv6 packet to the fourth communication device.
[0081] According to the above design, after receiving VXLAN packets corresponding to different next hop nodes and different VNIs (i.e., a first VXLAN packet corresponding to a second communication device and a third VXLAN packet corresponding to a fourth communication device, where different MAC addresses correspond to different SRv6 SIDs), the first communication device may separately determine a first SRv6 SID based on the different VNIs carried in the VXLAN packets and encapsulate the VXLAN packets. The different next hops correspond to different VNIs. Thus, on the one hand, on the SRv6 network, different VNIs may be used to transmit Layer 2 packets to facilitate load balancing; and on the other hand, on VXLAN, the next hop node of a Layer 2 packet after the VXLAN packet is transmitted to the first communication device may be determined based on the VNI carried in the VXLAN packet, which may facilitate network management and maintenance.
[0082] In a possible design, both the first communication device and the second communication device are each data center gateways.
[0083] According to a fourth aspect, a communication method is provided. The method includes: a first communication device receiving a first virtual extensible local area network (VXLAN) packet from a second communication device, the first VXLAN packet including a first virtual extensible local area network (VNI), the first VXLAN packet including a first Layer 2 packet whose destination address is a first medium access control (MAC) address; the first communication device determining a first segment routing over IPv6 segment identifier (SRv6 SID) based on the first VNI; the first communication device performing SRv6 encapsulation on the first Layer 2 packet to obtain a first SRv6 packet, the first SRv6 packet including the first SRv6 SID; and the first communication device forwarding the first SRv6 packet to a third communication device.
[0084] In this design, when the first communication device receives a VXLAN packet carrying a first VNI from the VXLAN, the first communication device may decapsulate the VXLAN packet to obtain a Layer 2 packet, and re-encapsulate the Layer 2 packet as an SRv6 packet including the first SRv6 SID, thereby implementing forwarding of the Layer 2 packet using the SRv6 network. In this way, interconnection between the VXLAN and the SRv6 network is implemented.
[0085] In a possible design, the first VNI is a VNI assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0086] According to the above design, when the first communication device receives a VXLAN packet carrying a first VNI from a VXLAN, it may first determine a first EVPN instance based on the first VNI, and then determine a forwarding entry corresponding to the Layer 2 packet by using the first EVPN instance to complete forwarding of the Layer 2 packet.
[0087] In a possible design, the first communications device determining a first segment routing over IPv6 segment identifier (SRv6 SID) based on the first VNI includes the first communications device determining a first EVPN instance based on the first VNI; and the first communications device determining a first SRv6 SID from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first SRv6 SID.
[0088] According to the above design, when the first communication device receives a VXLAN packet carrying a first VNI from a VXLAN, the first communication device may determine a first EVPN instance based on the first VNI, and then find a correspondence between the first MAC address and a first SRv6 SID from a MAC table corresponding to the first EVPN instance to determine the first SRv6 SID, and encapsulate the Layer 2 packet into an SRv6 packet carrying the first SRv6 SID for forwarding, thereby completing forwarding of the Layer 2 packet.
[0089] In a possible design, the method further includes: the first communications device receiving, from the second communications device, a second VXLAN packet including a second VNI, where the second VXLAN packet includes a second Layer 2 packet whose destination address is a second MAC address; the first communications device determining a second EVPN instance based on the second VNI; the first communications device determining a second SRv6 SID from a MAC table corresponding to the second EVPN instance based on the second MAC address, where the MAC table includes a correspondence between the second MAC address and the second SRv6 SID; the first communications device performing SRv6 encapsulation on the second Layer 2 packet to obtain a second SRv6 packet, where the second SRv6 packet includes the second SRv6 SID; and the first communications device forwarding the second SRv6 packet.
[0090] In the above design, after receiving SRv6 packets carrying different VNIs (e.g., a first VXLAN packet carrying a first VNI and a second VXLAN packet carrying a second VNI) from VXLAN, the first communication device may first determine an EVPN instance based on the VNIs carried in the VXLAN packets (e.g., determine the first EVPN instance based on the first VNI or determine the second EVPN instance based on the second VNI), determine a forwarding entry for the Layer 2 packet by using the corresponding EVPN instance, and complete VXLAN encapsulation and forwarding of the Layer 2 packet.
[0091] In a possible design, the first communications device determining a first segment routing over IPv6 segment identifier (SRv6 SID) based on the first VNI includes the first communications device determining the first SRv6 SID based on the first VNI and a correspondence between the first VNI and the first SRv6 SID, recorded in the first communications device.
[0092] According to the above design, the first communication device can quickly determine a first SRv6 SID corresponding to a first VNI. Furthermore, after receiving a VXLAN packet from a VXLAN, the first communication device may first quickly determine a first SRv6 SID based on the first VNI carried in the VXLAN packet, and complete encapsulation of the SRv6 packet for forwarding based on the first SRv6 SID.
[0093] In a possible design, the method further includes: the first communications device receiving, from the second communications device, a third VXLAN packet including a third VNI, where the third VXLAN packet includes a third Layer 2 packet whose destination address is a third MAC address; the first communications device determining a first SRv6 SID based on the third VNI and a correspondence between the third VNI and the first SRv6 SID, recorded in the first communications device; the first communications device performing SRv6 encapsulation on the third Layer 2 packet to obtain a third SRv6 packet, where the third SRv6 packet includes the first SRv6 SID; and the first communications device forwarding the third SRv6 packet to the third communications device.
[0094] According to the above design, after receiving VXLAN packets corresponding to different MAC addresses and different VNIs (i.e., a first VXLAN packet corresponding to a first MAC address and a third VXLAN packet corresponding to a third MAC address, where the different MAC addresses correspond to different VNIs), the first communication device may separately determine SRv6 SIDs based on the different VNIs carried in the VXLAN packets and encapsulate the SRv6 packets. The different MAC addresses correspond to different VNIs. Thus, on the one hand, on VXLAN, the different VNIs may be used to transmit Layer 2 packets from different MAC addresses to facilitate load balancing; and on the other hand, on VXLAN, the destination address of the VXLAN packet may be determined based on the VNI carried in the VXLAN packet, which may facilitate network management and maintenance.
[0095] In a possible design, the method further includes: the first communications device receiving a fourth VXLAN packet from the second communications device, the fourth VXLAN packet including a fourth VNI, where the fourth VXLAN packet includes a fourth Layer 2 packet whose destination address is the first MAC address; the first communications device determining a first SRv6 SID based on the fourth VNI and a correspondence between the fourth VNI and the first SRv6 SID, recorded in the first communications device; the first communications device performing SRv6 encapsulation on the fourth Layer 2 packet to obtain a fourth SRv6 packet, where the fourth SRv6 packet includes the first SRv6 SID; and the first communications device forwarding the fourth SRv6 packet to the fourth communications device.
[0096] According to the above design, after receiving VXLAN packets corresponding to different next hop nodes and different VNIs (i.e., a first VXLAN packet corresponding to a third communication device and a third VXLAN packet corresponding to a fourth communication device, where different MAC addresses correspond to different SRv6 SIDs), the first communication device may separately determine a first SRv6 SID based on the different VNIs carried in the VXLAN packets and encapsulate the VXLAN packets. The different next hops correspond to different VNIs. Thus, on the one hand, on the SRv6 network, different VNIs may be used to transmit Layer 2 packets to facilitate load balancing; and on the other hand, on VXLAN, the next hop node of a Layer 2 packet after the VXLAN packet is transmitted to the first communication device may be determined based on the VNI carried in the VXLAN packet, which may facilitate network management and maintenance.
[0097] In a possible design, both the first communication device and the third communication device are each a data center gateway.
[0098] According to a fifth aspect, the present application provides a first communication device configured to implement the method performed by the first communication device in any one of the first aspect and possible implementations. Specifically, the first communication device includes a transceiver unit and a processing unit. The transceiver unit is configured to perform receiving and / or transmitting operations performed by the first communication device, and the processing unit is configured to perform operations other than the operations performed by the transceiver unit.
[0099] In one possible design, the transceiver unit is configured to receive a first Ethernet Virtual Private Network (EVPN) MAC route from a second communication device, the first EVPN MAC route carrying a first MAC address and a first Virtual Extensible Local Area Network (VNI). The processing unit is configured to generate a second EVPN MAC route based on the first EVPN MAC route, the second EVPN MAC route carrying the first MAC address and a first Segment Routing over IPv6 segment identifier (SRv6 SID) of the first communication device and corresponding to the first VNI. The transceiver unit is further configured to transmit the second EVPN MAC route to a third communication device.
[0100] In a possible design, the first SRv6 SID is an SRv6 SID assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0101] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first VNI.
[0102] In a possible design, the transceiver unit is further configured to receive a third EVPN MAC route, the third EVPN MAC route carrying a second MAC address and a second VNI, the third EVPN MAC route corresponding to a second EVPN instance of the first communication device; the processing unit is further configured to generate a fourth EVPN MAC route based on the third EVPN MAC route, the fourth EVPN MAC route carrying the second MAC address and a second SRv6 SID, the second SRv6 SID being an SRv6 SID assigned to the second EVPN instance; and the transceiver unit is further configured to transmit the fourth EVPN MAC route to the third communication device.
[0103] In a possible design, the processing unit is further configured to record, by the first communication device, a correspondence between the first SRv6 SID and the first VNI.
[0104] In a possible design, the first SRv6 SID is associated with a first operation, and the first operation is performing a Virtual Extensible Local Area Network (VXLAN) encapsulation.
[0105] In a possible design, the transceiver unit is further configured to receive a fifth EVPN MAC route, the fifth EVPN MAC route carrying the third MAC address and the first VNI; the processing unit is further configured to generate a sixth EVPN MAC route based on the fifth EVPN MAC route, the sixth EVPN MAC route carrying the third MAC address and a third SRv6 SID corresponding to the first VNI; and the first communication device transmits the sixth EVPN MAC route to the third communication device.
[0106] In a possible design, the transceiver unit is further configured to receive a seventh EVPN MAC route from the fourth communication device, the seventh EVPN MAC route carrying the first MAC address and the first VNI; the processing unit is further configured to generate an eighth EVPN MAC route based on the seventh EVPN MAC route, the eighth EVPN MAC route carrying the first MAC address and a fourth SRv6 SID corresponding to the first VNI; and the transceiver unit is further configured to transmit the eighth EVPN MAC route to the third communication device.
[0107] In a possible design, the transceiver unit is further configured to receive a first SRv6 packet from the third communication device, the SRv6 packet having a destination address of the first SRv6 SID, the SRv6 packet including a first Layer 2 packet having a destination address of the first MAC address; the processing unit is further configured to determine a first VNI based on the first SRv6 SID; the processing unit is further configured to perform VXLAN encapsulation on the first Layer 2 packet to obtain a first VXLAN packet, the first VXLAN packet including the first VNI; and the transceiver unit is further configured to forward the first VXLAN packet to the second communication device.
[0108] In a possible design, the processing unit being further configured to determine the first VNI based on the first SRv6 SID includes the processing unit being further configured to determine a first EVPN instance based on the first SRv6 SID; and the processing unit being further configured to determine the first VNI from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first VNI.
[0109] In a possible design, the processing unit is further configured to receive a second SRv6 packet from the third communication device, the second SRv6 packet having a destination address of the second SRv6 SID, the second SRv6 packet including a second Layer 2 packet having a destination address of the second MAC address; the processing unit is further configured to determine a second EVPN instance based on the second SRv6 SID; the processing unit is further configured to determine a second VNI from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second VNI; the first communication device performs VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet, the second VXLAN packet including the second VNI; and the transceiver unit is further configured to forward the second VXLAN packet.
[0110] In a possible design, the processing unit further configured to determine the first VNI based on the first SRv6 SID includes the processing unit further configured to determine the first VNI based on the first SRv6 SID and a correspondence between the first SRv6 SID and the first VNI, recorded in the first communication device.
[0111] In a possible design, the transceiver unit is further configured to receive a third SRv6 packet from the third communication device, the third SRv6 packet having a destination address of the third SRv6 SID, the third SRv6 packet including a third Layer 2 packet having a destination address of the third MAC address; the processing unit is further configured to determine the first VNI based on the third SRv6 SID and a correspondence between the third SRv6 SID and the first VNI recorded in the first communication device; the processing unit is further configured to perform VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet, the third VXLAN packet including the first VNI; and the transceiver unit is further configured to forward the third VXLAN packet to the second communication device.
[0112] In a possible design, the transceiver unit is further configured to receive a fourth SRv6 packet from the third communication device, the fourth SRv6 packet having a destination address of the fourth SRv6 SID, the fourth SRv6 packet including a fourth Layer 2 packet having a destination address of the first MAC address; the processing unit is further configured to determine the first VNI based on the fourth SRv6 SID and a correspondence between the fourth SRv6 SID and the first VNI recorded in the first communication device; the processing unit is further configured to perform VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet, the fourth VXLAN packet including the first VNI; and the transceiver unit is further configured to forward the fourth VXLAN packet to the fourth communication device.
[0113] In a possible design, both the first communication device and the second communication device are each data center gateways.
[0114] According to a sixth aspect, the present application provides a first communication device configured to implement the method performed by the first communication device of the second aspect and any one of the possible implementations. Specifically, the first communication device includes a transceiver unit and a processing unit. The transceiver unit is configured to perform the receiving operation and / or the transmitting operation performed by the first communication device, and the processing unit is configured to perform operations other than the operations performed by the transceiver unit.
[0115] In a possible design, the transceiver unit is configured to receive a first SRv6 packet from the second communication device, the first SRv6 packet having a destination address that is a first segment routing over IPv6 segment identifier (SRv6 SID), the first SRv6 packet including a first Layer 2 packet having a destination address that is a first medium access control (MAC) address; the processing unit is configured to determine a first virtual extensible local area network identifier (VNI) based on the first SRv6 SID; the processing unit is further configured to perform virtual extensible local area network (VXLAN) encapsulation on the first Layer 2 packet to obtain a first VXLAN packet, the first VXLAN packet including the first VNI; and the transceiver unit is further configured to forward the first VXLAN packet to the third communication device.
[0116] In a possible design, the first SRv6 SID is an SRv6 SID assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0117] In a possible design, the processing unit being configured to determine the first VNI based on the first SRv6 SID includes the processing unit being configured to determine the first EVPN instance based on the first SRv6 SID; the processing unit being configured to determine the first VNI from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first VNI.
[0118] In a possible design, the transceiver unit is further configured to receive a second SRv6 packet from the second communication device, the second SRv6 packet having a destination address of the second SRv6 SID, the second SRv6 packet including a second Layer 2 packet having a destination address of the second MAC address; the processing unit is further configured to determine a second EVPN instance based on the second SRv6 SID; the processing unit is further configured to determine a second VNI from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second VNI; the processing unit is further configured to perform VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet, the second VXLAN packet including the second VNI; and the transceiver unit is further configured to forward the second VXLAN packet.
[0119] In a possible design, the processing unit being configured to determine the first VNI based on the first SRv6 SID includes the processing unit being configured to determine the first VNI based on the first SRv6 SID and a correspondence between the first SRv6 SID and the first VNI, recorded in the first communication device.
[0120] In a possible design, the first SRv6 SID is associated with a first operation, and the first operation is performing VXLAN encapsulation.
[0121] In a possible design, the transceiver unit is further configured to receive a third SRv6 packet from the second communication device, the third SRv6 packet having a destination address of the third SRv6 SID, the third SRv6 packet including a third Layer 2 packet having a destination address of the third MAC address; the processing unit is further configured to determine the first VNI based on the third SRv6 SID and a correspondence between the third SRv6 SID and the first VNI recorded in the first communication device; the processing unit is further configured to perform VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet, the third VXLAN packet including the first VNI; and the transceiver unit is further configured to forward the third VXLAN packet to the third communication device.
[0122] In a possible design, the transceiver unit is further configured to receive a fourth SRv6 packet from the second communication device, the fourth SRv6 packet having a destination address of the fourth SRv6 SID, the fourth SRv6 packet including a fourth Layer 2 packet having a destination address of the first MAC address; the processing unit is further configured to determine the first VNI based on the fourth SRv6 SID and a correspondence between the fourth SRv6 SID and the first VNI recorded in the first communication device; the processing unit is further configured to perform VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet, the fourth VXLAN packet including the first VNI; and the transceiver unit is further configured to forward the fourth VXLAN packet to the fourth communication device.
[0123] In a possible design, both the first communication device and the third communication device are each a data center gateway.
[0124] According to a seventh aspect, the present application provides a first communication device configured to implement the method performed by the first communication device of the third aspect and any one of the possible implementations. Specifically, the first communication device includes a transceiver unit and a processing unit. The transceiver unit is configured to perform the receiving operation and / or the transmitting operation performed by the first communication device, and the processing unit is configured to perform operations other than the operations performed by the transceiver unit.
[0125] In a possible design, the transceiver unit is configured to receive a first Ethernet Virtual Private Network Medium Access Control (EVPN) MAC route from the second communication device, the first EVPN MAC route carrying a first MAC address and a first SRv6 SID; the processing unit is configured to generate a second EVPN MAC route based on the first EVPN MAC route, the second EVPN MAC route carrying the first MAC address and a first Virtual Extensible Local Area Network Identifier (VNI) corresponding to the first SRv6 SID; and the transceiver unit is further configured to transmit the second EVPN MAC route to the third communication device.
[0126] In a possible design, the first VNI is a VNI assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0127] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first SRv6 SID.
[0128] In a possible design, the transceiver unit is further configured to receive a third EVPN MAC route, the third EVPN MAC route carrying a second MAC address and a second SRv6 SID, the third EVPN MAC route corresponding to a second EVPN instance; the processing unit is further configured to generate a fourth EVPN MAC route based on the third EVPN MAC route, the fourth EVPN MAC route carrying the second MAC address and a second VNI, the second VNI being a VNI assigned to the second EVPN instance; and the transceiver unit is further configured to transmit the fourth EVPN MAC route to a third communication device.
[0129] In a possible design, the processing unit is further configured to record a correspondence between the first VNI and the first SRv6 SID.
[0130] In a possible design, the transceiver unit is further configured to receive a fifth EVPN MAC route, the fifth EVPN MAC route carrying the third MAC address and the first SRv6 SID; the processing unit is further configured to generate a sixth EVPN MAC route based on the fifth EVPN MAC route, the sixth EVPN MAC route carrying the third MAC address and a third VNI corresponding to the first SRv6 SID; and the transceiver unit is further configured to transmit the sixth EVPN MAC route to the third communication device.
[0131] In a possible design, the transceiver unit is further configured to receive a seventh EVPN MAC route from the fourth communication device, the seventh EVPN MAC route carrying the first MAC address and the first SRv6 SID; the processing unit is further configured to generate an eighth EVPN MAC route based on the seventh EVPN MAC route, the eighth EVPN MAC route carrying the first MAC address and a fourth VNI corresponding to the first SRv6 SID; and the transceiver unit is further configured to transmit the eighth EVPN MAC route to the third communication device.
[0132] In a possible design, the transceiver unit is further configured to receive a first VXLAN packet from the third communication device, the first VXLAN packet including the first VNI, the first VXLAN packet including a first Layer 2 packet whose destination address is the first MAC address; the processing unit is further configured to generate a first SRv6 SID based on the first VNI; the processing unit is further configured to perform SRv6 encapsulation on the first Layer 2 packet to obtain a first SRv6 packet, the first SRv6 packet including the first SRv6 SID; and the transceiver unit is further configured to forward the first SRv6 packet to the second communication device.
[0133] In a possible design, the processing unit being further configured to determine the first SRv6 SID based on the first VNI includes the processing unit being further configured to determine the first EVPN instance based on the first VNI; and the processing unit being further configured to determine the first SRv6 SID from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first SRv6 SID.
[0134] In a possible design, the transceiver unit is further configured to receive a second VXLAN packet from the third communication device, the second VXLAN packet including a second Layer 2 packet whose destination address is a second MAC address; the processing unit is further configured to determine a second EVPN instance based on the second VNI; the processing unit is further configured to determine a second SRv6 SID from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second SRv6 SID; the processing unit is further configured to perform SRv6 encapsulation on the second Layer 2 packet to obtain a second SRv6 packet, the second SRv6 packet including the second SRv6 SID; and the transceiver unit is further configured to forward the second SRv6 packet.
[0135] In a possible design, the processing unit being further configured to determine the first SRv6 SID based on the first VNI includes the processing unit being further configured to determine the first SRv6 SID based on the first VNI and a correspondence between the first VNI and the first SRv6 SID, recorded in the first communication device.
[0136] In a possible design, the transceiver unit is further configured to receive a third VXLAN packet from the third communication device, the third VXLAN packet including a third VNI, the third VXLAN packet including a third Layer 2 packet whose destination address is a third MAC address; the processing unit is further configured to determine a first SRv6 SID based on the third VNI and a correspondence between the third VNI and the first SRv6 SID recorded in the first communication device; the processing unit is further configured to perform SRv6 encapsulation on the third Layer 2 packet to obtain a third SRv6 packet, the third SRv6 packet including the first SRv6 SID; and the transceiver unit is further configured to forward the third SRv6 packet to the second communication device.
[0137] In a possible design, the transceiver unit is further configured to receive a fourth VXLAN packet from the third communication device, the fourth VXLAN packet including a fourth VNI, the fourth VXLAN packet including a fourth Layer 2 packet whose destination address is the first MAC address; the processing unit is further configured to determine a first SRv6 SID based on the fourth VNI and a correspondence between the fourth VNI and the first SRv6 SID recorded in the first communication device; the processing unit is further configured to perform SRv6 encapsulation on the fourth Layer 2 packet to obtain a fourth SRv6 packet, the fourth SRv6 packet including the first SRv6 SID; and the transceiver unit is further configured to forward the fourth SRv6 packet to the fourth communication device.
[0138] In a possible design, both the first communication device and the second communication device are each data center gateways.
[0139] According to an eighth aspect, the present application provides a first communication device configured to implement the method performed by the first communication device in the fourth aspect and any one of the possible implementations. Specifically, the first communication device includes a transceiver unit and a processing unit. The transceiver unit is configured to perform the receiving operation and / or the transmitting operation performed by the first communication device, and the processing unit is configured to perform operations other than the operations performed by the transceiver unit.
[0140] In a possible design, the transceiver unit is configured to receive a first virtual extensible local area network (VXLAN) packet from the second communication device, the first VXLAN packet including a first virtual extensible local area network identifier (VNI), the first VXLAN packet including a first Layer 2 packet whose destination address is a first medium access control (MAC) address; the processing unit is configured to determine a first segment routing over IPv6 segment identifier (SRv6 SID) based on the first VNI; the processing unit is further configured to perform SRv6 encapsulation on the first Layer 2 packet to obtain a first SRv6 packet, the first SRv6 packet including the first SRv6 SID; and the transceiver unit is further configured to forward the first SRv6 packet to the third communication device.
[0141] In a possible design, the first VNI is a VNI assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0142] In a possible design, the processing unit configured to determine a first segment routing over IPv6 segment identifier (SRv6 SID) based on the first VNI includes the processing unit configured to determine a first EVPN instance based on the first VNI; and the processing unit configured to determine a first SRv6 SID from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first SRv6 SID.
[0143] In a possible design, the transceiver unit is further configured to receive a second VXLAN packet from the second communication device, the second VXLAN packet including a second Layer 2 packet whose destination address is a second MAC address; the processing unit is further configured to determine a second EVPN instance based on the second VNI; the processing unit is further configured to determine a second SRv6 SID from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second SRv6 SID; the processing unit is further configured to perform SRv6 encapsulation on the second Layer 2 packet to obtain a second SRv6 packet, the second SRv6 packet including the second SRv6 SID; and the transceiver unit is further configured to forward the second SRv6 packet.
[0144] In a possible design, the processing unit configured to determine the first segment routing over IPv6 segment identifier (SRv6 SID) based on the first VNI includes the processing unit configured to determine the first SRv6 SID based on the first VNI and a correspondence between the first VNI and the first SRv6 SID, recorded in the first communication device.
[0145] In a possible design, the transceiver unit is further configured to receive a third VXLAN packet from the second communication device, the third VXLAN packet including a third VNI, the third VXLAN packet including a third Layer 2 packet whose destination address is a third MAC address; the processing unit is further configured to determine a first SRv6 SID based on the third VNI and a correspondence between the third VNI and the first SRv6 SID recorded in the first communication device; the processing unit is further configured to perform SRv6 encapsulation on the third Layer 2 packet to obtain a third SRv6 packet, the third SRv6 packet including the first SRv6 SID; and the transceiver unit is further configured to forward the third SRv6 packet to the third communication device.
[0146] In a possible design, the transceiver unit is further configured to receive a fourth VXLAN packet from the second communication device, the fourth VXLAN packet including a fourth VNI, the fourth VXLAN packet including a fourth Layer 2 packet whose destination address is the first MAC address; the processing unit is further configured to determine a first SRv6 SID based on the fourth VNI and a correspondence between the fourth VNI and the first SRv6 SID recorded in the first communication device; the processing unit is further configured to perform SRv6 encapsulation on the fourth Layer 2 packet to obtain a fourth SRv6 packet, the fourth SRv6 packet including the first SRv6 SID; and the transceiver unit is further configured to forward the fourth SRv6 packet to the fourth communication device.
[0147] In a possible design, both the first communication device and the third communication device are each a data center gateway.
[0148] According to a ninth aspect, there is provided a communication device including a processor and an interface, wherein the processor receives or transmits data through the interface, and the processor is configured to implement a method according to the first aspect or any design in the first aspect, the second aspect or any design in the second aspect, the third aspect or any design in the third aspect, or the fourth aspect or any design in the fourth aspect.
[0149] According to a tenth aspect, there is provided a communication system including a first data center gateway and a second data center gateway, wherein the first data center gateway is configured to implement a method according to the first aspect or any design in the first aspect, or the second aspect or any design in the second aspect, and the second data center gateway is configured to implement a method according to the third aspect or any design in the third aspect, or the fourth aspect or any design in the fourth aspect.
[0150] According to an eleventh aspect, there is provided a computer-readable storage medium storing instructions that, when executed on a processor, implement a method according to the first aspect or any design in the first aspect, the second aspect or any design in the second aspect, the third aspect or any design in the third aspect, or the fourth aspect or any design in the fourth aspect.
[0151] According to a twelfth aspect, there is provided a computer program product comprising instructions that, when executed on a processor, implement a method according to the first aspect or any design in the first aspect, the second aspect or any design in the second aspect, the third aspect or any design in the third aspect, or the fourth aspect or any design in the fourth aspect. [Brief explanation of the drawings]
[0152] [Figure 1]1 is a schematic diagram of a network architecture according to an embodiment of the present application;
[0153] [Figure 2] 1 is a schematic flowchart 1 of a communication method according to an embodiment of the present application;
[0154] [Figure 3] 2 is a schematic flowchart 2 of a communication method according to an embodiment of the present application;
[0155] [Figure 4] 3 is a schematic flowchart 3 of a communication method according to an embodiment of the present application;
[0156] [Figure 5A] 4 is a schematic flowchart 4 of a communication method according to an embodiment of the present application. [Figure 5B] 4 is a schematic flowchart 4 of a communication method according to an embodiment of the present application.
[0157] [Figure 6] 2 is a schematic diagram of a network architecture according to an embodiment of the present application;
[0158] [Figure 7A] 5 is a schematic flowchart 5 of a communication method according to an embodiment of the present application. [Figure 7B] 5 is a schematic flowchart 5 of a communication method according to an embodiment of the present application.
[0159] [Figure 8A] 6 is a schematic flowchart 6 of a communication method according to an embodiment of the present application. [Figure 8B] 6 is a schematic flowchart 6 of a communication method according to an embodiment of the present application.
[0160] [Figure 9] 7 is a schematic flowchart 7 of a communication method according to an embodiment of the present application.
[0161] [Figure 10(a)] 3 is a schematic diagram of a network architecture according to an embodiment of the present application; [Figure 10(b)] 3 is a schematic diagram of a network architecture according to an embodiment of the present application;
[0162] [Figure 11A] 8 is a schematic flowchart 8 of a communication method according to an embodiment of the present application. [Figure 11B] 8 is a schematic flowchart 8 of a communication method according to an embodiment of the present application.
[0163] [Figure 12] 9 is a schematic flowchart 9 of a communication method according to an embodiment of the present application.
[0164] [Figure 13] 1 is a schematic flowchart 10 of a communication method according to an embodiment of the present application.
[0165] [Figure 14] 1 is a schematic flowchart 11 of a communication method according to an embodiment of the present application.
[0166] [Figure 15] 1 is a schematic flowchart 12 of a communication method according to an embodiment of the present application.
[0167] [Figure 16] 1 is a schematic flowchart 13 of a communication method according to an embodiment of the present application.
[0168] [Figure 17] 1 is a schematic flowchart 14 of a communication method according to an embodiment of the present application.
[0169] [Figure 18] 1 is a schematic flowchart 15 of a communication method according to an embodiment of the present application.
[0170] [Figure 19] 1 is a schematic flowchart 16 of a communication method according to an embodiment of the present application.
[0171] [Figure 20] 1 is a schematic flowchart 17 of a communication method according to an embodiment of the present application.
[0172] [Figure 21] 1 is a schematic flowchart 18 of a communication method according to an embodiment of the present application.
[0173] [Figure 22] 1 is a schematic diagram 1 of the structure of a communication device according to an embodiment of the present application;
[0174] [Figure 23] 2 is a schematic diagram of the structure of a communication device according to an embodiment of the present application;
[0175] [Figure 24] 3 is a schematic diagram of the structure of a communication device according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION
[0176] The following describes the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. To clearly describe the technical solutions in the embodiments of the present application, terms such as "first" and "second" are used in the embodiments of the present application to distinguish between identical items or similar items having essentially the same function or purpose. Those skilled in the art will understand that terms such as "first" and "second" do not constitute limitations on the number or execution sequence, and terms such as "first" and "second" do not indicate clear distinctions. In addition, in the embodiments of the present application, terms such as "example" or "for example" are used to represent an example, illustration, or explanation. Any embodiment or design scheme described as "example" or "for example" in the multiple embodiments of the present application should not be described as being preferred or having more advantages than another embodiment or design scheme. Strictly speaking, the use of terms such as "example" or "for example" is intended to present a relative concept in a specific way for ease of understanding.
[0177] First, the related art in the embodiment of the present application will be described.
[0178] 1. Virtual extensible local area network (VXLAN) is a virtual network technology that overlays a Layer 2 network on a Layer 3 network. Currently, VXLAN is typically used within data centers to implement interconnections between tenants.
[0179] A Layer 2 network is a network constructed by a core layer and an access layer. A Layer 2 network is typically used to implement communication through media access control (MAC) addressing in the same collision domain. A Layer 3 network is a network that includes a core layer, an aggregation layer, and an access layer. A Layer 3 network can implement communication between network segments by using Internet Protocol (IP) routes across multiple collision domains.
[0180] Based on existing IP networks, VXLAN provides Layer 2 interconnection for distributed physical sites and can isolate services of different tenants. Specifically, in VXLAN, VXLAN tunnels may be established on Layer 3 networks between VXLAN tunnel endpoints (VTEPs), and Layer 2 network-based interconnections may be performed through the VXLAN tunnels among tenants corresponding to the same virtual extensible local area network identifier (VXLAN identifier, VNI).
[0181] 2. Segment routing over IPv6 (SRv6) is an SR technology based on the IPv6 forwarding plane. SRv6 combines the source routing advantages of SR with the simplicity and scalability of IPv6, and is increasingly being applied to various border gateway protocol (BGP) services.
[0182] In IPv6 networks, a segment identifier (SID) is used as an identifier (segment) in a route. The SID includes a locator field used to route and forward data packets, and a function field used to identify the forwarding operation to be performed by the communication device. Thus, SRv6 has both routing and MPLS forwarding attributes.
[0183] 3. Ethernet virtual private network (EVPN) is a Layer 2 network-based VPN technology. Currently, EVPN is typically used to transmit MAC routing information and IP routing information, and is used as the control layer of overlay networks, such as VXLAN or SRv6.
[0184] To facilitate understanding of the technical solutions provided in the embodiments of the present application, the following describes application scenarios of the embodiments of the present application.
[0185] At present, MPLS network is generally used in the related technology to implement interconnection between different data centers.However, since SRv6 network is increasingly widely used, in this embodiment, if data centers can be interconnected by using SRv6 network, it can reduce the construction cost of data centers and improve the construction speed of data centers, etc.
[0186] For the above-mentioned problem, this embodiment provides a network architecture. An SRv6 network can be used to implement interconnection between data centers. Figure 1 is a schematic diagram of a network architecture according to one embodiment. It includes data center A and data center B. Data exchange is performed between data center A and data center B by using a VXLAN. A data center interconnect (DCI) is implemented between data center A and data center B by using an SRv6 network.
[0187] Specifically, the data center A includes multiple switches configured to establish a VXLAN, such as top-of-rack (TOR) switches. For example, a communication device 103 and a communication device 107 are used as examples in the figure.
[0188] In a data center, a user terminal may be connected to one or more switches to exchange data with another user terminal in a VXLAN. Figure 1 is used as an example. A user terminal 109 may implement data exchange with another user terminal in a VXLAN by using a switch, such as communication device 103 or communication device 107.
[0189] When a user terminal is connected to multiple switches, different transmission paths corresponding to different switches may be load balanced through load sharing. For example, when the user terminal 109 is communicating with another user terminal, the user terminal 109 may communicate through the transmission path corresponding to the communication device 103, or may communicate through the transmission path corresponding to the communication device 107.
[0190] In a data center, the user terminal may specifically be a virtual machine (VM) running on a server or an entity hardware device. It may be understood that in some application scenarios, the TOR switch and the user terminal may be virtual machines running on the same server or different servers. In other application scenarios, the TOR switch may be an independent switch device. This may not be limited in this embodiment.
[0191] In addition, data center A further includes communication devices configured to interconnect with the SRv6 network, such as communication device 101 and communication device 105 in FIG. 1.
[0192] In one aspect, compared to the data center A, the communication device 101 and the communication device 105 are configured to implement the function of a data center gateway (DC-GW) of the data center A and implement the external interconnection of the data center A. In another aspect, compared to the DCI, the communication device 101 and the communication device 105 are each configured to implement the function of a provider edge (PE) router. Therefore, the communication device 101 and the communication device 105 can also each be considered as a DCI-PE in the DCI.
[0193] When the communication device 101 and the communication device 105 are each used as a DCI-PE in a DCI, the communication device 101 and the communication device 105 may each specifically be a superstratum PE (SPE). Correspondingly, the communication device 103 and the communication device 107 may each be an underlayer PE (UPE).
[0194] In addition, similar to the communication device 101 and the communication device 105 in the DCI, the DCI further includes the communication device 102 and the communication device 106. In one aspect, compared to the DCI, the communication device 102 and the communication device 106 are each configured to implement the function of a PE router. Therefore, the communication device 102 and the communication device 106 can each be considered as a DCI-PE of the DCI. In another aspect, the communication device 102 and the communication device 106 are each further used as a DC-GW for implementing the external interconnection of the data center B.
[0195] The communication device 101, the communication device 102, the communication device 105, and the communication device 106 can implement interconnection by using an SRv6 network.
[0196] In addition, data center B includes multiple switches configured to establish a VXLAN, such as TOR switches. For example, communication device 104 and communication device 108 are used as examples in the figure. In the data center, a user terminal may be connected to one or more switches to exchange data with another user terminal in the VXLAN. FIG. 1 is used as an example. User terminal 110 may implement data exchange with another user terminal in the VXLAN by using a switch, such as communication device 104 or communication device 108.
[0197] Additionally, when the communication device 102 and the communication device 106 are each used as a DCI-PE in a DCI, the communication device 102 and the communication device 106 may each specifically be a superstratum PE (SPE). Correspondingly, the communication device 104 and the communication device 108 may each be an underlayer PE (UPE).
[0198] It can be understood that for the description of each communication device and user terminal in data center B, reference should be made to the corresponding content described above for data center A. Here, the details will not be described again.
[0199] As described above, in the related art, currently, an MPLS network is typically used to implement interconnection between different data centers. Therefore, to implement the network architecture shown in FIG. 1, an interconnection between a VXLAN and an SRv6 network needs to be implemented. To solve this problem, this embodiment provides a communication method. This method can be applied to communication devices, such as the communication device 101, the communication device 102, the communication device 105, and the communication device 106 in FIG. 1.
[0200] In the communication method, when a communication device used as a DC-GW / DCI-PE in a data center on one side receives a VXLAN packet from a VXLAN, the communication device can decapsulate the VXLAN packet to obtain a Layer 2 packet, re-encapsulate the Layer 2 packet into a SRv6 packet that meets the requirements, and forward the SRv6 packet to a communication device used as a DC-GW / DCI-PE in a data center on the other side by using an SRv6 network. After the communication device in the data center on the other side receives the SRv6 packet that meets the requirements, the communication device can re-encapsulate the Layer 2 packet in the SRv6 packet as a VXLAN packet and forward the VXLAN packet to a corresponding user terminal.
[0201] With reference to an example, the following will describe in detail the communication method provided in this embodiment by using an example in which the user terminal 109 performs inter-datacenter interconnection with the user terminal 110 by using the communication device 103, the communication device 101, the communication device 102, and the communication device 104 in Figure 1.
[0202] First, the execution process of the control flow after the user terminal 109 accesses the VXLAN in the data center A will be described.
[0203] As shown in FIG. 2, the method may include the following steps.
[0204] S201: The communication device 103 recognizes the MAC address 1 of the user terminal 109 from the user terminal 109.
[0205] For example, after accessing the network, the user terminal 109 may actively transmit local MAC address 1 to the communication device 103 and communication device 107 connected to the user terminal 109, so that the communication device 103 and communication device 107 recognize the MAC address 1 of the user terminal 109.
[0206] Specifically, the communication device 103 recognizing MAC address 1 may include the communication device 103 recording the correspondence between the port of the user terminal 109 on the communication device 103 and MAC address 1 in a MAC table corresponding to a local EVPN instance (specifically, which may be an EVPN instance corresponding to an interface of the user terminal 109 on the communication device 103, hereinafter referred to as EVPN instance 1031).
[0207] S202: The communication device 103 transmits the EVPN MAC route 1 to the communication device 101.
[0208] EVPN MAC Route 1 carries MAC Address 1 and VNI 1. In addition, it can be understood that EVPN MAC Route 1 may further carry other information. For example, EVPN MAC Route 1 further carries next hop information. The next hop in this embodiment is the access address of the communication device 103.
[0209] For example, after the communication device 103 recognizes MAC address 1, it sends an EVPN MAC route (i.e., EVPN MAC route 1) to the communication device 101 by using the EVPN instance 1031 configured on the communication device 103. The EVPN MAC route carries MAC address 1 and the VNI (i.e., VNI 1) assigned to the EVPN instance 1031.
[0210] By using the carried MAC address 1 and VNI 1, EVPN MAC route 1 can instruct a Layer 2 packet whose destination address is MAC address 1 to be encapsulated into a VXLAN packet including VNI 1 and to forward the VXLAN packet to communication device 103.
[0211] S203: The communication device 101 generates an EVPN MAC route 2 based on the EVPN MAC route 1.
[0212] EVPN MAC Route 2 carries MAC Address 1 and SID1 corresponding to VNI1.
[0213] SID1 corresponds to VNI1, and this can be understood as the communication device 101 being able to determine the corresponding VNI1 based on SID1.
[0214] Specifically, when the communication device 101 allocates SIDs to different VNIs, the SIDs may be allocated in different implementations according to actual requirements. Specifically, this embodiment provides the following several implementations:
[0215] Implementation 1: Per EVPN instance per SID. The communication device 101 assigns different SIDs to different EVPN instances. For example, in S203, SID1 may be the SID assigned to the EVPN instance (the EVPN instance corresponds to VNI1) in the communication device 101. This implementation will be described in detail below with reference to the examples shown in FIGS. 4 to 8A and 8B.
[0216] Implementation 2: Per MAC Address Per SID. Different SIDs may be assigned to the same VNI and different MAC addresses in data center A. For example, in S203, SID1 may be the SID assigned to MAC address 1 by communication device 101. This implementation will be described in detail below in the examples shown in FIGS. 9, 10(a), and 11A and 11B to 13.
[0217] Implementation 3: Per SID per next hop. Different SIDs may be assigned to the same VNI and different next hop information in data center A. For example, in S203, SID1 may be the SID assigned to communication device 103 by communication device 101. This implementation will be described in detail below in the examples shown in FIGS. 9, 10(a), 14, and 15.
[0218] It can be understood that in the actual application process, the correspondence between VNI and SID can be established in ways other than the above three implementations. The specific implementation of the correspondence between VNI and SID does not need to be limited in this embodiment.
[0219] In addition, it can be understood that EVPN MAC Route 1 may further include other information, for example, the access address of the communication device 101.
[0220] By using the MAC address 1 and SID1 carried, EVPN MAC route 2 can instruct the encapsulation of a Layer 2 packet whose destination address is MAC address 1 into an SRv6 packet whose destination address is SID1, and to forward the SRv6 packet to communication device 101.
[0221] S204: The communication device 101 transmits the EVPN MAC route 2 to the communication device 102.
[0222] In this way, after receiving an SRv6 packet whose destination address is SID1 from the communication device 102, the communication device 101 can first determine VNI1 based on SID1. After decapsulating the SRv6 packet to obtain a Layer 2 packet (for example, a Layer 2 packet whose destination address is MAC address 1), the communication device 101 encapsulates the Layer 2 packet into a VXLAN packet including VNI1 according to the instructions of EVPN MAC route 1, and forwards the VXLAN packet to the communication device 103. Next, the communication device 103 forwards the Layer 2 packet to the user terminal 109, completing packet transmission.
[0223] S205: The communication device 102 generates an EVPN MAC route 3 based on the EVPN MAC route 2.
[0224] EVPN MAC Route 3 carries MAC Address 1 and VNI 2 corresponding to SID 1.
[0225] VNI2 corresponds to SID1, and this can be understood as the communication device 102 being able to determine the corresponding SID1 based on VNI2.
[0226] Specifically, when the communication device 102 allocates VNIs to different SIDs, the VNIs may be allocated in different implementations according to actual requirements. Specifically, this embodiment provides the following several implementations:
[0227] Implementation 1: Per EVPN instance per VNI. The communication device 102 assigns different VNIs to different EVPN instances. For example, in S205, VNI2 may be a VNI assigned to an EVPN instance (the EVPN instance corresponds to SID1) in the communication device 102. This implementation will be described in detail below with reference to the examples shown in FIGS. 4 to 8A and 8B.
[0228] Implementation 2: Per MAC Address Per VNI. Different VNIs may be assigned to different MAC addresses. For example, in S205, VNI2 may be the VNI assigned to MAC address1 by communication device 102. This implementation will be described in detail below in the examples shown in FIGS. 9, 10(a), and 11A and 11B to 13.
[0229] Implementation 3: Per next hop per VNI. Different VNIs may be assigned different next hop information. For example, in S203, VNI2 may be an SID assigned to communication device 101 by communication device 102. This implementation will be described in detail below in the examples shown in Figures 9, 10(a), 16, and 17.
[0230] It can be understood that in the actual application process, the correspondence between SID and VNI can be established in ways other than the above three implementations. The specific implementation of the correspondence between SID and VNI does not need to be limited in this embodiment.
[0231] Additionally, it may be understood that the EVPN MAC route 3 may further include other information, for example, the access address of the communication device 102.
[0232] EVPN MAC route 3 may instruct a Layer 2 packet whose destination address is MAC address 1 to be encapsulated into a VXLAN packet including VNI 2 by using MAC address 1 and VNI 2 to be carried, and to forward the VXLAN packet to communication device 102.
[0233] S206: The communication device 102 transmits the EVPN MAC route 3 to the communication device 104.
[0234] In this way, after receiving a VXLAN packet including VNI2 from the communication device 104, the communication device 102 can first determine SID1 based on VNI2. The communication device 102 decapsulates the VXLAN packet to obtain a Layer 2 packet (for example, a Layer 2 packet whose destination address is MAC address 1), and then encapsulates the Layer 2 packet into an SRv6 packet whose destination address is SID1 in accordance with the instructions of EVPN MAC route 2, and forwards the SRv6 packet to the communication device 101. Next, referring to the description in S204, the communication device 101 decapsulates the SRv6 packet, encapsulates the Layer 2 packet into a VXLAN packet, and forwards the VXLAN packet to the communication device 103. Next, the communication device 103 forwards the Layer 2 packet to the user terminal 109, completing packet transmission.
[0235] S207: The communication device 104 generates a MAC entry based on the EVPN MAC route 3.
[0236] For example, the communication device 104 generates a MAC entry in an EVPN instance (hereinafter referred to as EVPN instance 1041) corresponding to VNI2 configured on the communication device 104 based on EVPN MAC route 3. The MAC entry may include MAC address 1, VNI2, and the access address of the communication device 102. In this way, when the communication device 104 receives a Layer 2 packet forwarded by the user terminal 110 and whose destination address is MAC address 1, the communication device 104 may determine the EVPN instance 1041 based on the interface of the user terminal 110, and then find a MAC entry including MAC address 1, VNI2, and the access address of the communication device 102 from the MAC table corresponding to the EVPN instance 1041. Next, the communication device 104 may encapsulate the Layer 2 packet into a VXLAN packet including VNI2 and forward the VXLAN packet to the communication device 102.
[0237] With reference to the control flow execution process shown in FIG. 2, the process by which a user terminal 110 in data center B forwards a packet to a user terminal 109 in data center A will be described below.
[0238] As shown in FIG. 3, the method may include the following steps:
[0239] S301: The user terminal 110 transfers a Layer 2 packet 1 whose destination address is MAC address 1 to the communication device 104.
[0240] MAC address 1 is the MAC address of the user terminal 109 .
[0241] It can be understood that a layer 2 packet in this embodiment can be understood as a packet transmitted in a layer 2 network or a packet addressed by using a MAC address.
[0242] S302: The communication device 104 encapsulates the Layer 2 packet 1 into a VXLAN packet 1.
[0243] The communication device 104 may first determine the EVPN instance 1041 corresponding to the user terminal 110 based on the interface of the user terminal 110 on the communication device 104. Next, the communication device 104 searches the MAC table corresponding to the EVPN instance 1041 for a MAC entry based on MAC address 1. A MAC entry including MAC address 1, VNI 2, and the access address of the communication device 102 is found. Next, the communication device 104 encapsulates Layer 2 packet 1 into VXLAN packet 1 including VNI 2 and with a destination address of the communication device 102.
[0244] S303: The communication device 104 transfers the VXLAN packet 1 to the communication device 102.
[0245] As explained above, VXLAN packet 1 carries VNI 2 and Layer 2 packet 1 with destination address MAC address 1.
[0246] S304: The communication device 102 determines SID1 based on VNI2 in the VXLAN packet.
[0247] Specifically, as described above in S205, there is a correspondence between VNI2 and SID1, so the communication device 102 may determine SID1 based on VNI2.
[0248] S305: The communication device 102 performs SRv6 encapsulation on the Layer 2 packet 1 to obtain the SRv6 packet 1.
[0249] SRv6 packet 1 contains SID1.
[0250] For example, when a segment routing policy (SR policy) transmission method is used between the communication device 102 and the communication device 101, SID1 may be directly used as a destination address in the SRv6 packet 1. In another example, when a Segment Routing IPv6 Best Effort (SRv6 BE) transmission method is used between the communication device 102 and the communication device 101, SID1 is carried as a segment identifier in SRv6.
[0251] S306: The communication device 102 transfers the SRv6 packet 1 to the communication device 101.
[0252] S307: The communication device 101 determines VNI1 based on the destination address SID1 in the SRv6 packet1.
[0253] Specifically, as described above in 203, there is a correspondence between SID1 and VNI1, so the communication device 101 may determine VNI1 based on SID1.
[0254] S307: The communication device 101 performs VXLAN encapsulation on the Layer 2 packet 1 to obtain a VXLAN packet 2.
[0255] VXLAN packet 2 carries VNI 1.
[0256] S308: The communication device 101 transfers the VXLAN packet 2 to the communication device 103.
[0257] S309: The communication device 103 transfers the Layer 2 packet 1 in the VXLAN packet to the user terminal 109.
[0258] Specifically, after receiving a VXLAN packet, the communication device 103 decapsulates the VXLAN packet, then determines an EVPN instance (which may be the EVPN instance 1031 corresponding to the user terminal 109 described in S202) based on the VNI1 in the VXLAN packet, and further determines an interface (i.e., the interface of the user terminal 109) corresponding to the MAC address 1 in the found MAC entry in the MAC table corresponding to the EVPN instance 1031 based on the MAC address 1.
[0259] In the method shown in FIG. 3, a Layer 2 packet transmitted by a user terminal 110 in data center B may be forwarded to a user terminal 109 in data center A.
[0260] In some application scenarios, it is considered that communication devices on the transmission path (e.g., communication device 101, communication device 102, communication device 105, and communication device 106 in FIG. 1) may be configured with an EVPN instance used to control Layer 2 packet forwarding, or may not be configured with an EVPN instance used to control Layer 2 packet forwarding. The following describes in detail the communication methods provided in FIG. 2 and FIG. 3 in this embodiment in two implementations according to whether an EVPN instance is configured on the communication device.
[0261] In a first implementation, when an EVPN instance is configured on all communication devices on the transmission path, the communication method provided in this embodiment is described in detail below by using an example in which a user terminal 109 performs inter-datacenter interconnection with a user terminal 110 by using communication device 103, communication device 101, communication device 102, and communication device 104 in Figure 1.
[0262] First, the execution process of the control flow after the user terminal 109 accesses the VXLAN in the data center A will be described.
[0263] As shown in FIG. 4, the method may specifically include the following steps:
[0264] S401: The communication device 103 recognizes the MAC address 1 of the user terminal 109 from the user terminal 109.
[0265] For the specific implementation process of S401, please refer to the content of S201 above. Here, we will not go into details again.
[0266] S402: The communication device 103 transmits the EVPN MAC route 1 to the communication device 101.
[0267] As described in S202, after the communication device 103 recognizes the MAC address 1, it sends the EVPN MAC route (i.e., EVPN MAC route 1) to the communication device 101 by using the EVPN instance 1031.
[0268] S403: The communication device 101 generates an EVPN MAC route 2 based on the EVPN MAC route 1.
[0269] Similar to the contents in S204, EVPN MAC route 2 carries MAC address 1 and SID1 corresponding to VNI 1. EVPN MAC route 2 can instruct to encapsulate a Layer 2 packet whose destination address is MAC address 1 into an SRv6 packet including SID1 by using the carried MAC address 1 and SID1, and to forward the SRv6 packet to the communication device 101.
[0270] In a possible design, the communication device 101 may determine an EVPN instance 1011 configured on the communication device 101 based on a route target extended community attribute carried in EVPN MAC Route 1. Then, an EVPN MAC Route 2 is created in EVPN instance 1011.
[0271] In a possible design, SID1 is an SID assigned to the EVPN instance 1011 of the communication device 101. In other words, the EVPN instance 1011 may be determined within the communication device 101 based on SID1.
[0272] According to this design, after receiving an SRv6 packet whose destination address is SID1, the communication device 101 may determine an EVPN instance 1011 based on SID1 and may further search for the EVPN instance 1011 to forward information of Layer 2 packet 1.
[0273] In a possible implementation, in this embodiment, the MAC table of the EVPN instance 1011 includes a correspondence between MAC address 1 and VNI 1.
[0274] Specifically, the correspondence between MAC address 1 and VNI1 is recorded in the MAC table of EVPN instance 1011, so that after receiving an SRv6 packet whose destination address is SID1 (in which a Layer 2 packet whose destination address is MAC address 1 is encapsulated), the communication device 101 first determines the EVPN instance 1011 based on SID1; then, based on MAC address 1, searches the MAC table corresponding to the EVPN instance 1011 to find the correspondence between MAC address 1 and VNI1, thereby further determining VNI1; and further, based on SID1, the communication device 101 can determine VNI1 corresponding to SID1.
[0275] In addition, it may be understood that the MAC entry that records MAC address 1 and VNI 1 in the MAC table of EVPN instance 1011 may further include other information. For example, the next hop information in this specification may be the address of communication device 103, so that when communication device 101 encapsulates a VXLAN packet, it determines that the next hop of the VXLAN packet is communication device 103.
[0276] S404: The communication device 101 transmits the EVPN MAC route 2 to the communication device 102.
[0277] S405: The communication device 102 generates an EVPN MAC route 3 based on the EVPN MAC route 2.
[0278] EVPN MAC route 3 carries MAC address 1 and VNI 2 corresponding to SID 1. EVPN MAC route 3 may instruct the communication device 102 to encapsulate a Layer 2 packet whose destination address is MAC address 1 into a VXLAN packet including VNI 2 by using MAC address 1 and VNI 2, and to forward the VXLAN packet to the communication device 102.
[0279] In a possible design, the communication device 102 may determine an EVPN instance 1021 configured on the communication device 102 based on the route target extended community attribute carried in EVPN MAC route 2. Then, an EVPN MAC route 3 is created in EVPN instance 1021.
[0280] In a possible design, VNI2 is a VNI assigned to EVPN instance 1021 of communication device 102.
[0281] According to this design, after receiving a VXLAN packet carrying VNI2, the communication device 102 may determine an EVPN instance 1021 based on VNI2 and may further search for the EVPN instance 1021 to forward information for the Layer 2 packet.
[0282] In a possible implementation, in this embodiment, the MAC table of the EVPN instance 1021 includes a correspondence between MAC address 1 and SID1.
[0283] Specifically, the correspondence between MAC address 1 and SID1 is recorded in the MAC table of EVPN instance 1021, so that after receiving a VXLAN packet carrying VNI2 (in which a Layer 2 packet whose destination address is MAC address 1 is encapsulated), the communication device 102 first determines the EVPN instance 1021 based on VNI2; then, based on MAC address 1, searches the MAC table corresponding to EVPN instance 1021 for the correspondence between MAC address 1 and SID1, thereby further determining SID1; and further, based on VNI2, it can determine SID1 corresponding to VNI2.
[0284] In addition, it may be understood that the MAC entry that records MAC address 1 and SID1 in the MAC table of the EVPN instance 1021 may further include other information. For example, the next hop information in this specification may be the address of the communication device 101, so that when the communication device 102 encapsulates an SRv6 packet, the communication device 102 determines that the next hop of the SRv6 packet is the communication device 101.
[0285] S406: The communication device 102 transmits the EVPN MAC route 3 to the communication device 104.
[0286] S407: The communication device 104 generates a MAC entry based on the EVPN MAC route 3.
[0287] For the specific implementation process of S407, please refer to the relevant content of S207 above. The repeated parts will not be explained again.
[0288] With reference to the control flow execution process shown in FIG. 4, the process by which a user terminal 110 in data center B transfers a packet to a user terminal 109 in data center A will be described below.
[0289] As shown in FIGS. 5A and 5B, the method may include the following steps.
[0290] S501: The user terminal 110 transfers a Layer 2 packet 1 whose destination address is MAC address 1 to the communication device 104.
[0291] S502: The communication device 104 encapsulates the Layer 2 packet 1 into a VXLAN packet 1 that includes the VNI 2 and has the communication device 102 as its destination address.
[0292] S503: The communication device 104 transfers the VXLAN packet 1 to the communication device 102.
[0293] For the contents of S501 to S503, please refer to the corresponding contents of S301 to S303. Repeated parts will not be explained again.
[0294] S504: The communication device 102 determines SID1 based on VNI2 in the VXLAN packet 1.
[0295] In a possible design, as described above in S405, VNI2 is a VNI assigned to the EVPN instance 1021 of the communication device 102. Therefore, the communication device 102 may determine the EVPN instance 1021 based on VNI2 and further determine SID1.
[0296] Optionally, S504 may specifically include the following steps:
[0297] S5041: The communication device 102 determines the EVPN instance 1021 based on the VNI2.
[0298] S5042: The communication device 102 determines SID1 from the MAC table corresponding to the EVPN instance 1021 based on MAC address 1.
[0299] As described in S407, the correspondence between MAC address 1 and SID1 is recorded in the MAC table corresponding to EVPN instance 1021.
[0300] S505: The communication device 102 performs SRv6 encapsulation on the Layer 2 packet 1 to obtain the SRv6 packet 1.
[0301] See S305. SRv6 packet 1 contains SID1.
[0302] S506: The communication device 102 transfers the SRv6 packet 1 to the communication device 101.
[0303] S507: The communication device 101 determines VNI1 based on SID1 in SRv6 packet1.
[0304] In a possible design, as described above in S403, SID1 is an SID assigned to the EVPN instance 1011 of the communication device 101. Therefore, the communication device 101 may determine the EVPN instance 1011 based on SID1 and further determine VNI1.
[0305] Optionally, S507 may specifically include the following steps:
[0306] S5071: The communication device 101 determines the EVPN instance 1011 based on SID1.
[0307] S5072: The communication device 101 determines VNI1 from the MAC table corresponding to the EVPN instance 1011 based on MAC address 1.
[0308] As described in S404, the correspondence between MAC address 1 and VNI 1 is recorded in the MAC table corresponding to EVPN instance 1011.
[0309] S508: The communication device 101 performs VXLAN encapsulation on the Layer 2 packet 1 to obtain a VXLAN packet 2.
[0310] As shown in S308, VXLAN packet 2 carries VNI1.
[0311] S509: The communication device 101 transfers the VXLAN packet 2 to the communication device 103.
[0312] S510: The communication device 103 transfers Layer 2 packet 1 in the VXLAN packet to the user terminal 109.
[0313] For the contents of S509 and S510, please refer to the corresponding contents of S309 and S310. Repeated parts will not be explained again.
[0314] The above S401 to S407 and S501 to S510 describe in detail the control flow and packet forwarding process after the user terminal 109 accesses the VXLAN of data center A, by using an example in which the user terminal 109 performs inter-datacenter interconnection with the user terminal 110 by using the communication device 103, the communication device 101, the communication device 102, and the communication device 104. In an actual application process, the communication device may include one or more EVPN instances used to implement data transmission on different paths. In this way, different SIDs or VNIs may be assigned to different EVPN instances to implement data transmission across the VXLAN and the SRv6 network on different paths.
[0315] For example, in FIG. 6 , in addition to EVPN instance 1011, communication device 101 further includes EVPN instance 1012. VNI3 and SID2 are assigned to EVPN instance 1012. In addition, in addition to EVPN instance 1021, communication device 102 further includes EVPN instance 1022. VNI4 is assigned to EVPN instance 1022. In addition, in addition to EVPN instance 1031 corresponding to VNI1, communication device 103 further includes EVPN instance 1032 to which VNI3 is assigned. In addition, in addition to EVPN instance 1041 corresponding to VNI2, communication device 104 further includes EVPN instance 1042 to which VNI4 is assigned.
[0316] With reference to an example, the following describes a process in which a user terminal 111 in a data center A accesses a VXLAN in the data center A and then interconnects with a user terminal 112 in a data center B.
[0317] First, the execution process of the control flow after the user terminal 111 accesses the VXLAN in the data center A will be described.
[0318] As shown in FIGS. 7A and 7B, the method specifically further includes the following steps:
[0319] S601: The communication device 103 recognizes the MAC address 2 of the user terminal 111 from the user terminal 111.
[0320] S602: The communication device 103 transmits EVPN MAC route 4 to the communication device 101.
[0321] After recognizing MAC address 2, the communication device 103 determines EVPN instance 1032 corresponding to the user terminal 111 based on the interface of the user terminal 111, and then transmits EVPN MAC route 4 to the communication device 101 by using EVPN instance 1032. EVPN MAC route 4 includes MAC address 2 and VNI 3.
[0322] S603: The communication device 101 generates an EVPN MAC route 5 based on the EVPN MAC route 4.
[0323] EVPN MAC Route 5 carries MAC address 2 and SID2 corresponding to VNI 3. EVPN MAC Route 2 can instruct the communication device 101 to encapsulate a Layer 2 packet whose destination address is MAC address 2 into an SRv6 packet containing SID2 by using the carried MAC address 2 and SID2, and to forward the SRv6 packet to the communication device 101.
[0324] SID2 is an SID assigned to the EVPN instance 1012 of the communication device 101.
[0325] Specifically, different SIDs are assigned to different EVPN instances in the communication device 101, and as a result, after the communication device 101 receives an SRv6 packet including a different SID, it can find the corresponding EVPN instance based on the SID, and then find the next hop information of the Layer 2 packet in the SRv6 packet from the MAC table corresponding to the EVPN instance (e.g., based on the MAC address carried in the Layer 2 packet, find the corresponding VNI and next hop address in the MAC table of the corresponding EVPN instance), and complete the corresponding encapsulation and forwarding of the Layer 2 packet.
[0326] The MAC table of EVPN instance 1012 includes a correspondence between MAC address 2 and VNI 3.
[0327] In addition, it may be understood that the MAC entry that records MAC address 2 and VNI 3 in the MAC table of EVPN instance 1012 may further include other information. For example, the next hop information in this specification may be the address of communication device 103, so that when communication device 101 encapsulates a VXLAN packet, it determines that the next hop of the VXLAN packet is communication device 103.
[0328] S604: The communication device 101 transmits the EVPN MAC route 5 to the communication device 102.
[0329] S605: The communication device 102 generates an EVPN MAC route 6 based on the EVPN MAC route 5.
[0330] EVPN MAC route 6 carries MAC address 2 and VNI 4 corresponding to SID 2. EVPN MAC route 6 may instruct to encapsulate a Layer 2 packet whose destination address is MAC address 2 into a VXLAN packet including VNI 4 by using MAC address 2 and VNI 4, and to forward the VXLAN packet to communication device 102.
[0331] VNI4 is a VNI assigned to the EVPN instance 1022 of the communication device 102.
[0332] Specifically, different VNIs are assigned to different EVPN instances in the communication device 102, so that after the communication device 102 receives a VXLAN packet including different VNIs, it can find the corresponding EVPN instance based on the VNI, and then find the next hop information of the Layer 2 packet in the VXLAN packet from the MAC table corresponding to the EVPN instance (e.g., based on the MAC address carried in the Layer 2 packet, find the corresponding SID and next hop address in the MAC table of the corresponding EVPN instance), and complete the corresponding encapsulation and forwarding of the Layer 2 packet.
[0333] The MAC table of EVPN instance 1022 includes a correspondence between MAC address 2 and SID2.
[0334] It may be understood that the MAC entry that records MAC address 2 and SID2 in the MAC table of EVPN instance 1022 may further include other information.
[0335] S606: The communication device 102 sends the EVPN MAC route 6 to the communication device 104.
[0336] S607: The communication device 104 generates a MAC entry based on the EVPN MAC route 6.
[0337] For the specific implementation process of S607, please refer to the relevant content of S207 above. The repeated parts will not be explained again.
[0338] With reference to the control flow execution process shown in FIGS. 7A and 7B, the process by which user terminal 112 in data center B forwards a packet to user terminal 111 in data center A will be described below.
[0339] As shown in FIGS. 8A and 8B, the method may include the following steps.
[0340] S701: The user terminal 112 transfers a Layer 2 packet 2 whose destination address is MAC address 2 to the communication device 104.
[0341] S702: The communication device 104 encapsulates the Layer 2 packet 2 into a VXLAN packet that includes the VNI 4 and has the communication device 102 as the destination address.
[0342] S703: The communication device 104 transfers the VXLAN packet to the communication device 102.
[0343] For the contents of S701 to S703, please refer to the corresponding contents of S301 to S303. Repeated parts will not be explained again.
[0344] S704: The communication device 102 determines SID2 based on VNI4 in the VXLAN packet.
[0345] As described above in S605, VNI4 is a VNI assigned to the EVPN instance 1022 of the communication device 102. Therefore, the communication device 102 may determine the EVPN instance 1022 based on VNI4, and may further determine SID2.
[0346] S704 may specifically include the following steps:
[0347] S7041: The communication device 102 determines the EVPN instance 1022 based on VNI4.
[0348] S7042: The communication device 102 determines SID4 from the MAC table corresponding to the EVPN instance 1022 based on MAC address 2.
[0349] As described in S605, the correspondence between MAC address 1 and SID4 is recorded in the MAC table corresponding to EVPN instance 1022.
[0350] S705: The communication device 102 performs SRv6 encapsulation on the Layer 2 packet 2 to obtain an SRv6 packet.
[0351] The SRv6 packet includes SID2.
[0352] S706: The communication device 102 transfers the SRv6 packet to the communication device 101.
[0353] S707: The communication device 101 determines VNI2 based on SID2 in the SRv6 packet.
[0354] As described above in S603, SID2 is an SID assigned to the EVPN instance 1012 of the communication device 101. Therefore, the communication device 101 may determine the EVPN instance 1012 based on SID2, and further determine VNI3.
[0355] S707 may specifically include the following steps:
[0356] S7071: The communication device 101 determines the EVPN instance 1012 based on SID2.
[0357] S7072: The communication device 101 determines VNI3 from the MAC table corresponding to the EVPN instance 1012 based on the MAC address 1.
[0358] As described in S603, the correspondence between MAC address 2 and VNI 3 is recorded in the MAC table corresponding to EVPN instance 1012.
[0359] S708: The communication device 101 performs VXLAN encapsulation on the Layer 2 packet 2 to obtain a VXLAN packet.
[0360] The VXLAN packet carries VNI3.
[0361] S709: The communication device 101 transfers the VXLAN packet to the communication device 103.
[0362] S710: The communication device 103 transfers Layer 2 packet 1 in the VXLAN packet to the user terminal 111.
[0363] For the contents of S709 and S710, please refer to the corresponding contents of S309 and S310. The repeated parts will not be explained again.
[0364] In a second implementation, when an EVPN instance is not configured on a communication device on the transmission path, the communication method provided in this embodiment is described in detail below by using an example in which a user terminal 109 performs inter-datacenter interconnection with a user terminal 110 by using communication device 103, communication device 101, communication device 102, and communication device 104 in Figure 1.
[0365] First, the execution process of the control flow after the user terminal 109 accesses the VXLAN in the data center A will be described.
[0366] As shown in FIG. 9, the method may specifically include the following steps:
[0367] S801: The communication device 103 recognizes the MAC address 1 of the user terminal 109 from the user terminal 109.
[0368] For the specific implementation process of S801, please refer to the content of S201 above. Here, we will not go into details again.
[0369] S802: The communication device 103 transmits the EVPN MAC route 1 to the communication device 101.
[0370] As described in S202, after the communication device 103 recognizes the MAC address 1, it sends the EVPN MAC route (i.e., EVPN MAC route 1) to the communication device 101 by using the EVPN instance 1031.
[0371] S803: The communication device 101 generates an EVPN MAC route 2 based on the EVPN MAC route 1.
[0372] Similar to the contents in S204, EVPN MAC route 2 carries MAC address 1 and SID 1. EVPN MAC route 2 instructs the communication device 101 to encapsulate a Layer 2 packet whose destination address is MAC address 1 into an SRv6 packet whose destination address is SID 1, and to forward the SRv6 packet to the communication device 101.
[0373] Specifically, the communication device 101 may obtain EVPN MAC route 2 by modifying information in EVPN MAC route 1. For example, the communication device 101 may obtain EVPN MAC route 2 by modifying the next hop in EVPN MAC route 1 to the access address of the communication device 101, deleting the VNI in EVPN MAC route 1, and adding SID1 to EVPN MAC route 1.
[0374] S804: The communication device 101 transmits the EVPN MAC route 2 to the communication device 102.
[0375] In a possible design, the method further comprises the following steps:
[0376] S805: The communication device 101 records the correspondence between SID1 and VNI1.
[0377] In this way, after receiving an SRv6 packet whose destination address is SID1, communication device 101 can encapsulate the Layer 2 packet carried in the SRv6 packet into a VXLAN packet that includes VNI1 and whose destination address is communication device 103 according to the correspondence for forwarding.
[0378] That is, after communication device 102 encapsulates a Layer 2 packet whose destination address is MAC address 1 into an SRv6 packet whose destination address is SID1 based on EVPN MAC route 2 and forwards the SRv6 packet to communication device 101, if the content in the Layer 2 packet is not analyzed, communication device 101 may encapsulate the Layer 2 packet into a VXLAN packet that includes VNI1 and whose destination address is communication device 103 based on the first correspondence for forwarding.
[0379] Additionally, when the communication device 101 allocates an SID corresponding to a VNI, the communication device 101 may allocate the SID using different policies.
[0380] In a possible design, the communication device 101 may generate different SIDs based on different MAC addresses carried in the EVPN MAC route.
[0381] 10(a), in one aspect, the communication device 101 may generate SID1 based on MAC address 1 carried in EVPN MAC route 1, and generate EVPN MAC route 2 including SID1 (S803). In another aspect, the communication device 101 may further generate SID3 based on MAC address 3 of the user terminal 113.
[0382] In this case, in one aspect, when a user terminal in data center B sends a packet to user terminal 109, communication device 102 needs to encapsulate the Layer 2 packet into an SRv6 packet including SID1 and forward the SRv6 packet to communication device 101. In another aspect, when a user terminal in data center B sends a packet to user terminal 113, communication device 102 needs to encapsulate the Layer 2 packet into an SRv6 packet including SID3 and forward the SRv6 packet to communication device 101.
[0383] In another possible design, the communication device 101 may generate different SIDs corresponding to different next hop nodes based on next hop information in the EVPN MAC route.
[0384] 10(b), in one aspect, the communication device 101 assigns SID1 to EVPN MAC route 1 whose next hop is the communication device 103, and generates EVPN MAC route 2 including SID1 (S803). In another aspect, the communication device 101 may further assign SID4 to EVPN MAC route whose next hop is the communication device 107.
[0385] Specifically, unlike the above description in which different SIDs are generated based on different MAC addresses, it is used as an example that the user terminal 109 accesses the data center A separately by using the communication device 103 and the communication device 107. When the communication device 103 sends an EVPN MAC route (carrying the MAC address of the user terminal 109), the communication device 101 assigns SID1. When the communication device 107 sends an EVPN MAC route (carrying the MAC address of the user terminal 109), the communication device 101 assigns SID4.
[0386] In this case, in one aspect, when a user terminal in data center B sends a packet to a user terminal connected to communication device 103 corresponding to VNI1, communication device 102 needs to encapsulate the Layer 2 packet into an SRv6 packet including SID1 and forward the SRv6 packet to communication device 101. In another aspect, when a user terminal in data center B sends a packet to a user terminal connected to communication device 107 corresponding to VNI1, communication device 102 needs to encapsulate the Layer 2 packet into an SRv6 packet including SID4 and forward the SRv6 packet to communication device 101. In a possible design, in the method provided in this embodiment, SID1 may be pre-configured to associate SID1 with the execution of a VXLAN encapsulation operation.
[0387] For example, a function type of an SID may be preconfigured, and the function type may instruct an SID of this type to perform VXLAN encapsulation or instruct an SID of this type to query a table of correspondence between SIDs and VNIs. In this manner, the communication device 101 may indicate the function of SID1 as a preconfigured type (e.g., the function of SID1 may be indicated as END.SWV) and locally record the preconfigured type. Therefore, after receiving SID1, the communication device 101 is directly triggered to search for the correspondence between SID1 and VNI1 and perform VXLAN encapsulation.
[0388] S806: The communication device 102 generates an EVPN MAC route 3 based on the EVPN MAC route 2.
[0389] Similar to the content in S206, EVPN MAC route 3 carries MAC address 1 and VNI 2. EVPN MAC route 3 instructs the communication device 102 to encapsulate a Layer 2 packet whose destination address is MAC address 1 into a VXLAN packet including VNI 2, and to forward the VXLAN packet to the communication device 102.
[0390] Specifically, the communication device 102 may obtain EVPN MAC route 3 by modifying information in EVPN MAC route 2. For example, the communication device 102 may obtain EVPN MAC route 3 by modifying the next hop in EVPN MAC route 2 to the access address of the communication device 102, deleting SID1 in EVPN MAC route 2, and adding VNI2 to EVPN MAC route 2.
[0391] S807: The communication device 102 transmits the EVPN MAC route 3 to the communication device 104.
[0392] In a possible design, the method further comprises the following steps:
[0393] S808: The communication device 102 records the correspondence between VNI2 and SID1.
[0394] In this way, after receiving a VXLAN packet including VNI2, communication device 102 can encapsulate the Layer 2 packet carried in the VXLAN packet into an SRv6 packet including SID1 according to the correspondence between VNI2 and SID1, and forward the SRv6 packet to communication device 101.
[0395] In other words, after communication device 104 encapsulates a Layer 2 packet whose destination address is MAC address 1 into a VXLAN packet including VNI2 based on EVPN MAC route 3 and forwards the VXLAN packet to communication device 102, if the content in the Layer 2 packet is not analyzed, communication device 102 may encapsulate the Layer 2 packet into an SRv6 packet whose destination address is SID1 according to the second correspondence relationship and forward the SRv6 packet to communication device 101.
[0396] Additionally, when the communication device 102 allocates a VNI corresponding to a SID, the communication device 102 may allocate the VNI using different policies.
[0397] In a possible design, the communication device 102 may generate different VNIs based on different MAC addresses carried in the EVPN MAC route.
[0398] 10(a), in one aspect, the communication device 102 may generate a VNI 2 based on a MAC address 1 carried in an EVPN MAC route 2 from the communication device 101, and generate an EVPN MAC route 3 including the VNI 2 (S806). In another aspect, the communication device 101 may further generate a VNI 5 based on a MAC address 3 of the user terminal 113.
[0399] In this case, in one aspect, when a user terminal in data center B sends a packet to user terminal 109, the Layer 2 packet may be encapsulated into a VXLAN packet including VNI2, and the VXLAN packet is forwarded to communication device 102, completing the packet transmission. In another aspect, when a user terminal in data center B sends a packet to user terminal 113, the Layer 2 packet may be encapsulated into a VXLAN packet including VNI5, and the VXLAN packet is forwarded to communication device 102, completing the packet transmission.
[0400] In another possible design, the communication device 101 may generate different VNIs corresponding to different next hop nodes based on the next hop information in the EVPN MAC route.
[0401] For example, as shown in FIG. 10(b), for communication device 102:
[0402] In one aspect, in response to EVPN MAC route 2 whose next hop is the communication device 101, the communication device 101 assigns VNI2 and generates EVPN MAC route 3 including VNI2 (S806). In addition, for another EVPN MAC route whose next hop is the communication device 101, the communication device also assigns VNI7. For example, in FIG. 10(b), for an EVPN MAC route transmitted from the communication device 107 and carrying the MAC address of the user terminal 109 to the communication device 101, the communication device 101 transmits an EVPN MAC route carrying SID4 to the communication device 102 based on the EVPN MAC route, and the communication device 102 assigns VNI7 based on the received EVPN MAC route.
[0403] In another aspect, the communication device 102 may further assign a VNI 6 corresponding to an EVPN MAC route whose next hop is the communication device 105.
[0404] Specifically, unlike the above description in which different SIDs are generated based on different MAC addresses, in Figure 10(b) , it is used as an example that user terminal 109 separately accesses data center A by using communication device 103, communication device 107, and communication device 120. When communication device 101 sends an EVPN MAC route (carrying the MAC address of user terminal 109 and SID1), communication device 102 assigns VNI2. When communication device 105 sends an EVPN MAC route (carrying the MAC address of user terminal 109 and SID1), communication device 102 assigns VNI6.
[0405] In this case, corresponding to the same MAC address (MAC address 1) and the same SID (SID1), in one aspect, when a user terminal in data center B sends a packet to a user terminal connected to communication device 101 corresponding to VNI1, communication device 104 needs to encapsulate the Layer 2 packet into a VXLAN packet including VNI2 and forward the VXLAN packet to communication device 102. In another aspect, when a user terminal in data center B sends a packet to a user terminal connected to communication device 105 corresponding to VNI1, communication device 102 needs to encapsulate the Layer 2 packet into a VXLAN packet including VNI6 and forward the VXLAN packet to communication device 102.
[0406] S809: The communication device 104 generates a MAC entry based on the EVPN MAC route 3.
[0407] For the specific implementation process of S809, please refer to the relevant content of S207 above. The repeated parts will not be explained again.
[0408] With reference to the control flow execution process shown in FIG. 9, the process by which a user terminal 110 in data center B transfers a packet to a user terminal 109 in data center A will be described below.
[0409] As shown in FIGS. 11A and 11B, the method may include the following steps.
[0410] S901: The user terminal 110 transfers a Layer 2 packet 1 whose destination address is MAC address 1 to the communication device 104.
[0411] S902: The communication device 104 encapsulates the Layer 2 packet 1 into a VXLAN packet that includes the VNI 2 and has the communication device 102 as its destination address.
[0412] S903: The communication device 104 transfers the VXLAN packet to the communication device 102.
[0413] For the contents of S901 to S903, please refer to the corresponding contents of S301 to S303. Repeated parts will not be explained again.
[0414] S904: The communication device 102 determines SID1 based on VNI2 in the VXLAN packet.
[0415] In a possible design, S904 specifically includes the communication device 102 determining SID1 based on VNI2 and the correspondence between VNI2 and SID1 recorded in the communication device 102.
[0416] Specifically, as described above in S808, the communication device 102 records the correspondence between VNI2 and SID1.
[0417] S905: The communication device 102 performs SRv6 encapsulation on the Layer 2 packet 1 to obtain an SRv6 packet.
[0418] The SRv6 packet contains SID1.
[0419] S906: The communication device 102 transmits an SRv6 packet to the communication device 101.
[0420] S907: The communication device 101 determines VNI1 based on SID1 in the SRv6 packet.
[0421] In a possible design, S907 specifically includes: the communication device 101 determining the VNI1 based on the SID1 and the correspondence between the SID1 and the VNI1 recorded in the communication device 101.
[0422] Specifically, as described above in S805, the communication device 101 records the correspondence between SID1 and VNI1.
[0423] S908: The communication device 101 performs VXLAN encapsulation on the Layer 2 packet 1 to obtain a VXLAN packet.
[0424] The VXLAN packet includes VNI1.
[0425] S909: The communication device 101 transfers the VXLAN packet to the communication device 103.
[0426] S910: The communication device 103 transfers Layer 2 packet 1 in the VXLAN packet to the user terminal 109.
[0427] For the contents of S909 and S910, please refer to the corresponding contents of S309 and S310. The repeated parts will not be explained again.
[0428] With reference to FIG. 10(a), the process by which a user terminal 113 in data center A interconnects with a user terminal in data center B will now be described in detail.
[0429] As shown in FIG. 12, the method may specifically include the following steps:
[0430] S1001: The communication device 103 recognizes the MAC address 3 of the user terminal 113 from the user terminal 113.
[0431] S1002: The communication device 103 transmits the EVPN MAC route 7 to the communication device 101.
[0432] EVPN MAC route 7 carries MAC address 3 and VNI 1.
[0433] S1003: The communication device 101 generates an EVPN MAC route 8 based on the EVPN MAC route 7.
[0434] EVPN MAC route 8 includes SID3 and MAC address 3. Specifically, as shown in FIG. 10(a), the correspondence between VNI1 and SID1 and the correspondence between VNI1 and SID3 may be recorded in communication device 101. SID1 is an SID assigned corresponding to MAC address 1, and SID3 is an SID assigned corresponding to MAC address 3.
[0435] S1004: The communication device 101 transmits the EVPN MAC route 8 to the communication device 102.
[0436] In a possible design, the method may further include the following steps: S1005: The communication device 101 records the correspondence between SID3 and VNI1.
[0437] S1006: The communication device 102 generates an EVPN MAC route 9 based on the EVPN MAC route 8.
[0438] EVPN MAC route 9 includes VNI5 and MAC address 3. Specifically, as shown in FIG. 10(a), the correspondence between SID1 and VNI2 and the correspondence between SID3 and VNI5 may be recorded in communication device 101. VNI2 is a VNI assigned corresponding to MAC address 1, and VNI5 is a VNI assigned corresponding to MAC address 3.
[0439] S1007: The communication device 102 transmits the EVPN MAC route 9 to the communication device 104.
[0440] In a possible design, the method may further include the following steps: S1008: The communication device 102 records the correspondence between VNI5 and SID3.
[0441] S1009: The communication device 104 generates a MAC entry based on the EVPN MAC route 9.
[0442] For the contents of the implementation processes S1001 to S1009 that are similar to those of S801 to S809, please refer to the corresponding explanations of S801 to S809. Repeated parts will not be explained again.
[0443] 12, the following describes a process in which the user terminal 114 in the data center B forwards a packet to the user terminal 113 in the data center A according to the VNI 5. Specifically, as shown in FIG. 13, the method further includes the following steps:
[0444] S1101: The user terminal 114 transfers a Layer 2 packet 3 whose destination address is MAC address 3 to the communication device 104.
[0445] S1102: The communication device 104 encapsulates the Layer 2 packet 3 into a VXLAN packet that includes the VNI 5 and has the communication device 102 as its destination address.
[0446] S1103: The communication device 104 transfers the VXLAN packet to the communication device 102.
[0447] For the contents of S1101 to S1103, please refer to the corresponding contents of S301 to S303. Repeated parts will not be explained again.
[0448] S1104: The communication device 102 determines SID3 based on VNI5 in the VXLAN packet.
[0449] In a possible design, S1104 specifically includes the communication device 102 determining SID3 based on VNI5 and the correspondence between VNI5 and SID3 recorded in the communication device 102.
[0450] S1105: The communication device 102 performs SRv6 encapsulation on the Layer 2 packet 3 to obtain an SRv6 packet.
[0451] The SRv6 packet contains SID3.
[0452] S1106: The communication device 102 transmits an SRv6 packet to the communication device 101.
[0453] S1107: The communication device 101 determines VNI1 based on SID3 in the SRv6 packet.
[0454] In a possible design, S1107 specifically includes the communication device 101 determining VNI1 based on SID3 and the correspondence between SID3 and VNI1 recorded in the communication device 101.
[0455] S1108: The communication apparatus 101 performs VXLAN encapsulation on the Layer 2 packet 1 to obtain a VXLAN packet.
[0456] The VXLAN packet includes VNI1.
[0457] S1109: The communication device 101 transfers the VXLAN packet to the communication device 103.
[0458] S1110: The communication device 103 transfers Layer 2 packet 3 in the VXLAN packet to the user terminal 113.
[0459] For the contents of S1109 and S1110, please refer to the corresponding contents of S309 and S310. Repeated parts will not be explained again.
[0460] With reference to FIG. 10(b), the process by which a user terminal 109 in data center A interconnects with a user terminal in data center B will now be described in detail.
[0461] As shown in FIG. 14, the method may specifically include the following steps:
[0462] S1201: The communication device 107 recognizes the MAC address 1 of the user terminal 109 from the user terminal 109.
[0463] S1202: The communication device 107 transmits the EVPN MAC route 10 to the communication device 101.
[0464] EVPN MAC route 10 carries MAC address 1 and VNI1.
[0465] S1203: The communication device 101 generates an EVPN MAC route 11 based on the EVPN MAC route 10.
[0466] The EVPN MAC route 11 includes SID4 and MAC address 1. Specifically, as shown in FIG. 10(b), the correspondence between VNI1 and SID1 and the correspondence between VNI1 and SID4 may be recorded in the communication device 101. SID1 is an SID assigned to the communication device 103 corresponding to the next hop, and SID4 is an SID assigned to the communication device 107 corresponding to the next hop.
[0467] Comparing Figure 10(b) with Figure 10(a), it can be seen that S1203 corresponds to the same MAC address (i.e., MAC address 1), but since the user terminal is connected to multiple communication devices (communication device 103, communication device 107, and communication device 120), for communication device 101, the EVPN MAC routes received from communication device 103 and communication device 107 carry the same MAC address, but the next hop information is different, so the corresponding SIDs are different.
[0468] S1204: The communication device 101 transmits the EVPN MAC route 11 to the communication device 102.
[0469] In a possible design, the method may further include the following steps: S1205: The communication device 101 records the correspondence between SID4 and VNI1.
[0470] S1206: The communication device 102 generates an EVPN MAC route 12 based on the EVPN MAC route 11.
[0471] The EVPN MAC route 12 includes VNI2 and MAC address 1. Specifically, as shown in FIG. 10(b), the correspondence between SID1 and VNI2, the correspondence between SID4 and VNI7, and the correspondence between SID1 and VNI6 may be recorded in the communication device 102 (in this case, the SR policy transmission method is used in the SRv6 network, and therefore, it can be understood that SID1 may correspond to the communication device 101 and the communication device 105 separately). VNI1 is a VNI assigned corresponding to the next hop as the communication device 101, and VNI6 is a VNI assigned corresponding to the next hop as the communication device 105.
[0472] In comparison with communication device 102, since communication device 101 and communication device 105 are different next hop nodes, the EVPN MAC routes (EVPN MAC route 2 and EVPN MAC route 11) sent from communication device 101 and communication device 105 to communication device 102 carry MAC address 1 and SID1, respectively, but communication device 102 assigns VNI2 and VNI6 to EVPN MAC route 2 and EVPN MAC route 11, respectively, in accordance with the SID assignment policy in which different SIDs are assigned based on different next hop nodes.
[0473] S1207: The communication device 102 sends the EVPN MAC route 12 to the communication device 104.
[0474] In a possible design, the method may further include the following steps: S1208: The communication device 102 records the correspondence between VNI7 and SID4.
[0475] S1209: The communication device 104 generates a MAC entry based on the EVPN MAC route 12.
[0476] For the contents of the implementation processes S1201 to S1209 that are similar to those of S801 to S809, please refer to the corresponding explanations of S801 to S809. The repeated parts will not be explained again.
[0477] With reference to the execution process of the control flow shown in Figure 14, the following describes a process in which the user terminal 117 in data center B forwards a packet to the user terminal 109 in data center A according to VNI 7. Specifically, as shown in Figure 15, this method further includes the following steps:
[0478] S1301: The user terminal 117 transfers the Layer 2 packet 4, whose destination address is the MAC address 1, to the communication device 104.
[0479] S1302: The communication device 104 encapsulates the Layer 2 packet 4 into a VXLAN packet that includes the VNI 7 and has the communication device 102 as its destination address.
[0480] S1303: The communication device 104 transfers the VXLAN packet to the communication device 102.
[0481] For the contents of S1301 to S1303, please refer to the corresponding contents of S301 to S303. Repeated parts will not be explained again.
[0482] S1304: The communication device 102 determines SID4 based on VNI7 in the VXLAN packet.
[0483] S1305: The communication device 102 performs SRv6 encapsulation on the Layer 2 packet 4 to obtain an SRv6 packet.
[0484] The SRv6 packet contains SID4.
[0485] S1306: The communication device 102 transmits an SRv6 packet to the communication device 101.
[0486] S1307: The communication device 101 determines VNI1 based on SID4 in the SRv6 packet.
[0487] S1308: The communication apparatus 101 performs VXLAN encapsulation on the Layer 2 packet 4 to obtain a VXLAN packet.
[0488] The VXLAN packet includes VNI1.
[0489] S1309: The communication device 101 transfers the VXLAN packet to the communication device 107.
[0490] S1310: The communication device 107 transfers Layer 2 packet 4 in the VXLAN packet to the user terminal 109.
[0491] For the contents of S1309 and S1310, please refer to the corresponding contents of S309 and S310. Repeated parts will not be explained again.
[0492] In addition, in Fig. 10(b), when the EVPN MAC route for the MAC address of the user terminal 109 is sent by using the communication device 120, the process of the user terminal 109 in the data center A interconnecting with the user terminal in the data center B is shown in Fig. 16. This method may specifically include the following steps:
[0493] S1401: The communication device 120 recognizes the MAC address 1 of the user terminal 109 from the user terminal 109.
[0494] S1402: The communication device 120 transmits the EVPN MAC route 13 to the communication device 101.
[0495] EVPN MAC route 13 carries MAC address 1 and VNI 1.
[0496] S1403: The communication device 105 generates an EVPN MAC route 14 based on the EVPN MAC route 13.
[0497] The EVPN MAC route 14 includes SID1 and MAC address 1. Specifically, as shown in Fig. 10(b), the correspondence between VNI1 and SID1 may be recorded in the communication device 105. SID1 is an SID assigned to the communication device 120 by the communication device 105 corresponding to the next hop.
[0498] S1404: The communication device 105 transmits the EVPN MAC route 14 to the communication device 102.
[0499] In a possible design, the method may further include the following steps: S1405: The communication device 105 records the correspondence between SID1 and VNI1.
[0500] S1406: The communication device 102 generates an EVPN MAC route 15 based on the EVPN MAC route 14.
[0501] The EVPN MAC route 15 includes VNI6 and MAC address 1. Specifically, as shown in FIG. 10(b), the correspondence between SID1 and VNI2, the correspondence between SID4 and VNI2, and the correspondence between SID1 and VNI6 may be recorded in the communication device 102. VNI2 is a VNI assigned corresponding to the next hop as the communication device 101, and VNI6 is a VNI assigned corresponding to the next hop as the communication device 105.
[0502] It can be seen that, in one aspect, the EVPN MAC routes sent by communication device 101 and communication device 105 to communication device 102 may each include SID1. However, for communication device 102, communication device 101 and communication device 105 are different next-hop nodes, and therefore, in response to the EVPN MAC route from communication device 101 (i.e., EVPN MAC route 2 in S804), communication device 102 assigns VNI2; and in response to the EVPN MAC route from communication device 105 (i.e., EVPN MAC route 14 in S1404), communication device 102 assigns VNI6.
[0503] S1407: The communication device 102 transmits the EVPN MAC route 15 to the communication device 104.
[0504] In a possible design, the method may further include the following steps: S1408: The communication device 102 records the correspondence between VNI6 and SID1.
[0505] S1409: The communication device 104 generates a MAC entry based on the EVPN MAC route 15.
[0506] For the contents of the implementation processes S1401 to S1409 that are similar to those of S801 to S809, please refer to the corresponding explanations of S801 to S809. Repeated parts will not be explained again.
[0507] With reference to the execution process of the control flow shown in Figure 16, the following describes a process in which the user terminal 118 in data center B forwards a packet to the user terminal 109 in data center A corresponding to VNI 6. Specifically, as shown in Figure 17, this method further includes the following steps:
[0508] S1501: The user terminal 118 transfers the Layer 2 packet 5, whose destination address is the MAC address 1, to the communication device 104.
[0509] S1502: The communication device 104 encapsulates the Layer 2 packet 5 into a VXLAN packet that includes the VNI 6 and has the communication device 102 as its destination address.
[0510] S1503: The communication device 104 transfers the VXLAN packet to the communication device 102.
[0511] For the contents of S1501 to S1503, please refer to the corresponding contents of S301 to S303. Repeated parts will not be explained again.
[0512] S1504: The communication apparatus 102 determines SID1 based on VNI6 in the VXLAN packet.
[0513] S1505: The communication device 102 performs SRv6 encapsulation on the Layer 5 packet 2 to obtain an SRv6 packet.
[0514] The SRv6 packet contains SID1.
[0515] In addition, the communication device 102 may further determine the next hop information (i.e., the communication device 105) of the SRv6 packet based on the VNI6 in the VXLAN packet.
[0516] S1506: The communication device 102 transmits an SRv6 packet to the communication device 105.
[0517] S1507: The communication device 105 determines VNI1 based on SID1 in the SRv6 packet.
[0518] S1508: The communication device 105 performs VXLAN encapsulation on the Layer 2 packet 5 to obtain a VXLAN packet.
[0519] The VXLAN packet includes VNI1.
[0520] S1509: The communication device 105 transfers the VXLAN packet to the communication device 120.
[0521] S1510: The communication device 120 transfers the Layer 2 packet 5 in the VXLAN packet to the user terminal 109.
[0522] For the contents of S1509 and S1510, please refer to the corresponding contents of S309 and S310. Repeated parts will not be explained again.
[0523] With reference to the accompanying drawings, the method provided in this embodiment will be described below from the perspective of a single communication device. Specifically, as shown in Figure 18, the method includes the following steps:
[0524] S1601: A first communication device receives a first EVPN MAC route from a second communication device.
[0525] The first EVPN MAC route carries the first MAC address and the first VNI.
[0526] The first communication device may specifically be the communication device 101 in Figures 2 to 15, and the second communication device may specifically be the communication device 103 in Figures 2 to 15. Specifically, S1601 may specifically be implemented by using the content of S202, S402, or S802.
[0527] S1602: The first communication device generates a second EVPN MAC route based on the first EVPN MAC route.
[0528] The second EVPN MAC route carries the first MAC address and the first SRv6 SID of the first communication device corresponding to the first VNI.
[0529] Specifically, S1602 can be implemented by using the content of S203, S403 or S803.
[0530] S1603: The first communication device sends the second EVPN MAC route to the third communication device.
[0531] The third communication device may specifically be the communication device 102 in Figures 2 to 15. Specifically, S1603 may specifically be implemented by using the content of S204, S404, or S804.
[0532] In a possible design, in this embodiment, the first SRv6 SID is an SRv6 SID assigned to the first EVPN instance of the first communication device.
[0533] For example, if the first communication device is the above-mentioned communication device 101, the first EVPN instance may be the EVPN instance 1011 in the communication device 101. The first SRv6 SID may be the above-mentioned SID1.
[0534] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first VNI.
[0535] In a possible design, the method further comprises the following steps S1604 to S1606.
[0536] S1604: The first communication device receives a third EVPN MAC route.
[0537] The third EVPN MAC route carries a second MAC address and a second VNI, and the third EVPN MAC route corresponds to a second EVPN instance of the first communication device.
[0538] The second EVPN instance may specifically be the EVPN instance 1012 in Figures 7A and 7B and Figures 8A and 8B. Specifically, S1604 may be implemented by using the content of S602.
[0539] S1605: The first communication device generates a fourth EVPN MAC route based on the third EVPN MAC route.
[0540] The fourth EVPN MAC route carries a second MAC address and a second SRv6 SID, where the second SRv6 SID is an SRv6 SID assigned to the second EVPN instance.
[0541] Specifically, S1605 can be implemented by using the contents of S603.
[0542] S1606: The first communication device sends the fourth EVPN MAC route to the third communication device.
[0543] Specifically, S1606 can be implemented by using the contents of S604.
[0544] In a possible design, the method further comprises the following steps:
[0545] S1607: The first communication device records the correspondence between the first SRv6 SID and the first VNI.
[0546] Specifically, S1607 can be implemented by using the contents of S805.
[0547] In one possible design, a first SRv6 SID is associated with a first operation, the first operation performing VXLAN encapsulation.
[0548] In a possible design, the method further comprises the following steps S1608 to S1610.
[0549] S1608: The first communication device receives a fifth EVPN MAC route.
[0550] The fifth EVPN MAC route carries the third MAC address and the first VNI.
[0551] S1608 may be implemented by using the content of S1002. The fifth EVPN MAC route may specifically be EVPN MAC route 7 in S1002.
[0552] S1609: The first communication device generates a sixth EVPN MAC route based on the fifth EVPN MAC route.
[0553] The sixth EVPN MAC route carries a third MAC address and a third SRv6 SID corresponding to the first VNI.
[0554] S1609 may be implemented by using the content of S1003. The sixth EVPN MAC route may specifically be EVPN MAC route 8 in S1003.
[0555] S1610: The first communication device sends the sixth EVPN MAC route to the third communication device.
[0556] S1610 can be implemented by using the contents of S1004.
[0557] In a possible design, the method further comprises the following steps S1611 to S1613.
[0558] S1611: The first communication device receives a seventh EVPN MAC route from the fourth communication device.
[0559] The seventh EVPN MAC route carries the first MAC address and the first VNI.
[0560] 10(b). Specifically, S1611 may be implemented by using the content of S1202, and the seventh EVPN MAC route may be EVPN MAC route 10.
[0561] S1612: The first communication device generates an eighth EVPN MAC route based on the seventh EVPN MAC route.
[0562] The eighth EVPN MAC route carries the first MAC address and the fourth SRv6 SID corresponding to the first VNI.
[0563] Specifically, S1612 may be implemented by using the contents of S1203, and the eighth EVPN MAC route may be EVPN MAC route 11.
[0564] S1613: The first communication device sends the eighth EVPN MAC route to the third communication device.
[0565] Specifically, S1613 can be implemented by using the contents of S1204.
[0566] The following describes the execution process of the first communication device corresponding to Figure 18 from the perspective of a packet forwarding process. Specifically, as shown in Figure 19, the method further includes the following steps:
[0567] S1701: A first communication device receives a first SRv6 packet whose destination address is a first SRv6 SID from a second communication device.
[0568] The first SRv6 packet includes a first Layer 2 packet whose destination address is the first MAC address.
[0569] Specifically, the first communication device may be specifically the communication device 101 in Figures 2 to 15, and the second communication device may be specifically the communication device 102 in Figures 2 to 15. Specifically, S1701 may be specifically implemented by using the content of S306, S506, or S906.
[0570] S1702: The first communication device determines a first VNI based on the first SRv6 SID.
[0571] Specifically, S1702 can be implemented by using the content of S307, S507 or S907.
[0572] In a possible design, the first SRv6 SID is an SRv6 SID assigned to a first EVPN instance of the first communication device, which may be the EVPN instance 1011 described above.
[0573] In a possible design, S1702 includes the following steps:
[0574] S17021: The first communication device determines a first EVPN instance based on the first SRv6 SID.
[0575] S17022: The first communication device determines a first VNI from a MAC table corresponding to the first EVPN instance based on the first MAC address, where the MAC table includes a correspondence between the first MAC address and the first VNI.
[0576] Specifically, for the specific implementation process of S17021 and S17022, please refer to the aforementioned contents of S5071 and S5072.
[0577] In another possible design, S1702 includes the following steps:
[0578] S1702a: The first communication device determines a first VNI based on the first SRv6 SID and the correspondence between the first SRv6 SID and the first VNI recorded in the first communication device.
[0579] Specifically, for the specific implementation process of S1702a, please refer to the aforementioned content of S907.
[0580] The first SRv6 SID is associated with a first operation, which is performing VXLAN encapsulation.
[0581] S1703: The first communication device performs VXLAN encapsulation on the first Layer 2 packet to obtain a first VXLAN packet.
[0582] The first VXLAN packet includes the first VNI1.
[0583] Specifically, S1703 can be implemented by using the content of S308, S508 or S908.
[0584] S1704: The first communication device transfers the first VXLAN packet to the third communication device.
[0585] Specifically, S1703 can be implemented by using the content of S309, S509 or S909.
[0586] In a possible design, the method further comprises the following steps S1705 to S1709.
[0587] S1705: The first communication device receives a second SRv6 packet whose destination address is a second SRv6 SID from the second communication device.
[0588] The second SRv6 packet includes a second Layer 2 packet whose destination address is the second MAC address.
[0589] Specifically, S1705 can be implemented by using the contents of S706.
[0590] S1706: The first communication device determines a second EVPN instance based on the second SRv6 SID.
[0591] Specifically, S1706 may be implemented by using the content of S7071. The second EVPN instance may be understood as EVPN instance 1012.
[0592] S1707: The first communication device determines a second VNI from a MAC table corresponding to a second EVPN instance based on the second MAC address.
[0593] The MAC table includes a correspondence between the second MAC address and the second VNI.
[0594] Specifically, S1707 can be implemented by using the contents of S7072.
[0595] S1708: The first communication device performs VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet.
[0596] The second VXLAN packet includes a second VNI.
[0597] Specifically, S1708 can be implemented by using the contents of S708.
[0598] S1709: The first communication device forwards the second VXLAN packet.
[0599] Specifically, S1709 can be implemented by using the contents of S709.
[0600] In a possible design, the method further comprises the following steps S1710 to S1713.
[0601] S1710: The first communication device receives a third SRv6 packet whose destination address is a third SRv6 SID from the second communication device.
[0602] The third SRv6 packet includes a third Layer 2 packet whose destination address is the third MAC address.
[0603] Specifically, S1710 can be implemented by using the contents of S1106.
[0604] S1711: The first communication device determines a first VNI based on a third SRv6 SID and a correspondence between the third SRv6 SID and the first VNI, which is recorded in the first communication device.
[0605] Specifically, S1711 can be implemented by using the contents of S1107.
[0606] S1712: The first communication device performs VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet.
[0607] The third VXLAN packet includes the first VNI1.
[0608] Specifically, S1712 can be implemented by using the contents of S1108.
[0609] S1713: The first communication device transfers the third VXLAN packet to the third communication device.
[0610] Specifically, S1713 can be implemented by using the contents of S1109.
[0611] In a possible design, the method further comprises the following steps S1714 to S1717.
[0612] S1714: The first communication device receives a fourth SRv6 packet whose destination address is the fourth SRv6 SID from the second communication device.
[0613] The fourth SRv6 packet includes a fourth Layer 2 packet whose destination address is the first MAC address.
[0614] Specifically, S1714 can be implemented by using the contents of S1306.
[0615] S1715: The first communication device determines the first VNI based on the fourth SRv6 SID and the correspondence between the fourth SRv6 SID and the first VNI recorded in the first communication device.
[0616] Specifically, S1715 can be implemented by using the contents of S1307.
[0617] S1716: The first communication device performs VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet.
[0618] The fourth VXLAN packet includes the first VNI1.
[0619] Specifically, S1716 can be implemented by using the contents of S1308.
[0620] S1717: The first communication device transfers the fourth VXLAN packet to the fourth communication device.
[0621] Specifically, S1717 can be implemented by using the contents of S1309.
[0622] In addition, as shown in FIG. 20, the method provided in this embodiment may further include the following steps.
[0623] S1801: A first communication device receives a first EVPN MAC route from a second communication device.
[0624] The first EVPN MAC route carries a first MAC address and a first SRv6 SID.
[0625] The first communication device may be the communication device 102 in Figures 2 to 15, and the second communication device may specifically be the communication device 101 in Figures 2 to 15. Specifically, S1801 may specifically be implemented by using the content of S204, S404, or S804.
[0626] S1802: The first communication device generates a second EVPN MAC route based on the first EVPN MAC route.
[0627] The second EVPN MAC route carries the first MAC address and the first VNI corresponding to the first SRv6 SID.
[0628] Specifically, S1802 can be implemented by using the content of S205, S405 or S806.
[0629] S1803: The first communication device sends the second EVPN MAC route to the third communication device.
[0630] Specifically, S1803 can be implemented by using the content of S206, S406 or S807.
[0631] In a possible design, the first VNI is a VNI assigned to a first EVPN instance of the first communication device.
[0632] For example, if the first communication device is the above-mentioned communication device 102, the first EVPN instance may be the EVPN instance 1021 in the communication device 102. The first VNI may be the above-mentioned VNI2.
[0633] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first SRv6 SID.
[0634] In a possible design, the method further includes S1804 to S1806.
[0635] S1804: The first communication device receives a third EVPN MAC route.
[0636] The third EVPN MAC route carries a second MAC address and a second SRv6 SID; the third EVPN MAC route corresponds to a second EVPN instance.
[0637] The second EVPN instance may specifically be the EVPN instance 1022 in Figures 7A and 7B and 8A and 8B. Specifically, S1804 may be implemented by using the content of S604.
[0638] S1805: The first communication device generates a fourth EVPN MAC route based on the third EVPN MAC route.
[0639] The fourth EVPN MAC route carries a second MAC address and a second VNI, where the second VNI is a VNI assigned to the second EVPN instance. Specifically, S1805 can be implemented by using the content of S605.
[0640] S1806: The first communication device sends the fourth EVPN MAC route to the third communication device.
[0641] Specifically, S1806 can be implemented by using the contents of S606.
[0642] In a possible design, the method further comprises the following steps:
[0643] S1807: The first communication device records the correspondence between the first VNI and the first SRv6 SID.
[0644] Specifically, S1807 can be implemented by using the contents of S808.
[0645] In a possible design, the method further comprises the following steps S1808 to S1810.
[0646] S1808: The first communication device receives a fifth EVPN MAC route.
[0647] The fifth EVPN MAC route carries the third MAC address and the first SRv6 SID. S1808 may be implemented by using the contents of S1004. The fifth EVPN MAC route may specifically be EVPN MAC route 8 in S1004.
[0648] S1809: The first communication device generates a sixth EVPN MAC route based on the fifth EVPN MAC route.
[0649] The sixth EVPN MAC route carries a third MAC address and a third VNI corresponding to the first SRv6 SID.
[0650] S1809 may be implemented by using the content of S1006. The sixth EVPN MAC route may specifically be EVPN MAC route 9 in S1006.
[0651] S1810: The first communication device sends the sixth EVPN MAC route to the third communication device.
[0652] S1810 can be implemented by using the contents of S1007.
[0653] In a possible design, the method further comprises the following steps S1811 to S1813.
[0654] S1811: The first communication device receives a seventh EVPN MAC route from the fourth communication device.
[0655] The seventh EVPN MAC route carries the first MAC address and the first SRv6 SID.
[0656] 10(b). Specifically, S1811 may be implemented by using the content of S1404, and the seventh EVPN MAC route may be EVPN MAC route 14.
[0657] S1812: The first communication device generates an eighth EVPN MAC route based on the seventh EVPN MAC route.
[0658] The eighth EVPN MAC route carries the first MAC address and the fourth VNI corresponding to the first SRv6 SID.
[0659] Specifically, S1812 may be implemented by using the contents of S1406, and the eighth EVPN MAC route may be EVPN MAC route 15.
[0660] S1813: The first communication device sends the eighth EVPN MAC route to the third communication device.
[0661] Specifically, S1812 can be implemented by using the contents of S1407.
[0662] The following describes the execution process of the first communication device corresponding to Figure 20 from the perspective of a packet forwarding process. Specifically, as shown in Figure 21, the method further includes the following steps:
[0663] S1901: The first communication device receives a VXLAN packet including a first VNI from the second communication device.
[0664] The first VXLAN packet includes a first Layer 2 packet whose destination address is the first MAC address.
[0665] Specifically, the first communication device may be specifically the communication device 102 in Figures 2 to 15, and the second communication device may be specifically the communication device 104 in Figures 2 to 15. Specifically, S1901 may be specifically implemented by using the content of S303, S503, or S903.
[0666] S1902: The first communication device determines a first SRv6 SID based on the first VNI.
[0667] Specifically, S1902 can be implemented by using the content of S304, S504, or S904.
[0668] In a possible design, the first VNI is a VNI assigned to a first EVPN instance of the first communication device.
[0669] In a possible design, S1902 includes the following steps:
[0670] S19021: The first communication device determines a first EVPN instance based on the first VNI.
[0671] S19022: The first communication device determines a first SRv6 SID from a MAC table corresponding to the first EVPN instance based on the first MAC address.
[0672] The MAC table includes a correspondence between a first MAC address and a first SRv6 SID.
[0673] Specifically, for the specific implementation process of S19021 and S19022, please refer to the above contents of S5041 and S5042.
[0674] In another possible design, S1902 includes the following steps:
[0675] S1902a: The first communication device determines a first SRv6 SID based on the first VNI and a correspondence between the first VNI and the first SRv6 SID recorded in the first communication device.
[0676] Specifically, for the specific implementation process of S1902a, please refer to the above content of S904.
[0677] S1903: The first communication device performs SRv6 encapsulation on the first Layer 2 packet to obtain a first SRv6 packet.
[0678] The first SRv6 packet includes a first SRv6 SID.
[0679] Specifically, S1903 can be implemented by using the content of S305, S505 or S905.
[0680] S1904: The first communication device forwards the first SRv6 packet to the third communication device.
[0681] Specifically, S1904 can be implemented by using the content of S306, S506, or S906.
[0682] In a possible design, the method further comprises the following steps S1905 to S1909.
[0683] S1905: The first communication device receives a second VXLAN packet including a second VNI from the second communication device.
[0684] The second VXLAN packet includes a second Layer 2 packet whose destination address is the second MAC address.
[0685] S1906: The first communication device determines a second EVPN instance based on the second VNI.
[0686] S1907: The first communication device determines a second SRv6 SID from a MAC table corresponding to a second EVPN instance based on the second MAC address.
[0687] The MAC table includes a correspondence between a second MAC address and a second SRv6 SID.
[0688] S1908: The first communication device performs SRv6 encapsulation on the second Layer 2 packet to obtain a second SRv6 packet.
[0689] The second SRv6 packet includes a second SRv6 SID.
[0690] S1909: The first communication device forwards the second SRv6 packet.
[0691] The above-described steps S1905 to S1909 may be implemented by specifically using the above-described contents of steps S703 to S706. The second EVPN instance may be understood as EVPN instance 1022.
[0692] In a possible design, the method further comprises the following steps S1910 to S1913.
[0693] S1910: The first communication device receives a third VXLAN packet including a third VNI from the second communication device.
[0694] The third VXLAN packet includes a third Layer 2 packet whose destination address is the third MAC address.
[0695] S1911: The first communication device determines a first SRv6 SID based on a third VNI and a correspondence between the third VNI and the first SRv6 SID recorded in the first communication device.
[0696] S1912: The first communication device performs SRv6 encapsulation on the third Layer 2 packet to obtain a third SRv6 packet.
[0697] The third SRv6 packet contains the first SRv6 SID.
[0698] S1913: The first communication device forwards the third SRv6 packet to the third communication device.
[0699] The above-described steps S1910 to S1913 can be specifically implemented by using the above-described contents of steps S1103 to S1106.
[0700] In a possible design, the method further comprises the following steps S1914 to S1917.
[0701] S1914: The first communication device receives a fourth VXLAN packet including a fourth VNI from the second communication device.
[0702] The fourth VXLAN packet includes a fourth Layer 2 packet whose destination address is the first MAC address.
[0703] S1915: The first communication device determines a first SRv6 SID based on the fourth VNI and the correspondence between the fourth VNI and the first SRv6 SID recorded in the first communication device.
[0704] S1916: The first communication device performs SRv6 encapsulation on the fourth Layer 2 packet to obtain a fourth SRv6 packet.
[0705] The fourth SRv6 packet contains the first SRv6 SID.
[0706] S1917: The first communication device forwards the fourth SRv6 packet to the fourth communication device.
[0707] The above-described steps S1914 to S1917 can be specifically implemented by using the above-described contents of steps S1303 to S1306.
[0708] Based on the above method embodiment, the following describes a communication device provided in this embodiment.
[0709] Figure 22 is a schematic diagram of a possible structure of a communication device in the embodiment of the aforementioned method. The first communication device 200 may implement the functions of the communication device 101 in the embodiments shown in Figures 2 to 15, the first communication device 200 may implement the functions of the communication device 102 in the embodiments shown in Figures 2 to 17, or the first communication device 200 may implement the functions of the first communication device in the embodiments shown in Figures 18 to 21.
[0710] See Figure 22. The first communication device 200 includes a transceiver unit 2001 and a processing unit 2002. These units may perform the corresponding functions of each communication device in the above-mentioned method examples.
[0711] In a possible implementation, the transceiver unit 2001 is configured to receive a first Ethernet Virtual Private Network Medium Access Control (EVPN) MAC route from the second communication device, the first EVPN MAC route carrying a first MAC address and a first Virtual Extensible Local Area Network Identifier (VNI).
[0712] The processing unit 2002 is configured to generate a second EVPN MAC route based on the first EVPN MAC route, the second EVPN MAC route carrying the first MAC address and a first segment routing over IPv6 segment identifier SRv6 SID that is of the first communication device and corresponds to the first VNI.
[0713] The transceiver unit 2001 is configured to transmit the second EVPN MAC route to a third communication device.
[0714] In a possible design, the transceiver unit 2001 is configured to receive a first Ethernet Virtual Private Network Medium Access Control (EVPN) MAC route from the second communication device, the first EVPN MAC route carrying a first MAC address and a first Virtual Extensible Local Area Network Identifier (VNI).
[0715] The processing unit 2002 is configured to generate a second EVPN MAC route based on the first EVPN MAC route, the second EVPN MAC route carrying the first MAC address and a first segment routing over IPv6 segment identifier SRv6 SID that is of the first communication device and corresponds to the first VNI.
[0716] The transceiver unit 2001 is further configured to transmit the second EVPN MAC route to the third communication device.
[0717] In a possible design, the first SRv6 SID is an SRv6 SID assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0718] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first VNI.
[0719] In a possible design, the transceiver unit 2001 is further configured to receive a third EVPN MAC route, the third EVPN MAC route carrying a second MAC address and a second VNI, and the third EVPN MAC route corresponding to a second EVPN instance of the first communication device.
[0720] The processing unit 2002 is further configured to generate a fourth EVPN MAC route based on the third EVPN MAC route, the fourth EVPN MAC route carrying a second MAC address and a second SRv6 SID, the second SRv6 SID being an SRv6 SID assigned to the second EVPN instance.
[0721] The transceiver unit 2001 is further configured to transmit the fourth EVPN MAC route to the third communication device.
[0722] In a possible design, the processing unit 2002 is further configured to record, by the first communication device, a correspondence between the first SRv6 SID and the first VNI.
[0723] In a possible design, the first SRv6 SID is associated with a first operation, and the first operation is performing a Virtual Extensible Local Area Network (VXLAN) encapsulation.
[0724] In a possible design, the transceiver unit 2001 is further configured to receive a fifth EVPN MAC route, the fifth EVPN MAC route carrying the third MAC address and the first VNI.
[0725] The processing unit 2002 is further configured to generate a sixth EVPN MAC route based on the fifth EVPN MAC route, the sixth EVPN MAC route carrying a third MAC address and a third SRv6 SID corresponding to the first VNI, and the first communication device transmits the sixth EVPN MAC route to the third communication device.
[0726] In a possible design, the transceiver unit 2001 is further configured to receive a seventh EVPN MAC route from the fourth communication device, the seventh EVPN MAC route carrying the first MAC address and the first VNI.
[0727] The processing unit 2002 is further configured to generate an eighth EVPN MAC route based on the seventh EVPN MAC route, where the eighth EVPN MAC route carries the first MAC address and a fourth SRv6 SID corresponding to the first VNI.
[0728] The transceiver unit 2001 is further configured to transmit the eighth EVPN MAC route to the third communication device.
[0729] In a possible design, the transceiver unit 2001 is further configured to receive a first SRv6 packet from the third communication device, the SRv6 packet having a destination address of the first SRv6 SID, the SRv6 packet including a first Layer 2 packet having a destination address of the first MAC address.
[0730] The processing unit 2002 is further configured to determine a first VNI based on the first SRv6 SID.
[0731] The processing unit 2002 is further configured to perform VXLAN encapsulation on the first Layer 2 packet to obtain a first VXLAN packet, where the first VXLAN packet includes the first VNI.
[0732] The transceiver unit 2001 is further configured to forward the first VXLAN packet to a second communication device.
[0733] In a possible design, the processing unit 2002 being further configured to determine the first VNI based on the first SRv6 SID includes:
[0734] The processing unit 2002 is further configured to determine a first EVPN instance based on the first SRv6 SID; the processing unit 2002 is further configured to determine a first VNI from a MAC table corresponding to the first EVPN instance based on the first MAC address, where the MAC table includes a correspondence between the first MAC address and the first VNI.
[0735] In a possible design, the processing unit 2002 is further configured to receive a second SRv6 packet from the third communication device, the second SRv6 packet having a destination address of the second SRv6 SID, the second SRv6 packet including a second Layer 2 packet having a destination address of the second MAC address; the processing unit 2002 is further configured to determine a second EVPN instance based on the second SRv6 SID; the processing unit 2002 is further configured to determine a second VNI from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second VNI; the first communication device performs VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet, the second VXLAN packet including the second VNI; and the transceiver unit 2001 is further configured to forward the second VXLAN packet.
[0736] In a possible design, the processing unit 2002 being further configured to determine the first VNI based on the first SRv6 SID includes the processing unit 2002 being further configured to determine the first VNI based on the first SRv6 SID and a correspondence between the first SRv6 SID and the first VNI, recorded in the first communication device.
[0737] In a possible design, the transceiver unit 2001 is further configured to receive a third SRv6 packet from the third communication device, the third SRv6 packet having a destination address of the third SRv6 SID, the third SRv6 packet including a third Layer 2 packet having a destination address of the third MAC address; the processing unit 2002 is further configured to determine the first VNI based on the third SRv6 SID and a correspondence between the third SRv6 SID and the first VNI, recorded in the first communication device; the processing unit 2002 is further configured to perform VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet, the third VXLAN packet including the first VNI; and the transceiver unit 2001 is further configured to forward the third VXLAN packet to the second communication device.
[0738] In a possible design, the transceiver unit 2001 is further configured to receive a fourth SRv6 packet from the third communication device, the fourth SRv6 packet having a destination address of the fourth SRv6 SID, the fourth SRv6 packet including a fourth Layer 2 packet having a destination address of the first MAC address; the processing unit 2002 is further configured to determine the first VNI based on the fourth SRv6 SID and a correspondence between the fourth SRv6 SID and the first VNI, recorded in the first communication device; the processing unit 2002 is further configured to perform VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet, the fourth VXLAN packet including the first VNI; and the transceiver unit 2001 is further configured to forward the fourth VXLAN packet to the fourth communication device.
[0739] In another implementation, the transceiver unit 2001 is configured to receive a first SRv6 packet from a second communication device, the first SRv6 packet having a destination address that is a first segment routing over IPv6 segment identifier (SRv6 SID), the first SRv6 packet including a first Layer 2 packet having a destination address that is a first medium access control (MAC) address; the processing unit 2002 is configured to determine a first virtual extensible local area network identifier (VNI) based on the first SRv6 SID; the processing unit 2002 is further configured to perform virtual extensible local area network (VXLAN) encapsulation on the first Layer 2 packet to obtain a first VXLAN packet, the first VXLAN packet including the first VNI; the transceiver unit 2001 is further configured to forward the first VXLAN packet to a third communication device.
[0740] In a possible design, the first SRv6 SID is an SRv6 SID assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0741] In a possible design, the processing unit 2002 being configured to determine the first VNI based on the first SRv6 SID includes the processing unit 2002 being configured to determine the first EVPN instance based on the first SRv6 SID; the processing unit 2002 being configured to determine the first VNI from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first VNI.
[0742] In a possible design, the transceiver unit 2001 is further configured to receive a second SRv6 packet from the second communication device, the second SRv6 packet having a destination address of a second SRv6 SID, the second SRv6 packet including a second Layer 2 packet having a destination address of a second MAC address; the processing unit 2002 is further configured to determine a second EVPN instance based on the second SRv6 SID; the processing unit 2002 is further configured to determine a second VNI from a MAC table corresponding to the second EVPN instance based on the second MAC address, the MAC table including a correspondence between the second MAC address and the second VNI; the processing unit 2002 is further configured to perform VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet, the second VXLAN packet including the second VNI; and the transceiver unit 2001 is further configured to forward the second VXLAN packet.
[0743] In a possible design, the processing unit 2002 being further configured to determine the first VNI based on the first SRv6 SID includes the processing unit 2002 being further configured to determine the first VNI based on the first SRv6 SID and a correspondence between the first SRv6 SID and the first VNI, recorded in the first communication device.
[0744] In a possible design, the first SRv6 SID is associated with a first operation, and the first operation is performing VXLAN encapsulation.
[0745] In a possible design, the transceiver unit 2001 is further configured to receive a third SRv6 packet from the second communication device, the third SRv6 packet having a destination address of a third SRv6 SID, the third SRv6 packet including a third Layer 2 packet having a destination address of a third MAC address.
[0746] The processing unit 2002 is further configured to determine the first VNI based on the third SRv6 SID and a correspondence between the third SRv6 SID and the first VNI recorded in the first communication device.
[0747] The processing unit 2002 is further configured to perform VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet, where the third VXLAN packet includes the first VNI.
[0748] The transceiver unit 2001 is further configured to forward the third VXLAN packet to a third communication device.
[0749] In a possible design, the transceiver unit 2001 is further configured to receive a fourth SRv6 packet from the second communication device, the fourth SRv6 packet having a destination address of a fourth SRv6 SID, the fourth SRv6 packet including a fourth Layer 2 packet having a destination address of the first MAC address.
[0750] The processing unit 2002 is further configured to determine the first VNI based on the fourth SRv6 SID and a correspondence between the fourth SRv6 SID and the first VNI recorded in the first communication device.
[0751] The processing unit 2002 is further configured to perform VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet, where the fourth VXLAN packet includes the first VNI.
[0752] The transceiver unit 2001 is further configured to forward the fourth VXLAN packet to a fourth communication device.
[0753] In another possible implementation, the transceiver unit 2001 is configured to receive a first Ethernet Virtual Private Network Medium Access Control (EVPN) MAC route from the second communication device, the first EVPN MAC route carrying a first MAC address and a first SRv6 SID.
[0754] The processing unit 2002 is configured to generate a second EVPN MAC route based on the first EVPN MAC route, where the second EVPN MAC route carries the first MAC address and a first virtual extensible local area network identifier VNI corresponding to the first SRv6 SID.
[0755] The transceiver unit 2001 is further configured to transmit the second EVPN MAC route to the third communication device.
[0756] In a possible design, the first VNI is a VNI assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0757] In a possible design, a MAC table corresponding to the first EVPN instance includes a correspondence between a first MAC address and a first SRv6 SID.
[0758] In a possible design, the transceiver unit 2001 is further configured to receive a third EVPN MAC route, where the third EVPN MAC route carries a second MAC address and a second SRv6 SID, and where the third EVPN MAC route corresponds to a second EVPN instance.
[0759] The processing unit 2002 is further configured to generate a fourth EVPN MAC route based on the third EVPN MAC route, the fourth EVPN MAC route carrying a second MAC address and a second VNI, the second VNI being a VNI assigned to the second EVPN instance.
[0760] The transceiver unit 2001 is further configured to transmit the fourth EVPN MAC route to the third communication device.
[0761] In a possible design, the processing unit 2002 is further configured to record a correspondence between the first VNI and the first SRv6 SID.
[0762] In a possible design, the transceiver unit 2001 is further configured to receive a fifth EVPN MAC route, the fifth EVPN MAC route carrying the third MAC address and the first SRv6 SID.
[0763] The processing unit 2002 is further configured to generate a sixth EVPN MAC route based on the fifth EVPN MAC route, where the sixth EVPN MAC route carries a third MAC address and a third VNI corresponding to the first SRv6 SID.
[0764] The transceiver unit 2001 is further configured to transmit the sixth EVPN MAC route to the third communication device.
[0765] In a possible design, the transceiver unit 2001 is further configured to receive a seventh EVPN MAC route from the fourth communication device, the seventh EVPN MAC route carrying the first MAC address and the first SRv6 SID.
[0766] The processing unit 2002 is further configured to generate an eighth EVPN MAC route based on the seventh EVPN MAC route, where the eighth EVPN MAC route carries the first MAC address and a fourth VNI corresponding to the first SRv6 SID.
[0767] The transceiver unit 2001 is further configured to transmit the eighth EVPN MAC route to the third communication device.
[0768] In a possible design, the transceiver unit 2001 is further configured to receive a first VXLAN packet from a third communication device, the first VXLAN packet including a first VNI, the first VXLAN packet including a first Layer 2 packet whose destination address is the first MAC address.
[0769] The processing unit 2002 is further configured to generate a first SRv6 SID based on the first VNI.
[0770] The processing unit 2002 is further configured to perform SRv6 encapsulation on the first Layer 2 packet to obtain a first SRv6 packet, where the first SRv6 packet includes the first SRv6 SID.
[0771] The transceiver unit 2001 is further configured to forward the first SRv6 packet to a second communication device.
[0772] In a possible design, the processing unit 2002 further configured to determine a first SRv6 SID based on the first VNI includes:
[0773] The processing unit 2002 is further configured to determine a first EVPN instance based on the first VNI; the processing unit 2002 is further configured to determine a first SRv6 SID from a MAC table corresponding to the first EVPN instance based on the first MAC address, the MAC table including a correspondence between the first MAC address and the first SRv6 SID.
[0774] In a possible design, the transceiver unit 2001 is further configured to receive a second VXLAN packet from a third communication device, the second VXLAN packet including a second VNI, the second VXLAN packet including a second Layer 2 packet whose destination address is a second MAC address.
[0775] The processing unit 2002 is further configured to determine a second EVPN instance based on the second VNI.
[0776] The processing unit 2002 is further configured to determine, based on the second MAC address, a second SRv6 SID from a MAC table corresponding to the second EVPN instance, where the MAC table includes a correspondence between the second MAC address and the second SRv6 SID.
[0777] The processing unit 2002 is further configured to perform SRv6 encapsulation on the second Layer 2 packet to obtain a second SRv6 packet, where the second SRv6 packet includes a second SRv6 SID.
[0778] The transceiver unit 2001 is further configured to forward the second SRv6 packet.
[0779] In a possible design, the processing unit 2002 further configured to determine a first SRv6 SID based on the first VNI includes:
[0780] The processing unit 2002 is further configured to determine the first SRv6 SID based on the first VNI and a correspondence between the first VNI and the first SRv6 SID recorded in the first communication device.
[0781] In a possible design, the transceiver unit 2001 is further configured to receive a third VXLAN packet from a third communication device, the third VXLAN packet including a third VNI, the third VXLAN packet including a third Layer 2 packet whose destination address is a third MAC address.
[0782] The processing unit 2002 is further configured to determine the first SRv6 SID based on the third VNI and a correspondence between the third VNI and the first SRv6 SID recorded in the first communication device.
[0783] The processing unit 2002 is further configured to perform SRv6 encapsulation on the third Layer 2 packet to obtain a third SRv6 packet, where the third SRv6 packet includes the first SRv6 SID.
[0784] The transceiver unit 2001 is further configured to forward the third SRv6 packet to the second communication device.
[0785] In a possible design, the transceiver unit 2001 is further configured to receive a fourth VXLAN packet from the third communication device, the fourth VXLAN packet including a fourth VNI, the fourth VXLAN packet including a fourth Layer 2 packet whose destination address is the first MAC address.
[0786] The processing unit 2002 is further configured to determine the first SRv6 SID based on the fourth VNI and a correspondence between the fourth VNI and the first SRv6 SID recorded in the first communication device.
[0787] The processing unit 2002 is further configured to perform SRv6 encapsulation on the fourth Layer 2 packet to obtain a fourth SRv6 packet, where the fourth SRv6 packet includes the first SRv6 SID.
[0788] The transceiver unit 2001 is further configured to forward the fourth SRv6 packet to the fourth communication device.
[0789] In another possible implementation, the transceiver unit 2001 is configured to receive a first virtual extensible local area network (VXLAN) packet from a second communication device, the first VXLAN packet including a first virtual extensible local area network identifier (VNI), the first VXLAN packet including a first Layer 2 packet having a destination address that is a first medium access control (MAC) address.
[0790] The processing unit 2002 is configured to determine a first segment routing over IPv6 segment identifier SRv6 SID based on the first VNI.
[0791] The processing unit 2002 is further configured to perform SRv6 encapsulation on the first Layer 2 packet to obtain a first SRv6 packet, where the first SRv6 packet includes the first SRv6 SID.
[0792] The transceiver unit 2001 is further configured to forward the first SRv6 packet to a third communication device.
[0793] In a possible design, the first VNI is a VNI assigned to a first Ethernet Virtual Private Network EVPN instance of the first communication device.
[0794] In a possible design, the processing unit 2002 being configured to determine a first segment routing over IPv6 segment identifier SRv6 SID based on the first VNI includes:
[0795] The processing unit 2002 is configured to determine a first EVPN instance based on the first VNI.
[0796] The processing unit 2002 is configured to determine, based on the first MAC address, a first SRv6 SID from a MAC table corresponding to the first EVPN instance, where the MAC table includes a correspondence between the first MAC address and the first SRv6 SID.
[0797] In a possible design, the transceiver unit 2001 is further configured to receive a second VXLAN packet from a second communication device, the second VXLAN packet including a second VNI, the second VXLAN packet including a second Layer 2 packet whose destination address is a second MAC address.
[0798] The processing unit 2002 is further configured to determine a second EVPN instance based on the second VNI.
[0799] The processing unit 2002 is further configured to determine, based on the second MAC address, a second SRv6 SID from a MAC table corresponding to the second EVPN instance, where the MAC table includes a correspondence between the second MAC address and the second SRv6 SID.
[0800] The processing unit 2002 is further configured to perform SRv6 encapsulation on the second Layer 2 packet to obtain a second SRv6 packet, where the second SRv6 packet includes a second SRv6 SID.
[0801] The transceiver unit 2001 is further configured to forward the second SRv6 packet.
[0802] In a possible design, the processing unit 2002 further configured to determine a first segment routing over IPv6 segment identifier (SRv6 SID) based on the first VNI includes:
[0803] The processing unit 2002 is further configured to determine the first SRv6 SID based on the first VNI and a correspondence between the first VNI and the first SRv6 SID recorded in the first communication device.
[0804] In a possible design, the transceiver unit 2001 is further configured to receive a third VXLAN packet from the second communication device, the third VXLAN packet including a third VNI, the third VXLAN packet including a third Layer 2 packet whose destination address is a third MAC address.
[0805] The processing unit 2002 is further configured to determine the first SRv6 SID based on the third VNI and a correspondence between the third VNI and the first SRv6 SID recorded in the first communication device.
[0806] The processing unit 2002 is further configured to perform SRv6 encapsulation on the third Layer 2 packet to obtain a third SRv6 packet, where the third SRv6 packet includes the first SRv6 SID.
[0807] The transceiver unit 2001 is further configured to forward the third SRv6 packet to a third communication device.
[0808] In a possible design, the transceiver unit 2001 is further configured to receive a fourth VXLAN packet from the second communication device, the fourth VXLAN packet including a fourth VNI, the fourth VXLAN packet including a fourth Layer 2 packet whose destination address is the first MAC address.
[0809] The processing unit 2002 is further configured to determine the first SRv6 SID based on the fourth VNI and a correspondence between the fourth VNI and the first SRv6 SID recorded in the first communication device.
[0810] The processing unit 2002 is further configured to perform SRv6 encapsulation on the fourth Layer 2 packet to obtain a fourth SRv6 packet, where the fourth SRv6 packet includes the first SRv6 SID.
[0811] The transceiver unit 2001 is further configured to forward the fourth SRv6 packet to the fourth communication device.
[0812] It should be noted that in this embodiment of the present application, the division into units is an example and is merely a logical division of functions. In actual implementation, other division schemes may be used. The functional units in the embodiments of the present application may be integrated into one processing unit, or each of these units may exist physically alone, or two or more units may be integrated into one unit. For example, in the above-mentioned embodiments, the processing unit and the transmitting unit may be the same unit or different units. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0813] Figure 23 is a schematic diagram of another possible structure of a communication device in the embodiment of the aforementioned method. The first communication device 300 may implement the functions of the communication device 101 in the embodiments shown in Figures 2 to 15, the first communication device 300 may implement the functions of the communication device 102 in the embodiments shown in Figures 2 to 17, or the first communication device 300 may implement the functions of the first communication device in the embodiments shown in Figures 18 to 21.
[0814] Please refer to Figure 23. The first communication device 300 includes all or some hardware in a processor 3001, a communication interface 3002, and a memory 3003. There may be one or more processors 3001 in the first communication device 300. In Figure 23, one processor is used as an example. In this embodiment of the present application, the processor 3001, the communication interface 3002, and the memory 3003 may be connected by using a bus system or in another manner. In Figure 23, an example is used in which a bus system 3004 is used for connection.
[0815] The processor 3001 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor 3001 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0816] The communication interface 3002 is configured to receive and transmit data. Specifically, the communication interface 3002 may include a receiving interface and a transmitting interface. The receiving interface may be configured to receive data, and the transmitting interface may be configured to transmit data. There may be one or more communication interfaces 3002.
[0817] The memory 3003 may include volatile memory, such as random access memory (RAM). Alternatively, the memory 3003 may include non-volatile memory, such as flash memory, a hard disk drive (HDD), or a solid-state drive (SSD). Alternatively, the memory 3003 may include a combination of the aforementioned types of memory.
[0818] Optionally, the memory 3003 stores an operating system and programs, executable modules or data structures, a subset thereof, or an extended set thereof. The programs may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor 3001 may read the programs in the memory 3003 to implement the methods provided in the embodiments of the present application.
[0819] The memory 3003 may be a storage device within the first communication device 300 or may be a storage device separate from the first communication device 300 .
[0820] The bus system 3004 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus system 3004 may be categorized into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used to represent a bus in Figure 23, but this does not imply that there is only one bus or only one type of bus.
[0821] Figure 24 is a schematic diagram of another structure of a communication device according to an embodiment of the present application. The first communication device 400 may implement the functions of the communication device 101 in the embodiments shown in Figures 2 to 15, the first communication device 400 may implement the functions of the communication device 102 in the embodiments shown in Figures 2 to 17, or the first communication device 400 may implement the functions of the first communication device in the embodiments shown in Figures 18 to 21.
[0822] The first communication device 400 includes a main control board 4001 and an interface board 4003 .
[0823] The main control board 4001 is also referred to as a main processing unit (MPU) or a route processor card. The main control board 4001 controls and manages the components within the first communication device 400, including functions such as routing calculation, device management, device maintenance, and protocol processing. The main control board 4001 includes a central processing unit 40011 and a memory 40012.
[0824] The interface board 4003 is also referred to as a line processing unit (LPU), line card, or service board. The interface board 4003 is configured to provide various service interfaces and transfer data packets. The service interfaces include, but are not limited to, an Ethernet interface and a Packet over SONET / SDH (POS) interface. The Ethernet interface is, for example, a Flexible Ethernet service interface (Flexible Ethernet Client, FlexE Client). The interface board 4003 includes a central processing unit 40031, a network processor 40032, a forwarding entry memory 40034, and a physical interface card (PIC) 40033.
[0825] A central processing unit 40031 on the interface board 4003 is configured to control and manage the interface board 4003 and to communicate with a central processing unit 40011 on the main control board 4001 .
[0826] The network processor 40032 is configured to implement packet forwarding processing. The network processor 40032 may take the form of a forwarding chip. Specifically, processing on uplink packets includes processing at a packet input interface and forwarding table lookup, and processing on downlink packets includes forwarding table lookup, etc.
[0827] The physical interface card 40033 is configured to implement interconnection functions at the physical layer. Original traffic enters the interface board 4003 from the physical interface card 40033, and processed packets are transmitted from the physical interface card 40033. The physical interface card 40033 includes at least one physical interface. A physical interface is also referred to as a physical port. The physical interface card 40033, also referred to as a subcard, may be installed on the interface board 4003 and is responsible for converting optical / electrical signals into packets, performing validity checks on the packets, and forwarding the packets to the network processor 40032 for processing. In some embodiments, the central processing unit 40031 of the interface board 1103 may alternatively perform the functions of the network processor 40032, for example, implementing software forwarding based on a general-purpose CPU. Therefore, the network processor 40032 is not required in the physical interface card 40033.
[0828] Optionally, the first communication device 400 includes a plurality of interface boards. For example, the first communication device 400 further includes an interface board 4004, which includes a central processing unit 40041, a network processor 40042, a forwarding entry memory 40044, and a physical interface card 40043.
[0829] Optionally, the first communication device 400 further includes a switching board 4002. The switching board 4002 may also be referred to as a switch fabric unit (SFU). When the first communication device has multiple interface boards 4003, the switching board 4002 is configured to complete data exchange between the interface boards. For example, the interface board 4003 and the interface board 4004 may communicate with each other through the switching board 4002.
[0830] The main control board 4001 is coupled to the interface board 4003. For example, the main control board 4001, the interface board 4003, the interface board 4004, and the switching board 4002 are connected to a system backplane through a system bus to implement interworking. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 4001 and the interface board 4003, and communication is performed between the main control board 4001 and the interface board 4003 through the IPC channel.
[0831] Logically, the first communication device 400 includes a control plane and a forwarding plane. The control plane includes a main control board 4001 and a central processing unit 40031. The forwarding plane includes components for performing forwarding, such as a forwarding entry memory 40034, a physical interface card 40033, and a network processor 40032. The control plane performs functions such as routing, generating forwarding tables, processing signaling and protocol packets, and configuring and maintaining device status. The control plane communicates the generated forwarding tables to the forwarding plane. In the forwarding plane, based on the forwarding tables communicated from the control plane, the network processor 40032 looks up the tables and forwards packets received by the physical interface card 40033. The forwarding tables communicated from the control plane may be stored in the forwarding entry memory 40034. In some embodiments, the control plane and the forwarding plane may be completely separate and not on the same device.
[0832] It should be understood that the processing unit 2002 in the first communication device 200 may be equivalent to the central processing unit 40011 or the central processing unit 40031 in the first communication device 400.
[0833] It should be understood that in this embodiment of the present application, the operations for interface board 4004 are the same as the operations for interface board 4003. For the sake of brevity, the details will not be repeated.
[0834] It may be understood that there may be one or more main control boards. If there are multiple main control boards, the main control board may include an active main control board and a standby main control board. One or more interface boards may be present, and a first communication device 400 with stronger data processing capabilities provides more interface boards. One or more physical interface cards may also be present on the interface board. There may be no switching board, or there may be one or more switching boards. If there are multiple switching boards, both load balancing and redundant backup may be implemented. In a centralized forwarding architecture, the first communication device 400 may not require a switching board, and the interface board performs the service data processing function for the entire system. In a distributed forwarding architecture, the first communication device 400 may have at least one switching board, and by using the switching board, data is exchanged between multiple interface boards, providing the ability to exchange and process larger amounts of data. Therefore, the data access and processing capabilities of the first communication device 400 in the distributed architecture are greater than those of a device in a centralized architecture. Optionally, the first communication device 400 may alternatively have a form in which only one card exists inside. Specifically, there is no switching board, and the functions of the interface board and the main control board are integrated on the card. In this case, the central processing unit on the interface board and the central processing unit on the main control board are combined to form one central processing unit on the card, and the functions obtained by combining these two central processing units can be executed. Devices of this form (e.g., low-end switches or routers) have relatively weak data exchange and processing capabilities. The specific architecture used depends on the specific networking deployment scenario.
[0835] In some possible embodiments, the aforementioned communication devices may be implemented as virtualization devices. For example, the virtualized device may be a virtual machine (VM) on which a program having a packet transmission function is executed, and the virtual machine is deployed on a hardware device (e.g., a physical server). The virtual machine is a complete software-simulated computer system that has complete hardware system functions and operates in a completely isolated environment. The virtual machine may be configured as a communication device. For example, the function of the communication device may be implemented based on a general-purpose physical server in combination with network functions virtualization (NFV) technology. After reading this application, a person skilled in the art may refer to NFV technology to obtain a communication device having the above-mentioned functions on a general-purpose physical server through virtualization. Details will not be described here.
[0836] An embodiment of the present application further provides a chip including a processor and an interface circuit. The interface circuit is configured to receive instructions and transmit the instructions to the processor. The processor may be configured to perform the operations of each communication device in the above-mentioned communication method. The processor is coupled to a memory. The memory is configured to store a program or instructions. When the program or instructions are executed by the processor, the chip system is capable of implementing the method in any one of the above-mentioned method embodiments.
[0837] Optionally, one or more processors may be present in the chip system. The processor may be implemented using hardware or software. If the processor is implemented using hardware, the processor may be a logic circuit, an integrated circuit, or the like. If the processor is implemented using software, the processor may be a general-purpose processor and is implemented by reading software code stored in a memory.
[0838] Optionally, one or more memories may also be present in the chip system. The memory may be integrated with the processor or located separately from the processor. This is not limited in this application. For example, the memory may be a non-transitory processor, such as a read-only memory (ROM). The memory and the processor may be integrated into the same chip or located separately on different chips. The type of memory and the arrangement of the memory and the processor are not particularly limited in this application.
[0839] For example, the chip system may be a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU) or a programmable logic device (PLD), or another integrated chip.
[0840] An embodiment of the present application further provides a computer-readable storage medium containing instructions or a computer program, which, when executed on a computer, enables the computer to perform the communication method provided in the aforementioned embodiment.
[0841] An embodiment of the present application further provides a computer program product including instructions or a computer program, which, when executed on a computer, enables the computer to perform the packet forwarding method provided in the aforementioned embodiment.
[0842] In the specification, claims, and accompanying drawings of this application, terms such as "first," "second," "third," "fourth," etc. (when present) are intended to distinguish between similar objects, but do not necessarily indicate a particular order or sequence. It should be understood that data labeled in such a manner may be interchanged, where appropriate, so that the embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein. In addition, the terms "comprise" and "have," as well as any other variations, are intended to include non-exclusive inclusions. For example, a process, method, system, product, or device that includes a list of steps or units is not necessarily limited to those explicitly listed steps or units, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.
[0843] For the purpose of simple and concise description, it can be clearly understood by those skilled in the art that the detailed operation processes of the above-mentioned systems, devices and units should be referred to the corresponding processes in the above-mentioned method embodiments, and the details will not be described again here.
[0844] In some embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the described device embodiments are merely examples. For example, the division into units is merely a logical division of services, and may be otherwise implemented in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some functions may be omitted or not performed. In addition, the shown or described mutual couplings or direct couplings or communication connections may be implemented using some interfaces. Indirect couplings or communication connections between devices or units may be implemented in electronic, mechanical, or other forms.
[0845] The units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units, in other words, they may be located in one location or distributed over multiple network units. To achieve the objectives of the solutions of the embodiments in this application, some or all of the units may be selected according to actual requirements.
[0846] In one or more of the foregoing examples, those skilled in the art will recognize that the services described herein may be implemented using hardware, software, firmware, or any combination thereof. If the services are implemented using software, they may be stored on or transmitted as one or more instructions or code in a computer-readable medium. Computer-readable media include computer storage media and communication media, and communication media include any medium that allows a computer program to be transmitted from one place to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer.
[0847] In the above specific implementation, the objectives, technical solutions and advantages of the present application are described in more detail. It should be understood that the above description is only a specific implementation of the present application.
[0848] The above embodiments are only intended to describe the technical solutions of the present application, rather than limiting the present application. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that, without departing from the scope of the technical solutions of the embodiments of the present application, further modifications may be made to the technical solutions described in the above embodiments, or equivalent substitutions may be made for some technical features thereof.
Claims
1. a memory having instructions; and Processor A first communication device comprising: When the instructions are executed by the processor, the processor: receiving a first Ethernet Virtual Private Network Medium Access Control (EVP) MAC route from a second communication device, wherein the first EVPN MAC route carries a first MAC address and a first Virtual Extensible Local Area Network Identifier (VNI) of a first user terminal connected with the second communication device; generating a second EVPN MAC route based on the first EVPN MAC route, wherein the second EVPN MAC route carries the first MAC address and a first segment routing over IPv6 segment identifier (SRv6 SID) of the first communication device and corresponding to the first VNI; and transmitting the second EVPN MAC route to a third communication device; causing the first communication device to execute A first communication device.
2. When the instructions are executed by the processor, the processor further determining the first SRv6 SID corresponding to the first VNI according to an SRv6 SID allocation policy, where the SRv6 SID allocation policy includes at least one of: allocating different SRv6 SIDs based on different EVPN instances corresponding to EVPN MAC routes; allocating different SRv6 SIDs based on different MAC addresses carried in the EVPN MAC routes; or allocating different SRv6 SIDs based on EVPN MAC routes from different communication devices. causing the first communication device to execute The first communication device according to claim 1 .
3. The first communications device of claim 1 , wherein the first SRv6 SID is an SRv6 SID assigned to a first Ethernet Virtual Private Network EVPN instance of the first communications device.
4. The first communication device of claim 3 , wherein a MAC table corresponding to the first EVPN instance includes a correspondence between the first MAC address and the first VNI.
5. When the instructions are executed by the processor, the processor further receiving a third EVPN MAC route from the second communication device, where the third EVPN MAC route carries a second MAC address and a second VNI of a second user terminal connected to the second communication device, and the third EVPN MAC route corresponds to a second EVPN instance of the first communication device; generating a fourth EVPN MAC route based on the third EVPN MAC route, wherein the fourth EVPN MAC route carries the second MAC address and a second SRv6 SID, the second SRv6 SID being an SRv6 SID assigned to the second EVPN instance; and transmitting the fourth EVPN MAC route to the third communication device; causing the first communication device to execute The first communication device according to claim 3 .
6. 6. The first communications device of claim 1, wherein the instructions, when executed by the processor, further cause the processor to perform a procedure of recording a correspondence between the first SRv6 SID and the first VNI.
7. 7. The first communication device of claim 6, wherein the first SRv6 SID is associated with a first operation, the first operation performing Virtual Extensible Local Area Network (VXLAN) encapsulation.
8. When the instructions are executed by the processor, the processor: receiving a first SRv6 packet from the third communication device, the destination address of which is a third SRv6 SID, wherein the first SRv6 packet includes a first Layer 2 packet, the destination address of which is a third MAC address of a third user terminal connected to the second communication device; determining a third VNI based on the third SRv6 SID; performing a Virtual Extensible Local Area Network (VXLAN) encapsulation on the first Layer 2 packet to obtain a first VXLAN packet, wherein the first VXLAN packet includes the third VNI; and and transferring the first VXLAN packet to the second communication device. causing the first communication device to execute The first communication device according to claim 1 .
9. The first communications device of claim 8 , wherein the third SRv6 SID is an SRv6 SID assigned to a third Ethernet Virtual Private Network EVPN instance of the first communications device.
10. When the instructions are executed by the processor, the processor further determining the third EVPN instance based on the third SRv6 SID; and determining the third VNI from a MAC table corresponding to the third EVPN instance based on the third MAC address, where the MAC table includes a correspondence between the third MAC address and the third VNI; causing the first communication device to execute The first communication device according to claim 9 .
11. When the instructions are executed by the processor, the processor further receiving a second SRv6 packet from the third communication device, the second SRv6 packet having a destination address of a fourth SRv6 SID, wherein the second SRv6 packet includes a second Layer 2 packet having a destination address of a fourth MAC address of a fourth user terminal connected to the second communication device; determining a fourth EVPN instance based on the fourth SRv6 SID; determining a fourth VNI from a MAC table corresponding to the fourth EVPN instance based on the fourth MAC address, where the MAC table includes a correspondence relationship between the fourth MAC address and the fourth VNI; performing VXLAN encapsulation on the second Layer 2 packet to obtain a second VXLAN packet, where the second VXLAN packet includes a fourth VNI; and and transferring the second VXLAN packet to the second communication device. causing the first communication device to execute The first communication device according to claim 9 .
12. The first communication device of claim 11 , wherein the third SRv6 SID is associated with a second operation, the second operation performing VXLAN encapsulation.
13. When the instructions are executed by the processor, the processor further receiving a third SRv6 packet from the third communication device, the destination address of which is a fifth SRv6 SID, wherein the third SRv6 packet includes a third Layer 2 packet, the destination address of which is a fifth MAC address of a fifth user terminal connected to the second communication device; determining the third VNI based on the fifth SRv6 SID and a correspondence between the fifth SRv6 SID and the third VNI recorded in the first communication device; performing VXLAN encapsulation on the third Layer 2 packet to obtain a third VXLAN packet, wherein the third VXLAN packet includes the third VNI; and and transferring the third VXLAN packet to the second communication device. causing the first communication device to execute A first communication device according to any one of claims 8 to 12.
14. When the instructions are executed by the processor, the processor further receiving a fourth SRv6 packet from the third communication device, the fourth SRv6 packet having a destination address of a sixth SRv6 SID, wherein the fourth SRv6 packet includes a fourth Layer 2 packet having a destination address of the third MAC address; determining the third VNI based on the sixth SRv6 SID and a correspondence between the sixth SRv6 SID and the third VNI recorded in the first communication device; performing VXLAN encapsulation on the fourth Layer 2 packet to obtain a fourth VXLAN packet, wherein the fourth VXLAN packet includes the third VNI; and and transferring the fourth VXLAN packet to a fourth communication device. causing the first communication device to execute A first communication device according to any one of claims 8 to 12.
15. The first communication device according to claim 8 , wherein both the first communication device and the third communication device are each a data center gateway.
16. a memory having instructions; and Processor A first communication device comprising: When the instructions are executed by the processor, the processor: receiving a first Ethernet Virtual Private Network Medium Access Control (EVP) MAC route from a second communication device, wherein the first EVPN MAC route carries a first MAC address and a first SRv6 SID of a first user terminal connected with the second communication device; generating a second EVPN MAC route based on the first EVPN MAC route, wherein the second EVPN MAC route carries the first MAC address and a first virtual extensible local area network identifier VNI corresponding to the first SRv6 SID; and transmitting the second EVPN MAC route to a third communication device; causing the first communication device to execute A first communication device.
17. When the instructions are executed by the processor, the processor further determining the first VNI corresponding to the first SRv6 SID according to a VNI allocation policy, where the SRv6 SID allocation policy includes at least one of: allocating different VNIs based on different EVPN instances corresponding to EVPN MAC routes; allocating different VNIs based on different MAC addresses carried in the EVPN MAC routes; or allocating different VNIs based on EVPN MAC routes from different communication devices. causing the first communication device to execute The first communication device of claim 16.
18. The first communications device of claim 16 , wherein the first VNI is a VNI assigned to a first Ethernet Virtual Private Network EVPN instance of the first communications device.
19. The first communication device of claim 18 , wherein a MAC table corresponding to the first EVPN instance includes a correspondence between the first MAC address and the first SRv6 SID.
20. When the instructions are executed by the processor, the processor further receiving a third EVPN MAC route, where the third EVPN MAC route carries a second MAC address and a second SRv6 SID of a second user terminal connected to the second communication device, and the third EVPN MAC route corresponds to a second EVPN instance; generating a fourth EVPN MAC route based on the third EVPN MAC route, wherein the fourth EVPN MAC route carries the second MAC address and a second VNI, the second VNI being a VNI assigned to the second EVPN instance; and transmitting the fourth EVPN MAC route to the third communication device; causing the first communication device to execute 20. A first communication device according to claim 18 or 19.
Citation Information
Patent Citations
Route processing method and network device
JP2022058267A
Packet Transmission Method and Device
US20210409318A1
Ethernet Virtual Private Network using Segment Routing
US20220166860A1