Traffic forwarding method and VTEP device

By setting the first forwarding module and the second forwarding module in the VTEP device, VXLAN encapsulation and forwarding of VLAN traffic is realized, which solves the problem of excessive resource consumption of VTEP devices in the prior art and supports large-scale deployment.

CN119854221APending Publication Date: 2025-04-18MAIPU COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411990638.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

When the prior art introduces VLAN traffic into the VXLAN network, VTEP device resource consumption is too large and cannot support large-scale deployment.

Method used

Using a traffic forwarding method, by setting a first forwarding module and a second forwarding module in the VTEP device, the first forwarding module receives the second layer traffic to be forwarded sent by the host device and forwards it. When the second forwarding module satisfies the VXLAN forwarding rule, it performs VXLAN encapsulation on the second layer traffic and forwards it through the VXLAN tunnel.

Benefits of technology

Logically decouples the mapping relationship between port + VLAN, reducing the resource consumption of VTEP devices and supporting large-scale deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854221A_ABST
    Figure CN119854221A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a traffic forwarding method and VTEP equipment, and relates to the technical field of communication. The VTEP equipment comprises a first forwarding module and a second forwarding module, and the first forwarding module receives to-be-forwarded two-layer traffic sent by the host equipment and forwards the to-be-forwarded two-layer traffic according to address information of the to-be-forwarded two-layer traffic; the second forwarding module receives the to-be-forwarded two-layer traffic sent by the first forwarding module; and the second forwarding module carries out VXLAN packaging on the to-be-forwarded two-layer traffic under the condition that the to-be-forwarded two-layer traffic meets the VXLAN forwarding rule, and forwards the packaged to-be-forwarded two-layer traffic to other corresponding VTEP equipment through a VXLAN tunnel according to the address information of the to-be-forwarded two-layer traffic. Therefore, resource consumption can be reduced, and large-scale deployment can be supported.
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 traffic forwarding method and a VTEP device. Background Art

[0002] With the popularization of VXLAN (Virtual eXtensible Local Area Network) technology, in order to deploy VXLAN networks, staff often need to relearn VXLAN technology, understand the differences between VXLAN and VLAN (Virtual Local Area Network) technology in actual applications, and make corresponding adjustments based on the differences in order to carry out subsequent deployment work normally. For example, they need to understand VXLAN planning, VXLAN configuration, traffic monitoring, problem location, etc., which increases the difficulty of VXLAN deployment.

[0003] At present, in order to reduce the difficulty of VXLAN deployment, a one-to-one mapping solution for VLAN and VXLAN is often adopted to make the VXLAN and VLAN network deployment methods basically consistent.

[0004] In the prior art, VLAN is usually associated and bound with the VXLAN configuration of the port in the VTEP (VxLAN Tunnel End Point) device, and the VLAN is added to the port, and the VXLAN network is connected in the form of port + VLAN, so as to introduce the Layer 2 traffic to the logical port of the VXLAN network. When the VLAN is connected to the VXLAN network in the form of port + VLAN, the corresponding logical port, editing table and other resources are often applied for mapping.

[0005] However, this method is a strong coupling solution, which consumes a lot of system resources of VTEP devices and cannot support large-scale deployment. For example, if a device has 48 service ports, 4K VLANs are all added to the 48 ports, and 4K VLANs are bound to 4K VXLANs one-to-one, and Port+VLAN is used to implement VXLAN network access, 48 ​​ports * 4K VLANs = 192K logical ports are required, which will cause a lot of resource consumption. Summary of the invention

[0006] In view of this, the purpose of the present application is to provide a traffic forwarding method and a VTEP device to reduce resource consumption when introducing VLAN traffic into a VXLAN network, thereby supporting large-scale deployment.

[0007] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0008] In a first aspect, the present application provides a traffic forwarding method, which is applied to a virtual extensible local area network tunnel endpoint VTEP device, wherein the VTEP device includes a first forwarding module and a second forwarding module, wherein the first forwarding module is communicatively connected to at least one host device, the second forwarding module is connected to at least one remote VTEP device through a VXLAN tunnel, and the first forwarding module is communicatively connected to the second forwarding module through a loopback port, and the method includes:

[0009] The first forwarding module receives the layer 2 traffic to be forwarded sent by the host device, and forwards the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded;

[0010] The second forwarding module receives the layer 2 traffic to be forwarded sent by the first forwarding module;

[0011] When the layer 2 traffic to be forwarded meets the VXLAN forwarding rules, the second forwarding module performs VXLAN encapsulation on the layer 2 traffic to be forwarded, and forwards the encapsulated layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the layer 2 traffic to be forwarded.

[0012] In an optional implementation, the address information includes a source MAC address and a destination MAC address, and the first forwarding module is communicatively connected to the host device via a connection port;

[0013] The forwarding of the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded includes:

[0014] The first forwarding module searches the first MAC table according to the destination MAC address and VLAN ID of the layer 2 traffic to be forwarded;

[0015] If there is a corresponding first MAC table entry for the layer 2 traffic to be forwarded, the first forwarding module forwards the layer 2 traffic to be forwarded according to the first MAC table entry;

[0016] If there is no corresponding first MAC table entry for the layer 2 traffic to be forwarded, the first forwarding module performs MAC address learning according to the source MAC address of the layer 2 traffic to be forwarded, the VLAN identifier and the connection port, and floods the layer 2 traffic to be forwarded according to the flooding domain corresponding to the VLAN identifier.

[0017] In an optional implementation, the second forwarding module is communicatively connected to the first forwarding module via a second loopback port;

