Message forwarding method and communication device

By adopting the MAC address learning method of IVL mode in the EVPN communication system, the communication device in the IVL mode and the SVL mode are allowed to communicate with each other, which solves the problem that the IVL mode and the SVL mode cannot communicate with each other, and improves the continuity and reliability of message forwarding and optimize the use of network resources.

CN119109865APending Publication Date: 2024-12-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310681505.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-08
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

In the EVPN communication system, the communication devices in the IVL mode and the SVL mode cannot achieve routing interoperability, resulting in a reduction in the continuity and reliability of message forwarding services.

Method used

By realizing the MAC address learning of IVL mode in the communication device, it allows matching and forwarding of MAC address table entries between the IVL mode and the SVL mode communication device, and uses the combined index of the MAC address and VLAN identifier to query the table entries to ensure the reporting Correct forwarding of the article.

Benefits of technology

The routing interoperability between IVL mode and SVL mode is realized, which improves the continuity and reliability of message forwarding services, reduces network bandwidth and device memory usage, and reduces routing shock and routing convergence problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119109865A_ABST
    Figure CN119109865A_ABST
Patent Text Reader

Abstract

The invention provides a message forwarding method and a communication device, and the method comprises the steps that a first communication device receives a first message, the first communication device is configured to carry out media access control (MAC) address learning through an independent virtual local area network (IVL) learning mode, the first message comprises a first MAC address and a first virtual local area network (VLAN) identifier, and the first MAC address is configured to carry out media access control (MAC) address learning through an IVL learning mode; the first MAC address is a destination MAC address of the first message; the first communication device determines a first MAC address table entry from an MAC address table according to the first MAC address, the first MAC address table entry comprising the first MAC address and not comprising a first VLAN identifier; and the first communication device forwards the first message according to the first MAC address table entry. According to the method and the device, the two communication devices in the IVL mode and the SVL mode can realize routing intercommunication, and the continuity and the reliability of message forwarding services of the communication devices can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a message forwarding method and a communication device. Background Art

[0002] Ethernet Virtual Private Network (EVPN) is a VPN technology used for Layer 2 network interconnection. EVPN uses Border Gateway Protocol (BGP) to transmit Layer 2 or Layer 3 reachability information, realizing the separation of the forwarding plane and the control plane. EVPN subverts the mechanism of traditional Layer 2 VPN learning Media Access Control (MAC) addresses through the forwarding plane, introduces the control plane, and uses BGP on the control plane to announce MAC routes, so that different sites in the EVPN system can learn MAC addresses through the control plane.

[0003] In the current EVPN communication system, a first communication device enabled with independent VLAN learning (IVL) mode can learn the MAC routes (including VLAN identifiers) published by a second communication device also enabled with IVL mode, generate corresponding MAC address entries, and forward messages based on the MAC address entries.

[0004] However, for the third communication device enabled with the shared VLAN learning (SVL) mode, which publishes VLAN-independent MAC routes, the first communication device does not learn the MAC routes published by the third communication device, resulting in the two communication devices in IVL mode and SVL mode being unable to communicate with each other, reducing the continuity and reliability of the communication device's message forwarding service. Summary of the invention

[0005] The embodiments of the present application provide a message forwarding method and a communication device, which can enable two communication devices in IVL mode and SVL mode to achieve routing intercommunication, thereby improving the continuity and reliability of the message forwarding service of the communication device.

[0006] In a first aspect, a method for message forwarding is provided, comprising: a first communication device receives a first message, the first communication device is configured to perform media access control MAC address learning through an independent virtual local area network learning IVL mode, the first message includes a first MAC address and a first virtual local area network VLAN identifier, the first MAC address is a destination MAC address of the first message; the first communication device determines a first MAC address table entry from a MAC address table according to the first MAC address, the first MAC address table entry includes the first MAC address and does not include the first VLAN identifier; the first communication device forwards the first message according to the first MAC address table entry.

[0007] According to the message forwarding method provided in the embodiment of the present application, the first communication device is configured to learn the MAC address of the message through the IVL mode, so as to effectively solve the problem of MAC address conflict. After the first communication device with IVL mode enabled receives the first message, it is not necessary to use the first MAC address and the first VLAN identifier in the message to match the MAC address table entries. That is, the first communication device only uses the first MAC address but not the first VLAN identifier to match the table entries, and can forward the message according to the matched first MAC address table entry.

[0008] Since the first communication device has the above-mentioned message forwarding capability, on this basis, when the first communication device receives a VLAN-independent MAC route issued by the second communication device enabled with the SVL mode, it can learn it and generate corresponding table entries (instead of directly discarding it), and can retrieve and match the table entries to guide the forwarding of messages, thereby enabling the two communication devices in the IVL mode and the SVL mode to achieve route intercommunication, and can improve the continuity and reliability of the message forwarding service of the first communication device.

[0009] Optionally, the first MAC address table entry may be generated by performing a local static routing configuration on the first communication device. That is, the user may generate the first MAC address table entry by performing a local configuration (e.g., importing) on ​​the first communication device. At this time, the outbound interface information of the first MAC address table entry may include information such as the port number of the first communication device.

[0010] Optionally, the first MAC address table entry may be generated by learning a VLAN-independent MAC route published by a second communication device in the EVPN communication system. In this case, the outbound interface information of the first MAC address table entry may include information such as an IP address of the second communication device.

[0011] In one possible implementation, the MAC address table includes a first MAC address table and a second MAC address table, the first MAC address table includes the first MAC address table entry, the second MAC address table is used to store the MAC address table entry learned based on the IVL mode, and the first communication device determines the first MAC address table entry from the MAC address table according to the first destination MAC address, including: the first communication device matches the first MAC address table entry in the first MAC address table with a first key key, wherein the first key includes the first MAC address but does not include the first VLAN identifier.

[0012] That is to say, the first communication device can store two tables locally, one of which is a first MAC address table, which may not include a VLAN identifier, for example, for storing MAC address table entries learned based on the SVL mode. The other may be a second MAC address table, which may include a VLAN identifier, for storing MAC address table entries learned based on the IVL mode. The first communication device can use a first key that includes the first MAC address but does not include the first VLAN identifier to query the first MAC address table to obtain the first MAC address table entry. At this time, there is no need to query the second MAC address table, which can improve the efficiency of query matching.

[0013] In a possible implementation, before the first communication device searches the first MAC address table, the method further includes: the first communication device searches the second MAC address table with a second key, and no matching MAC address table entry is found, wherein the second key includes the first MAC address and the first VLAN identifier.

[0014] Through the above settings, when forwarding a received message, the forwarding plane of the first communication device first uses the destination MAC address and VLAN ID in the message to query the second MAC address table, that is, first uses the second key to query the second MAC address table, so as to avoid MAC address conflicts as much as possible. After no hit, continue to use the first key including the destination MAC address but not the VLAN ID to query the first MAC address table. After hitting the first MAC address table entry, the first message is forwarded according to the outbound interface information in the first MAC address table entry.

[0015] In a possible implementation, the second MAC address table includes a second MAC address table entry, the second MAC address table entry includes a second MAC address and a second VLAN identifier, and the method also includes: the first communication device receives a second message, the second message includes the second MAC address and the second VLAN identifier, and the second MAC address is the destination MAC address of the second message; the first communication device matches the second MAC address table entry from the second MAC address table according to the second MAC address and the second VLAN identifier; the first communication device forwards the second message according to the second MAC address table entry.

[0016] In a possible implementation, the first MAC address table entry includes the first MAC address and a special VLAN identifier, the special VLAN identifier is different from the first VLAN identifier, and the first communication device determines the first MAC address table entry from the MAC address table according to the first MAC address, including: the first communication device matches the first MAC address table entry from the MAC address table with a third key, wherein the third key includes the first MAC address and the special VLAN identifier.

[0017] Through the above settings, the same retrieval logic (ie, MAC+VLAN) can be used to query and match table items obtained in different ways at the same time, which is conducive to simplifying the retrieval process, and the table items obtained in different ways can be put into the same table, thereby simplifying the storage process of the table items.

[0018] In a possible implementation manner, the value of the special VLAN identifier is 0.

[0019] In a possible implementation, before the first communication device determines the first MAC address table entry, the method further includes: the first communication device receives a VLAN-independent MAC route published by the second communication device, the MAC route including the first MAC address; and generates the first MAC address table entry according to the MAC route.

[0020] Through the above settings, not only can the two communication devices in IVL mode and SVL mode achieve routing intercommunication, so as to improve the continuity and reliability of the message forwarding service of the first communication device. In addition, compared with publishing VLAN-related MAC routes, it can also effectively reduce the number of MAC routes published by the second communication device, reduce the network bandwidth and device memory usage, reduce the MAC routing pressure on the RR reflector, and the pressure of learning MAC on the first communication device, and reduce the impact on the MAC routing of RR and the first communication device. And it can improve the routing convergence performance and avoid problems such as routing over-specification.

[0021] Optionally, the first communication device and the second communication device may be EVPN neighbors to each other.

[0022] Optionally, the VLAN-independent MAC route includes only the MAC address but not the VLAN ID.

