MAC address transmission method, apparatus, and system, and related devices

By aggregating MAC addresses of virtual machines with the same MAC address across different virtual local area networks into a single route, the method addresses the challenge of excessive route generation in EVPN, improving network performance and efficiency.

JP7547494B2Active Publication Date: 2024-09-09HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2022557970
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-03-23
Filing Date
2021-03-01
Publication Date
2024-09-09
Estimated Expiration
2041-03-01

AI Technical Summary

Technical Problem

The existing Ethernet Virtual Private Network (EVPN) technologies face challenges in managing a large number of routes for advertising MAC addresses of virtual machines, leading to increased network performance overhead due to the continuous generation of MAC/IP Advertisement routes for virtual machines with the same MAC addresses in different virtual local area networks.

Method used

A method and apparatus for aggregating MAC addresses of virtual machines with the same MAC address across different virtual local area networks into a single route, reducing the number of routes transmitted and stored in the network, using techniques such as Border Gateway Protocol (BGP) routes and MAC Mobility Extended Community (MMEC) attributes to manage virtual machine migrations and updates.

Benefits of technology

This approach reduces the number of routes in the network, enhancing route transmission performance and convergence performance by consolidating information about multiple virtual machines with the same MAC address into a single route, thereby optimizing network efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007547494000004
    Figure 0007547494000004
  • Figure 0007547494000005
    Figure 0007547494000005
  • Figure 0007547494000006
    Figure 0007547494000006
Patent Text Reader

Abstract

A MAC address transmission method, apparatus, and system, as well as related devices, are provided and relate to the field of communications technology. The method is applied to a network system including a first network device and a second network device. The first network device is connected to multiple virtual machines, including a first virtual machine and a second virtual machine. The first network device acquires the MAC address of the first virtual machine, and if the first virtual machine and the second virtual machine have the same MAC address but are located in different virtual local area networks, acquires a first route and transmits the first route to the second network device. The first route includes route information, which includes the MAC address, first virtual local area network information of the first virtual machine, and second virtual local area network information of the second virtual machine. In this method, information about virtual machines with the same MAC address in different virtual local area networks is aggregated into a single route to reduce the number of routes in the network.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001]

[0013] Embodiments of the present application claim priority to Chinese Patent Application No. 202010209165.5, entitled "MAC Address Transmission Method, Apparatus, and System," filed on March 23, 2020, the entire contents of which are incorporated by reference into the embodiments of the present application.

[0002] TECHNICAL FIELD Embodiments of the present application relate to the field of communication technologies, and in particular to a Media Access Control (MAC) address transmission method, apparatus, and system, and related devices. [Background technology]

[0003] Ethernet Virtual Private Network (EVPN) is a Virtual Private Network (VPN) technology for Layer 2 network interconnection. As the mainstream solution for carrying Layer 2 services, EVPN has been widely used in the network designs of various operators. An EVPN-based virtual extensible local area network (VXLAN) includes multiple Provider Edge (PE) devices that communicate with each other. Hosts may be connected to PE devices in a VXLAN to access the VXLAN.

[0004] A PE device may be connected to multiple hosts (which may be referred to as local hosts for the PE device), and multiple virtual machines (which may be referred to as local virtual machines for the PE device) may be created on each of the multiple hosts. The multiple virtual machines on each host may belong to the same virtual local area network (VLAN) or to different VLANs.

[0005] A PE device can obtain the MAC address of a virtual machine local to the PE device. Each time the PE device obtains the MAC address of a virtual machine, the PE device can generate a Media Access Control / Internet Protocol Advertisement (MAC / IP Advertisement) route to advertise the MAC address of the virtual machine and send the MAC / IP Advertisement route to other PE devices. The MAC / IP Advertisement route contains the MAC address of the virtual machine and the VXLAN network identifier (VNI) of the virtual machine. Summary of the Invention [Means for solving the problem]

[0006] The embodiments of the present application provide a MAC address transmission method, apparatus and system, and related devices, to reduce to a certain extent the number of paths for notifying the MAC address of a virtual machine in a network.

[0007] According to a first aspect, a MAC address transmission method is provided and applied to a network system, the network system includes a first network device and a second network device, the first network device is connected to a plurality of virtual machines, the plurality of virtual machines includes a first virtual machine and a second virtual machine.

[0008] The method may be performed by a first network device. Specifically, the first network device obtains a MAC address of a first virtual machine. When the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, the first network device obtains a first route, the first route including route information, the route information including the MAC address, the first virtual machine's first virtual local area network information, and the second virtual machine's second virtual machine's second virtual machine's second virtual machine information. The first network device sends the first route to the second network device.

[0009] In one embodiment, there are multiple virtual machines whose MAC addresses are the same as the MAC address of the first virtual machine, and the multiple virtual machines are located in virtual local area networks different from the virtual local area network in which the first virtual machine is located, and the virtual local area networks are also different from each other. The second virtual machine is one of the multiple virtual machines. In the above case, the route information in the first route includes the MAC address, the first virtual local area network information of the first virtual machine, and the multiple virtual local area network information of the multiple virtual machines, and the multiple virtual machines correspond one-to-one to the multiple virtual local area network information.

[0010] In the embodiment of the present application, for multiple virtual machines located in different virtual local area networks with the same MAC address, one route can be used to notify the MAC addresses and virtual local area network information of each of the multiple virtual machines, that is, multiple information of multiple virtual machines located in different virtual local area networks with the same MAC address can be aggregated into one route. In this way, the number of routes in the network can be reduced, and the route transmission performance and route convergence performance can be improved.

[0011] In a possible implementation, the first network device can store a second route (e.g., a Border Gateway Protocol (BGP) route), where the second route includes route information. In this way, for multiple virtual machines located in different virtual local area networks with the same MAC address, only one route needs to be stored locally to record the same MAC address and virtual local area network information of the multiple virtual machines, and the route can include multiple route table entries corresponding to the multiple virtual machines respectively. That is, for multiple virtual machines located in different virtual local area networks with the same MAC address, multiple pieces of information corresponding to the multiple virtual machines are recorded in one route, reducing the number of routes that need to be stored locally and saving storage resources.

[0012] In a possible implementation, before the first network device obtains the first route, the first network device can send a third route to the second network device, the third route including the MAC address and the second virtual local area network information but not including the first virtual local area network information. For example, when one or more virtual machines are online, the first network device can obtain related attribute information of the one or more virtual machines, the one or more virtual machines including the second virtual machine but not including the first virtual machine. In the above case, the first network device can send the third route to the second network device to notify the related information of the second virtual machine. If the first network device further confirms that the virtual machines that are simultaneously online (here, "simultaneously online" does not necessarily mean that the virtual machines are online at the same time, and the virtual machines may be online sequentially at times within a certain threshold range) further include a virtual machine having a MAC address that is the same as the MAC address of the second virtual machine, the first network device can send the related information of the multiple virtual machines having the same MAC address in the third route. After the first network device sends the third route, the first virtual machine goes online immediately, and the first virtual machine and the second virtual machine have the same MAC address. In this case, the first network device can send the first route to notify the related information of the first virtual machine. The first route may include the related information of the first virtual machine and the related information of one or more virtual machines included in the above third route. That is, the first route may be used as an update route of the third route. The above uses an example in which the route sent when the virtual machine goes online is the third route. It will be understood that the third route may alternatively be a route in an update scenario. In this way, the second network device can continuously receive the latest route notified by the first network device, and notify the virtual machine under the first network device and having the same MAC address. The routes include aggregated attribute information of the virtual machines, reducing the number of routes stored locally in the second network device.

[0013] For example, the first virtual local area network information may include a virtual private network tag. For example, if the first network device is located in an EVPN-based VXLAN, the virtual private network tag may include a VNI. Alternatively, if the first network device is located in a Segment Routing (SR) network or an Internet Protocol Version 6 segment routing (SRv6) network, the virtual private network tag may include a segment identifier (SID). Alternatively, if the first network device is located in a Multi-protocol Label Switching (MPLS) network, the virtual private network tag may include an MPLS label.

[0014] For example, the first virtual local area network information may further include any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

[0015] The first route may be a route for advertising a MAC address. For example, the first route may be a MAC / IP Advertisement route, and the MAC / IP Advertisement route may be carried in a BGP Update packet. In the above case, the route information including the MAC address, the first virtual local area network information, and the second virtual local area network information may be present in some fields in the MAC / IP Advertisement route. Alternatively, some information of the route information may be directly present in some fields in the BGP Update packet, and other information may be present in the MAC / IP Advertisement route. In another case, the route information may alternatively be present in another type of route. The route and one or more other advertised routes may be carried in a packet and transmitted together, or the routes may be transmitted separately.

[0016] In a possible implementation, an attribute value of a MAC Mobility Extended Community (MMEC) attribute included in the first virtual local area network information is a first attribute value. In this case, the first network device receives a fourth route, the fourth route including a MAC address and third virtual local area network information of the first virtual machine, and an attribute value of a MAC Mobility Extended Community attribute included in the third virtual local area network information is a second attribute value. If the first attribute value is less than the second attribute value, the first network device deletes the first virtual local area network information in the second route and stores a fifth route, the fifth route including the MAC address and the third virtual local area network information.

[0017] When the first attribute value is smaller than the second attribute value, it indicates that the third virtual local area network information is updated virtual local area network information of the first virtual machine compared with the first virtual local area network information and sent by another network device. In this case, it indicates that the first virtual machine migrates from the first network device to another network device. Therefore, the first network device can update the locally stored route table entry corresponding to the first virtual machine, specifically, the first network device can delete the first virtual local area network information stored in the second route. The first network device further generates a fifth route (e.g., a BGP route) based on the received fourth route, and stores the fifth route, where the fifth route includes the third virtual local area network information sent by the second network device. Therefore, by using the MMEC attribute, the first network device can timely detect the migration of the local virtual machine to improve the accuracy of the locally maintained route information and improve the robustness of the network operation.