[0018] The method of forwarding the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded includes:

[0019] The second forwarding module searches the second MAC table according to the destination MAC address of the layer 2 traffic to be forwarded and the VXLAN network identifier; if there is a corresponding second MAC table entry for the layer 2 traffic to be forwarded, the second forwarding module sends the encapsulated layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the second MAC table entry;

[0020] If there is no corresponding second MAC table entry for the Layer 2 traffic to be forwarded, the second forwarding module performs MAC address learning according to the source MAC address of the Layer 2 traffic to be forwarded, the VXLAN network identifier and the second loopback port, and floods the Layer 2 traffic to be forwarded according to the VXLAN tunnel corresponding to the VXLAN network identifier to send the Layer 2 traffic to be forwarded to the corresponding remote VTEP device.

[0021] In an optional embodiment, the method further comprises:

[0022] The second forwarding module receives the to-be-processed layer 2 traffic sent by the remote VTEP device through the VXLAN tunnel;

[0023] The second forwarding module performs VXLAN decapsulation on the to-be-processed layer 2 traffic when the to-be-processed layer 2 traffic meets the VXLAN decapsulation rule, and forwards the to-be-processed layer 2 traffic according to the address information of the to-be-processed layer 2 traffic;

[0024] The first forwarding module receives the decapsulated layer 2 traffic to be processed sent by the second forwarding module, and forwards the layer 2 traffic to be processed to a corresponding host device according to address information of the layer 2 traffic to be processed.

[0025] In an optional implementation manner, forwarding the to-be-processed layer 2 traffic according to the address information of the to-be-processed layer 2 traffic includes:

[0026] The second forwarding module searches the third MAC table according to the destination MAC address and the VXLAN network identifier of the to-be-processed layer 2 traffic;

[0027] If there is a corresponding third MAC table entry for the to-be-processed layer 2 traffic, the second forwarding module forwards the to-be-processed layer 2 traffic according to the third MAC table entry;

[0028] If there is no corresponding third MAC table entry for the to-be-processed Layer 2 traffic, the second forwarding module performs MAC learning according to the source MAC address of the to-be-processed Layer 2 traffic, the VXLAN network identifier, and the VXLAN tunnel, and floods the to-be-processed Layer 2 traffic according to other ports except the VXLAN tunnel in the flooding domain corresponding to the VXLAN network identifier.

[0029] In an optional implementation manner, the first forwarding module is communicatively connected to the second forwarding module via a first loopback port, and forwarding the to-be-processed layer 2 traffic to a corresponding host device according to the address information of the to-be-processed layer 2 traffic includes:

[0030] The first forwarding module searches the fourth MAC table according to the destination MAC address of the to-be-processed layer 2 traffic and the VLAN identifier;

[0031] If there is a corresponding fourth MAC table entry for the to-be-processed layer 2 traffic, the first forwarding module forwards the to-be-processed layer 2 traffic to the corresponding host device according to the fourth MAC table entry;

[0032] If there is no corresponding fourth MAC table entry for the to-be-processed Layer 2 traffic, the first forwarding module performs MAC learning according to the source MAC address of the to-be-processed Layer 2 traffic, the VLAN ID and the first loopback port, and floods the to-be-processed Layer 2 traffic according to the flooding domain corresponding to the VLAN ID to send the to-be-processed Layer 2 traffic to the corresponding host device.

[0033] In an optional embodiment, the method further comprises:

[0034] Receiving a first ARP message sent by the host device through the connection port of the first forwarding module, and performing ARP learning according to the source IP address of the first ARP message, the connection port and the VLAN identifier;

[0035] The second forwarding module receives a second ARP message sent by the remote VTEP device through the VXLAN tunnel, and performs ARP learning according to the source IP address of the second ARP message, the VXLAN tunnel and the VXLAN network identifier. In an optional implementation, the method further includes:

[0036] Receive the layer-3 traffic to be forwarded sent by the host device, and search the host table according to the destination IP address of the layer-3 traffic to be forwarded to obtain a first host table entry corresponding to the layer-3 traffic to be forwarded;

[0037] VXLAN encapsulation is performed on the layer-3 traffic to be forwarded, and the encapsulated layer-3 traffic to be forwarded is sent to the corresponding remote device VTEP device through the second forwarding module according to the first host table entry.

[0038] In an optional embodiment, the method further comprises:

[0039] Receiving the to-be-processed layer-3 traffic sent by the remote VTEP device through the VXLAN tunnel, and decapsulating the to-be-processed layer-3 traffic;

[0040] The host table is searched according to the destination IP address of the three-layer traffic to be processed, a second host table entry corresponding to the three-layer traffic to be forwarded is obtained, and the decapsulated three-layer traffic to be processed is forwarded to the corresponding host device through the first forwarding module according to the second host table entry.

[0041] In a second aspect, the present application provides a VTEP device, the VTEP device comprising a first forwarding module and a second forwarding module, the first forwarding module is communicatively connected to at least one host device, the second forwarding module is connected to at least one remote VTEP device through a VXLAN tunnel, and the first forwarding module is communicatively connected to the second forwarding module through a loopback port;

[0042] The first forwarding module is used to receive the layer 2 traffic to be forwarded sent by the host device, and forward the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded;

[0043] The second forwarding module is used to receive the Layer 2 traffic to be forwarded sent by the first forwarding module, and when the Layer 2 traffic to be forwarded meets the VXLAN forwarding rules, perform VXLAN encapsulation on the Layer 2 traffic to be forwarded, and forward the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded.