[0023] Optionally, the VLAN-independent MAC route includes a MAC address and a special VLAN identifier. The special VLAN identifier may also be referred to as a shared VLAN identifier, which is shared by multiple VLAN-independent MAC routes issued by the second communication device. The special VLAN identifier may be pre-configured by the system or user, and is a specific VLAN identifier that does not usually appear in a regular data message. The special VLAN identifier is different from the aforementioned first VLAN identifier, and its value may be 0, for example, and multiple MAC routes share the special VLAN identifier.

[0024] The VLAN-independent MAC route is set to include the special VLAN identifier in order to align the table entries generated according to the announced route with the table entries learned from the message by the first communication device (both include the three items of MAC address, VLAN identifier and output interface information). At this time, the table entries learned from the message and obtained in various different ways such as generated according to the MAC route can be placed in the same MAC address table, and the retrieval logic (through MAC+VLAN) can be ensured to be consistent, which is conducive to simplifying the retrieval logic and storage logic.

[0025] Optionally, if the VLAN-independent MAC route does not include the special VLAN identifier, the first communication device can configure the special VLAN identifier by itself, so that the table entries obtained in different ways can be aligned (all contain three items).

[0026] In one possible implementation, the first communication device is an access side leaf node A-Leaf device, and the second communication device is a service side leaf node S-Leaf device; or, the first communication device is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

[0027] In a possible implementation, the second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, the second communication device is configured to perform MAC address learning through the IVL mode.

[0028] In a second aspect, a method for learning a media access control MAC address is provided, including: a first communication device receives an Ethernet virtual private network EVPN MAC route that is independent of a virtual local area network VLAN and published by a second communication device, the first communication device being configured to learn a MAC address through an independent virtual local area network learning IVL mode, the MAC route including a first MAC address; the first communication device generates a first MAC address table entry according to the MAC route, the first MAC address table entry including the first MAC address.

[0029] According to the method for learning MAC addresses provided by the embodiment of the present application, when the first communication device receives a MAC route that is not related to a VLAN, it is not discarded directly, but a corresponding MAC address table entry is generated and stored according to the MAC route. The table entry can be stored in the local MAC address table of the first communication device. For example, if the MAC route includes a first MAC address, a first MAC address table entry including the first MAC address can be generated in the MAC address table. On this basis, after receiving a message, the first communication device can use the destination MAC address in the message (without using the VLAN identifier therein) to query the MAC address table entry, and guide the forwarding of the message according to the query result.

[0030] In one possible implementation, the first communication device is an access side leaf node A-Leaf device, and the second communication device is a service side leaf node S-Leaf device; or, the first communication device is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

[0031] In a possible implementation, the second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, the second communication device is configured to perform MAC address learning through the IVL mode.

[0032] In a possible implementation manner, the first MAC table entry further includes a special VLAN identifier.

[0033] In a possible implementation manner, the value of the special VLAN identifier is 0.

[0034] In a third aspect, a communication device is provided, comprising: a transceiver unit, configured to receive a first message, the communication device being configured to perform media access control MAC address learning through an independent virtual local area network learning IVL mode, the first message comprising a first MAC address and a first virtual local area network VLAN identifier, the first MAC address being a destination MAC address of the first message; a processing unit, configured to determine a first MAC address table entry from a MAC address table according to the first MAC address, the first MAC address table entry comprising the first MAC address and excluding the first VLAN identifier; the transceiver unit is also configured to forward the first message according to the first MAC address table entry.

[0035] In one possible implementation, the MAC address table includes a first MAC address table and a second MAC address table, the first MAC address table includes the first MAC address table entry, the second MAC address table is used to store the MAC address table entry learned based on the IVL mode, and the processing unit is specifically used to: match the first MAC address table entry in the first MAC address table with a first key key, wherein the first key includes the first MAC address but does not include the first VLAN identifier.

[0036] In a possible implementation, before searching the first MAC address table, the processing unit is further configured to: search the second MAC address table with a second key, and find no matching MAC address entry, wherein the second key includes the first MAC address and the first VLAN identifier.

[0037] In a possible implementation, the second MAC address table includes a second MAC address table entry, the second MAC address table entry includes a second MAC address and a second VLAN identifier, the transceiver unit is further used to receive a second message, the second message includes a second MAC address and a second VLAN identifier, and the second MAC address is a destination MAC address of the second message; the processing unit is further used to match the second MAC address table entry from the second MAC address table according to the second MAC address and the second VLAN identifier; the transceiver unit is further used to forward the second message according to the second MAC address table entry.

[0038] In a possible implementation, the first MAC address table entry includes the first MAC address and a special VLAN identifier, the special VLAN identifier is different from the first VLAN identifier, and the processing unit is specifically used to: match the first MAC address table entry from the MAC address table with a third key, wherein the first key includes the first MAC address and the special VLAN identifier.

[0039] In a possible implementation manner, the value of the special VLAN identifier is 0.

[0040] In a possible implementation, before the processing unit determines the first MAC address table entry, the transceiver unit is further used to receive a VLAN-independent MAC route published by a second communication device, where the MAC route includes the first MAC address; the processing unit is further used to generate the first MAC address table entry based on the MAC route.

[0041] In one possible implementation, the communication device is an access side leaf node A-Leaf device, and the second communication device is a service side leaf node S-Leaf device; or, the communication device is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

[0042] In a possible implementation, the second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, the second communication device is configured to perform MAC address learning through the IVL mode.

[0043] In a fourth aspect, a communication device is provided, comprising: a transceiver unit for receiving an Ethernet virtual private network (EVPN) media access control (MAC) route that is independent of a virtual local area network (VLAN) and published by a second communication device, wherein the communication device is configured to learn a MAC address through an independent virtual local area network (IVL) learning mode, and the MAC route includes a first MAC address; and a processing unit for generating a first MAC address table entry based on the MAC route, wherein the first MAC address table entry includes the first MAC address.

[0044] In one possible implementation, the communication device is an access side leaf node A-Leaf device, and the second communication device is a service side leaf node S-Leaf device; or, the communication device is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

[0045] In a possible implementation, the second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, the second communication device is configured to perform MAC address learning through the IVL mode.

[0046] In a possible implementation manner, the first MAC table entry further includes a special VLAN identifier.

[0047] In a possible implementation manner, the value of the special VLAN identifier is 0.

[0048] In a fifth aspect, a communication device is provided, comprising: a memory storing instructions; and a processor, wherein when the instructions are executed by the processor, the communication device executes the method provided by any possible implementation of the first aspect or the second aspect.

[0049] In a sixth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a processor, implements the method provided by any possible implementation of the first aspect or the second aspect.

[0050] In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program runs on a processor, the method provided by any possible implementation of the first aspect or the second aspect is implemented.

[0051] It can be understood that the communication devices provided in the third, fourth and fifth aspects, the computer program product provided in the sixth aspect and the computer-readable storage medium provided in the seventh aspect are all used to execute the method provided in the first or second aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is the forwarding table corresponding to the two address learning modes of the switch that supports VLAN.

[0053] Figure 2 This is a schematic diagram of a network architecture of an EVPN communication system provided in an embodiment of the present application.

[0054] Figure 3 This is a schematic diagram of a network architecture of another EVPN communication system provided in an embodiment of the present application.

[0055] Figure 4 It is a flowchart of an example of a method for message forwarding provided in an embodiment of the present application.

[0056] Figure 5 This is a schematic diagram of a scenario in which the second communication device publishes a VLAN-independent MAC route.

[0057] Figure 6 This is a schematic diagram of another scenario in which the second communication device publishes a VLAN-independent MAC route.

[0058] Figure 7 This is a schematic diagram of another scenario in which the second communication device publishes a VLAN-independent MAC route.

[0059] Figure 8 It is a flowchart of another example of the message forwarding method provided in an embodiment of the present application.

[0060] Fig. 9 It is a flowchart of the method for learning MAC addresses provided in an embodiment of the present application.

[0061] Fig.10 It is a schematic block diagram of a communication device provided in an embodiment of the present application.

[0062] Fig.11 It is a structural block diagram of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] The technical solution in the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0064] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0065] The term "comprising" herein indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. The terms "comprising", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized. Below, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise stated, the meaning of "multiple" is two or more.

[0066] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0067] In order to facilitate the understanding of the technical solution of the present application, the relevant contents of MAC address learning are first introduced below.

[0068] As a data unit exchanged and transmitted in the network, a message contains a source MAC address and a destination MAC address. For Layer 2 forwarding, network devices (such as switches, routers, etc.) forward messages based on the destination MAC address of the message. Therefore, network devices maintain a forwarding table that records the correspondence between MAC addresses and ports (PORT) to instruct switches to forward. This forwarding table is usually called a MAC address forwarding table, MAC address table, MAC forwarding table, MAC routing table, or MAC table.

[0069] With the development of Virtual Local Area Network (VLAN) technology, VLAN information is added to the standard Ethernet frame. At this time, the message includes not only the source MAC address and the destination MAC address, but also a VLAN ID (VLAN Identified) to indicate the local VLAN.