[0018] According to a second aspect, there is provided a MAC address transmission device having a function of implementing the behavior in the MAC address transmission method according to the first aspect. The MAC address transmission device includes at least one module, and the at least one module is configured to implement the MAC address transmission method according to the first aspect.

[0019] According to a third aspect, a MAC address transmission device is provided. The structure of the MAC address transmission device includes a processor and a transceiver. The processor is configured to execute a program stored in the memory to perform the MAC address transmission method according to the first aspect. The transceiver is configured to transmit and receive various types of data in the first aspect. Optionally, the device may further include a memory configured to store a program supporting the MAC address transmission device in performing the MAC address transmission method according to the first aspect. The MAC address transmission device may further include a communication bus, the communication bus configured to establish a connection between the processor and the transceiver.

[0020] According to a fourth aspect, there is provided a computer readable storage medium storing instructions which, when executed on a computer, enable the computer to perform the MAC address transmission method according to the first aspect.

[0021] According to a fifth aspect there is provided a computer program product comprising instructions which, when run on a computer, enable the computer to perform the MAC address transmission method according to the first aspect.

[0022] According to a sixth aspect, a MAC address receiving method is provided, which is applied to a network system, the network system includes a first network device and a second network device, the first network device is connected to a plurality of virtual machines, the plurality of virtual machines includes a first virtual machine and a second virtual machine.

[0023] The method is performed by a second network device. Specifically, the second network device receives a first route transmitted by the first network device, the first route includes first route information, the first route information includes a MAC address, a first virtual local area network information, and a second virtual local area network information, the MAC address is a MAC address of both a first virtual machine and a second virtual machine connected to the first network device, the first virtual local area network information is information about the first virtual machine, and the second virtual local area network information is information about the second virtual machine. The second network device stores the first route information.

[0024] When possible, there are multiple virtual machines whose MAC addresses are the same as the MAC address of the first virtual machine, and the multiple virtual machines are located in virtual local area networks different from the virtual local area network in which the first virtual machine is located, and the virtual local area networks are also different from each other. The second virtual machine is one of the multiple virtual machines. In the aforementioned case, the route information in the first route includes a MAC address, first virtual local area network information of the first virtual machine, and multiple virtual local area network information of the multiple virtual machines, and the multiple virtual machines correspond one-to-one to the multiple virtual local area network information.

[0025] In the embodiment of the present application, for multiple virtual machines located in different virtual local area networks with the same MAC address, one route can be used to inform the MAC addresses and virtual local area network information of each of the multiple virtual machines, that is, the same MAC addresses in different virtual local area networks can be aggregated into one route. In this way, the number of routes in the network can be reduced, and the route transmission performance and route convergence performance can be improved.

[0026] In a possible implementation, when storing the first route information, the second network device stores the first route information in a second route. In this way, for multiple virtual machines located in different virtual local area networks with the same MAC address, only one route needs to be stored to record the MAC addresses of the multiple virtual machines and the virtual local area network information of the multiple virtual machines. That is, for multiple virtual machines located in different virtual local area networks with the same MAC address, multiple route table entries corresponding to the multiple virtual machines can be recorded in one route to reduce the number of routes that need to be stored locally.

[0027] In a possible implementation, before receiving the first route, the second network device receives a third route sent by the first network device, the third route includes second route information, the second route information includes a MAC address and a second virtual local area network information, but does not include the first virtual local area network information. The second network device stores the second route information in the second route. That is, the second route stored locally by the second network device includes the virtual local area network information of the second virtual machine. In this case, the third route sent by the first network device and received by the second network device does not include information about the first virtual machine, which has the same MAC address as the MAC address of the second virtual machine, because the first virtual machine may not be online under the first network device, etc. Thus, the second route stored locally by the second network device does not include information about the first virtual machine either. After the second network device receives the third route, the second network device may receive the first route including the attribute information of the first virtual machine, and when storing the first route information included in the first route in the second route, the second network device may update the second route information in the second route as the first route information. The update may be, for example, updating the complete second route information as the first route information, or may be partially updating data content in the second route information that is different from the first route information.

[0028] In the above case, the third path includes information about the second virtual machine, and the first path includes information about the first virtual machine and information about the second virtual machine, which is used as an example. In a practical application scenario, the third path may further include information about one or more other virtual machines that have the same MAC address as the MAC address of the second virtual machine, and the third path may include a virtual machine that has the same MAC address as the MAC address of the first virtual machine, for example, the second virtual machine and / or one or more other virtual machines, or may not include information about another virtual machine. That is, when the first network device sends the first path, the first path information included in the first path is information about a virtual machine that is actually mounted on the first network device and has the same MAC address as the MAC address that the first virtual machine is confirmed to have when the first virtual machine goes online.

[0029] For example, the first virtual local area network information may include a virtual private network tag. For example, if the first network device is located in an EVPN-based VXLAN, the virtual private network tag may include a VNI. Alternatively, if the first network device is located in an SR network or an SRv6 network, the virtual private network tag may include a SID. Alternatively, if the first network device is located in an MPLS network, the virtual private network tag may include an MPLS label.

[0030] For example, the first virtual local area network information may further include any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

[0031] The first route may be a route for advertising a MAC address. For example, the first route may be a MAC / IP Advertisement route, and the MAC / IP Advertisement route may be carried in a BGP Update packet. In the above case, the route information including the MAC address, the first virtual local area network information, and the second virtual local area network information may be present in some fields in the MAC / IP Advertisement route. Alternatively, some information of the route information may be directly present in some fields in the BGP Update packet, and other information may be present in the MAC / IP Advertisement route. In another case, the route information may alternatively be present in another type of route. The route and one or more other routes may be carried in a packet and transmitted together, or the routes may be transmitted separately.

[0032] In a possible implementation, an attribute value of a MAC mobility extended community attribute belonging to the first virtual machine and included in the first route information is a first attribute value. In this case, the second network device generates a fourth route (such as a MAC / IP Advertisement route) based on a connection between the first virtual machine and the second network device, and transmits the fourth route to the first network device. The fourth route includes a MAC address of the first virtual machine and third virtual local area network information. An attribute value of a MAC mobility extended community attribute belonging to the first virtual machine and included in the third virtual local area network information is a second attribute value, the second attribute value being greater than the first attribute value. The second network device can further locally store a sixth route, the sixth route including a MAC address of the first virtual machine and third virtual local area network information. The sixth route and the second route are two independently stored routes, the second route being a route stored based on a MAC / IP Advertisement route received from the first network device, and the sixth route being a route generated or obtained by the second network device based on a virtual machine detected under the second network device.

[0033] When the first virtual machine is connected to the second network device, it indicates that the first virtual machine migrates from the first network device to the second network device. Therefore, the second network device can update the attribute value of the locally stored MMEC attribute of the first virtual machine, specifically, can increase the attribute value of the MMEC attribute of the first virtual machine, in other words, the second attribute value is greater than the first attribute value. After the attribute value of the MMEC attribute of the first virtual machine is increased, the MAC address and virtual local area network information of the first virtual machine can be notified again, i.e., the fourth route can be sent to the first network device. In some cases, in addition to the updated virtual local area network information of the first virtual machine, the fourth route can further include information about another virtual machine stored by the second network device and having the same MAC address as the MAC address of the first virtual machine. In another case, for example, when another virtual machine migrates from the first network device to the second network device at the same time, or when another virtual machine newly comes online under the second network device, the fourth route may alternatively carry only the updated virtual local area network information of the first virtual machine, or alternatively carry the updated virtual local area network information of the first virtual machine and other updated virtual local area network information having the same MAC address as the MAC address of the first virtual machine. In another case, the first network device receiving the fourth route may update route table entries in locally stored routes having the same MAC address based on the updated information carried in the received route, to improve route transmission efficiency and reduce the number of routes locally stored by the route receiver.

[0034] In a possible implementation, after the second network device receives the first route, the second network device can further transmit the first route to a third network device. The second network device may be, for example, a route reflector. Since the first network device reduces the number of routes that need to be transmitted, the second network device also reduces the number of routes that need to be re-advertised, thereby improving the overall transmission efficiency of the network.

[0035] According to a seventh aspect, there is provided a MAC address transmission device having a function of implementing the behavior in the MAC address transmission method according to the sixth aspect. The MAC address transmission device includes at least one module, and the at least one module is configured to implement the MAC address transmission method according to the sixth aspect.

[0036] According to an eighth aspect, a MAC address transmission device is provided. The structure of the MAC address transmission device includes a processor and a transceiver. The processor is configured to execute a program stored in a memory to perform the MAC address transmission method according to the sixth aspect. The transceiver is configured to transmit and receive various types of data in the sixth aspect. Optionally, the device may further include a memory configured to store a program supporting the MAC address transmission device in performing the MAC address transmission method according to the sixth aspect. The MAC address transmission device may further include a communication bus, the communication bus configured to establish a connection between the processor and the transceiver.

[0037] According to a ninth aspect, there is provided a computer readable storage medium storing instructions which, when executed on a computer, enable the computer to perform the MAC address transmission method according to the sixth aspect.

[0038] According to a tenth aspect there is provided a computer program product comprising instructions which, when run on a computer, enable the computer to perform the MAC address transmission method according to the sixth aspect.

[0039] According to an eleventh aspect, a MAC address transmitting and receiving system is provided, the system includes a first network device and a second network device, the first network device is connected to a plurality of virtual machines, the plurality of virtual machines includes a first virtual machine and a second virtual machine.