[0044] The traffic forwarding method and VTEP device provided by the embodiment of the present application, the VTEP device is provided with a first forwarding module and a second forwarding module, the first forwarding module receives the Layer 2 traffic to be forwarded sent by the host device, and forwards the Layer 2 traffic to be forwarded according to the address information of the Layer 2 traffic to be forwarded, the second forwarding module receives the Layer 2 traffic to be forwarded sent by the first forwarding module, and in the case where the Layer 2 traffic to be forwarded meets the VXLAN forwarding rule, the Layer 2 traffic to be forwarded is VXLAN encapsulated, and according to the address information of the Layer 2 traffic to be forwarded, the encapsulated Layer 2 traffic to be forwarded is forwarded to the corresponding remote VTEP device through the VXLAN tunnel. In this way, the mapping relationship of port + VLAN can be logically decoupled, the communication forwarding of the local side of the VTEP device is realized by the first forwarding module, and the communication forwarding between the VTEP device and the remote VTEP device is realized by the second forwarding module, and the first forwarding module and the second forwarding module only need a loopback port to realize the intercommunication between the modules, so the resource consumption of the VTEP device can be reduced, so as to support large-scale deployment.

[0045] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A block diagram of a VTEP device provided in an embodiment of the present application is shown;

[0048] Figure 2 An example diagram of a VTEP device provided in an embodiment of the present application is shown;

[0049] Figure 3 A flow chart of a traffic forwarding method provided in an embodiment of the present application is shown;

[0050] Figure 4 An example diagram of a MAC representation is shown;

[0051] Figure 5 An example diagram of a host table is shown.

[0052] Icon: 10-VTEP device; 100-first forwarding module; 110-second forwarding module; 20-host device; 30-remote VTEP device. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0054] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0055] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0056] Figure 1 For a block diagram of a VTEP (VxLAN Tunnel End Point) device 10 provided in an embodiment of the present application, see Figure 1 The VTEP device 10 may include a first forwarding module 100 and a second forwarding module 110, wherein the first forwarding module 100 is connected to at least one host device 20 in communication, the second forwarding module 110 is connected to at least one remote VTEP device 30 via a VXLAN tunnel, and the first forwarding module 100 is connected to the second forwarding module 110 in communication via a loopback port. The loopback port may be an internal loopback port or an external loopback port.

[0057] In this embodiment, the first forwarding module 100 can be applied as a VLAN access service forwarding module, and the second forwarding module 110 can be applied as a communication forwarding module between VTEP devices.

[0058] Optionally, the second forwarding module 110 may be communicatively connected to a second forwarding module of at least one remote VTEP device through a VXLAN tunnel.

[0059] In one example, Figure 2 For an example diagram of a VTEP device provided in an embodiment of the present application, see Figure 2 The VTEP device may be VTEP1, the first forwarding module may be an Underlay (bottom layer) forwarding module, which is used for Layer 2 traffic forwarding, such as VLAN traffic forwarding, the VLAN traffic has a VLAN identifier (i.e., VLAN ID), such as VLAN10, the second forwarding module may be an Overlay (upper layer) forwarding module, which is used for VXLAN network traffic forwarding, the VXLAN network traffic has a VXLAN network identifier (i.e., VNI, VXLAN Network Identifier), such as VNI10, the loopback port may include loop1 and loop2, the Underlay forwarding module may be connected to the host device through a physical port (port), and the Overlay forwarding module may be connected to the remote VTEP device VTEP2 through a VXLAN tunnel.

[0060] In this example, the Overlay forwarding module in VTEP1 can be connected to the Overlay forwarding module in the remote VTEP device VTEP2 through a VXLAN tunnel.

[0061] In this example, the Underlay forwarding module and the Overlay forwarding module also need to be configured. Specifically, VLAN10 can be associated with VNI10 on VTEP1, port1 and port2 can be added to VLAN10, host device Host1 can be connected to port1, and loopback port loop1 can be added to the flooding domain of VLAN10.

[0062] In this example, the traffic of VLAN10 can be connected to the VXLAN sending process based on the loopback port loop2. The corresponding traffic classification rule can be: map the VLAN10 traffic received by port loop2 to VNI10 of the VXLAN network, and generate a logical port (expressed as Svp) corresponding to VLAN10 and add it to the flooding domain of VNI10. The example is as follows:

[0063] loop2+VLAN10->Svp.

[0064] In this example, the Overlay forwarding module of VTEP1 can establish a VXLAN tunnel with the Overlay forwarding module of VTEP2, generate a virtual port of the VXLAN tunnel and add it to the flooding domain of VNI10. In addition, in order to prevent the protocol message from being submitted to the CPU for the second time, it is also necessary to cancel the function of submitting all types of protocols to the CPU based on the loop2 port, such as disabling the protocol identification function on the relevant ports of the VTEP device. At this time, all the messages obtained from the loop2 port can be forwarded as data messages.

[0065] It can be understood that based on this method, when the access device is replaced with a device that supports the VXLAN function, the VLAN configuration before the replacement can be directly inherited. Only one VLAN-associated VXLAN configuration and a new VXLAN tunnel configuration need to be added to complete the transformation. Therefore, the original business can be guaranteed not to change, and the staff can still configure it according to the VLAN planning thinking, thereby reducing the configuration difficulty of the staff and simplifying the complex business access configuration logic.

[0066] In this embodiment, the first forwarding module is used to receive the layer 2 traffic to be forwarded sent by the host device, and forward the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded.