[0070] In the related art, network devices supporting VLAN have two MAC address learning modes, namely independent VLAN learning (IVL) mode and shared VLAN learning (SVL) mode. Figure 1 It is the forwarding table corresponding to the two address learning modes of network devices that support VLAN. Figure 1 As shown in part (a) of Figure 1, in IVL mode, a MAC address table is created for each VLAN, and each MAC address table has no influence on each other. A MAC address can be learned into different VLANs. In other words, the same MAC address can appear in multiple MAC address tables, that is, in different VLANs. Figure 1 (a) MAC2, so if a MAC belongs to multiple VLANs, the information in each VLAN needs to be learned. In SVL mode, Figure 1 As shown in part (b) of the figure, the network device only establishes one MAC address table, which is applicable to all VLANs. Therefore, the same MAC address only appears once in the MAC address table.

[0071] IVL mode is also commonly known as qualify mode. It is an exclusive MAC address learning mode. The MAC addresses learned in each VLAN belong to each VLAN and will not be shared with other VLANs. The network device forwarding process in IVL mode is clearer, and VLANs will not affect each other. Therefore, network devices in actual applications currently use this mode more.

[0072] In IVL mode, multiple VLANs may correspond to multiple MAC address tables. The multiple MAC address tables here are just logical multiple tables, which may actually be stored as one table in the network device (see Table 1). In other words, if all records with the same VLAN ID are extracted to form a table, then a physical table can be logically considered as multiple tables.

[0073] Table 1: MAC address table corresponding to MAC address learning in IVL mode

[0074] MAC Address VLAN ID Port ID MAC1 VLAN1 PORT1 MAC2 VLAN1 PORT2 MAC2 VLAN2 PORT3 MAC3 VLAN3 PORT3

[0075] Table 1 is the MAC address table corresponding to the MAC address learning of IVL mode. As shown in Table 1, it corresponds to Figure 1 , multiple MAC address tables corresponding to multiple VLANs can be saved as a table in the network device. That is to say, the MAC address learning in IVL mode also adds the VLAN ID in the process of establishing the MAC address table, and the same MAC address can appear in different VLANs. In IVL mode, the MAC address and VLAN ID are used as indexes to find and determine a forwarding table entry. For example, if the destination MAC in a message is MAC2 and the VLAN ID is VLAN2, then according to Table 1, the table entry where PORT3 is located can be hit, so PORT3 is used to forward the message.

[0076] Table 2: MAC address table corresponding to MAC address learning in SVL mode

[0077] MAC Address Port ID MAC1 PORT1 MAC2 PORT2 MAC3 PORT3

[0078] Table 2 is the MAC address table corresponding to the MAC address learning in SVL mode. The SVL mode is also commonly referred to as the unqualify mode. The MAC address table is stored with MAC as the primary key. In other words, the same MAC can only have one record in the MAC table in SVL mode, that is, there will not be multiple identical MAC addresses in the table entries of the MAC address table corresponding to the SVL mode. As shown in Table 2, the MAC address learning in SVL mode does not attach the VLAN ID in the process of establishing the MAC address table, or its MAC address table is shared by all VLANs.

[0079] Network devices in SVL working mode can share a MAC address table for all VLANs, so the storage resources (table entries) are relatively small. In SVL mode, the MAC address is used as an index (without using the VLAN ID in the message) to find and determine a forwarding table entry. For example, if the destination MAC in a message is MAC2, the table entry where PORT2 is located can be hit according to Table 2, so PORT2 is used to forward the message.

[0080] Ethernet Virtual Private Network (EVPN) is a VPN technology used for Layer 2 network interconnection. EVPN uses Border Gateway Protocol (BGP) to transmit Layer 2 or Layer 3 reachability information, realizing the separation of the forwarding plane and the control plane. EVPN subverts the mechanism of traditional Layer 2 VPN learning MAC addresses through the forwarding plane, introduces the control plane, and uses BGP on the control plane to announce MAC routes, so that different sites in the EVPN communication system can learn MAC addresses through the control plane. On the data plane, the EVPN system can use virtual eXtensible Local Area Network (VXLAN) encapsulation to forward messages. VXLAN is a tunnel protocol that can overlay a Layer 2 virtual network on any network reachable by a route, thereby improving the network's scale expansion capabilities.

[0081] Figure 2 Schematic diagram of the network architecture of an EVPN communication system provided by an embodiment of the present application. Figure 2 As shown in the figure, in order to achieve intercommunication between various sites, the EVPN network establishes an EVPN instance on the provider edge (PE) device and connects to the customer edge (CE) device of each site. At the same time, neighbor relationships and multi-protocol label switching (MPLS) / segment routing (SR) tunnels are established between various PE devices. According to the connection form between PE devices and CE devices, the networking type of EVPN can be divided into two types: CE multi-homing and CE single-homing. The CE multi-homing networking type can support load sharing.

[0082] Figure 2The EVPN communication system shown includes an access side and a network side. Among them, the access side includes a first CE device, a first PE device, and a second PE device. The first CE device is dual-homed connected to the first PE device and the second PE device through an aggregation interface. The network side includes a second CE device and a third PE device, and the second CE device is singly connected to the third PE device. The third PE device is used to realize communication between the second CE device and the first PE device and the second PE device. The first PE device and the second PE device can be the same PE device or different PE devices. The third PE device constitutes an EVPN neighbor of the first PE device and the second PE device.

[0083] Figure 3 Schematic diagram of another network architecture of an EVPN communication system provided in an embodiment of the present application. Figure 3 As shown, the EVPN system provided in the embodiment of the present application includes a home gateway (Home Gateway, HG), an optical line terminal (Optical Line Terminal, OLT), an access side (Access Leaf, A-Leaf) device, a router (Spine), a service side (Serve Leaf, S-Leaf) device, a user plane (User Plane, UP) and a control plane (Control Plane, CP), etc.

[0084] Among them, OLT can be used as a CE device to connect HG to the metropolitan area network, so that HG can provide Internet access services to users. A-Leaf devices are also commonly referred to as access-side leaf nodes. With the EVPN protocol enabled, they can be used as access-side PE devices. Access-side device 1 (hereinafter referred to as A-Leaf1) and access-side device 2 (hereinafter referred to as A-Leaf2) can be used as dual-home access devices; A-Leaf devices forward messages sent by the user side to S-Leaf devices through Spine, and forward messages sent by S-Leaf devices to HG through OLT; Spine is used as a route reflector (RR) to reflect routes and forward messages. In some cases, Spine can also be a virtual route reflector (VRR). S-Leaf devices are also commonly referred to as service-side leaf nodes. With the EVPN protocol enabled, they can be used as network-side PE devices. Service-side device 1 (hereinafter referred to as S-Leaf1) and service-side device 2 (hereinafter referred to as S-Leaf2) can be used as dual-homing access devices. S-Leaf devices forward messages sent by A-Leaf devices to UP, and forward messages sent by UP to A-Leaf devices through Spine. UP is responsible for responding to messages sent by the user side, such as performing user online authentication. CP can control the messages responded by UP.

[0085] The network between the OLT and A-Leaf devices can be deployed as a VLAN / QinQ network, the network between the A-Leaf devices and S-Leaf devices can be deployed as an L2EVPN VPLS over Mpls / SRv6 network, and the network between the S-Leaf devices and UP can be deployed as a VLAN / QinQ network.

[0086] The source MAC addresses in the packets from different VLANs or different interfaces on the OLT on the access side of the A-Leaf device may be the same, which may easily lead to MAC address conflicts. To solve the problem of MAC address conflicts, both A-Leaf and S-Leaf enable MAC address learning in IVL mode and use EVPN virtual private LAN service (VPLS) to communicate with each other, that is, route publishing (notifying MAC routes) through the control plane, so that different devices in the network can learn (share) MAC information from each other.

[0087] Table 3: MAC address table stored in A-Leaf1 in IVL mode

[0088] MAC Address VLAN ID Outbound interface information MAC1 VLAN1 PORT1 MAC2 VLAN1 PORT2 MAC2 VLAN2 A-Leaf2 IP MAC3 VLAN3 A-Leaf2 IP MAC4 VLAN4 S-Leaf1 IP MAC4 VLAN5 S-Leaf1 IP MAC4 VLAN6 S-Leaf1 IP MAC5 VLAN7 S-Leaf2 IP

[0089] In EVPN VPLS networking, when a device (referred to as a publishing device) learns a new MAC address, it needs to publish a MAC advertisement route (MAC Advertisement Route) through the control plane. The MAC advertisement route is also commonly referred to as a MAC route. After receiving the MAC route, other devices in the network can obtain the Internet Protocol (IP) address of the publishing device and the advertised MAC address, and add the obtained IP address and MAC address to the MAC address table. The MAC route in IVL mode is a VLAN-related MAC route, which also includes the corresponding VLANID, that is, the MAC route in IVL mode (VLAN-related MAC route) is based on the MAC+VLAN granularity, so the receiver also needs to add the corresponding VLAN ID to the MAC address table. In some cases, the MAC advertisement route here is also called MAC / IP advertisement route, second-class EVPN route or EVPN second-class route, etc.