[0040] The first network device Get the MAC address of the first virtual machine, obtain a first route when the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, the first route including first route information, the first route information including the MAC address, the first virtual machine's first virtual local area network information, and the second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's first ... The first route is configured to be transmitted to a second network device.

[0041] The second network device receives the first route transmitted by the first network device; The first route information is configured to be stored in the first route.

[0042] In a possible implementation, the first network device is further configured to store a second route, the second route including the first route information.

[0043] In a possible implementation, the second network device is configured to store the first route information in a sixth route.

[0044] In a possible implementation, the first network device is further configured to send a third route to the second network device, the third route including second route information, the second route information including the MAC address and the second virtual local area network information but not including the first virtual local area network information. In this manner, the first network device is configured to update the third route to obtain the first route.

[0045] The second network device receives the third route sent by the first network device and adds the second route information to the sixth route. In this way, the second network device is configured to update the second route information of the sixth route as the first route information.

[0046] When possible, the first virtual local area network information includes a virtual private network tag. For example, if the first network device is located in an EVPN-based VXLAN, the virtual private network tag includes a VNI. Alternatively, if the first network device is located in an SR network or an SRv6 network, the virtual private network tag includes a SID. Alternatively, if the first network device is located in an MPLS network, the virtual private network tag includes an MPLS label.

[0047] Where possible, the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

[0048] When possible, the first route is the MAC / IP Advertisement route.

[0049] In a possible implementation, an attribute value of a MAC mobility extended community attribute included in the first virtual local area network information is a first attribute value.

[0050] The second network device is further configured to generate a fourth route based on the connection between the first virtual machine and the second network device, the fourth route including a MAC address of the first virtual machine and third virtual local area network information, where an attribute value of a MAC mobility extended community attribute for the first virtual machine and included in the third virtual local area network information is a second attribute value, the second attribute value being greater than the first attribute value, and to send the fourth route to the first network device.

[0051] The first network device is further configured to receive the fourth route and, if the first attribute value is less than the second attribute value, delete the first virtual local area network information in the second route and store a fifth route including the MAC address and the third virtual local area network information.

[0052] In a possible implementation, the second network device is further configured to transmit the first route to a third network device.

[0053] The technical effects achieved in the second, third, fourth and fifth aspects are similar to those achieved by the corresponding technical means in the first aspect, and the details will not be repeated here.

[0054] The technical effects achieved in the seventh, eighth, ninth and tenth aspects are similar to those achieved by the corresponding technical means in the sixth aspect, and the details are not repeated here.

[0055] The technical effects obtained in the eleventh aspect are similar to those achieved by the corresponding technical means in the first and sixth aspects, and the details are not repeated here. [Brief description of the drawings]

[0056] [Figure 1] 1 is a schematic diagram of a network system according to an embodiment of the present application. [Diagram 2] 1 is a flowchart of a MAC address transmission method according to an embodiment of the present application. [Diagram 3] FIG. 2 is a schematic diagram of another network system according to an embodiment of the present application. [Figure 4] FIG. 2 is a schematic diagram of the structure of a network device according to an embodiment of the present application. [Diagram 5] 1 is a schematic diagram of the structure of a MAC address sending device according to an embodiment of the present application; [Figure 6] FIG. 1 is a schematic diagram of the structure of another MAC address sending device according to an embodiment of the present application; [Figure 7] 1 is a schematic diagram of a MAC address transmitting and receiving system according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0057] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following further describes the implementation of the present application in detail with reference to the accompanying drawings.

[0058] Before the embodiments of the present application are described in detail, application scenarios in the embodiments of the present application are first described.

[0059] Figure 1 is a schematic diagram of a network system according to an embodiment of the present application. Please refer to Figure 1. A network system, for example, an EVPN-based VXLAN network, an SR network, an SRv6 network, or an MPLS network, typically includes a number of network devices (for example, network device 1 and network device 2 shown in Figure 1) for communicating with each other to perform data forwarding functions. A host (for example, host 1, host 2, host 3, host 4 shown in Figure 1) may be connected to a network device in the network system to access the network system.

[0060] Each network device may be connected to multiple hosts (which may be referred to as local hosts for the network device), and multiple virtual machines (which may be referred to as local virtual machines for the network device) may be created on each of the multiple hosts. That is, each network device may be connected to multiple virtual machines. The multiple virtual machines connected to a network device may belong to the same VLAN or different VLANs. Each network device may obtain the MAC address of the virtual machine connected to the network device and transmit the MAC address to another network device.

[0061] Typically, in a VXLAN, whenever a network device obtains a MAC address of a virtual machine connected to the network device, the network device generates a MAC / IP Advertisement route to advertise the MAC address of the virtual machine. The MAC / IP Advertisement route includes the MAC address of the virtual machine and the VNI of the virtual machine. The network device then sends the MAC / IP Advertisement route to another network device so that the other network device knows the MAC address of the virtual machine.

[0062] However, as virtual machine technology develops, a large number of virtual machines may be created on one host, and different virtual machines may belong to different virtual local area networks and have the same MAC address. In the aforementioned MAC address notification method, one MAC / IP Advertisement route needs to be generated for each virtual machine. As a result, the number of routes in the network increases continuously, which affects the network performance.

[0063] Therefore, one embodiment of the present application provides a MAC address transmission method, such that the same MAC addresses in different virtual local area networks can be aggregated into one route, thereby reducing the number of routes transmitted within the network to a certain extent, significantly reducing the number of routes maintained locally by network devices, and improving the overall network operation performance.

[0064] Figure 2 is a flowchart of a MAC address sending method according to an embodiment of the present application. The method is applied to the network system shown in Figure 1, where the network system includes a first network device and a second network device, the first network device is connected to a plurality of virtual machines, and the plurality of virtual machines includes a first virtual machine and a second virtual machine. Referring to Figure 2, the method includes the following steps:

[0065] 201: A first network device obtains a MAC address of a first virtual machine.

[0066] The first network device may be a device having a data forwarding function, such as a switch or a router, etc. In different networks, the types of the first network devices may be the same or different.

[0067] For example, in an EVPN-based VXLAN, the first network device may be a VXLAN tunnel end point (VTEP) device, etc. EVPN is a VPN technology for Layer 2 network interconnection.

[0068] In another example, in an EVPN-based VXLAN, SR network, SRv6 network, or MPLS network, the first network device may be a PE device. An SRv6 network uses an Internet Protocol Version 6 (IPv6) data plane and may be incrementally deployed in an IPv6 network.

[0069] The first network device may be connected to multiple hosts (which may be referred to as local hosts of the first network device), and multiple virtual machines (which may be referred to as local virtual machines of the first network device) may be created on each of the multiple hosts. That is, the first network device may be connected to multiple virtual machines. The multiple virtual machines connected to the first network device may belong to the same VLAN or different VLANs.

[0070] Furthermore, the first virtual machine is one of a plurality of virtual machines connected to the first network device, i.e., the first virtual machine is a local virtual machine of the first network device, and the first network device can obtain a MAC address of the local virtual machine.

[0071] Specifically, the first network device can obtain the MAC address of the first virtual machine in multiple ways. In one possible way, in an Internet Protocol Version 4 (IPv4) network, the MAC address of the first virtual machine can be determined by the first network device based on Address Resolution Protocol (ARP) packets received from the first virtual machine, where the ARP packets can include a gratuitous ARP message, an ARP request message, an ARP reply message, etc. In another possible way, in an IPv6 network, the MAC address of the first virtual machine can be determined by the first network device based on Neighbor Discovery Protocol (NDP) packets received from the first virtual machine, where the NDP packets can include a Neighbor Solicitation (NS) message, a Neighbor Advertisement (NA) message, etc.

[0072] For example, in an IPv4 network, after a first virtual machine goes online, the first virtual machine may send a gratuitous ARP message including the MAC address of the first virtual machine to a first network device connected to the first virtual machine to inform the first network device of the address of the first virtual machine. Alternatively, before communicating with another virtual machine, the first virtual machine may send an ARP request message carrying the IP address of another virtual machine to a first network device connected to the first virtual machine to inquire about the MAC address of the other virtual machine based on the IP address of the other virtual machine. In this case, the source address of the ARP request message is the MAC address of the first virtual machine. Alternatively, when receiving an ARP request message carrying the IP address of the first virtual machine and sent by the other virtual machine, the first virtual machine may send an ARP response message carrying the MAC address of the first virtual machine to the other virtual machine. In this case, the source address of the ARP response message is the MAC address of the first virtual machine. Then, after receiving the gratuitous ARP message, ARP request message, or ARP response message sent by the first virtual machine, the first network device can obtain the MAC address of the first virtual machine from the gratuitous ARP message, ARP request message, or ARP response message.

[0073] As another example, in an IPv6 network, after a first virtual machine goes online and before the first virtual machine communicates with another virtual machine, the first virtual machine can send an NS message carrying the IP address of the other virtual machine to a first network device connected to the first virtual machine to inquire about the MAC address of the other virtual machine based on the IP address of the other virtual machine. In this case, the source address of the NS message is the MAC address of the first virtual machine. Alternatively, when receiving an NS message carrying the IP address of the first virtual machine and sent by another virtual machine, the first virtual machine can send an NA message carrying the MAC address of the first virtual machine to the other virtual machine. In this case, the source address of the NA message is the MAC address of the first virtual machine. Then, after receiving the NS message or NA message sent by the first virtual machine, the first network device can obtain the MAC address of the first virtual machine from the NS message or NA message.