[0067] In this embodiment, the second forwarding module is used to receive the Layer 2 traffic to be forwarded sent by the first forwarding module, and when the Layer 2 traffic to be forwarded meets the VXLAN forwarding rules, VXLAN encapsulates the Layer 2 traffic to be forwarded, and forwards the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded.

[0068] The VTEP device provided by the embodiment of the present application may be provided with a first forwarding module and a second forwarding module, wherein the first forwarding module receives the Layer 2 traffic to be forwarded sent by the host device, and forwards the Layer 2 traffic to be forwarded according to the address information of the Layer 2 traffic to be forwarded, and the second forwarding module receives the Layer 2 traffic to be forwarded sent by the first forwarding module, and performs VXLAN encapsulation on the Layer 2 traffic to be forwarded when the Layer 2 traffic to be forwarded meets the VXLAN forwarding rule, and forwards the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded. In this way, the mapping relationship of port + VLAN can be logically decoupled, the communication forwarding on the local side of the VTEP device is realized by the first forwarding module, and the communication forwarding between the VTEP device and the remote VTEP device is realized by the second forwarding module, and the first forwarding module and the second forwarding module only need a loopback port to realize the intercommunication between the modules, thereby reducing the resource consumption of the VTEP device.

[0069] Next, the above Figure 1 The VTEP device 10 is the execution body, and the traffic forwarding method provided in the embodiment of the present application is exemplarily introduced in combination with the flow chart.

[0070] Specifically, Figure 3 A flow chart of the traffic forwarding method provided in the embodiment of the present application is shown in Figure 3 , the method comprising:

[0071] Step S20: The first forwarding module receives the layer 2 traffic to be forwarded sent by the host device, and forwards the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded.

[0072] Step S21: The second forwarding module receives the layer 2 traffic to be forwarded sent by the first forwarding module.

[0073] Optionally, the first forwarding module may determine, according to address information of the layer-2 traffic to be forwarded, through which port the layer-2 traffic to be forwarded should be forwarded.

[0074] Step S22, when the second forwarding module satisfies the VXLAN forwarding rules, the second forwarding module performs VXLAN encapsulation on the second layer traffic to be forwarded, and forwards the encapsulated second layer traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the second layer traffic to be forwarded.

[0075] Optionally, the VXLAN forwarding rule may be configured by a user, for example, by defining the VXLAN forwarding rule in the form of a port+forwarding module.

[0076] Please continue to refer to the above example. The VXLAN forwarding rule may include that if the port at which the second forwarding module receives the layer 2 traffic to be forwarded is loop2 and the source is VLAN10, it can be determined that the VXLAN forwarding rule is satisfied.

[0077] Optionally, the second forwarding module may determine, based on the address information of the layer 2 traffic to be forwarded, through which specific VXLAN tunnel the layer 2 traffic to be forwarded should be forwarded.

[0078] In this embodiment, each port of the first forwarding module corresponding to the second forwarding module can generate a logical port resource, thereby greatly reducing resource consumption and supporting large-scale deployment.

[0079] In one example, if the solution in the prior art is adopted, a device has 48 service ports, 4K VLANs are all added to the 48 ports, and 4K VLANs are associated and bound one-to-one with 4K VXLANs. If port+VLAN is used to implement access to the VXLAN network, 48 ports * 4K VLANs = 192K logical ports are required. However, by adopting the traffic forwarding method provided in the embodiment of the present application, only one logical port resource needs to be generated for each VLAN for the loop2 port, that is, 4K logical port resources. Obviously, this method can greatly reduce resource consumption compared with the prior art.

[0080] The traffic forwarding method provided by the embodiment of the present application is that the VTEP device is provided with a first forwarding module and a second forwarding module, the first forwarding module receives the Layer 2 traffic to be forwarded sent by the host device, and forwards the Layer 2 traffic to be forwarded according to the address information of the Layer 2 traffic to be forwarded, the second forwarding module receives the Layer 2 traffic to be forwarded sent by the first forwarding module, and performs VXLAN encapsulation on the Layer 2 traffic to be forwarded when the Layer 2 traffic to be forwarded meets the VXLAN forwarding rule, and forwards the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded. In this way, the mapping relationship of port + VLAN can be logically decoupled, the communication forwarding of the local side of the VTEP device is realized by the first forwarding module, and the communication forwarding between the VTEP device and the remote VTEP device is realized by the second forwarding module, and the first forwarding module and the second forwarding module only need a loopback port to realize the intercommunication between the modules, so the resource consumption of the VTEP device can be reduced, thereby supporting large-scale deployment.

[0081] Optionally, the address information of the layer 2 traffic to be forwarded may include a source MAC address and a destination MAC address of the layer 2 traffic to be forwarded.

[0082] In this embodiment, the first forwarding module can be connected to the host device through the connection port, the first forwarding module can include a first loopback port, and the second forwarding module can include a second loopback port. It can be understood that the first forwarding module can be connected to the second forwarding module through the first loopback port, and the second forwarding module can be connected to the first forwarding module through the second loopback port.

[0083] In an example, see above Figure 2 , the connection port may be port1, the first loopback port may be loop1, and the second loopback port may be loop2.

[0084] Next, a possible implementation manner is provided for how the first forwarding module forwards the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded.

[0085] Specifically, the first forwarding module may search the first MAC table according to the destination MAC address and VLAN identifier of the layer 2 traffic to be forwarded.

[0086] Optionally, the VTEP device may store a corresponding MAC table, or may not store a corresponding MAC table.