[0090] It is worth mentioning that the IP address can also be replaced by any other information that can indicate the device that publishes the announcement route. Table 3 and its related content are only used as examples for convenience of explanation, and this application does not limit this. For example, the IP address in Table 3 can also be replaced by the port information connected to the publishing device, or the tunnel information between the publishing device, etc.

[0091] Combined with the above analysis, we can know that at this time, some of the entries in the MAC address table stored in A-Leaf1 in Table 3 are learned by itself through the MAC address of IVL mode, and the other part is generated according to the MAC routes published by other devices such as A-Leaf2, S-Leaf1 and S-Leaf2 in the system. Other devices also learn MAC addresses through IVL mode, so no matter who learns and publishes the MAC addresses in Table 3, they all include the corresponding VLAN ID.

[0092] Specifically, as shown in Table 3, at this time, in the MAC address table stored in A-Leaf1, the table entries corresponding to MAC1 and the first MAC2 can be learned by itself through the MAC address in IVL mode, while the second MAC2, MAC3 and the corresponding VLAN are learned and published by A-Leaf2 through the MAC address in IVL mode. After A-Leaf1 receives the VLAN-related MAC route published by A-Leaf2, it adds MAC2, VLAN2, and A-Leaf2IP to its own MAC address table to constitute the table entry corresponding to the second MAC2 in the figure, and adds MAC3, VLAN3, and A-Leaf2 IP to its own MAC address table to constitute the table entry corresponding to MAC3 in the figure.

[0093] The first MAC4 and its corresponding VLAN4, the second MAC4 and its corresponding VLAN5, and the third MAC4 and its corresponding VLAN6 are obtained and published by S-Leaf1 through MAC address learning in IVL mode. After A-Leaf1 receives the three MAC routes related to VLANs published by S-Leaf1, it adds the three entries of MAC4, VLAN4, S-Leaf1 IP, MAC4, VLAN5, S-Leaf1 IP, and MAC4, VLAN6, S-Leaf1 IP to its own MAC address table, forming the three entries corresponding to MAC4 in the figure. MAC5 and its corresponding VLAN7 are obtained and published by S-Leaf2 through MAC address learning in IVL mode. After A-Leaf1 receives the VLAN-related announcement routes published by S-Leaf2, it adds MAC5, VLAN7, and S-Leaf2 IP to its own MAC address table, forming the entry corresponding to MAC5 in the figure.

[0094] Furthermore, A-Leaf1 can match each entry in Table 3 according to the destination MAC address and VLAN ID in the message, and forward the message according to the query result. For example, for the first message received by A-Leaf1, the destination MAC address is MAC4 and the VLAN ID is VLAN5, so it can match the sixth entry in Table 3. At this time, A-Leaf1 forwards the first message to S-Leaf1 according to the outbound interface information corresponding to the entry.

[0095] Combined with the above analysis, it can be seen that the communication device enabled with IVL mode uses MAC address and VLAN ID as indexes to match table entries. On this basis, in the current EVPN communication system, the first communication device enabled with IVL mode can learn the MAC route (including VLAN ID) published by the second communication device also enabled with IVL mode and generate corresponding MAC address table entries, and can forward messages based on the MAC address table entries.

[0096] However, for the third communication device enabled with SVL mode, the first communication device does not learn the MAC route published by the third communication device, which is independent of the VLAN. As a result, the two communication devices in IVL mode and SVL mode cannot communicate with each other through routing, thereby reducing the continuity and reliability of the message forwarding service of the communication device.

[0097] For example, combining the above Figure 3 As shown in Table 3, when S-Leaf1 is configured to learn MAC addresses through SVL mode, S-Leaf1 will only learn the MAC address in the message, but not the VLAN ID. At this time, S-Leaf1 will publish VLAN-independent MAC routes. After A-Leaf1 enabled with IVL mode receives such MAC routes, it will not learn them but discard them directly. As a result, the two communication devices A-Leaf1 and S-Leaf1 cannot achieve routing intercommunication, which will reduce the continuity and reliability of A-Leaf1's message forwarding service.

[0098] In response to the above problems, an embodiment of the present application provides a message forwarding method and a communication device, which can enable two communication devices in IVL mode and SVL mode to achieve routing intercommunication, thereby improving the continuity and reliability of the message forwarding service of the communication device.