[0074] After obtaining the MAC address of the first virtual machine local to the first network device, the first network device can obtain a route for notifying the MAC address by performing step 202 below.

[0075] 202: When the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, the first network device obtains a first route and sends the first route to the second network device, the first route including route information, the route information including the MAC address, the first virtual machine's first virtual local area network information, and the second virtual machine's second virtual local area network information.

[0076] The second network device may be a device having a data forwarding function, such as a switch or a router. In different networks, the type of the second network device may be the same or different. For example, in an EVPN-based VXLAN, the second network device may be a VTEP device, etc. In another example, in an EVPN-based VXLAN, an SR network, an SRv6 network, or an MPLS network, the second network device may be a PE device.

[0077] Moreover, the second virtual machine is a virtual machine other than the first virtual machine among the multiple virtual machines connected to the first network device, and the second virtual machine is also a local virtual machine of the first network device.

[0078] In an embodiment of the present application, there may be one or more virtual machines whose MAC addresses are the same as the MAC address of the first virtual machine, and the one or more virtual machines are located in a virtual local area network different from the virtual local area network in which the first virtual machine is located. The second virtual machine is one of the one or more virtual machines. That is, the route information in the first route includes the MAC address and the first virtual local area network information of the first virtual machine, and may further include one or more virtual local area network information of the one or more virtual machines whose MAC addresses are the same as the MAC address of the first virtual machine.

[0079] In this embodiment of the present application, for multiple virtual machines located in different virtual local area networks with the same MAC address, one route can be used to inform the MAC addresses and virtual local area network information of each of the multiple virtual machines, that is, the same MAC addresses in different virtual local area networks can be aggregated into one route. In this way, the number of routes in the network can be reduced, and the route transmission performance and route convergence performance can be improved.

[0080] The first network device can obtain the first route in several ways. Several possible cases are described below.

[0081] In a first possible case, the first network device obtains the MAC address of the first virtual machine and the MAC address of the second virtual machine within a preset duration, and verifies that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine. In this case, the first network device directly generates a first route, including the MAC address, the first virtual machine's first virtual local area network information, and the second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's first virtual local area network information, and sends the first route to the second network device. In this way, the number of routes that need to be sent can be reduced.

[0082] It should be noted that the preset duration may be appropriately set according to actual requirements, and the preset duration may be set to a small value. For example, the preset duration may be greater than or equal to 0 seconds and less than or equal to 600 seconds. In other words, the first network device obtains both the MAC address of the first virtual machine and the MAC address of the second virtual machine within a short period of time.

[0083] For example, in a scenario where virtual machines are brought online in batches, when a first virtual machine and a second virtual machine are brought online at the same time or with a short time interval, the first network device acquires the MAC address of the first virtual machine and the MAC address of the second virtual machine at the same time. Or, the first network device acquires the MAC address of the first virtual machine first, and then acquires the MAC address of the second virtual machine after a short time interval. Or, the first network device acquires the MAC address of the second virtual machine first, and then acquires the MAC address of the first virtual machine after a short time interval.

[0084] As another example, when the function for aggregating and notifying attribute information of virtual machines having the same MAC address is enabled for the first time, the first network device may have learned information about multiple local virtual machines having the same MAC address before enabling the function, where the information of these virtual machines is stored in multiple routes, respectively. In this case, the first route may be generated and transmitted by enabling the aggregation and notification function.

[0085] In a second possible case, the first network device first obtains the MAC address of the second virtual machine, and then obtains the MAC address of the first virtual machine after a preset duration has elapsed. The "after a preset duration has elapsed" is different from the first case described above. Specifically, after obtaining the MAC address of the second virtual machine, the first network device does not obtain the MAC address of another virtual machine (e.g., the first virtual machine) having the same MAC address within the preset duration specified in the first case, but the first network device can send a third route to the second network device after obtaining the MAC address of the second virtual machine. The third route includes the MAC address and the second virtual local area network information, but does not include the first virtual machine information because the first virtual machine has not yet been confirmed. When the first network device subsequently obtains the MAC address of the first virtual machine, if the first network device confirms that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine, the first network device can send an updated first route. Compared to the third route, the updated first route may carry the MAC address, virtual local area network information of the first virtual machine, and virtual local area network information of the second virtual machine. In another case, the updated first route may alternatively include the MAC address and virtual local area network information of the first virtual machine, but not the virtual local area network information of the second virtual machine. For example, when the first virtual machine comes online, the second virtual machine is offloaded from the first network device or migrated to another network device. The virtual machine information carried in the first route and transmitted by the first network device may be virtual local area network information of one or more virtual machines that are actually mounted on the first network device and have the same MAC address at the time the device transmits the route, and may be the virtual local area network information of the first virtual machine or virtual machines that are actually mounted on the first network device and have the same MAC address at the time the device transmits the route, and may be the virtual local area network information of the first virtual machine or virtual machines that are actually mounted on the first network device and have the same MAC address at the time the device transmits the route. The transmission of this route is triggered by the first virtual machine coming online.

[0086] In addition to the second virtual local area network information of the second virtual machine, the third route may further include virtual local area network information of another virtual machine that has the same MAC address and is confirmed within a preset duration.

[0087] For example, in a scenario where a virtual machine comes online, if multiple virtual machines come online at the same time or in a short time interval, the first network device can obtain the MAC addresses of the multiple virtual machines within a short period of time. Assuming that the MAC addresses of the multiple virtual machines are the same, the first network device can generate a third route including the MAC addresses and virtual local area network information of the multiple virtual machines, and send the third route to the second network device. After a long period of time that exceeds a preset duration, the first virtual machine comes online, and the first network device obtains the MAC address of the first virtual machine. Assuming that the MAC address of the first virtual machine is the same as the MAC addresses of the multiple virtual machines, the first network device can add the first virtual local area network information of the first virtual machine to obtain an updated first route.

[0088] The first network device may locally store a correspondence between the MAC address and virtual local area network information of one or more virtual machines having the MAC address, and the correspondence may be stored in a local route as route information. For example, in response to a first route sent to the second network device, the first network device may locally store a second route, the second route including route information that is the same as the route information of the first route, and the route information including the MAC address, the first virtual local area network information of the first virtual machine, and the second virtual machine information.

[0089] In this embodiment of the present application, for multiple virtual machines located in different virtual local area networks with the same MAC address, only one route needs to be stored to record the MAC addresses of multiple virtual machines and the virtual local area network information of multiple virtual machines. That is, for multiple virtual machines located in different virtual local area networks with the same MAC address, multiple route table entries corresponding to multiple virtual machines can be recorded in one route to reduce the number of routes that need to be stored.

[0090] It should be noted that if the first route is generated directly by the first network device, the first network device does not store the second route before obtaining the first route. In this case, after generating the first route, the first network device can generate and store the second route.

[0091] When the first route is obtained by the first network device by updating the third route, before obtaining the first route, the first network device has already stored a route including the MAC address and the second virtual local area network information of the second virtual machine. In this case, the first network device can update the stored route to obtain the second route. Specifically, the first network device can add the first virtual local area network information to the stored route to obtain the updated second route.

[0092] Virtual Local Area Network information is explained.

[0093] The virtual local area network information may re-inform the relevant information of the virtual local area network in which the virtual machine is located, specifically, the attribute information of one or more virtual local area networks corresponding to the virtual machine. In different networks, the attributes included in the virtual local area network information may be the same or different. The virtual local area network information may be designed according to specific requirements, provided that the virtual local area network information may re-inform the relevant information of the virtual local area network in which the virtual machine is located, and the relevant information of the virtual local area network can be used to distinguish different virtual machines.

[0094] Optionally, the virtual local area network information may include a virtual private network tag (VPN tag) for identifying the VPN in which the virtual machine is located.

[0095] For example, if the first network device is located in an EVPN-based VXLAN, the virtual private network tag may include a VNI, if the first network device is located in an SR network or an SRv6 network, the virtual private network tag may include a SID, or if the first network device is located in an MPLS network, the virtual private network tag may include an MPLS label.

[0096] Optionally, the virtual local area network information may further include any one or more of a Route Target attribute, a virtual local area network tag (VLAN tag), and an MMEC attribute. When the first virtual local area network information of the first virtual machine and the second virtual local area network information of the second virtual machine are included in the first route, for example, both the first virtual local area network information and the second virtual local area network information may include a virtual private network tag, a route target attribute, a VLAN tag, and an MMEC attribute. Or, both the first virtual local area network information and the second virtual local area network information may include a virtual private network tag, a route target attribute, and an MMEC attribute. Or, both the first virtual local area network information and the second virtual local area network information may include a virtual private network tag and a route target attribute.

[0097] Note that the Route Target attribute may be for controlling the advertisement and reception of a route. Specifically, if the virtual local area network information included in a route carries a Route Target attribute, other network devices receiving the route may compare the Route Target attribute set by another network device with the Route Target attribute in the route, and store the route information in the route only if the attribute values ​​of the two Route Target attributes are identical. Otherwise, the other network devices will not store the route information in the route.

[0098] The VLAN tag may also identify the VLAN to which the data frame belongs. Specifically, if the virtual local area network information included in the route carries a VLAN tag, another network device that receives the route may store the route information in the route, and when the other network device subsequently forwards a data frame whose destination address is a MAC address, it may add the VLAN tag to the data frame and forward the data frame within the VLAN identified by the VLAN tag.

[0099] In addition, the MMEC attribute includes a sequence number, and the more times the virtual machine migrates, the larger the sequence number. Specifically, the migration of a virtual machine means that the virtual machine migrates from a network device accessed by the virtual machine to another network device in the network. After detecting that the virtual machine has gone online, the network device to which the virtual machine has newly migrated may resend a route for notifying the MAC address of the virtual machine. The difference between the route and the route previously notified for notifying the MAC address of the virtual machine is that the sequence number (or value) in the MMEC attribute included in the route is increased by one. After another network device receives a route with a sequence number larger than the route currently stored in the other network device, the other network device updates the stored route based on the route.