[0087] In this embodiment, if the corresponding MAC table is stored in the VTEP device, it can be forwarded directly by looking up the table. If the corresponding MAC table is not stored, MAC learning needs to be performed first to generate a MAC table.

[0088] Specifically, if there is a corresponding first MAC table entry for the Layer 2 traffic to be forwarded, the first forwarding module can forward the Layer 2 traffic to be forwarded according to the first MAC table entry; if there is no corresponding first MAC table entry for the Layer 2 traffic to be forwarded, the first forwarding module performs MAC address learning based on the source MAC address, VLAN ID and connection port of the Layer 2 traffic to be forwarded, and floods the Layer 2 traffic to be forwarded according to the flooding domain corresponding to the VLAN ID.

[0089] Optionally, the first MAC table entry may include a port that should be used when forwarding the layer 2 traffic to be forwarded.

[0090] Optionally, after MAC learning, a corresponding MAC table entry may be obtained, that is, a correspondence between a source MAC address, a VLAN identifier, and a connection port.

[0091] In this embodiment, after MAC learning, the first forwarding module may send the to-be-forwarded layer 2 traffic to each port in the flooding domain, which may include ports for connecting to some host devices and the first loopback port.

[0092] In one example, Figure 4 For an example of a MAC table, see Figure 4 And in the above example Figure 2 If the source MAC address of the Layer 2 traffic to be forwarded is MAC1, the destination MAC address is MAC2, and the VLAN ID of the Layer 2 traffic to be forwarded is VLAN10, the Underlay forwarding module can match MAC2 and VLAN10 in the MAC table, thereby hitting the fourth record as the first MAC table entry. At this time, the port to be used is loop1.

[0093] Based on this, the Underlay forwarding module can send the Layer 2 traffic to be forwarded to the Overlay forwarding module through loop1.

[0094] In this example, if the corresponding record cannot be hit according to MAC2 and VLAN10, MAC learning needs to be performed according to MAC1, VLAN10 and the corresponding egress port port1. Then, the Underlay forwarding module can obtain the corresponding MAC table entry, which is represented by: MAC1+VLAN10->port1.

[0095] In this example, the Underlay forwarding module can flood the Layer 2 traffic to be forwarded after MAC learning, and send it to port2 and loop1 respectively, and then send it to the Overlay forwarding module.

[0096] Next, a possible implementation method is provided for how the second forwarding module forwards the encapsulated Layer 2 traffic to be forwarded to the corresponding other VTEP devices through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded.

[0097] Specifically, the second forwarding module may search the second MAC table according to the destination MAC address of the layer 2 traffic to be forwarded and the VXLAN network identifier.

[0098] Optionally, the VTEP device may store a corresponding MAC table, or may not store a corresponding MAC table.

[0099] In this embodiment, if the corresponding MAC table is stored in the VTEP device, it can be forwarded directly by looking up the table. If the corresponding MAC table is not stored, MAC learning needs to be performed first to generate a MAC table.

[0100] In this embodiment, if there is a corresponding second MAC table entry for the Layer 2 traffic to be forwarded, the second forwarding module can send the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the second MAC table entry; if there is no corresponding second MAC table entry for the Layer 2 traffic to be forwarded, the second forwarding module can perform MAC address learning according to the source MAC address, VXLAN network identifier and second loopback port of the Layer 2 traffic to be forwarded, and flood the Layer 2 traffic to be forwarded according to the VXLAN tunnel in the flooding domain corresponding to the VXLAN network identifier, so as to send the Layer 2 traffic to be forwarded to the corresponding other VTEP devices.

[0101] Optionally, the second MAC table entry may include a VXLAN tunnel that should be used when forwarding the layer 2 traffic to be forwarded.

[0102] Optionally, after MAC learning, a corresponding MAC table entry may be obtained, that is, a correspondence between the source MAC address, the VXLAN network identifier, and the second loopback port.

[0103] In an example, see above Figure 2 and Figure 4 , the VXLAN network identifier of the VXLAN tunnel, that is, VNI10, the Overlay forwarding module can match MAC2 and VNI10 in the MAC table, thereby hitting the third record as the second MAC table entry. At this time, the VXLAN tunnel that should be used is the VXLAN tunnel corresponding to VTEP2.

[0104] Based on this, the Overlay forwarding module can send the Layer 2 traffic to be forwarded to VTEP2 through the VXLAN tunnel corresponding to VTEP2.

[0105] In this example, if the corresponding record cannot be hit according to MAC2 and VNI10, MAC learning is required according to MAC1, VNI10 and the corresponding egress port loop2. The Overlay forwarding module can obtain the corresponding MAC table entry, and the example is expressed as: MAC1+VNI10->loop2.

[0106] In this example, the Overlay forwarding module can flood the Layer 2 traffic to be forwarded after MAC learning, thereby sending it to VTEP2 through the VXLAN tunnel.

[0107] In addition, the VTEP device can also receive and forward the Layer 2 traffic to be processed sent by the remote VTEP device.

[0108] In this embodiment, the second forwarding module can receive the to-be-processed Layer 2 traffic sent by the remote VTEP device through the VXLAN tunnel, and when the to-be-processed Layer 2 traffic meets the VXLAN decapsulation rules, perform VXLAN decapsulation on the to-be-processed Layer 2 traffic, and forward the to-be-processed Layer 2 traffic according to the address information of the to-be-processed Layer 2 traffic.

[0109] Optionally, the decapsulation rule may be configured by a user, for example, configuring all traffic received through the VXLAN tunnel to satisfy the decapsulation rule.