[0099] According to the message forwarding method provided in the embodiment of the present application, the first communication device (eg, Figure 2 The first PE device or Figure 3 When A-Leaf1 in the first communication device forwards a message, it is not necessary to use both the MAC address and the VLAN ID to match the MAC address table entries. For example, after receiving the first message, the first communication device uses the destination MAC address in the first message instead of the VLAN ID in the message to match the table entries, and can forward the message according to the matched first MAC address table entry. Since the first communication device has the above-mentioned message forwarding capability, on this basis, when the first communication device receives a second communication device (for example, Figure 2 The third PE device or Figure 3The VLAN-independent MAC routes published by S-Leaf1 in the communication device can be learned and corresponding table entries can be generated (instead of being directly discarded), and the table entries can be retrieved and matched to guide the forwarding of messages, thereby enabling the two communication devices in IVL mode and SVL mode to achieve routing intercommunication, and improving the continuity and reliability of the message forwarding service of the first communication device.

[0100] based on Figure 2 or Figure 3 The network architecture shown, combined with the message forwarding method provided in the embodiment of the present application, will continue to specifically analyze and solve the technical problems raised in the present application.

[0101] See attached Figure 4 , Figure 4 1 is a flow chart of a method 100 for forwarding a message provided in an embodiment of the present application. The execution subject of the method 100 for forwarding a message is a first communication device, which may be the above-mentioned Figure 2 Any PE device in, or a processor or chip in a PE device; the first communication device may also be the above Figure 3 Any A-Leaf or S-Leaf device, or a processor or chip in an A-Leaf or S-Leaf device. The method 100 may include the following steps 110 to 130.

[0102] Step 110, a first communication device receives a first message, the first communication device is configured to perform media access control MAC address learning through an independent virtual local area network learning IVL mode, the first message includes a first MAC address and a first virtual local area network VLAN identifier, and the first MAC address is the destination MAC address of the first message.

[0103] The first communication device in the embodiment of the present application can forward the received message. For example, the first communication device can be the aforementioned operator edge PE device or leaf node Leaf device. For example, the first communication device can be Figure 2 The first PE device, the second PE device or the third PE device in the embodiment; it can also be Figure 3 A-Leaf1, A-Leaf2, S-Leaf1 or S-Leaf2 in the first communication device. The first message may come from a user edge CE device, an optical line terminal OLT, or from other access side devices or service side devices, but is not limited thereto. In addition to the first MAC address and the first VLAN identifier, the first message may also include a first source MAC address.

[0104] The first communication device is configured to perform MAC address learning through IVL mode, that is, the first communication device enables IVL mode to perform MAC address learning. At this time, the first communication device not only needs to learn the source MAC address in the message, but also needs to learn the VLAN ID in the message, put the source MAC address and VLAN ID into the MAC address table together, and establish a mapping relationship between the source MAC address, VLAN ID and the output interface that receives the first message.

[0105] For example, the first message is received by the first communication device through port PORT1, and the first communication device determines that the first source MAC address in the first message is not included in the current MAC address table, that is, the first source MAC address is a new MAC address, so it needs to be learned. At this time, the first communication device can create a new table entry in the MAC address table, and store the first source MAC address, the first VLAN identifier and PORT1 in the table entry.

[0106] Step 120: The first communication device determines a first MAC address entry from a MAC address table according to the first MAC address, where the first MAC address entry includes the first MAC address but does not include a first VLAN identifier.

[0107] The first MAC address table entry does not include the first VLAN identifier, indicating that the first communication device does not use the first VLAN identifier as a keyword (key value) to match and retrieve the table entry. In other words, when the first communication device with IVL mode enabled receives the first message, it is not necessary to use the first MAC address and the first VLAN identifier in the message to match the MAC address table entry. That is, the first communication device uses the first MAC address but not the first VLAN identifier to match the table entry, and can forward the message according to the matched first MAC address table entry.

[0108] As a possible implementation, the first MAC address table entry may be generated by performing a local static routing configuration on the first communication device. That is, the user may generate the first MAC address table entry by performing a local configuration (e.g., importing) on ​​the first communication device. At this time, the outbound interface information of the first MAC address table entry may include information such as the port number of the first communication device.

[0109] As another possible implementation, the first MAC address table entry may be generated by learning a VLAN-independent MAC route published by a second communication device in the EVPN communication system. In this case, the outbound interface information of the first MAC address table entry may include information such as an IP address of the second communication device. This implementation will be described in detail below.

[0110] Step 130: The first communication device forwards the first message according to the first MAC address entry.

[0111] After the first communication device determines the first MAC address table entry that matches the first MAC address, it can forward the first message according to the outbound interface information in the first MAC address table entry.

[0112] Optionally, in other implementations, if the first communication device fails to successfully query a matching entry from the MAC address table according to the first MAC address, the first message may be broadcast, for example, the first message may be broadcast in multiple ports corresponding to the first VLAN identifier.

[0113] According to the message forwarding method 100 provided in the embodiment of the present application, the first communication device is configured to learn the MAC address of the message through the IVL mode, so as to effectively solve the problem of MAC address conflict. After the first communication device with the IVL mode enabled receives the first message, it is not necessary to use the first MAC address and the first VLAN identifier in the message to match the MAC address table entries. That is, the first communication device only uses the first MAC address but not the first VLAN identifier to match the table entries, and can forward the message according to the matched first MAC address table entry.

[0114] Since the first communication device has the above-mentioned message forwarding capability, on this basis, when the first communication device receives a VLAN-independent MAC route issued by the second communication device enabled with the SVL mode, it can learn it and generate corresponding table entries (instead of directly discarding it), and can retrieve and match the table entries to guide the forwarding of messages, thereby enabling the two communication devices in the IVL mode and the SVL mode to achieve route intercommunication, and can improve the continuity and reliability of the message forwarding service of the first communication device.

[0115] In an embodiment of the present application, the first MAC address table entry may be generated by learning a VLAN-independent MAC route published by a second communication device in the EVPN communication system. Specifically, in the aforementioned step 120, before the first communication device determines the first MAC address table entry from the MAC address table according to the first MAC address, the method 100 further includes:

[0116] The first communication device receives a VLAN-independent MAC route issued by the second communication device, where the MAC route includes a first MAC address;

[0117] The first communication device generates the aforementioned first MAC address table entry according to the MAC route.

[0118] Specifically, the first communication device and the second communication device are two different sites in the EVPN system, for example, the first communication device and the second communication device can be EVPN neighbors, but not limited to this. After the first communication device learns a new MAC address, it can publish a MAC route through the control plane for the second communication device and other devices in the system or network to learn; similarly, after the second communication device learns a new MAC address, it can publish a MAC route through the control plane for the first communication device and other devices in the system or network to learn.

[0119] In the embodiment of the present application, the second communication device may be configured to publish a VLAN-independent MAC route. After the first communication device receives the VLAN-independent MAC route published by the second communication device, it generates the aforementioned first MAC address table entry according to the MAC route. At this time, the first MAC address table entry may include the IP address of the second communication device, but is not limited thereto. For example, it may also be any information that can indicate the second communication device, such as the port information of the first communication device connected to the second communication device, or the tunnel information between the first communication device and the second communication device.

[0120] Through the above settings, not only can the two communication devices in IVL mode and SVL mode achieve routing intercommunication, so as to improve the continuity and reliability of the message forwarding service of the first communication device. In addition, compared with publishing VLAN-related MAC routes, it can also effectively reduce the number of MAC routes published by the second communication device, reduce the network bandwidth and device memory usage, reduce the MAC routing pressure on the RR reflector, and the pressure of learning MAC on the first communication device, and reduce the impact on the MAC routing of RR and the first communication device. And it can improve the routing convergence performance and avoid problems such as routing over-specification.

[0121] Optionally, the first communication device and the second communication device may be EVPN neighbors. For example, the first communication device may be an access-side leaf node A-Leaf device (e.g. Figure 3 A-Leaf1 or A-Leaf2 in the figure), the second communication device may be a service-side leaf node S-Leaf device (e.g. Figure 3 For another example, the first communication device may be an access side operator edge PE device (eg Figure 2 The first PE device or the second PE device in the communication device), the second communication device is a network side operator edge PE device (for example Figure 2 The third PE device in the PE).

[0122] Here, the communication device enabled with IVL mode needs to learn the MAC address and VLAN ID at the same time, and the MAC route it publishes includes the MAC address and VLAN ID. Therefore, this type of MAC route can be called VLAN-related MAC route; while the communication device enabled with SVL mode does not need to learn the VLAN ID, and the MAC route it publishes includes the MAC address but does not include valid VLAN ID information. Therefore, this type of MAC route can be called VLAN-independent MAC route.

[0123] In some cases, the VLAN-independent MAC route includes only the MAC address but not the VLAN ID.

[0124] In other cases, the VLAN-independent MAC route includes a MAC address and a special VLAN identifier. The special VLAN identifier may also be called a shared VLAN identifier, which is shared by multiple VLAN-independent MAC routes issued by the second communication device. The special VLAN identifier may be pre-configured by the system or user, and is a specific VLAN identifier that usually does not appear in a regular data message. The special VLAN identifier is different from the aforementioned first VLAN identifier, for example, its value may be 0, and multiple MAC routes share the use of the special VLAN identifier.

[0125] The VLAN-independent MAC route is set to include the special VLAN identifier in order to align the table entries generated according to the announced route with the table entries learned by the first communication device from the message (both include the three items of MAC address, VLAN identifier and output interface information). At this time, the table entries obtained by two different methods can be placed in the same MAC address table, and the retrieval logic (through MAC+VLAN) can also be ensured to be consistent, which is conducive to simplifying the retrieval logic and storage logic.

[0126] Optionally, as a possible implementation, if the VLAN-independent MAC route does not include the special VLAN identifier, the first communication device can configure the special VLAN identifier itself, so that the table entries obtained in two different ways can be aligned (both contain three items).

[0127] It is worth emphasizing that the communication device enabled with IVL mode can also be configured to publish MAC routes that are independent of VLAN. At this time, although the communication device also learns the MAC address and VLAN identifier, it can perform routing compression on the MAC address and only publish the learned MAC address without publishing the learned VLAN identifier. In other words, the second communication device in the embodiment of the present application can be configured to learn MAC addresses through the shared virtual LAN SVL mode; or it can also be configured to learn MAC addresses through the IVL mode, and the present application does not limit this.

[0128] The following further describes the MAC route that the second communication device issues regardless of VLAN in conjunction with the accompanying drawings. Figure 5 This is a schematic diagram of a scenario in which a second communication device publishes a VLAN-independent MAC route. In this scenario, the second communication device is configured to perform MAC address learning through the SVL mode, and the VLAN-independent MAC route it publishes includes a MAC address but not a VLAN identifier. Figure 5 At the same time, a method for message forwarding is shown, such as Figure 5 As shown, the method includes steps ① to ⑥.

[0129] Step ①, the second communication device enabled with SVL mode receives a third message through port PORT1, where the third message includes a source MAC address MAC1 and a VLAN identifier VLAN1.

[0130] Step ②, the second communication device performs MAC address learning and generates a table entry of MAC1, PORT1 locally.

[0131] Step ③, the second communication device publishes a VLAN-independent MAC route, which includes MAC1.

[0132] Step ④, the first communication device enabled with IVL mode generates a table entry of MAC1, IP1 (corresponding to the aforementioned first MAC address table entry) according to the VLAN-independent MAC route published by the second communication device, wherein IP1 is the IP address of the second communication device.

[0133] Step ⑤: The first communication device receives a first message, which includes a destination MAC address MAC1 and a VLAN identifier VLAN1.

[0134] Step ⑥, the first communication device matches the MAC address table entries according to MAC1, successfully matches the entry generated in the above step ④, and forwards the message according to the entry, forwarding the first message to the second communication device.

[0135] Figure 6This is a scenario diagram of another example in which the second communication device publishes a VLAN-independent MAC route. In this scenario, the second communication device is configured to perform MAC address learning through the SVL mode, and the VLAN-independent MAC route it publishes includes a MAC address and a special VLAN identifier. Figure 6 At the same time, a method for message forwarding is shown, such as Figure 6 As shown, the method includes steps ① to ⑥.

[0136] Step ①, the second communication device enabled with SVL mode receives a third message through port PORT1, where the third message includes a source MAC address MAC1 and a VLAN identifier VLAN1.

[0137] Step ②, the second communication device performs MAC address learning and generates a table entry of MAC1, PORT1 locally.

[0138] Step ③, the second communication device publishes a VLAN-independent MAC route, the MAC route includes MAC1 and VLAN0, wherein VLAN0 is the aforementioned special VLAN identifier.

[0139] Step ④, the first communication device enabled with IVL mode generates a table entry of MAC1, VLAN0, IP1 (corresponding to the aforementioned first MAC address table entry) according to the VLAN-independent MAC route published by the second communication device, wherein IP1 is the IP address of the second communication device.

[0140] Step ⑤: The first communication device receives a first message, which includes a destination MAC address MAC1 and a VLAN identifier VLAN1.

[0141] Step ⑥, the first communication device matches the MAC address table entries according to MAC1 and VLAN0, successfully matches the entry generated in the above step ④, and forwards the message according to the entry, forwarding the first message to the second communication device.

[0142] Figure 7 This is a scenario diagram of another example in which the second communication device publishes a VLAN-independent MAC route. In this scenario, the second communication device is configured to perform MAC address learning through the IVL mode, and the VLAN-independent MAC route it publishes includes a MAC address and a special VLAN identifier. Figure 7 At the same time, a method for message forwarding is shown, such as Figure 7 As shown, the method includes steps ① to ⑥.

[0143] Step ①, the second communication device enabled with IVL mode receives a third message through port PORT1, where the third message includes a source MAC address MAC1 and a VLAN identifier VLAN1.

[0144] Step ②, the second communication device performs MAC address learning and generates a table entry of MAC1, VLAN1, PORT1 locally.

[0145] Step ③, the second communication device publishes a VLAN-independent MAC route, the MAC route includes MAC1 and VLAN0, wherein VLAN0 is the aforementioned special VLAN identifier.

[0146] In other implementations, similar to the above Figure 5 In the illustrated embodiment, the VLAN-independent MAC routing may not include VLAN 0.

[0147] Step ④, the first communication device enabled with IVL mode generates a table entry of MAC1, VLAN0, IP1 (corresponding to the aforementioned first MAC address table entry) according to the VLAN-independent MAC route published by the second communication device, wherein IP1 is the IP address of the second communication device.

[0148] Step ⑤: The first communication device receives a first message, which includes a destination MAC address MAC1 and a VLAN identifier VLAN1.

[0149] Step ⑥, the first communication device matches the MAC address table entries according to MAC1 and VLAN0, successfully matches the entry generated in the above step ④, and forwards the message according to the entry, forwarding the first message to the second communication device.

[0150] The following continues to introduce the message forwarding method 100 provided in an embodiment of the present application in conjunction with the accompanying drawings, especially how the first communication device determines the first MAC address table entry from the MAC address table according to the first destination MAC address.

[0151] As a possible implementation, the MAC address table locally stored in the first communication device includes a first MAC address table and a second MAC address table, and the first MAC address table includes a first MAC address table entry. For example, the first MAC address table is an address table that does not include a VLAN identifier, similar to the aforementioned Table 2, and the first MAC address table may be, for example, an address table generated based on VLAN-independent MAC routes published by other devices. The first MAC address table may be used, for example, to store MAC address table entries learned based on the SVL mode.

[0152] The second MAC address table is used to store MAC address table items learned based on the IVL mode, for example, the second MAC address table includes a second MAC address table item, and the second MAC address table item includes a second MAC address and a second VLAN identifier. The second MAC address table may be, for example, an address table including a VLAN identifier similar to the aforementioned Table 1 or Table 3, and the second MAC address table may be, for example, an address table generated by the first communication device learning the message and / or according to the VLAN-related MAC routing published by other devices.

[0153] On this basis, combined with the Figure 5 The aforementioned step 120, that is, the first communication device determines the first MAC address table entry from the MAC address table according to the first MAC address, can be implemented in the following manner:

[0154] The first communication device matches the first MAC address entry in the first MAC address table with the first key, wherein the first key includes the first MAC address but does not include the first VLAN identifier. For example, the first key may also include information such as a virtual switch interface (Virtual Switch Interface, VSI).

[0155] Specifically, the first communication device can store two tables locally, one of which is a first MAC address table, which may not include a VLAN identifier, for example, for storing MAC address table entries learned based on the SVL mode. The other may be a second MAC address table, which may include a VLAN identifier, for storing MAC address table entries learned based on the IVL mode. The first communication device can use a first key that includes the first MAC address but does not include the first VLAN identifier to query the first MAC address table to obtain the first MAC address table entry. At this time, there is no need to query the second MAC address table, which can improve the efficiency of query matching.

[0156] Table 4: An example of a first MAC address table stored locally in the first communication device

[0157] Serial number MAC Address Outbound interface information 1 MAC1 S-Leaf1 IP 2 MAC6 S-Leaf1 IP 3 MAC7 S-Leaf1 IP 4 MAC8 S-Leaf2 IP

[0158] Table 4 is an example of a first MAC address table stored locally in the first communication device. Figure 3Taking A-Leaf1 in Table 4 as an example, each entry in Table 4 may be generated by the first communication device (i.e., A-Leaf1) according to the VLAN-independent MAC route received from the service-side device. The service-side device may include a first service-side device (e.g., S-Leaf1) and a second service-side device (e.g., S-Leaf2) that are dual-homed to each other. The entries corresponding to sequence numbers 1 to 3 are generated according to the VLAN-independent MAC route issued by the first service-side device, and the entry corresponding to sequence number 4 is generated according to the VLAN-independent MAC route issued by the second service-side device.

[0159] For example, the first MAC address can be MAC1 in Table 4. At this time, MAC1 can be used to search and query Table 4 (the first key includes MAC1), and it can be determined that the first MAC address table entry is the entry corresponding to sequence number 1 in Table 4. At this time, the outbound interface information S-Leaf1 IP in the table entry can be used to forward the first message, send the first message to the public network and send it to S-Leaf1.

[0160] Optionally, if the first communication device fails to successfully query a matching entry from the first MAC address table based on the first MAC address, the second MAC address table can be queried based on the first MAC address and the first VLAN identifier, and the message forwarding can be guided based on the query result. The entry in the second MAC address table includes a VLAN identifier. The entry in the second MAC address table can be obtained by the first communication device itself learning the message, or it can be generated based on the MAC route related to the VLAN issued by other devices. At this time, when a matching entry is queried, the first message is forwarded based on the outbound interface information in the matching entry; when no matching entry is queried, the first message can be broadcast.

[0161] Table 5: An example of a second MAC address table locally stored in the first communication device

[0162] Serial number MAC Address VLAN ID Outbound interface information 1 MAC1 VLAN1 PORT1 2 MAC2 VLAN1 PORT2 3 MAC2 VLAN2 PORT1 4 MAC3 VLAN3 A-Leaf2 IP 5 MAC4 VLAN4 A-Leaf2 IP

[0163] Table 5 is an example of a second MAC address table stored locally by the first communication device. The table entries corresponding to sequence numbers 1 to 3 are obtained by the first communication device itself through learning the message, and the table entries corresponding to sequence numbers 4 and 5 are generated based on the VLAN-related MAC routes issued by another access side device (e.g., A-Leaf2) received.

[0164] For example, the first destination MAC address may be MAC2 in Table 5, and the first VLAN identifier may be VLAN2 in Table 5. After the first communication device receives the first message containing the above information, it first uses MAC2 to query Table 4. Since Table 4 does not contain MAC2, no matching entry is found. At this time, the first communication device continues to use MAC2+VLAN2 as an index to query Table 5, and can successfully query the entry corresponding to sequence number 3. At this time, the outbound interface information PORT1 in the entry can be used to forward the first message, that is, the first message is forwarded through port PORT1.

[0165] Optionally, in other implementations, the second MAC address table may be queried using the first destination MAC address and the first VLAN identifier, and when no matching entry is found, the first destination MAC address may be used to query the first MAC address table.

[0166] When the first communication device receives a message, whether to query the first MAC address table first or the second MAC address table first can be determined according to the specific usage scenario and usage requirements of the first communication device, and this application does not limit this. For example, in the current networking, when the problem of MAC address conflict is not serious, the first MAC address table can be queried first. For another example, when it is determined that the message comes from the terminal side (user side), the message is more likely to be sent to the network side in the current scenario. At this time, the first MAC address table can be queried first; and when it is determined that the message comes from the network side, the message is more likely to be sent to the terminal side. At this time, the second MAC address table can be queried first.

[0167] As another possible implementation, the first communication device may store only one table locally. Furthermore, in order to keep the table items aligned and consistent (including three items), and to be able to use the same retrieval logic (i.e., MAC+VLAN) to retrieve table items of two different modes, the table items generated according to the VLAN-independent MAC routing (e.g., the first MAC address table item) may also include the aforementioned special VLAN identifier. The special VLAN identifier may come from the VLAN-independent MAC announcement routing, or it may be configured and supplemented by the first communication device. For example, the value of the special VLAN identifier may be 0.

[0168] As a possible implementation method, Figure 6 and attached Figure 7 The first MAC address table entry includes the first MAC address and the special VLAN identifier, the special VLAN identifier is different from the first VLAN identifier, and the aforementioned step 120, that is, the first communication device determines the first MAC address table entry from the MAC address table according to the first MAC address, can be implemented in the following manner:

[0169] The first communication device matches the first MAC address entry from the MAC address table with a third key, wherein the third key includes the first MAC address and a special VLAN identifier.

[0170] Through the above settings, the same retrieval logic (ie, MAC+VLAN) can be used to query and match table items obtained in different ways at the same time, which is conducive to simplifying the retrieval process, and the table items obtained in different ways can be put into the same table, thereby simplifying the storage process of the table items.

[0171] Table 6: An example of a MAC address table stored locally in the first communication device

[0172] Serial number MAC Address VLAN ID Outbound interface information 1 MAC1 VLAN1 PORT1 2 MAC2 VLAN1 PORT2 3 MAC2 VLAN2 PORT1 4 MAC3 VLAN3 A-Leaf2 IP 5 MAC4 VLAN4 A-Leaf2 IP 6 MAC1 VLAN0 S-Leaf1 IP 7 MAC6 VLAN0 S-Leaf1 IP 8 MAC7 VLAN0 S-Leaf1 IP 9 MAC8 VLAN0 S-Leaf2 IP

[0173] Table 6 is an example of a MAC address table locally stored in the first communication device in an embodiment of the present application. Table 6 can be regarded as the MAC address table entry in the aforementioned Table 4 plus a special VLAN identifier (VLAN0) and then added to the table entry in Table 5.

[0174] For example, the first MAC address can be MAC1 in Table 6, and the special VLAN identifier can be VLAN0 in Table 6. At this time, MAC1 and VLAN0 can be used to search Table 6 (that is, the third key includes MAC1 and VLAN0), and it can be determined that the first MAC address table entry is the entry corresponding to sequence number 6 in Table 6. At this time, the outbound interface information S-Leaf1 IP in the table entry can be used to forward the first message, that is, the first message is sent to the public network and sent to S-Leaf1.

[0175] Furthermore, the aforementioned second MAC address table includes a second MAC address table entry, and the second MAC address table entry includes a second MAC address and a second VLAN identifier. Different from the aforementioned first message, when the first communication device in the embodiment of the present application receives the second message, it can process it according to the following process:

[0176] The first communication device receives a second message, where the second message includes the aforementioned second MAC address and the aforementioned second VLAN identifier, and the second MAC address is a destination MAC address of the second message;

[0177] The first communication device matches (determines) a second MAC address table entry from the aforementioned second MAC address table according to the second destination MAC address and the second VLAN identifier;

[0178] The first communication device forwards the second message according to the outgoing interface information in the second MAC address table entry.

[0179] That is to say, for the second message, the first communication device can use the second MAC address and the second VLAN identifier in the second message to query the locally stored second MAC address table, that is, use the retrieval method corresponding to the conventional SVL mode to perform a matching query on the table items, and guide the forwarding of the message according to the query results.

[0180] For example, the second MAC address can be MAC2 in Table 5, and the second VLAN identifier can be VLAN1 in Table 5. At this time, MAC2 and VLAN1 can be used to search Table 5, and it can be determined that the second MAC address table entry is the entry corresponding to sequence number 2 in Table 5. At this time, the outbound interface information PORT2 in the table entry can be used to forward the second message.

[0181] Optionally, the second MAC address table entry may be obtained by the first communication device itself learning the message, such as the table entry corresponding to sequence number 1-sequence number 3 in Table 5; or, the second MAC address table entry may also be generated according to the MAC route related to the VLAN published by another communication device, for example, the second MAC address table entry may be the table entry corresponding to sequence number 4 and sequence number 5 in Table 5. The first communication device and the other communication device may be dual-homed, and the first communication device may be Figure 3 A-Leaf1 in the figure, and the second access side device can be Figure 3 Alternatively, the first communication device may be Figure 2 The first PE device in the second access device can be Figure 2 The second PE device in.

[0182] Optionally, when the first communication device does not find a matching entry in the second MAC address table according to the second MAC address and the second VLAN identifier, the second message may be broadcast, for example, the second message may be broadcast in multiple ports corresponding to the second VLAN identifier.

[0183] Optionally, when the first communication device does not find a matching entry in the MAC address table according to the second MAC address and the second VLAN identifier, the first MAC address table can be queried according to the second MAC address + special VLAN identifier, and the message forwarding can be guided according to the query result. For example, when a matching entry is found, the second message is forwarded according to the outbound interface information in the matching entry; when no matching entry is found, the second message can be broadcast.

[0184] Optionally, in combination with the relevant contents of the aforementioned first message and the second message, after the first communication device receives a message, whether to use the destination MAC+special VLAN identifier as the first message to query the MAC address table, or to use the destination MAC+VLAN identifier in the message as the second message to query the MAC address table, can be determined according to the specific usage scenario and usage requirements of the first communication device, and this application does not limit this. For example, in the current network, when the problem of MAC address conflict is not serious, the destination MAC+special VLAN identifier can be used as the first message, and when the problem of MAC conflict is more serious (for example, there are more terminal devices hanging down), the destination MAC+VLAN identifier in the message can be used as the second message. For another example, when it is determined that the message comes from the terminal side (user side), the message is more likely to be sent to the network side. At this time, the destination MAC+shared VLAN identifier can be used as the first message, and when it is determined that the message comes from the network side, the message is more likely to be sent to the terminal side. At this time, the destination MAC+VLAN identifier in the message can be used as the second message.

[0185] See attached Figure 8 , Figure 8 2 is a flow chart of a method 200 for forwarding a message provided in an embodiment of the present application. The method 200 for forwarding a message can be applied to a first communication device, which can be the above-mentioned Figure 2 Any PE device in, or a processor or chip in a PE device; the first communication device may also be the above Figure 3 Any A-Leaf or S-Leaf device, or a processor or chip in an A-Leaf or S-Leaf device. The method 200 may include the following steps 210 to 260.

[0186] Step 210: A first communication device receives a first message. The first communication device is configured to perform MAC address learning through IVL mode. The first message includes a first media access control MAC address and a first virtual local area network VLAN identifier. The first MAC address is a destination MAC address of the first message.

[0187] In step 220, the first communication device searches the second MAC address table with the second key to determine whether a third MAC address table entry that can match each other is found, wherein the second key includes the first MAC address and the first VLAN identifier, and the third MAC address table entry should include the first MAC address and the first VLAN identifier. If a third MAC address table entry that can match each other is found, proceed to step 230, otherwise proceed to step 240.

[0188] Step 230: If a third MAC address entry that matches each other is found in the second MAC address table, the first communication device forwards the first message according to the outbound interface information in the third MAC address entry.

[0189] In step 240, if no matching MAC address entry can be found from the second MAC address table, in response to the failure to find a matching entry, the first communication device uses the first key to query the first MAC address table to determine whether a first MAC address entry that can match each other is found, wherein the first key includes the first MAC address but does not include the first VLAN identifier, and the first MAC address entry should include the first MAC address. If a first MAC address entry that can match each other is found, proceed to step 250, otherwise proceed to step 260. Step 240 can be understood according to the aforementioned step 120, and will not be repeated here.

[0190] Step 250: If a first MAC address entry that matches each other is found in the first MAC address table, the first communication device forwards the first message according to the outbound interface information in the first MAC address entry.

[0191] Step 260: If no matching entry is found in the first MAC address table, the first communication device broadcasts the first message.

[0192] According to the message forwarding method 200 provided in an embodiment of the present application, when forwarding a received message, the forwarding plane of the first communication device first uses the destination MAC address and VLAN identifier in the message to query the second MAC address table, that is, first uses the second key to query the second MAC address table, so as to avoid MAC address conflicts as much as possible, and continues to use the first key including the destination MAC address but not the VLAN identifier to query the first MAC address table after no hit, and forwards the first message according to the outbound interface information in the first MAC address table entry after hitting the first MAC address table entry.

[0193] See attached Fig. 9 , Fig. 9 3 is a flow chart of a method 300 for learning a MAC address provided in an embodiment of the present application. The method 300 for learning a MAC address can be applied to a first communication device, which can be the above-mentioned Figure 2 Any PE device in, or a processor or chip in a PE device; the first communication device may also be the above Figure 3 Any A-Leaf or S-Leaf device, or a processor or chip in an A-Leaf or S-Leaf device. The method 300 may include the following steps 310 to 320.

[0194] Step 310, the first communication device receives a virtual local area network (VLAN)-independent Ethernet virtual private network (EVPN) media access control (MAC) route issued by the second communication device, the first communication device is configured to perform MAC address learning through an independent virtual local area network (IVL) learning mode, and the MAC route includes a first MAC address.

[0195] In step 320, the first communication device generates a first MAC address table entry according to the MAC route, and the first MAC address table entry includes a first MAC address. The first MAC address table entry can be used by the first communication device to forward a message according to the destination MAC address in the message. The specific concept of the first MAC address table entry and its use method can be understood according to the first MAC address table entry in the aforementioned method 100 and method 200, and will not be repeated here.

[0196] Optionally, the first communication device is an access side leaf node A-Leaf device, and the second communication device is a service side leaf node S-Leaf device; or, the first communication device is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

[0197] Optionally, the second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, the second communication device is configured to perform MAC address learning through an IVL mode.

[0198] Optionally, the VLAN-independent MAC route may include the aforementioned special VLAN identifier. For example, the value of the special VLAN identifier may be 0.

[0199] According to the method 300 for learning MAC addresses provided in the embodiment of the present application, when the first communication device receives a MAC route that is not related to a VLAN, it is not discarded directly, but a corresponding MAC address table entry is generated and stored according to the MAC route. The table entry can be stored in a local MAC address table of the first communication device. For example, if the MAC route includes a first MAC address, a first MAC address table entry including the first MAC address can be generated in the MAC address table. On this basis, after receiving a message, the first communication device can use the destination MAC address in the message (without using the VLAN identifier therein) to query the MAC address table entry, and guide the forwarding of the message according to the query result.

[0200] Combination of the above Figures 1 to 9 The method provided in the embodiment of the present application is described in detail. Figure 10-11 Describe the communication device provided in the embodiment of the present application. It should be understood that Figure 10-11 The communication device shown can realize Figure 4-Figure 9One or more steps executed by the first communication device in the method flow shown are not described in detail here to avoid repetition.

[0201] Fig.10 4 is a schematic block diagram of a communication device 400 provided in an embodiment of the present application. Fig.10 As shown, the communication device 400 includes a transceiver unit 410 and a processing unit 420 .

[0202] The transceiver unit 410 is used to receive a first message. The communication device 400 is configured to perform media access control MAC address learning through an independent virtual local area network learning IVL mode. The first message includes a first MAC address and a first virtual local area network VLAN identifier. The first MAC address is the destination MAC address of the first message.

[0203] The processing unit 420 is configured to determine a first MAC address entry from a MAC address table according to the first MAC address, where the first MAC address entry includes the first MAC address but does not include the first VLAN identifier.

[0204] The transceiver unit 410 is further configured to forward the first message according to the first MAC address entry.

[0205] Optionally, the MAC address table includes a first MAC address table and a second MAC address table, the first MAC address table includes the first MAC address table entry, the second MAC address table is used to store the MAC address table entry learned based on the IVL mode, and the processing unit 420 is specifically used to: match the first MAC address table entry in the first MAC address table with a first key key, wherein the first key includes the first MAC address but does not include the first VLAN identifier.

[0206] Optionally, before searching the first MAC address table, the processing unit 420 is further configured to: search the second MAC address table with a second key, and find no matching MAC address entry, wherein the second key includes the first MAC address and the first VLAN identifier.

[0207] Optionally, the second MAC address table includes a second MAC address table entry, the second MAC address table entry includes a second MAC address and a second VLAN identifier, and the transceiver unit 410 is further used to receive a second message, the second message includes a second MAC address and a second VLAN identifier, and the second MAC address is the destination MAC address of the second message.

[0208] The processing unit 420 is further configured to match the second MAC address entry from the second MAC address table according to the second MAC address and the second VLAN identifier.

[0209] The transceiver unit 410 is further configured to forward the second message according to the second MAC address entry.

[0210] Optionally, the first MAC address table entry includes the first MAC address and a special VLAN identifier, and the special VLAN identifier is different from the first VLAN identifier. The processing unit 420 is specifically used to: match the first MAC address table entry from the MAC address table with a third key, and the third key includes the first MAC address and the special VLAN identifier.

[0211] Optionally, the value of the special VLAN identifier is 0.

[0212] Optionally, before the processing unit 420 determines the first MAC address table entry, the transceiver unit 410 is further configured to receive a VLAN-independent MAC route issued by a second communication device, where the MAC route includes the first MAC address.

[0213] The processing unit 420 is further configured to generate the first MAC address entry according to the MAC route.

[0214] Optionally, the communication device 400 is an access side leaf node A-Leaf device, and the second communication device is a service side leaf node S-Leaf device; or, the communication device 400 is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

[0215] Optionally, the second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, the second communication device is configured to perform MAC address learning through the IVL mode.

[0216] In another possible implementation, the transceiver unit 410 is used to receive an Ethernet virtual private network EVPN media access control MAC route that is independent of the virtual local area network VLAN and published by a second communication device, and the communication device 400 is configured to perform MAC address learning through an independent virtual local area network learning IVL mode, and the MAC route includes a first MAC address.

[0217] The processing unit 420 is configured to generate a first MAC address entry according to the MAC route, where the first MAC address entry includes the first MAC address.

[0218] Optionally, the communication device 400 is an access side leaf node A-Leaf device, and the second communication device is a service side leaf node S-Leaf device; or, the communication device 400 is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

[0219] Optionally, the second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, the second communication device is configured to perform MAC address learning through the IVL mode.

[0220] Optionally, the first MAC table entry also includes a special VLAN identifier.

[0221] Optionally, the value of the special VLAN identifier is 0. Specifically, the communication device 400 may correspond to the first communication device in the aforementioned method 100, method 200 and method 300. The communication device 400 may include a method for executing Figure 4-Figure 9 In addition, each unit in the communication device 400 and the above-mentioned other operations and / or functions are respectively for implementing the corresponding processes of method 100, method 200 and method 300. The specific process of each unit performing the above-mentioned corresponding steps has been described in detail in the above-mentioned method embodiment, and for the sake of brevity, it will not be repeated here.

[0222] The embodiment of the present application further provides a communication device 600, Fig.11 600 is a structural block diagram of a communication device 600 provided in an embodiment of the present application. Fig.11 As shown, the communication device 600 includes a processor 610 and a memory 620 , and the above-mentioned components may be connected via one or more buses 630 .

[0223] The communication device 600 further includes an instruction 621, which is stored in the memory 620. When the instruction 621 is executed by the processor 610, the communication device 600 executes the above Figure 4 The method 100, Figure 8 The method 200 shown or Fig. 9 The method 300 shown in FIG. 300 , wherein all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding physical device, and will not be repeated here.

[0224] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program runs on a processor, the method provided by the above method embodiment is implemented.

[0225] An embodiment of the present application further provides a computer program product, including: a computer program code, which, when executed on a processor, implements the method provided in the above method embodiment.

[0226] An embodiment of the present application also provides a chip system, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a network device equipped with the chip system executes the method provided in the above method embodiment.

[0227] Among them, the chip system may include an input circuit or interface for sending information or data, and an output circuit or interface for receiving information or data.

[0228] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0229] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0230] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

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

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

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

[0235] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0236] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for forwarding a message, characterized in that: include: A first communication device receives a first message, the first communication device is configured to perform media access control MAC address learning through an independent virtual local area network learning IVL mode, the first message includes a first MAC address and a first virtual local area network VLAN identifier, and the first MAC address is a destination MAC address of the first message; The first communication device determines a first MAC address entry from a MAC address table according to the first MAC address, where the first MAC address entry includes the first MAC address but does not include the first VLAN identifier; The first communication device forwards the first message according to the first MAC address entry.