[0100] When the virtual local area network information includes an MMEC attribute, a first virtual machine migrates from a first network device to a second network device is used as an example. When the attribute value of the MMEC attribute included in the first virtual local area network information stored in the first network device (corresponding to the first virtual machine) is a first attribute value, the first network device receives a fourth route sent by the second network device. The fourth route is generated when the second network device confirms that the first virtual machine goes online, and includes the MAC address and third virtual local area network information of the first virtual machine. The attribute value of the MMEC attribute, which is of the first virtual machine and is included in the third virtual local area network information, is a second attribute value. When the first attribute value is less than the second attribute value, the first network device updates the second route. Specifically, the first network device can delete the first virtual local area network information of the first virtual machine from the second route stored locally. In addition, the first network device generates a fifth route based on the fourth route and stores the fifth route, the fifth route including the MAC address and the third virtual local area network information. The updated second route and the stored fifth route are two different routes, the second route including the virtual local area network information of the virtual machine having the MAC address under the first network device, and the fifth route including the virtual local area network information of the virtual machine having the MAC address under the second network device. The second route and the fifth route may be two different BGP routes.

[0101] If the first attribute value is less than the second attribute value, the third virtual local area network information is compared with the first virtual local area network information to indicate new virtual local area network information of the first virtual machine. In this case, the first virtual machine has migrated from the first network device to the second network device. Thus, the first network device can update the stored route corresponding to the first virtual machine, specifically, delete the first virtual local area network information in the second route, and store the fifth route.

[0102] In the above case, before deleting the first virtual local area network information of the first virtual machine, the first network device may first detect whether the first virtual machine still exists locally. If it is determined that the first virtual machine does not exist locally, the first network device may perform a deletion operation. If not, the first network device may perform an operation such as reporting an error. In addition to deleting the first virtual local area network information, the second route update may temporarily block the first virtual local area network information by setting.

[0103] In the above case, the third virtual local area network information must include at least a virtual private network tag and an MMEC attribute, and may further include a Route Target attribute and / or a VLAN tag.

[0104] The first route may be a route for advertising a MAC address. For example, the first route may be a MAC / IP Advertisement route. The MAC / IP Advertisement route may be carried in a BGP Update packet. In this case, route information including the MAC address, the first virtual local area network information, and the second virtual local area network information may be present in some fields in the MAC / IP Advertisement route. Alternatively, some of the route information may be directly present in some fields in the BGP Update packet, and other information may be present in the MAC / IP Advertisement route. In another case, the route information may alternatively be present in another type of route. The route and one or more other routes may be carried in a packet and transmitted together, or the routes may be transmitted separately.

[0105] In a first possible method, the MAC / IP Advertisement route may include an EVPN network layer reachability information (NLRI) attribute, and the route information may be present in the EVPN NLRI attribute. For example, the fields included in the EVPN NLRI attribute may be shown in Table 1 below.

[0106] [Table 1]

[0107] The route discriminator field is for discriminating the MAC / IP Advertisement routes of different VXLANs to avoid MAC / IP Advertisement route conflicts. The Ethernet segment identifier field is for uniquely identifying a link between a virtual machine and a network device. The Ethernet tag identification document field is for identifying a VLAN ID actually configured for a network device. The MAC address length field is for indicating the length of the MAC address field, and the MAC address can be determined by referring to the MAC address length field and the MAC address field. The IP address length field is for indicating the length of the IP address field. In an embodiment of the present application, the values ​​of both the IP address length field and the IP address field can be 0.

[0108] It can be seen from Table 1 that the EVPN NLRI attribute of the MAC / IP Advertisement path may include one MAC address and multiple virtual local area network information (i.e., virtual private network tag, Route Target attribute, VLAN tag, and MMEC attribute), which is the virtual local area network information of multiple virtual machines to which the MAC address belongs. In this way, one MAC / IP Advertisement path carries the virtual local area network information and MAC addresses of multiple virtual machines that are located in different virtual local area networks and have the same MAC address.

[0109] It should be noted that in the embodiment of the present application, Table 1 is only used as an example to describe the EVPN NLRI attributes, and Table 1 does not constitute an inherent limitation to the embodiment of the present application. For example, a MAC / IP Advertisement route can actually carry any number of pieces of virtual local area network information, and the attribute fields included in each piece of virtual local area network information can alternatively be determined according to requirements.

[0110] In a second possible method, the Route Target attribute in the route information may be present in an extended communities attribute in the BGP Update packet, and information other than the Route Target attribute in the route information may be present in an EVPN NLRI attribute. For example, the fields included in the BGP Update packet may be as shown in Table 2 below.

[0111] [Table 2]

[0112] As can be seen from Table 2, a BGP Update packet may contain one MAC address and multiple virtual local area network information (i.e., virtual private network tag, Route Target attribute, VLAN tag, and MMEC attribute), which is the virtual local area network information of multiple virtual machines to which the MAC address belongs. In this way, one BGP Update packet carries the virtual local area network information and the MAC addresses of multiple virtual machines that are located in different virtual local area networks and have the same MAC address.

[0113] It should be noted that in the embodiment of the present application, Table 2 is only used as an example to describe a BGP Update packet, and Table 2 does not constitute an inherent limitation to the embodiment of the present application.

[0114] 203: The second network device receives the first route sent by the first network device.

[0115] The first route includes the aforementioned route information, referred to herein as first route information. In other words, the first route information includes a MAC address, a first virtual local area network information, and a second virtual local area network information. The MAC address is a MAC address of both a first virtual machine and a second virtual machine connected to the first network device, the first virtual local area network information is information about the first virtual machine, and the second virtual local area network information is information about the second virtual machine.

[0116] In addition, after receiving the first route sent by the first network device, the second network device can further perform route re-advertising, specifically, can send the first route to the third network device, so that the third network device can perform virtual machine route learning based on the first route. In the embodiment of the present application, since the number of routes that need to be sent by the first network device is reduced, the number of routes that need to be re-advertised by the second network device is correspondingly reduced, thereby further reducing the number of routes in the network.

[0117] 204: The second network device stores the first route information.

[0118] It should be noted that after the first network device sends the first route, the second network device receiving the first route can perform virtual machine route learning based on the first route, in other words, can store the first route information in the first route.

[0119] Specifically, the second network device can store first route information in a local route, the local route including a MAC address advertised by the first network device using the first route, first virtual local area network information of a first virtual machine having the MAC address, and second virtual local area network information of a second virtual machine having the MAC address.

[0120] If possible, if the second network device does not have a route stored that includes the MAC address when it receives the first route, the second network device can generate and store a local route that includes the first route information when it receives the first route.

[0121] In another possible case, before receiving the first route, the second network device has received a third route sent by the first network device, and the third route includes second route information, and the second route information includes the MAC address and the second virtual local area network information, but does not include the first virtual local area network information. In this case, the second network device adds the second route information to the second route. Then, when receiving the first route, if the second network device confirms that the local route including the MAC address and notified by the first network device is stored locally, the second network device can update the local route based on the received first route. In this case, the second network device updates the second route information of the local route as the first route information. Specifically, for example, the second route information may be completely replaced by the first route information. Alternatively, a different portion of the second route information may be updated in part by comparing the first route information with the second route information, e.g., to perform the update, the first virtual local area network information is added to the local route.

[0122] In this way, for multiple virtual machines located in different virtual local area networks with the same MAC address, the same network device only needs to store one route to record the MAC addresses of the multiple virtual machines and the virtual local area network information of the multiple virtual machines, thereby reducing the number of routes that need to be stored.

[0123] If an attribute value of an MMEC attribute belonging to the first virtual machine and included in the first route information is a first attribute value, the second network device may generate a fourth route based on a connection between the first virtual machine and the second network device and send the fourth route to the first network device, the fourth route including a MAC address of the first virtual machine and third virtual local area network information. An attribute value of an MMEC attribute belonging to the first virtual machine and included in the third virtual local area network information is a second attribute value, the second attribute value is determined based on the first attribute value, and the second attribute value is greater than the first attribute value, which may indicate that the first virtual machine performs migration.

[0124] It should be noted that when the first virtual machine is connected to the second network device, it indicates that the first virtual machine migrates from the first network device to the second network device. Therefore, the second network device can update the attribute value of the MMEC attribute corresponding to the first virtual machine, specifically, can increase the attribute value of the MMEC attribute of the first virtual machine, in other words, the second attribute value is greater than the first attribute value. After increasing the attribute value of the MMEC attribute of the first virtual machine, the second network device can notify the third virtual local area network information including the MAC address and the second attribute value of the first virtual machine, and the third virtual local area network information can be carried on a fourth route sent by the second network device to the first network device.

[0125] The second network device may further locally store a sixth route including the third virtual local area network information. In some cases, before the first virtual machine comes online under the second network device, the second network device has already confirmed that one or more other virtual machines having the same MAC address as the first virtual machine's MAC address will come online, and stores the virtual local area network information of the one or more other virtual machines in the sixth route. In this case, when the second network device confirms that the first virtual machine has come online, it may update the sixth route by adding the third virtual local area network information. In another case, before the first virtual machine comes online under the second network device, another virtual machine having the first virtual machine's MAC address is not loaded on the second network device. In this case, when the first virtual machine comes online, the second network device locally generates and stores the sixth route. In yet another case, when the third virtual local area network information is added to the sixth path, the virtual local area network information of one or more other virtual machines may be deleted, and the one or more other virtual machines may be, for example, virtual machines that are offloaded within a preset duration after the first virtual machine comes online.