[0110] In this embodiment, the first forwarding module may receive the decapsulated layer 2 traffic to be processed sent by the second forwarding module, and forward the layer 2 traffic to be processed to the corresponding host device according to the address information of the layer 2 traffic to be processed.

[0111] Optionally, the first forwarding module may determine, according to address information of the layer-2 traffic to be processed, through which port the layer-2 traffic to be processed should be forwarded.

[0112] Next, a possible implementation manner is provided for how the second forwarding module forwards the layer 2 traffic to be processed according to the address information of the layer 2 traffic to be processed.

[0113] Specifically, the second forwarding module may search the third MAC table according to the destination MAC address of the layer 2 traffic to be processed and the VXLAN network identifier.

[0114] In this embodiment, if there is a corresponding third MAC table entry for the Layer 2 traffic to be processed, the second forwarding module can forward the Layer 2 traffic to be processed according to the third MAC table entry; if there is no corresponding third MAC table entry for the Layer 2 traffic to be processed, the second forwarding module can perform MAC learning based on the source MAC address, VXLAN network identifier and VXLAN tunnel of the Layer 2 traffic to be forwarded, and flood the Layer 2 traffic to be processed according to other ports except the VXLAN tunnel in the flooding domain corresponding to the VXLAN network identifier.

[0115] Optionally, the third MAC table entry may include a port that should be used when forwarding the to-be-processed layer-2 traffic.

[0116] Optionally, after MAC learning, a corresponding MAC table entry can be obtained, that is, a correspondence between a source MAC address, a VXLAN network identifier, and a VXLAN tunnel.

[0117] Optionally, in order to prevent the formation of a loop, the VXLAN tunnels between the second forwarding module and each other VTEP device need to be set to be horizontally isolated. At this time, when the Layer 2 traffic to be processed is flooded, it can be ensured that it will not be sent to other VXLAN tunnels.

[0118] For an example, see Figure 2 and Figure 4 If the source MAC address of the Layer 2 traffic to be processed is MAC2 and the destination MAC address is MAC1, the Overlay forwarding module can match MAC1 and VNI10 in the MAC table, thereby hitting the second record as the third MAC table entry. At this time, the port to be used is loop2.

[0119] Based on this, the Overlay forwarding module can send the Layer 2 traffic to be processed to the Underlay forwarding module through loop2.

[0120] In this example, if the corresponding record cannot be hit according to MAC1 and VNI10, MAC learning is required according to the VXLAN tunnel corresponding to MAC2, VNI10 and VTEP2. The Overlay forwarding module can obtain the corresponding MAC table entry, that is, MAC2+VNI10->VTEP1-VXLAN tunnel.

[0121] In this example, the Overlay forwarding module can flood the Layer 2 traffic to be processed in the corresponding VLAN after MAC learning. At this time, the Layer 2 traffic to be processed is sent to the Underlay forwarding module through loop2.

[0122] Next, a possible implementation method is provided for how the first forwarding module forwards the to-be-processed layer 2 traffic to the corresponding host device according to the address information of the to-be-processed layer 2 traffic.

[0123] Specifically, the first forwarding module may search the MAC table according to the destination MAC address and VLAN identifier of the layer 2 traffic to be processed.

[0124] In this embodiment, if there is a corresponding fourth MAC table entry for the Layer 2 traffic to be processed, the first forwarding module can forward the Layer 2 traffic to be processed to the corresponding host device according to the fourth MAC table entry; if there is no corresponding fourth MAC table entry for the Layer 2 traffic to be processed, the first forwarding module can perform MAC learning based on the source MAC address, VLAN ID and first loopback port of the Layer 2 traffic to be processed, and flood the Layer 2 traffic to be processed according to the flooding domain corresponding to the VLAN ID, so as to send the Layer 2 traffic to be processed to the corresponding host device.

[0125] Optionally, the fourth MAC table entry may include a port that should be used when forwarding the to-be-processed layer-2 traffic.

[0126] Optionally, after MAC learning, a corresponding MAC table entry may be obtained, that is, a corresponding relationship between a source MAC address, a VLAN identifier, and a second loopback port.

[0127] For an example, see Figure 2 and Figure 4 After receiving the Layer 2 traffic to be processed, the Underlay forwarding module can match it in the MAC table according to MAC1 (the MAC address of Host1) and VLAN10, thereby hitting the first record as the fourth MAC table entry. At this time, the port to be used is port1.

[0128] Based on this, the Underlay forwarding module can send the Layer 2 traffic to be processed to the host device Host1 through port1.

[0129] In this example, if the corresponding record cannot be hit according to MAC1 and VLAN10, MAC learning is required according to MAC2 (MAC address of Host2), VLAN10 and egress port loop1. Then the Underlay forwarding module can obtain the corresponding MAC table entry, which is represented by: MAC2+VLAN10->loop1.

[0130] In this example, the Underlay forwarding module can flood the Layer 2 traffic to be processed after MAC learning and send it to port 1 and port 2, thereby sending the Layer 2 traffic to be processed to Host 1 through port 1.

[0131] Optionally, the VTEP device can also forward Layer 3 traffic.

[0132] In a possible implementation, the VTEP device needs to perform ARP (Address Resolution Protocol) learning before forwarding layer-3 traffic.

[0133] In this embodiment, the VTEP device may receive the first ARP message sent by the host device through the connection port of the first forwarding module, and perform ARP learning according to the source IP address, connection port and VLAN identifier of the first ARP message.

[0134] Optionally, after receiving the first ARP message through the connection port, the VTEP device may report it to the ARP module for processing, thereby performing ARP learning.