2. The method according to claim 1, characterized in that: The MAC address table includes a first MAC address table and a second MAC address table, the first MAC address table includes the first MAC address table item, the second MAC address table is used to store the MAC address table item learned based on the IVL mode, and the first communication device determines the first MAC address table item from the MAC address table according to the first MAC address, including: The first communication device matches the first MAC address entry in the first MAC address table with a first key, wherein the first key includes the first MAC address but does not include the first VLAN identifier.

3. The method according to claim 2, characterized in that Before the first communication device searches the first MAC address table, the method further includes: The first communication device searches the second MAC address table with a second key and does not find a matching MAC address table entry, wherein the second key includes the first MAC address and the first VLAN identifier.

4. The method according to claim 2, characterized in that: The second MAC address table includes a second MAC address entry, the second MAC address entry includes a second MAC address and a second VLAN identifier, and the method further includes: The first communication device receives a second message, where the second message includes the second MAC address and the second VLAN identifier, and the second MAC address is a destination MAC address of the second message; The first communication device matches the second MAC address entry from the second MAC address table according to the second MAC address and the second VLAN identifier; The first communication device forwards the second message according to the second MAC address entry.

5. The method according to any one of claims 1 to 4, characterized in that The first MAC address table entry includes the first MAC address and a special VLAN identifier, where the special VLAN identifier is different from the first VLAN identifier, and the first communication device determines the first MAC address table entry from the MAC address table according to the first MAC address, including: The first communication device matches the first MAC address entry from the MAC address table using a third key, wherein the third key includes the first MAC address and the special VLAN identifier.