[0126] In an embodiment of the present application, the first network device obtains a MAC address of the first virtual machine. Then, the first network device obtains a first route when the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, and the first route includes route information, where the route information includes the MAC address, the first virtual machine's first virtual local area network information, and the second virtual machine's ...

[0127] For ease of understanding, the following will use an example to describe the aforementioned MAC address transmission method with reference to the network system and application scenarios at different stages shown in FIG.

[0128] Scenario 1: Virtual machine comes online Virtual Machine 1 and Virtual Machine 2 are simultaneously online under Network Device 1. Upon obtaining the MAC address of Virtual Machine 1 and the MAC address of Virtual Machine 2, Network Device 1 determines that the MAC address of Virtual Machine 1 is the same as the MAC address of Virtual Machine 2, and the virtual local area network in which Virtual Machine 1 is located is different from the virtual local area network in which Virtual Machine 2 is located. Thus, Network Device 1 generates a route to notify the MAC address, where the route includes route information, where the route information includes the MAC address, the virtual local area network information of Virtual Machine 1, and the virtual local area network information of Virtual Machine 2. Network Device 1 sends the route to Network Device 2 and stores the local route including the route information.

[0129] After receiving the route sent by network device 1, network device 2 may perform operations such as route re-advertising to send the route to another network device. In addition, network device 2 may store a local route including route information in the route, where the local route corresponds to network device 1.

[0130] Scenario 2: Adding Virtual Machines After network device 1 sends the route to network device 2, virtual machine 5 comes online under network device 1. When network device 1 obtains the MAC address of virtual machine 5, it verifies that the MAC address of virtual machine 5 is the same as both the MAC address of virtual machine 1 and the MAC address of virtual machine 2, then network device 1 updates the route, and the route information in the updated route includes the MAC address, virtual local area network information of virtual machine 1, virtual local area network information of virtual machine 2, and virtual local area network information of virtual machine 5. Network device 1 sends the updated route to network device 2, and adds the virtual local area network information of virtual machine 5 to the previously stored local route.

[0131] After receiving the updated route sent by network device 1, network device 2 may perform route re-advertising, specifically, send the updated route to another network device, and network device 2 may also add virtual local area network information of virtual machine 5 to the pre-stored local route.

[0132] Scenario 3: Virtual Machine Migration Virtual machine 1 migrates from network device 1 to network device 2. After virtual machine 1 goes offline under network device 1 and goes online again under network device 2, network device 2 acquires the MAC address of virtual machine 1 and the virtual local area network information of virtual machine 1. Network device 2 confirms that the previously stored local route includes the MAC address and the virtual local area network information of virtual machine 1 advertised by the first network device. In this case, network device 2 deletes the virtual local area network information of virtual machine 1 stored in the local route and increases the attribute value of the MMEC attribute in the acquired virtual local area network information of virtual machine 1. Then, network device 2 generates a new local route including the MAC address and the virtual local area network information of virtual machine 1, and the newly generated local route corresponds to network device 2. In addition, network device 2 generates a route for advertising the MAC address and sends the route to network device 1, and the route includes the MAC address and the virtual local area network information of virtual machine 1.

[0133] After receiving the route sent by network device 2, network device 1 verifies that the MAC address notified by the route is the same as the MAC address included in the local route, and if it determines that the attribute value of the MMEC attribute included in the route that belongs to virtual machine 1 is greater than the attribute value of the MMEC attribute included in the local route that belongs to virtual machine 1 (if the route corresponds to network device 1), network device 1 removes the virtual local area network information of virtual machine 1 from the local route and generates a local route (if the route corresponds to network device 2) that includes the MAC address and virtual local area network information of virtual machine 1 in the route.

[0134] Figure 4 is a schematic diagram of a structure of a network device according to an embodiment of the present application. The network device may be the network device shown in Figure 1, the first network device in the embodiment of Figure 2, the second network device in the embodiment of Figure 2, or the network device 1 or the network device 2 shown in Figure 3. Please refer to Figure 4. The network device may include at least one processor 401 and at least one communication interface 404. The network device may further include a communication bus 402 and a memory 403.

[0135] The processor 401 may be a microprocessor (having a central processing unit (CPU) or the like), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to control program execution of the solutions of the present application.

[0136] The communication interface 404 may use any device, such as a transceiver, to communicate with another device or a communication network, such as Ethernet, a radio access network (RAN), or a wireless local area network (WLAN).