[0135] Optionally, after ARP learning is performed, a correspondence between the source IP address, the connection port, and the VLAN identifier of the first ARP message may be obtained.

[0136] In this embodiment, the VTEP device can receive the second ARP message sent by the remote VTEP device through the VXLAN tunnel through the second forwarding module, and perform ARP learning according to the source IP address, VXLAN tunnel and VXLAN network identifier of the second ARP message.

[0137] Optionally, the VTEP device may also receive a second ARP message sent by other VTEP devices through the VXLAN tunnel, and after decapsulating the second ARP message, send it to the ARP module for processing, thereby performing ARP learning.

[0138] Optionally, after ARP learning, a correspondence between the source IP address of the second ARP message, the VXLAN tunnel corresponding to the other VTEP device, and the VXLAN network identifier may be obtained.

[0139] In one example, Figure 5 For an example diagram of the host table, see Figure 5 And continue to see above Figure 2, the host device Host1 sends the first ARP message to VTEP1 through port1. VTEP1 can obtain the host table entry after ARP learning in the VRF (Virtual Routing Forwarding) instance Vpc-1 corresponding to Host1. The example is shown as follows:

[0140] Vpc-1+Host1 IP->port1+VLAN10.

[0141] The remote VTEP2 can send a second ARP packet to VTEP1 through the VXLAN tunnel. Then VTEP1 can obtain the host table entry after ARP learning, which is represented by: Vpc-1+Host2IP->vtep2-VNI10.

[0142] Optionally, the VTEP device can receive the three-layer traffic to be forwarded sent by the host device, and search the host table according to the destination IP address of the three-layer traffic to be forwarded, obtain the first host table entry corresponding to the three-layer traffic to be forwarded, perform VXLAN encapsulation on the three-layer traffic to be forwarded, and send the encapsulated three-layer traffic to be forwarded to the corresponding remote VTEP device through the second forwarding module according to the first host table entry.

[0143] Optionally, the first host table entry records a forwarding module and a port that should be used when sending the layer-3 traffic to be forwarded.

[0144] In this embodiment, after the first host table entry is obtained, the layer-3 traffic to be forwarded may be forwarded through a layer-3 routing forwarding process according to the first host table entry.

[0145] In an example, see above Figure 2 and Figure 5 If the destination IP address of the Layer 3 traffic to be forwarded is IP2 (the IP address of Host2), the host route can be found in the virtual forwarding instance Vpc-1, and the second record can be hit as the first host table entry, so that the encapsulated Layer 3 traffic to be forwarded is sent to VTEP2 through VNI10 and the VXLAN tunnel corresponding to VTEP2, and VTEP2 forwards it to Host2.

[0146] Optionally, the VTEP device can also receive the three-layer traffic to be processed sent by other VTEP devices through the VXLAN tunnel, decapsulate the three-layer traffic to be processed, search the host table according to the destination IP address of the three-layer traffic to be processed, obtain the second host table entry corresponding to the three-layer traffic to be processed, and forward the decapsulated three-layer traffic to be processed to the corresponding host device according to the second host table entry through the first forwarding module.

[0147] Optionally, the second host table entry records a forwarding module and a port that should be used when sending the to-be-processed layer-3 traffic.

[0148] In this embodiment, after the second host table entry is obtained, the to-be-processed layer-3 traffic may be forwarded through a layer-3 routing forwarding process according to the second host table entry.

[0149] In an example, see above Figure 2 and Figure 5 If the destination IP address of the Layer 3 traffic to be forwarded is IP1 (the IP address of Host 1), the host route can be found in the corresponding virtual forwarding instance Vpc-1, and the first record is hit as the first host table entry, so that the decapsulated Layer 3 traffic to be processed is sent to Host 1 through VLAN 10 and port 1.

[0150] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0151] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0152] If the functions are implemented in the form of software function modules 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, including several instructions to enable 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.

[0153] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A traffic forwarding method, characterized in that: Applied to a virtual extensible local area network tunnel endpoint VTEP device, the VTEP device includes a first forwarding module and a second forwarding module, the first forwarding module is communicatively connected to at least one host device, the second forwarding module is connected to at least one remote VTEP device through a VXLAN tunnel, and the first forwarding module is communicatively connected to the second forwarding module through a loopback port, the method includes: The first forwarding module receives the layer 2 traffic to be forwarded sent by the host device, and forwards the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded; The second forwarding module receives the layer 2 traffic to be forwarded sent by the first forwarding module; When the layer 2 traffic to be forwarded meets the VXLAN forwarding rules, the second forwarding module performs VXLAN encapsulation on the layer 2 traffic to be forwarded, and forwards the encapsulated layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the layer 2 traffic to be forwarded.

2. The method according to claim 1, characterized in that The address information includes a source MAC address and a destination MAC address, and the first forwarding module is connected to the host device through a connection port; The forwarding of the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded includes: The first forwarding module searches the first MAC table according to the destination MAC address and VLAN ID of the layer 2 traffic to be forwarded; If there is a corresponding first MAC table entry for the layer 2 traffic to be forwarded, the first forwarding module forwards the layer 2 traffic to be forwarded according to the first MAC table entry; If there is no corresponding first MAC table entry for the layer 2 traffic to be forwarded, the first forwarding module performs MAC address learning according to the source MAC address of the layer 2 traffic to be forwarded, the VLAN identifier and the connection port, and floods the layer 2 traffic to be forwarded according to the flooding domain corresponding to the VLAN identifier.