6. The method according to claim 5, characterized in that The value of the special VLAN identifier is 0.

7. The method according to any one of claims 1 to 6, characterized in that Before the first communication device determines the first MAC address entry, the method further includes: The first communication device receives a VLAN-independent MAC route issued by the second communication device, wherein the MAC route includes the first MAC address; The first MAC address table entry is generated according to the MAC route.

8. The method according to claim 7, characterized in that The first communication device is an access-side leaf node A-Leaf device, and the second communication device is a service-side leaf node S-Leaf device; or, The first communication device is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

9. The method according to claim 7 or 8, characterized in that: The second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, The second communication device is configured to perform MAC address learning through the IVL mode.

10. A method for learning a media access control MAC address, characterized in that: include: The first communication device receives a virtual local area network (VLAN)-independent Ethernet virtual private network (EVPN) MAC route issued by a second communication device, the first communication device being configured to learn a MAC address through an independent virtual local area network (IVL) learning mode, the MAC route including a first MAC address; The first communication device generates a first MAC address table entry according to the MAC route, where the first MAC address table entry includes the first MAC address.

11. The method according to claim 10, characterized in that The first communication device is an access-side leaf node A-Leaf device, and the second communication device is a service-side leaf node S-Leaf device; or, The first communication device is an access side operator edge PE device, and the second communication device is a network side operator edge PE device.

12. The method according to claim 10 or 11, characterized in that: The second communication device is configured to perform MAC address learning through a shared virtual local area network (SVL) mode; or, The second communication device is configured to perform MAC address learning through IVL mode.

13. The method according to any one of claims 10 to 12, characterized in that: The first MAC table entry also includes a special VLAN identifier.

14. The method according to claim 13, characterized in that The value of the special VLAN identifier is 0.

15. A communication device, characterized in that: include: A transceiver unit, configured to perform the receiving and / or sending operations in the method according to any one of claims 1 to 14; A processing unit, configured to perform other operations besides the receiving and / or sending operations in the method according to any one of claims 1 to 14.

16. A communication device, characterized in that: include: A memory storing instructions; The processor, when the instructions are executed by the processor, causes the communication device to perform the method according to any one of claims 1 to 14.

17. A computer program product, characterized in that include: Computer program code, when the computer program code is run on a processor, implements the method according to any one of claims 1 to 14.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on a processor, the method according to any one of claims 1 to 14 is implemented.