[0137] The memory 403 may be, but is not limited to, a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disk (including a compact disc read-only memory (CD-ROM), a compact disk, a laser disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium, another magnetic storage device, or any other medium that can be used to carry or store expected program code in the form of instructions or data structures and that can be accessed by a computer. The memory 403 may exist independently or be connected to the processor 401 via the communication bus 402. Alternatively, the memory 403 may be integral to the processor 401.

[0138] The communication bus 402 may include a path for transmitting information between the aforementioned components.

[0139] During specific implementation, in one embodiment, the processor 401 may include one or more CPUs, for example, CPU 0 and CPU 1 shown in FIG.

[0140] During a specific implementation, in one embodiment, the network device may include multiple processors, such as processor 401 and processor 405 shown in FIG. 4. Each of these processors may be a single-core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and / or processing cores configured to process data (e.g., computer program instructions).

[0141] During specific implementation, in one embodiment, the network device may further include an output device 406 and an input device 407. The output device 406 may communicate with the processor 401 and display information in multiple ways. For example, the output device 406 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, etc. The input device 407 may communicate with the processor 401 and receive user input in multiple ways. For example, the input device 407 may be a mouse, a keyboard, a touch screen device, or a sensing device, etc.

[0142] The network device may be, for example, a router, a PE device, a network server, a switch, or a desktop computer, or may be another type of communication device or embedded device. The type of the network device is not particularly limited in the embodiments of the present application.

[0143] When the network device includes the memory 403, the memory 403 is configured to store a program code 410 for performing the solution of the present application, and the processor 401 is configured to execute the program code 410 stored in the memory 403. The network device may perform the operations performed by the first network device or the second network device in the MAC address transmission method provided in the embodiment of FIG. 2 by using the processor 401 and the program code 410 in the memory 403. In another embodiment, the memory may alternatively exist independently from the network device. When the network device operates, the program code stored in the memory may be called to perform the operations performed by the first network device or the second network device in the MAC address transmission method shown in FIG. 2.

[0144] 5 is a schematic diagram of the structure of a MAC address sending device according to an embodiment of the present application. The device may be implemented as a part or whole of a network device by using software, hardware, or a combination thereof. The network device may be the network device shown in FIG. 4. Please refer to FIG. 5. The device may be located in the first network device shown in FIG. 2 or the network device 1 shown in FIG. 3, where the first network device is connected to multiple virtual machines, and the multiple virtual machines include a first virtual machine and a second virtual machine. The device includes a first acquisition module 501, a second acquisition module 502, and a sending module 503.

[0145] The first obtaining module 501 is configured to obtain a MAC address of a first virtual machine.

[0146] The second acquisition module 502 is configured to acquire a first route when the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, where the first route includes route information, where the route information includes the MAC address, the first virtual machine's ...

[0147] The sending module 503 is configured to send the first route to a second network device.

[0148] Optionally, the apparatus further includes a first storage module.

[0149] The first storage module is configured to store a second path, the second path including path information.

[0150] Optionally, the sending module 503 is: Further configured to send a third route to the second network device, the third route including the MAC address and the second virtual local area network information but not including the first virtual local area network information.

[0151] The second acquisition module 502 Update the third path to obtain the first path.

[0152] Optionally, the first virtual local area network information includes a virtual private network tag.

[0153] Optionally, if the first network device is in an EVPN-based VXLAN, the virtual private network tag includes a VNI.

[0154] Alternatively, if the first network device is located in an SR network or an SRv6 network, the virtual private network tag includes a SID.

[0155] Alternatively, if the first network device is located in an MPLS network, the virtual private network tag comprises an MPLS label.

[0156] Optionally, the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

[0157] Optionally, an attribute value of a MAC mobility extended community attribute included in the first virtual local area network information is the first attribute value. The apparatus further includes a receiving module, an updating module, and a second storing module.

[0158] The receiving module is configured to receive a fourth route, the fourth route including a MAC address of the first virtual machine and third virtual local area network information, the fourth route being for the first virtual machine, and an attribute value of a MAC mobility extended community attribute included in the third virtual local area network information is the second attribute value.

[0159] The update module is configured to delete the first virtual local area network information in the second path if the first attribute value is less than the second attribute value.

[0160] The second storage module is further configured to store a fifth path, the fifth path including the MAC address and the third virtual local area network information.

[0161] Optionally, the first route is a MAC / IP Advertisement route.

[0162] In an embodiment of the present application, the first network device obtains the MAC address of the first virtual machine. Then, the first network device obtains a first route when the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, and the first route includes route information, where the route information includes the MAC address, the first virtual local area network information of the first virtual machine, and the second virtual machine's ...

[0163] FIG. 6 is a schematic diagram of the structure of a MAC address sending device according to an embodiment of the present application. The device may be implemented as a part or whole of a network device by using software, hardware, or a combination thereof. The network device may be the network device shown in FIG. 4. Please refer to FIG. 6. The device may be located in the second network device shown in FIG. 2, or the network device 2 shown in FIG. 3. Both the second network device and the first network device are located in a network system, and the first network device is connected to multiple virtual machines, and the multiple virtual machines include a first virtual machine and a second virtual machine. The device includes a receiving module 601 and a storage module 602.

[0164] The receiving module 601 is configured to receive a first route transmitted by a first network device, the first route including first route information, the first route information including a MAC address, a first virtual local area network information, and a second virtual local area network information, the MAC address is a MAC address of both a first virtual machine and a second virtual machine connected to the first network device, the first virtual local area network information is information about the first virtual machine, and the second virtual local area network information is information about the second virtual machine.

[0165] The storage module 602 is configured to store the first route information.

[0166] Optionally, the storage module 602: The first route information is configured to be stored in a second route.

[0167] Optionally, the apparatus further comprises an additional module.

[0168] The receiving module 601 is further configured to receive a third route sent by the first network device before receiving the first route, the third route including second route information, the second route information including the MAC address and the second virtual local area network information but not including the first virtual local area network information. The adding module is configured to add the second route information to the second route.

[0169] The storage module 602 includes: The network device is further configured to update, for the second network device, the second route information in the second route as the first route information.

[0170] Optionally, the first virtual local area network information includes a virtual private network tag.

[0171] Optionally, if the first network device is in an EVPN-based VXLAN, the virtual private network tag includes a VNI.

[0172] Alternatively, if the first network device is located in an SR network or an SRv6 network, the virtual private network tag includes a SID.

[0173] Alternatively, if the first network device is located in an MPLS network, the virtual private network tag comprises an MPLS label.

[0174] Optionally, the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

[0175] Optionally, an attribute value of a MAC mobility extended community attribute, which belongs to the first virtual machine and is included in the first route information, is a first attribute value. The apparatus further includes a sending module.

[0176] The transmitting module is configured to transmit a fourth route to the first network device based on a connection between the first virtual machine and the second network device, the fourth route including a MAC address of the first virtual machine and third virtual local area network information, the fourth route being for the first virtual machine, an attribute value of an MMEC attribute included in the third virtual local area network information is a second attribute value, and the second attribute value is greater than the first attribute value.

[0177] Optionally, the apparatus further includes a transmitting module.

[0178] The transmitting module is configured to transmit the first route to a third network device.

[0179] Optionally, the first route is a MAC / IP Advertisement route.

[0180] In an embodiment of the present application, the second network device receives a first route sent by the first network device, the first route includes first route information, the first route information includes a MAC address, a first virtual local area network information, and a second virtual local area network information, the MAC address is a MAC address of both a first virtual machine and a second virtual machine connected to the first network device, the first virtual local area network information is information about the first virtual machine, and the second virtual local area network information is information about the second virtual machine. Then, the second network device stores the first route information. In this way, for multiple virtual machines located in different virtual local area networks with the same MAC address, one route can be used to notify the MAC address and the virtual local area network information of each of the multiple virtual machines, that is, the same MAC addresses located in different virtual local area networks can be aggregated into one route, so that the number of routes in the network can be reduced, and the route transmission performance and route convergence performance can be improved.

[0181] It should be noted that when the MAC address transmitting device provided in the above embodiment transmits a MAC address, the division of the above functional modules is used as an example only for explanation. In practical application, the above functions may be assigned to different functional modules for implementation according to requirements, that is, the internal structure of the device is divided into different functional modules to implement all or part of the above functions. In addition, the embodiments of the MAC address transmitting device and the MAC address transmitting method provided in the above embodiment share the same concept. For the specific implementation process thereof, please refer to the embodiment of the method, and the details will not be repeated here.

[0182] Figure 7 is a schematic diagram of a MAC address transmitting and receiving system according to an embodiment of the present application. Please refer to Figure 7. The system includes a first network device 701 and a second network device 702. The first network device 701 is connected to multiple virtual machines, and the multiple virtual machines include a first virtual machine and a second virtual machine.

[0183] The first network device 701 is configured to obtain a MAC address of the first virtual machine, and when the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, obtain a first route, the first route information including the MAC address, first virtual machine's ...

[0184] The second network device 702 is configured to receive the first route sent by the first network device 701, and store the first route information in the first route.

[0185] Optionally, the first network device 701 is further configured to store a second route, where the second route includes the first route information.

[0186] Optionally, the second network device 702 is configured to store the first route information in a sixth route.

[0187] Optionally, the first network device 701 is further configured to send a third route to the second network device 702, where the third route includes the second route information, where the second route information includes the MAC address and the second virtual local area network information but does not include the first virtual local area network information. In this manner, the first network device 701 is configured to update the third route to obtain the first route.

[0188] The second network device 702 is further configured to receive the third route sent by the first network device 701, and add the second route information to the sixth route. In this manner, the second network device 702 is configured to update the second route information in the sixth route as the first route information.

[0189] Optionally, the first virtual local area network information includes a virtual private network tag. For example, if the first network device 701 is located in an EVPN-based VXLAN, the virtual private network tag includes a VNI. Alternatively, if the first network device 701 is located in an SR network or an SRv6 network, the virtual private network tag includes a SID. Alternatively, if the first network device 701 is located in an MPLS network, the virtual private network tag includes an MPLS label.

[0190] Optionally, the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

[0191] Optionally, the first route is a MAC / IP Advertisement route.

[0192] Optionally, an attribute value of a MAC mobility extended community attribute included in the first virtual local area network information is the first attribute value.

[0193] The second network device 702 is further configured to generate a fourth route based on the connection between the first virtual machine and the second network device 702, the fourth route including a MAC address and third virtual local area network information of the first virtual machine, where an attribute value of a MAC mobility extended community attribute included in the third virtual local area network information is a second attribute value, the second attribute value being greater than the first attribute value, and further configured to send the fourth route to the first network device 701.

[0194] The first network device 701 receives the fourth route; The method is further configured to: delete the first virtual local area network information in the second route if the first attribute value is less than the second attribute value; and store a fifth route including the MAC address and the third virtual local area network information.

[0195] Optionally, the second network device 702 is further configured to transmit the first route to a third network device.

[0196] In an embodiment of the present application, the first network device first obtains the MAC address of the first virtual machine. Then, the first network device obtains a first route when the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, and the first route includes first route information, and the first route information includes the MAC address, the first virtual local area network information of the first virtual machine, and the second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's second virtual machine's first virtual local area network information. Then, the first network device sends the first route to the second network device, so that the second network device can store the first route information. In this way, for multiple virtual machines located in different virtual local area networks with the same MAC address, the first network device can use one route to notify the MAC address and virtual local area network information of each of the multiple virtual machines, i.e., information about multiple virtual machines belonging to the first network device and having the same MAC address but located in different virtual local area networks can be aggregated into one route, so that the number of routes for notifying the MAC addresses of virtual machines in the network can be reduced, and route transmission performance and route convergence performance can be improved.

[0197] All or part of the above-mentioned embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When the embodiments are implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded into a computer and executed, the procedures or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (e.g., coaxial cable, optical fiber, or Digital Subscriber Line (DSL)) or wireless (e.g., infrared, radio, and microwave) manner. The computer-readable storage medium may be any available medium accessible by a computer, or may be a data storage device, such as a server or a data center, that integrates one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a Digital Versatile Disc (DVD)), a semiconductor medium (e.g., a Solid-State Drive (SSD)), or the like.

[0198] The above description is merely an embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, or improvement made without departing from the spirit and principle of the present application should be included within the protection scope of the present application. [Explanation of symbols]

[0199] 401 Processor 402 Communication Bus 403 Memory 404 Communication Interface 405 Processor 406 Output Device 407 Input Devices 410 Program Code 501 First Acquisition Module 502 Second Acquisition Module 503 Transmitting Module 601 Receiver Module 602 Memory Module 701 First Network Device 702 Secondary Network Device

Claims

1. A media access control (MAC) address transmission method applied to a network system, the network system including a first network device and a second network device, the first network device is connected to a plurality of virtual machines, the plurality of virtual machines including a first virtual machine and a second virtual machine, the method being executed by the first network device, the method comprising: When the first network device acquires a MAC address of the first virtual machine and a MAC address of the second virtual machine within a preset duration and determines that the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, acquiring a first route by the first network device, the first route including route information, the route information including the MAC addresses, first virtual local area network information of the first virtual machine, and second virtual local area network information of the second virtual machine; transmitting, by the first network device, the first route to the second network device; A media access control (MAC) address transmission method comprising:

2. storing, by the first network device, a second route, the second route including the route information; The method of claim 1, further comprising:

3. Prior to the step of obtaining, by the first network device, a first route, the method further comprises: sending, by the first network device, a third route to the second network device, the third route including the MAC address and the second virtual local area network information but not including the first virtual local area network information; Further comprising: The step of obtaining the first route by the first network device includes: updating, by the first network device, the third route to obtain the first route. The method of claim 1.

4. The method of claim 1 , wherein the first virtual local area network information includes a virtual private network tag.

5. When the first network device is located in an Ethernet Virtual Private Network EVPN-based Virtual Extensible Local Area Network VXLAN, the Virtual Private Network tag includes a Virtual Extensible Local Area Network Identifier VNI; If the first network device is located in a segment routing SR network or an Internet Protocol version 6 segment routing SRv6 network, the virtual private network tag includes a segment identifier SID, or If the first network device is located in a Multi-Protocol Label Switching (MPLS) network, the virtual private network tag comprises an MPLS label. The method of claim 4.

6. 5. The method of claim 4, wherein the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

7. an attribute value of the MAC mobility extended community attribute included in the first virtual local area network information is a first attribute value; The method comprises: receiving, by the first network device, a fourth route, the fourth route including the MAC address of the first virtual machine and third virtual local area network information, the fourth route being for the first virtual machine, and an attribute value of a MAC mobility extended community attribute included in the third virtual local area network information being a second attribute value; if the first attribute value is less than the second attribute value, deleting, by the first network device, the first virtual local area network information in a second route and storing a fifth route, the fifth route including the MAC address and the third virtual local area network information; 7. The method of claim 6, further comprising:

8. The method of claim 1 , wherein the first path is a Media Access Control / Internet Protocol Advertisement (MAC / IP) path.

9. A media access control (MAC) address receiving method applied to a network system, the network system including a first network device and a second network device, the first network device is connected to a plurality of virtual machines, the plurality of virtual machines including a first virtual machine and a second virtual machine, the method being executed by the second network device; The method comprises: receiving, by the second network device, a first route transmitted by the first network device, the first route including first route information, the first route information including MAC addresses, first virtual local area network information, and second virtual local area network information, the MAC addresses being MAC addresses of both the first virtual machine and the second virtual machine connected to the first network device, the first route being a route obtained when both MAC addresses obtained within a preset duration are the same MAC address, the first virtual machine and the second virtual machine are located in different virtual local area networks, the first virtual local area network information being information about the first virtual machine, and the second virtual local area network information being information about the second virtual machine; storing the first route information by the second network device; A method for receiving a media access control (MAC) address, comprising:

10. The step of storing the first route information by the second network device includes: storing, by the second network device, the first route information in a second route; The method of claim 9.

11. The method comprises: receiving, by the second network device, a third route transmitted by the first network device before receiving the first route, the third route including second route information, the second route information including the MAC address and the second virtual local area network information but not including the first virtual local area network information; adding, by the second network device, the second route information to the second route; The step of storing the first route information in the second route by the second network device includes: updating, by the second network device, the second route information of the second route to the first route information; The method of claim 10.

12. The method of claim 9 , wherein the first virtual local area network information includes a virtual private network tag.

13. When the first network device is located in an Ethernet Virtual Private Network EVPN-based Virtual Extensible Local Area Network VXLAN, the Virtual Private Network tag includes a Virtual Extensible Local Area Network Identifier VNI; If the first network device is located in a segment routing SR network or an Internet Protocol version 6 segment routing SRv6 network, the virtual private network tag includes a segment identifier SID, or If the first network device is located in a Multi-Protocol Label Switching (MPLS) network, the virtual private network tag comprises an MPLS label. The method of claim 12.

14. 13. The method of claim 12, wherein the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

15. an attribute value included in the MAC mobility extended community attribute, which is for the first virtual machine and is included in the first route information, is a first attribute value, and the method includes: generating, by the second network device, a fourth route based on a connection between the first virtual machine and the second network device, the fourth route including the MAC address of the first virtual machine and third virtual local area network information, the fourth route being for the first virtual machine, an attribute value of a MAC mobility extended community attribute included in the third virtual local area network information is a second attribute value, and the second attribute value is greater than the first attribute value; transmitting, by the second network device, the fourth route to the first network device; 15. The method of claim 14, further comprising:

16. After the step of receiving, by the second network device, a first route, the method further comprises: transmitting, by the second network device, the first route to a third network device.

10. The method of claim 9, further comprising:

17. 10. The method of claim 9, wherein the first path is a Media Access Control / Internet Protocol Advertisement (MAC / IP) path.

18. A media access control (MAC) address transmission device, comprising: The apparatus is applied to a first network device, both the first network device and the second network device are located in a network system, the first network device is connected to a plurality of virtual machines, the plurality of virtual machines includes a first virtual machine and a second virtual machine, and the apparatus includes: an acquisition module configured to acquire a MAC address of the first virtual machine and a MAC address of the second virtual machine within a preset duration, and acquire a first route when determining that the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks, the first route including route information, the route information including the MAC address, first virtual local area network information of the first virtual machine, and second virtual local area network information of the second virtual machine; a transmitting module configured to transmit the first path to the second network device; a media access control (MAC) address transmitting device.

19. The apparatus comprises: a first storage module configured to store a second path, the second path including the path information; 20. The apparatus of claim 18, further comprising:

20. The transmitting module includes: and further configured to send a third route to the second network device, the third route including the MAC address and the second virtual local area network information but not the first virtual local area network information; The acquisition module includes: configured to update the third route to obtain the first route.

20. The apparatus of claim 18.

21. 20. The apparatus of claim 18, wherein the first virtual local area network information includes a virtual private network tag.

22. When the first network device is located in an Ethernet Virtual Private Network EVPN-based Virtual Extensible Local Area Network VXLAN, the Virtual Private Network tag includes a Virtual Extensible Local Area Network Identifier VNI; If the first network device is located in a segment routing SR network or an Internet Protocol version 6 segment routing SRv6 network, the virtual private network tag includes a segment identifier SID, or If the first network device is located in a Multiprotocol Label Switching (MPLS) network, the virtual private network tag comprises an MPLS label.

22. The apparatus of claim 21.

23. 22. The apparatus of claim 21, wherein the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

24. an attribute value of the MAC mobility extended community attribute included in the first virtual local area network information is a first attribute value; The apparatus comprises: a receiving module configured to receive a fourth route, the fourth route including the MAC address of the first virtual machine and third virtual local area network information, the fourth route being of the first virtual machine, and an attribute value of a MAC mobility extended community attribute included in the third virtual local area network information is a second attribute value; and an update module configured to delete the first virtual local area network information of a second path if the first attribute value is less than the second attribute value; a second storage module configured to store a fifth path, the fifth path including the MAC address and the third virtual local area network information; 24. The apparatus of claim 23, further comprising:

25. 20. The apparatus of claim 18, wherein the first path is a Media Access Control / Internet Protocol advertisement MAC / IP Advertisement path.

26. A media access control (MAC) address receiving apparatus, the apparatus being applied to a second network device, the second network device and a first network device both being located in a network system, the first network device being connected to a plurality of virtual machines, the plurality of virtual machines including a first virtual machine and a second virtual machine; The apparatus comprises: a receiving module configured to receive a first route transmitted by the first network device, the first route including first route information, the first route information including a MAC address, a first virtual local area network information, and a second virtual local area network information, the MAC address being a MAC address of both the first virtual machine and the second virtual machine connected to the first network device, the first route being a route obtained when both the MAC addresses obtained within a preset duration are the same MAC address, the first virtual machine and the second virtual machine are located in different virtual local area networks, the first virtual local area network information being information about the first virtual machine, and the second virtual local area network information being information about the second virtual machine; a storage module configured to store the first path information; a media access control (MAC) address receiving device.

27. The storage module includes: configured to store the first path information in a second path; 27. The apparatus of claim 26.

28. The apparatus further includes an additional module, the receiving module is further configured to receive a third route transmitted by the first network device before receiving the first route, the third route including second route information, the second route information including the MAC address and the second virtual local area network information but not including the first virtual local area network information; The adding module is configured to add the second route information to the second route; the storage module is further configured to update, for the second network device, the second route information of the second route to the first route information stored in the second route; 28. The apparatus of claim 27.

29. 27. The apparatus of claim 26, wherein the first virtual local area network information includes a virtual private network tag.

30. When the first network device is located in an Ethernet Virtual Private Network EVPN-based Virtual Extensible Local Area Network VXLAN, the Virtual Private Network tag includes a Virtual Extensible Local Area Network Identifier VNI; If the first network device is located in a segment routing SR network or an Internet Protocol version 6 segment routing SRv6 network, the virtual private network tag includes a segment identifier SID, or If the first network device is located in a Multiprotocol Label Switching (MPLS) network, the virtual private network tag comprises an MPLS label.

30. The apparatus of claim 29.

31. 30. The apparatus of claim 29, wherein the first virtual local area network information further includes any one or more of a route target attribute, a virtual local area network tag, and a MAC mobility extended community attribute.

32. an attribute value of the MAC mobility extended community attribute that belongs to the first virtual machine and is included in the first route information is a first attribute value; The apparatus comprises: a generating module configured to generate a fourth route based on a connection between the first virtual machine and the second network device, the fourth route including the MAC address of the first virtual machine and third virtual local area network information, the fourth route being of the first virtual machine, and an attribute value of a MAC mobility extended community attribute included in the third virtual local area network information is a second attribute value, and the second attribute value is greater than the first attribute value; a transmitting module configured to transmit the fourth path to the first network device; 32. The apparatus of claim 31 , further comprising:

33. The apparatus comprises: a transmitting module configured to transmit the first path to a third network device.

27. The apparatus of claim 26, further comprising:

34. 27. The apparatus of claim 26, wherein the first path is a Media Access Control / Internet Protocol advertisement MAC / IP Advertisement path.

35. A media access control (MAC) address transmission and reception system, the system including a first network device and a second network device, the first network device being connected to a plurality of virtual machines, the plurality of virtual machines including a first virtual machine and a second virtual machine; the first network device is configured to obtain a MAC address of the first virtual machine and a MAC address of the second virtual machine within a preset duration, and obtain a first route if determining that the first virtual machine and the second virtual machine have the same MAC address and are located in different virtual local area networks; the first route includes first route information, the first route information including the MAC address, first virtual local area network information of the first virtual machine, and second virtual local area network information of the second virtual machine, and is configured to send the first route to the second network device; the second network device is configured to receive the first route transmitted by the first network device and store the first route information in the first route; Media Access Control MAC Address Transmitting and Receiving System.

36. 18. A computer readable storage medium having instructions stored thereon that, when executed on a computer, enable the computer to perform the method of any one of claims 1 to 17.

37. A computer program comprising instructions, which when executed on a computer, enables the computer to carry out the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Edge router based on virtual private LAN service

    JP2015534388A

  • Network system and packet transfer method

    JP2017034365A

  • Data Processing

    JP2019534648A