3. The method according to claim 1, characterized in that The second forwarding module is communicatively connected to the first forwarding module via a second loopback port; The method of forwarding the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded includes: The second forwarding module searches the second MAC table according to the destination MAC address of the layer 2 traffic to be forwarded and the VXLAN network identifier; if there is a corresponding second MAC table entry for the layer 2 traffic to be forwarded, the second forwarding module sends the encapsulated layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the second MAC table entry; If there is no corresponding second MAC table entry for the Layer 2 traffic to be forwarded, the second forwarding module performs MAC address learning according to the source MAC address of the Layer 2 traffic to be forwarded, the VXLAN network identifier and the second loopback port, and floods the Layer 2 traffic to be forwarded according to the VXLAN tunnel corresponding to the VXLAN network identifier, so as to send the Layer 2 traffic to be forwarded to the corresponding remote VTEP device.

4. The method according to claim 1, characterized in that: The method further comprises: The second forwarding module receives the to-be-processed layer 2 traffic sent by the remote VTEP device through the VXLAN tunnel; The second forwarding module performs VXLAN decapsulation on the to-be-processed layer 2 traffic when the to-be-processed layer 2 traffic meets the VXLAN decapsulation rule, and forwards the to-be-processed layer 2 traffic according to the address information of the to-be-processed layer 2 traffic; The first forwarding module receives the decapsulated layer 2 traffic to be processed sent by the second forwarding module, and forwards the layer 2 traffic to be processed to a corresponding host device according to address information of the layer 2 traffic to be processed.

5. The method according to claim 4, characterized in that The forwarding the to-be-processed layer 2 traffic according to the address information of the to-be-processed layer 2 traffic includes: The second forwarding module searches the third MAC table according to the destination MAC address and the VXLAN network identifier of the to-be-processed layer 2 traffic; If there is a corresponding third MAC table entry for the to-be-processed layer 2 traffic, the second forwarding module forwards the to-be-processed layer 2 traffic according to the third MAC table entry; If there is no corresponding third MAC table entry for the to-be-processed Layer 2 traffic, the second forwarding module performs MAC learning according to the source MAC address of the to-be-processed Layer 2 traffic, the VXLAN network identifier, and the VXLAN tunnel, and floods the to-be-processed Layer 2 traffic according to other ports except the VXLAN tunnel in the flooding domain corresponding to the VXLAN network identifier.

6. The method according to claim 4, characterized in that The first forwarding module is communicatively connected to the second forwarding module through the first loopback port, and forwarding the to-be-processed layer 2 traffic to the corresponding host device according to the address information of the to-be-processed layer 2 traffic includes: The first forwarding module searches the fourth MAC table according to the destination MAC address and VLAN ID of the layer 2 traffic to be processed; If there is a corresponding fourth MAC table entry for the to-be-processed layer 2 traffic, the first forwarding module forwards the to-be-processed layer 2 traffic to the corresponding host device according to the fourth MAC table entry; If there is no corresponding fourth MAC table entry for the to-be-processed Layer 2 traffic, the first forwarding module performs MAC learning according to the source MAC address of the to-be-processed Layer 2 traffic, the VLAN ID and the first loopback port, and floods the to-be-processed Layer 2 traffic according to the flooding domain corresponding to the VLAN ID to send the to-be-processed Layer 2 traffic to the corresponding host device.

7. The method according to claim 1, characterized in that The method further comprises: Receiving a first ARP message sent by the host device through the connection port of the first forwarding module, and performing ARP learning according to the source IP address of the first ARP message, the connection port and the VLAN identifier; The second forwarding module receives a second ARP message sent by the remote VTEP device through the VXLAN tunnel, and performs ARP learning according to the source IP address of the second ARP message, the VXLAN tunnel and the VXLAN network identifier.

8. The method according to claim 7, characterized in that The method further comprises: Receive the layer-3 traffic to be forwarded sent by the host device, and search the host table according to the destination IP address of the layer-3 traffic to be forwarded to obtain a first host table entry corresponding to the layer-3 traffic to be forwarded; VXLAN encapsulation is performed on the layer-3 traffic to be forwarded, and the encapsulated layer-3 traffic to be forwarded is sent to the corresponding remote device VTEP device through the second forwarding module according to the first host table entry.

9. The method according to claim 7, characterized in that: The method further comprises: Receiving the to-be-processed layer-3 traffic sent by the remote VTEP device through the VXLAN tunnel, and decapsulating the to-be-processed layer-3 traffic; The host table is searched according to the destination IP address of the three-layer traffic to be processed, a second host table entry corresponding to the three-layer traffic to be processed is obtained, and the decapsulated three-layer traffic to be processed is forwarded to the corresponding host device through the first forwarding module according to the second host table entry.

10. A VTEP device, characterized in that: The VTEP device includes a first forwarding module and a second forwarding module, the first forwarding module is communicatively connected to at least one host device, the second forwarding module is connected to at least one remote VTEP device through a VXLAN tunnel, and the first forwarding module is communicatively connected to the second forwarding module through a loopback port; The first forwarding module is used to receive the layer 2 traffic to be forwarded sent by the host device, and forward the layer 2 traffic to be forwarded according to the address information of the layer 2 traffic to be forwarded; The second forwarding module is used to receive the Layer 2 traffic to be forwarded sent by the first forwarding module, and when the Layer 2 traffic to be forwarded meets the VXLAN forwarding rules, perform VXLAN encapsulation on the Layer 2 traffic to be forwarded, and forward the encapsulated Layer 2 traffic to be forwarded to the corresponding remote VTEP device through the VXLAN tunnel according to the address information of the Layer 2 traffic to be forwarded.