MAC address sending method, device and system

文档序号:38331 发布日期:2021-09-24 浏览:18次 中文

阅读说明:本技术 Mac地址发送方法、装置和系统 (MAC address sending method, device and system ) 是由 朱文惠 于 2020-03-23 设计创作,主要内容包括:一种MAC地址发送方法、装置和系统,属于通信技术领域。该方法应用于网络系统,该网络系统包括第一网络设备和第二网络设备,第一网络设备与多个虚拟机连接,多个虚拟机包括第一虚拟机和第二虚拟机。第一网络设备获取第一虚拟机的MAC地址,在第一虚拟机的MAC地址与第二虚拟机的MAC地址相同且第二虚拟机与第一虚拟机所在的虚拟局域网不同的情况下,获取第一路由并发送给第二网络设备,第一路由包括路由信息,该路由信息包括该MAC地址、第一虚拟机的第一虚拟局域网信息和第二虚拟机的第二虚拟局域网信息。本方法将不同虚拟局域网下具有相同MAC地址的虚拟机信息汇聚到一条路由,从而减少网络中的路由数量。(A method, a device and a system for sending MAC addresses belong to the technical field of communication. The method is applied to a network system which comprises a first network device and a second network device, wherein the first network device is connected with a plurality of virtual machines, and the plurality of virtual machines comprise a first virtual machine and a second virtual machine. The method comprises the steps that a first network device obtains an MAC address of a first virtual machine, under the condition that the MAC address of the first virtual machine is the same as the MAC address of a second virtual machine and a virtual local area network where the second virtual machine is located is different from the first virtual machine, a first route is obtained and sent to a second network device, the first route comprises routing information, and the routing information comprises 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. The method converges the virtual machine information with the same MAC address under different virtual local area networks to one route, thereby reducing the number of routes in the network.)

1. A method for sending a Media Access Control (MAC) address is applied to a network system, wherein the network system comprises a first network device and a second network device, the first network device is connected with a plurality of virtual machines, and the virtual machines comprise a first virtual machine and a second virtual machine; the method is performed by the first network device, and comprises:

the first network equipment acquires the MAC address of the first virtual machine;

under the condition that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine and the virtual local area network where the second virtual machine and the first virtual machine are located are different, the first network device acquires a first route, wherein the first route comprises routing information, and the routing information comprises 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;

the first network device sends the first route to the second network device.

2. The method of claim 1, wherein the method further comprises:

the first network device stores a second route, the second route including the routing information.

3. The method of claim 1, wherein prior to the first network device obtaining the first route, the method further comprises:

the first network device sends a third route to the second network device, wherein the third route comprises the MAC address and the second virtual local area network information but does not comprise the first virtual local area network information;

the first network device obtaining the first route includes:

and the first network equipment updates the third route to acquire the first route.

4. The method of any of claims 1-3, wherein the first virtual local area network information comprises a virtual private network tag.

5. The method of claim 4,

if the first network equipment is located in an extensible virtual local area network (VXLAN) based on an Ethernet Virtual Private Network (EVPN), the virtual private network tag comprises an extensible virtual local area network identity (VNI); alternatively, the first and second electrodes may be,

if the first network device is located in a segment routing SR network or an internet protocol version 6segment routing SRv6 network, the virtual private network label includes a segment identification SID; alternatively, the first and second electrodes may be,

if the first network device is located in a multiprotocol label switching (MPLS) network, the virtual private network label comprises an MPLS label.

6. The method of claim 4 or 5, wherein the first virtual local area network information further comprises any one or more of a route destination attribute, a virtual local area network tag, and a MAC migration extension community attribute.

7. The method of claim 6, wherein the attribute value of the attribute of the MAC migration extension community included in the first virtual local area network information is a first attribute value, the method further comprising:

the first network device receives a fourth route, the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, and an attribute value of an attribute of a MAC migration extended community of the first virtual machine included in the third virtual local area network information is a second attribute value;

and under the condition that the first attribute value is smaller than the second attribute value, the first network equipment deletes the first virtual local area network information in a second route and stores a fifth route, wherein the fifth route comprises the MAC address and the third virtual local area network information.

8. The method of any of claims 1-7, wherein the first route is a media access control/internet protocol Advertisement MAC/IP Advertisement route.

9. A receiving method of Media Access Control (MAC) address is applied to a network system, the network system comprises a first network device and a second network device, the first network device is connected with a plurality of virtual machines, and the virtual machines comprise a first virtual machine and a second virtual machine; the method is performed by the second network device, and the method comprises:

the second network device receives a first route sent by the first network device, wherein the first route comprises first route information, the first route information comprises an MAC address, first virtual local area network information and second virtual local area network information, the MAC address is the MAC address of a first virtual machine and the MAC address of a second virtual machine which are connected with the first network device, the first virtual local area network information is the information of the first virtual machine, and the second virtual local area network information is the information of the second virtual machine;

the second network device stores the first routing information.

10. The method of claim 9, wherein the second network device storing the first routing information comprises:

the second network device stores the first routing information in a second route.

11. The method of claim 10, wherein the method further comprises:

the second network device receives a third route sent by the first network device before receiving the first route, wherein the third route comprises second route information, the second route information comprises the MAC address and the second VLAN information, and does not comprise the first VLAN information, and the second network device adds the second route information to the second route;

the second network device storing the first routing information in a second route includes:

and the second network equipment updates the second routing information in the second route into the first routing information.

12. The method of any of claims 9-11, wherein the first virtual local area network information comprises a virtual private network tag.

13. The method of claim 12,

if the first network equipment is located in an extensible virtual local area network (VXLAN) based on an Ethernet Virtual Private Network (EVPN), the virtual private network tag comprises an extensible virtual local area network identity (VNI); alternatively, the first and second electrodes may be,

if the first network device is located in a segment routing SR network or an internet protocol version 6segment routing SRv6 network, the virtual private network label includes a segment identification SID; alternatively, the first and second electrodes may be,

if the first network device is located in a multiprotocol label switching (MPLS) network, the virtual private network label comprises an MPLS label.

14. The method of claim 12 or 13, wherein the first virtual local area network information further comprises any one or more of a routing destination attribute, a virtual local area network tag, and a MAC migration extension community.

15. The method of claim 14, wherein the MAC migration of the first virtual machine included in the first routing information extends an attribute value of the community attribute to a first attribute value, the method further comprising:

the second network device generates a fourth route according to connection between the first virtual machine and the second network device, where the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, the third virtual local area network information includes an attribute value of a MAC migration extended community attribute of the first virtual machine, which is a second attribute value, and the second attribute value is greater than the first attribute value;

the second network device sends a fourth route to the first network device.

16. The method of any of claims 9-15, wherein after the second network device receives the first route, the method further comprises:

and the second network equipment sends the first route to third network equipment.

17. The method of any of claims 9-16, wherein the first route is a media access control/internet protocol Advertisement MAC/IP Advertisement route.

18. An apparatus for sending a MAC address, the apparatus being applied to a first 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 apparatus comprising:

the first acquisition module is used for acquiring the MAC address of the first virtual machine;

a second obtaining module, configured to obtain a first route under a condition that a MAC address of the first virtual machine is the same as a MAC address of the second virtual machine and a virtual local area network where the second virtual machine and the first virtual machine are located are different, where the first route includes routing information, and the routing information 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;

and the sending module is used for sending the first route to second network equipment.

19. The apparatus of claim 18, wherein the apparatus further comprises:

a first storage module, configured to store a second route, where the second route includes the routing information.

20. The apparatus of claim 18, wherein the sending module is further configured to:

sending a third route to the second network device, the third route including the MAC address and the second vlan information but not including the first vlan information;

the second obtaining module is configured to:

updating the third route to obtain the first route.

21. The apparatus of any of claims 18-20, wherein the first virtual local area network information comprises a virtual private network tag.

22. The apparatus of claim 21,

if the first network equipment is located in an extensible virtual local area network (VXLAN) based on an Ethernet Virtual Private Network (EVPN), the virtual private network tag comprises an extensible virtual local area network identity (VNI); alternatively, the first and second electrodes may be,

if the first network device is located in a segment routing SR network or an internet protocol version 6segment routing SRv6 network, the virtual private network label includes a segment identification SID; alternatively, the first and second electrodes may be,

if the first network device is located in a multiprotocol label switching (MPLS) network, the virtual private network label comprises an MPLS label.

23. The apparatus of claim 21 or 22, wherein the first virtual local area network information further comprises any one or more of a route destination attribute, a virtual local area network tag, and a MAC migration extension community attribute.

24. The apparatus of claim 23, wherein an attribute value of a MAC migration extension community attribute included in the first virtual local area network information is a first attribute value, the apparatus further comprising:

a receiving module, configured to receive a fourth route, where the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, and an attribute value of an attribute of a MAC migration extended community of the first virtual machine included in the third virtual local area network information is a second attribute value;

an updating module, configured to delete, by the first network device, the first vlan information in a second route when the first attribute value is smaller than the second attribute value;

a second storage module, configured to store a fifth route, where the fifth route includes the MAC address and the third vlan information.

25. The apparatus of any of claims 18-24, wherein the first route is a media access control/internet protocol Advertisement MAC/IP Advertisement route.

26. A Media Access Control (MAC) address receiving device is applied to a second network device, the second network device and a first network device are both located in a network system, the first network device is connected with a plurality of virtual machines, the plurality of virtual machines include a first virtual machine and a second virtual machine, and the MAC address receiving device is characterized by comprising:

a receiving module, configured to receive a first route sent by the first network device, where the first route includes first routing information, the first routing information includes an MAC address, first virtual local area network information, and second virtual local area network information, the MAC address is an MAC address of the first virtual machine and an MAC address of the second virtual machine connected to the first network device, the first virtual local area network information is information of the first virtual machine, and the second virtual local area network information is information of the second virtual machine;

and the storage module is used for storing the first routing information.

27. The apparatus of claim 26, wherein the storage module is to:

storing the first routing information in a second route.

28. The apparatus of claim 27, wherein the apparatus further comprises an add module;

the receiving module is further configured to receive, before receiving the first route, a third route sent by the first network device, where the third route includes second route information, and the second route information includes the MAC address and the second vlan information, but does not include the first vlan information;

the adding module is used for adding the second route information to the second route;

the storage module is used for:

and the second network equipment updates the second routing information in the second route into the first routing information.

29. The apparatus of any one of claims 25-28, wherein the first virtual local area network information comprises a virtual private network tag.

30. The apparatus of claim 29,

if the first network equipment is located in an extensible virtual local area network (VXLAN) based on an Ethernet Virtual Private Network (EVPN), the virtual private network tag comprises an extensible virtual local area network identity (VNI); alternatively, the first and second electrodes may be,

if the first network device is located in a segment routing SR network or an internet protocol version 6segment routing SRv6 network, the virtual private network label includes a segment identification SID; alternatively, the first and second electrodes may be,

if the first network device is located in a multiprotocol label switching (MPLS) network, the virtual private network label comprises an MPLS label.

31. The apparatus of claim 29 or 30, wherein the first virtual local area network information further comprises any one or more of a routing destination attribute, a virtual local area network tag, and a MAC migration extension community.

32. The apparatus of claim 31, wherein the attribute value of the MAC migration extended community attribute of the first virtual machine included in the first routing information is a first attribute value, the apparatus further comprising:

a generating module, configured to generate a fourth route according to connection between the first virtual machine and the second network device, where the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, and an attribute value of a MAC migration extended community attribute of the first virtual machine 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 sending module, configured to send the fourth route to the first network device.

33. The apparatus of any of claims 26-32, wherein the apparatus further comprises:

and the sending module is used for sending the first route to third network equipment.

34. The apparatus of any of claims 26-33, wherein the first route is a media access control/internet protocol Advertisement MAC/IP Advertisement route.

35. A Media Access Control (MAC) address transceiving system is characterized by comprising a first network device and a second network device, wherein the first network device is connected with a plurality of virtual machines, and the plurality of virtual machines comprise 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, obtain a first route when the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine and a virtual local area network in which the second virtual machine is located is different from the first virtual machine, where the first route includes first route information, and the first route information 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, and send the first route to the second network device;

the second network device is configured to receive the first route sent by the first network device, and store first route information in the first route.

36. A computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1-17.

37. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 17.

Technical Field

The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for sending a Media Access Control (MAC) address.

Background

Ethernet Virtual Private Network (EVPN) is a Virtual Private Network (VPN) technology for implementing two-layer Network interconnection. EVPN is widely used in network design of large operators as a mainstream solution for carrying two-layer services. An EVPN-based scalable local area network (VXLAN) includes a plurality of Provider Edge (PE) devices, and the PE devices can communicate with each other. The host may connect to PE devices within the VXLAN to access the VXLAN.

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 may belong to different VLANs.

The PE device may obtain the MAC address of its local virtual machine. Each time the PE device acquires the MAC address of a virtual machine, it may generate a Media Access Control/Internet Protocol Advertisement (MAC/IP Advertisement) route for notifying the MAC address of the virtual machine, and send the route to other PE devices, where the MAC/IP Advertisement route includes the MAC address of the virtual machine and a VXLAN network identifier (VXLAN network identifier, VNI) of the virtual machine.

Disclosure of Invention

The application provides a method, a device and a system for sending MAC addresses, which can reduce the number of routes used for announcing the MAC addresses of virtual machines in a network to a certain extent.

In a first aspect, a MAC address sending method is provided, and is applied to a network system, 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.

The method may be performed by a first network device. Specifically, a first network device acquires an MAC address of a first virtual machine; under the condition that the MAC address of the first virtual machine is the same as that of the second virtual machine and the virtual local area network where the second virtual machine is located is different from that of the first virtual machine, the first network equipment acquires a first route, wherein the first route comprises routing information, and the routing information comprises 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; the first network device sends the first route to the second network device.

In a possible case, the number of virtual machines having the same MAC address as the first virtual machine and different from the virtual lan where the first virtual machine is located may also be multiple, and the virtual lans where the multiple virtual machines different from the virtual lan where the first virtual machine is located are also different, and the second virtual machine belongs to the multiple virtual machines. In the above situation, the routing information in the first route includes the MAC address, the first vlan information of the first virtual machine, and a plurality of vlan information of the plurality of virtual machines, where the plurality of virtual machines respectively correspond to the plurality of vlan information one to one.

In this application, for multiple virtual machines in different virtual lans but with the same MAC address, a route may be used to announce the MAC address and the virtual lan information of each of the multiple virtual machines, that is, multiple pieces of information of multiple virtual machines with the same MAC address in different virtual lans may be aggregated to a route. Therefore, the number of routes in the network can be reduced, and the route transmission performance and the route convergence performance are improved.

In one possible implementation, the first network device may store a second route (e.g., Border Gateway Protocol (BGP) route) that includes the routing information. In this way, for multiple virtual machines in different virtual local area networks but with the same MAC address, only one route is locally stored to record the same MAC address and the virtual local area network information of the multiple virtual machines, and the route may include multiple routing table entries corresponding to the multiple virtual machines respectively. That is, for a plurality of virtual machines in different virtual lans but having the same MAC address, by recording a plurality of pieces of information corresponding to the plurality of virtual machines in one route, the number of routes that need to be stored locally is reduced, and storage resources are saved.

In a possible implementation manner, before the first network device acquires the first route, the first network device may send a third route to the second network device, where the third route includes the MAC address and the second vlan information, and does not include the first vlan information. For example, when one or more virtual machines are online, the first network device can obtain relevant 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 may send a third route to the second network device to advertise the relevant information of the second virtual machine. When the first network device further finds that the virtual machines simultaneously coming on line (the simultaneous coming on line is not necessarily the same time point in a strict sense, and may be allowed to be in order within a certain threshold range) further include a virtual machine having the same MAC address as the second virtual machine, the first network device may send the related information of the multiple virtual machines having the same MAC address together in the third route. When the first network device sends the third route, the first virtual machine comes online at a certain time, and the first virtual machine and the second virtual machine have the same MAC address, at this time, the first network device may send the first route to notify the relevant information of the first virtual machine. The first route may include information about the first virtual machine and information about one or more virtual machines that have been included in the previous third route. I.e. the first route may be an updated route for the third route. In the above, the third route is taken as the route sent when the virtual machine is online, and it can be understood that the third route itself may also be the route in the update scenario. Therefore, the second network device can continuously receive the latest route advertised by the first network device, wherein the route comprises the aggregation attribute information of the virtual machines with the same MAC address under the first network device, and the number of routes locally stored by the second network device is reduced.

Illustratively, 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 comprises a VNI; or, if the first network device is located in a Segment Routing (SR) network or an Internet Protocol Version 6Segment Routing (SRv 6) 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 Label includes an MPLS Label.

Illustratively, the first virtual local area network information may further include any one or more of a route destination attribute, a virtual local area network tag, and a MAC migration extension community attribute.

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 (Update) message. In the above case, the routing information including the MAC address, the first vlan information, and the second vlan information may exist in a partial field of the MAC/IP Advertisement route, or part of the routing information may directly exist in a partial field of the BGP Update message, and the other part of the routing information exists in the MAC/IP Advertisement route. In other cases, the routing information may exist in other types of routes, and the route may be sent in a message carried with one or more other advertised routes, or sent separately.

In one possible implementation manner, an attribute value of a MAC Migration 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, where the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, and an attribute value of an attribute of the MAC migration extended community of the first virtual machine included in the third virtual local area network information is a second attribute value; and under the condition that the first attribute value is smaller than the second attribute value, the first network equipment deletes the first virtual local area network information in the second route and stores a fifth route, wherein the fifth route comprises the MAC address and the third virtual local area network information.

When the first attribute value is smaller than the second attribute value, it is described that the third virtual local area network information is updated virtual local area network information of the first virtual machine compared to the first virtual local area network information and is sent by the other network device, and at this time, it is described that the first virtual machine migrates from the first network device to the other network device. Therefore, the first network device may update the routing table entry corresponding to the locally stored first virtual machine, and specifically may delete the first virtual local area network information in the stored second route. The first network device further generates and stores a fifth route (such as a BGP route) according to the received fourth route, where the fifth route includes the third vlan information sent by the second network device. Therefore, by using the MMEC attribute, the first network device can detect the migration of the local virtual machine in time, the accuracy of locally maintaining routing information is improved, and the robustness of network operation is improved.

In a second aspect, there is provided a MAC address transmission apparatus having a function of implementing the behavior of the MAC address transmission method in the first aspect. The MAC address transmitting apparatus includes at least one module, where the at least one module is configured to implement the MAC address transmitting method provided in the first aspect.

In a third aspect, a MAC address transmitting apparatus is provided, which includes a processor and a transceiver in its structure. The processor is configured to execute a program stored in the memory to implement the MAC address transmission method according to the first aspect. The transceiver is for transmitting and receiving various data relating to the first aspect. Optionally, the apparatus may further include the memory, configured to store a program that supports the MAC address sending apparatus to execute the MAC address sending method provided in the first aspect. The MAC address transmitting apparatus may further include a communication bus for establishing a connection between the processor and the transceiver.

In a fourth aspect, a computer-readable storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to perform the MAC address transmitting method of the first aspect.

In a fifth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the MAC address sending method of the first aspect.

In a sixth aspect, a MAC address receiving method is provided, which is applied to a network system, 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 include a first virtual machine and a second virtual machine.

The method is performed by a second network device. Specifically, the second network device receives a first route sent by the first network device, where the first route includes first route information, the first route information includes an MAC address, first virtual local area network information, and second virtual local area network information, the MAC address is an MAC address of a first virtual machine and a second virtual machine connected to the first network device, the first virtual local area network information is information of the first virtual machine, and the second virtual local area network information is information of the second virtual machine; the second network device stores the first routing information.

In a possible case, the number of virtual machines having the same MAC address as the first virtual machine and different from the virtual lan where the first virtual machine is located may also be multiple, and the virtual lans where the multiple virtual machines different from the virtual lan where the first virtual machine is located are different from each other, and the second virtual machine belongs to the multiple virtual machines. In the above situation, the routing information in the first route includes the MAC address, the first vlan information of the first virtual machine, and a plurality of vlan information of the plurality of virtual machines, where the plurality of virtual machines respectively correspond to the plurality of vlan information one to one.

In this application, for multiple virtual machines in different virtual lans but having the same MAC address, a route may be used to announce the MAC address and the virtual lan information of each of the multiple virtual machines, that is, the same MAC address in different virtual lans may be aggregated into a route. Therefore, the number of routes in the network can be reduced, and the route transmission performance and the route convergence performance are improved.

In one possible implementation, when the second network device stores the first routing information, the first routing information is stored in the second route. In this way, for multiple virtual machines in different virtual local area networks but with the same MAC address, only one route needs to be stored to record the MAC address and the virtual local area network information of the multiple virtual machines. That is, for a plurality of virtual machines in different virtual lans but having the same MAC address, a plurality of routing table entries corresponding to the plurality of virtual machines may be recorded in one route, so that the number of routes that need to be stored locally may be reduced.

In a possible implementation manner, before receiving the first route, the second network device receives a third route sent by the first network device, where the third route includes second route information, the second route information includes a MAC address and second virtual local area network information, and does not include the first virtual local area network information, and the second network device stores the second route information to the second route. That is, the second route locally stored by the second network device includes the virtual local area network information of the second virtual machine, at this time, because the first virtual machine may not be on line with the first network device yet, the third route sent by the first network device and received by the second network device does not include the information of the first virtual machine having the same MAC address as the second virtual machine, and thus the second route locally stored by the second network device does not include the information of the first virtual machine. After the second network device receives the third route, when the second network device receives the first route including the first virtual machine attribute information again, the second network device may update the second route information in the second route to the first route information when storing the first route information included in the first route in the second route. The updating may be, for example, updating the complete second routing information to the first routing information, or partially updating a data content of the second routing information that is different from the first routing information.

In the above case, the third route includes information of the second virtual machine, and the first route includes information of the first virtual machine and the second virtual machine as an example. In an actual application scenario, the third route may further include information of another one or more virtual machines having the same MAC address as the second virtual machine, and the third route may include a virtual machine having the same MAC address as the first virtual machine, such as the second virtual machine and/or the other one or more virtual machines, or may not include information of the other virtual machines, that is, when the first network device sends the first route, the first route information included in the first route is information of a virtual machine having the same MAC address as the first virtual machine, which is actually mounted under the first network device when the first network device finds that the first virtual machine is online.

Illustratively, 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 comprises a VNI; alternatively, if the first network device is located in the SR network or the SRv6 network, the vpn label includes the SID; or, if the first network device is located in the MPLS network, the virtual private network label includes an MPLS label.

Illustratively, the first virtual local area network information may further include any one or more of a route destination attribute, a virtual local area network tag, and a MAC migration extension community attribute.

The first route may be a route for advertising a MAC address, e.g., the first route may be a MAC/IP Advertisement route. The MAC/IP Advertisement route may be carried in a BGP Update message. In the above case, the routing information including the MAC address, the first vlan information, and the second vlan information may exist in a partial field of the MAC/IP Advertisement route, or part of the routing information may directly exist in a partial field of the BGP Update message, and the other part of the routing information exists in the MAC/IP Advertisement route. In other cases, the routing information may exist in other types of routes, and the route may be carried in a message with one or more other routes for transmission, or may be transmitted separately.

In a possible implementation manner, the attribute value of the MAC migration extended community attribute of the first virtual machine included in the first routing information is a first attribute value. In this case, the second network device connects to the second network device according to the first virtual machine, generates a fourth route (for example, a MAC/IP Advertisement route) and sends the fourth route to the first network device, where the fourth route includes a MAC address and third virtual local area network information of the first virtual machine, an attribute value of a MAC migration extension community attribute of the first virtual machine 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. The second network device may also locally maintain a sixth route that includes the MAC address and third virtual local area network information for the first virtual machine. The sixth route and the second route are two routes stored independently, where the second route is a route stored according to a MAC/IP Advertisement route received from the first network device, and the sixth route is a route generated or obtained by the second network device according to a virtual machine detected under the second network device.

When the first virtual machine is connected with the second network device, the first virtual machine is described to be migrated from the first network device to the second network device. Therefore, the second network device may update the locally stored attribute value of the MMEC of the first virtual machine, and specifically, may increase the attribute value of the MMEC of the first virtual machine, that is, the second attribute value is greater than the first attribute value. After the attribute value of the MMEC of the first virtual machine is increased, the MAC address and the virtual local area network information of the first virtual machine may be re-advertised, that is, the fourth route may be sent to the first network device. At this time, in one case, the fourth route may include, in addition to the updated virtual local area network information of the first virtual machine, information of other virtual machines having the same MAC address as the first virtual machine, which is stored by the second network device. In another case, the fourth route may carry only the updated virtual local area network information of the first virtual machine, or may also carry other updated virtual local area network information having the same MAC address as the first virtual machine, for example, there may be a case where another virtual machine is migrated from the first network device to the second network device at the same time, or another new online virtual machine under the second network device, or the like. In another situation, the first network device receiving the fourth route may update the route entry in the route with the same MAC address stored locally according to the update information carried in the received route, so as to reduce the number of routes stored locally by the route receiving party while improving the route transmission efficiency.

In a possible implementation manner, after the second network device receives the first route, the second network device may further send 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 required to be sent, the corresponding second network device also reduces the number of routes required to be reflected, and the overall transmission efficiency of the network is improved.

In a seventh aspect, a MAC address transmitting apparatus is provided, which has a function of implementing the behavior of the MAC address transmitting method in the above sixth aspect. The MAC address sending apparatus includes at least one module, where the at least one module is configured to implement the MAC address sending method provided in the sixth aspect.

In an eighth aspect, a MAC address transmitting apparatus is provided, which structurally includes a processor and a transceiver, wherein the processor is configured to execute a program stored in a memory, so as to implement the MAC address transmitting method of the above sixth aspect. The transceiver is configured to transmit and receive various data related to the sixth aspect. Optionally, the apparatus may further include the memory, configured to store a program that supports the MAC address transmitting apparatus to execute the MAC address transmitting method provided in the sixth aspect. The MAC address transmitting apparatus may further include a communication bus for establishing a connection between the processor and the transceiver.

In a ninth aspect, there is provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the MAC address transmission method of the above sixth aspect.

A tenth aspect provides a computer program product containing instructions which, when run on a computer, cause the computer to perform the MAC address transmission method of the above sixth aspect.

In an eleventh aspect, a MAC address transceiving system is provided, which includes a first network device and a second network device, wherein the first network device is connected to a plurality of virtual machines, and the plurality of virtual machines include 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, obtain a first route when the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine and a virtual local area network in which the second virtual machine is located is different from the first virtual machine, where the first route includes first route information, and the first route information 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, and send the first route to the second network device;

the second network device is configured to receive the first route sent by the first network device, and store first route information in the first route.

In a possible implementation manner, the first network device is further configured to store a second route, where the second route includes the first route information.

In one possible implementation, the second network device is configured to store the first routing information in a sixth route.

In a possible implementation manner, the first network device is further configured to send a third route to the second network device, where the third route includes second route information, and the second route information includes the MAC address and the second vlan information, but does not include the first vlan information; in this way, the first network device is configured to update the third route to obtain the first route;

the second network device is further configured to receive a third route sent by the first network device, and add the second route information to the sixth route; in this way, the second network device is configured to update the second route information in the sixth route to the first route information.

In one possible scenario, the first virtual local area network information comprises a virtual private network tag. Illustratively, the virtual private network tag comprises a VNI if the first network device is located in an EVPN-based VXLAN; or, if the first network device is located in an SR network or an SRv6 network, the virtual private network tag includes a SID; or, if the first network device is located in an MPLS network, the virtual private network label includes an MPLS label.

In one possible case, the first virtual local area network information further includes any one or more of a routing destination attribute, a virtual local area network tag, and a MAC migration extension community attribute.

In one possible scenario, the first route is a MAC/IP Advertisement route.

In a possible implementation manner, an attribute value of an attribute of the MAC migration extension community included in the first virtual local area network information is a first attribute value;

the second network device is further configured to generate a fourth route according to connection between the first virtual machine and the second network device, where the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, an attribute value of a MAC migration extension community attribute of the first virtual machine 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; sending a fourth route to the first network device;

the first network device is further configured to receive a fourth route, delete the first vlan information in the second route and store a fifth route when the first attribute value is smaller than the second attribute value, where the fifth route includes the MAC address and the third vlan information.

In a possible implementation manner, the second network device is further configured to send the first route to a third network device.

The technical effects obtained by the second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described herein again.

The technical effects obtained by the seventh aspect, the eighth aspect, the ninth aspect, and the tenth aspect are similar to the technical effects obtained by the corresponding technical means in the sixth aspect, and are not described herein again.

The technical effect obtained by the above eleventh aspect is similar to the technical effect obtained by the corresponding technical means in the above first aspect and the sixth aspect, and is not described herein again.

Drawings

Fig. 1 is a schematic diagram of a network system provided in an embodiment of the present application;

fig. 2 is a flowchart of a method for sending a MAC address according to an embodiment of the present application;

fig. 3 is a schematic diagram of another network system provided in the embodiments of the present application;

fig. 4 is a schematic structural diagram of a network device according to an embodiment of the present application;

fig. 5 is a schematic structural diagram of a MAC address transmitting apparatus according to an embodiment of the present application;

fig. 6 is a schematic structural diagram of another MAC address transmitting apparatus according to an embodiment of the present application;

fig. 7 is a schematic diagram of a MAC address transceiving system according to an embodiment of the present application.

Detailed Description

To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.

Before explaining the embodiments of the present application in detail, an application scenario related to the embodiments of the present application will be described.

Fig. 1 is a schematic diagram of a network system according to an embodiment of the present application. Referring to fig. 1, in a network system, such as a VXLAN, SR network, SRv6 network, or MPLS network based on EVPN, a plurality of network devices (such as network device 1 and network device 2 shown in fig. 1) are generally included, and the plurality of network devices communicate with each other to implement a data forwarding function. Hosts (such as host 1, host 2, host 3, and host 4 shown in fig. 1) may connect to network devices within the network system to access the network system.

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 each network device may belong to the same VLAN or may belong to different VLANs. Each network device may obtain the MAC address of the virtual machine to which it is connected and send the MAC address to the other network devices.

In VXLAN, generally, each time a network device acquires a MAC address of a virtual machine connected to the network device, a MAC/IP Advertisement route for announcing the MAC address of the virtual machine may be generated, where the MAC/IP Advertisement route includes the MAC address of the virtual machine and a VNI of the virtual machine. Then the network device sends the MAC/IP Advertisement route to other network devices for other network devices to learn the MAC address of the virtual machine.

However, with the development of virtual machine technology, a larger number of virtual machines can be created on one host, and different virtual machines can belong to different virtual local area networks and have the same MAC address. In the MAC address Advertisement method, each virtual machine needs to generate a MAC/IP Advertisement route, which results in an increasing number of routes in the network and affects the network performance.

Therefore, the embodiment of the present application provides a MAC address sending method, which can converge the same MAC address in different virtual lans to one route, thereby reducing the number of routes transmitted in a network to a certain extent, significantly reducing the number of routes locally maintained by a network device, and improving the overall performance of network operation.

Fig. 2 is a flowchart of a MAC address sending method according to an embodiment of the present application, where the method is applied to the network system shown in fig. 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 fig. 2, the method includes:

201: the first network device obtains the MAC address of the first virtual machine.

The first network device may be a device with a data forwarding function, such as a switch, a router, or the like. The type of the first network device may be the same or different in different networks.

For example, in EVPN-based VXLAN, the first network device may be a VXLAN Tunnel End Point (VTEP) device or the like. EVPN is a VPN technology for implementing two-layer network interconnection.

Also for example, in an EVPN-based VXLAN, SR network, SRv6 network, or MPLS network, the first network device may be a PE device. The SRv6 network uses Internet Protocol Version 6(Internet Protocol Version 6, IPv6) data plane, and can be incrementally deployed on the IPv6 network.

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

In addition, the first virtual machine is one of a plurality of virtual machines to which the first network device is connected, i.e., the first virtual machine is a local virtual machine of the first network device. The first network device may acquire the MAC address of the local virtual machine.

Specifically, the first network device may acquire the MAC address of the first virtual machine in various ways. In one possible approach, in a network using Internet Protocol Version 4 (IPv 4), the MAC Address of the first virtual machine may be determined by the first network device according to a received Address Resolution Protocol (ARP) message from the first virtual machine, where the ARP message may include a gratuitous ARP message, an ARP request message, an ARP reply message, or the like. In another possible manner, in a network using IPv6, the MAC address of the first virtual machine may be determined by the first network device according to a received Neighbor Discovery Protocol (ND) message from the first virtual machine, where the ND message may include a Neighbor Solicitation (NS) message or a Neighbor Advertisement (NA) message, and the like.

For example, in a network using IPv4, after a first virtual machine is online, a gratuitous ARP message may be sent to a first network device to which the first virtual machine is connected, where the gratuitous ARP message includes a MAC address of the first virtual machine, so as to implement advertising of its own address to the first network device; or before the first virtual machine needs to communicate with other virtual machines, the first virtual machine may send an ARP request message carrying the IP addresses of the other virtual machines to the first network device connected to the first virtual machine, so as to query the MAC addresses of the other virtual machines through the IP addresses of the other virtual machines, where a source address of the ARP request message is the MAC address of the first virtual machine; or, when receiving an ARP request message carrying the IP address of the first virtual machine sent by another virtual machine, the first virtual machine may send an ARP reply message carrying the MAC address of the first virtual machine to the other virtual machine, where a source address of the ARP reply message is the MAC address of the first virtual machine. After receiving the gratuitous ARP message, the ARP request message, or the ARP reply message sent by the first virtual machine, the first network device may obtain the MAC address of the first virtual machine from the gratuitous ARP message, the ARP request message, or the ARP reply message.

For another example, in a network using IPv6, after a first virtual machine goes online, before communication with another virtual machine is needed, an NS message carrying an IP address of the other virtual machine may be sent to a first network device connected to the first virtual machine, so as to query the MAC address of the other virtual machine through the IP address of the other virtual machine, where a source address of the NS message is the MAC address of the first virtual machine; or, when receiving an NS message carrying the IP address of the first virtual machine sent by another virtual machine, the first virtual machine may send an NA message carrying the MAC address of the first virtual machine to the other virtual machine, where a source address of the NA message is the MAC address of the first virtual machine. After that, after receiving the NS message or the NA message sent by the first virtual machine, the first network device may acquire the MAC address of the first virtual machine from the NS message or the NA message.

After the first network device obtains the MAC address of the first virtual machine local to the first network device, a route for advertising the MAC address may be obtained as follows in operation 202.

202: and under the condition that the MAC address of the first virtual machine is the same as that of the second virtual machine and the virtual local area network where the second virtual machine and the first virtual machine are located are different, the first network equipment acquires the first route and sends the first route to the second network equipment. The first route includes routing 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.

The second network device may be a device with a data forwarding function, such as a switch, a router, and the like. The type of the second network device may be the same or different in different networks. For example, in EVPN-based VXLAN, the second network device may be a VTEP device or the like. Also for example, in an EVPN-based VXLAN, SR network, SRv6 network, or MPLS network, the second network device may be a PE device.

In addition, the second virtual machine is a virtual machine other than the first virtual machine among the plurality of virtual machines connected to the first network device, and the second virtual machine is also a local virtual machine of the first network device.

In this embodiment of the application, the number of virtual machines that are the same as the MAC address of the first virtual machine and different from the virtual lan in which the first virtual machine is located may be one or more, and the second virtual machine belongs to the one or more virtual machines. That is, the routing information in the first route includes the MAC address, the first vlan information of the first virtual machine, and may further include one or more vlan information of one or more virtual machines having the same MAC address as the first virtual machine.

In this embodiment of the present application, for multiple virtual machines in different virtual local area networks but with the same MAC address, a route may be used to advertise the MAC address and the virtual local area network information of each of the multiple virtual machines, that is, the same MAC address in different virtual local area networks may be aggregated to a route. Therefore, the number of routes in the network can be reduced, and the route transmission performance and the route convergence performance are improved.

There are various ways for the first network device to obtain the first route, and various possible scenarios are described below.

Under a first possible condition, the first network device acquires the MAC address of the first virtual machine and the MAC address of the second virtual machine within a preset time period, and finds 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, first virtual local area network information of the first virtual machine, and second virtual local area network information of the second virtual machine, and sends the first route to the second network device. In this way, the number of routes to be sent can be reduced.

It should be noted that the preset time duration can be reasonably set according to actual requirements, and the preset time duration can be set to be smaller. For example, the preset time period may be greater than or equal to 0 second and less than or equal to 600 seconds. That is, the first network device acquires both the MAC address of the first virtual machine and the MAC address of the second virtual machine in a short time.

For example, in a scenario that virtual machines are online in batch, if a first virtual machine and a second virtual machine are online at the same time or online at a short time interval, a 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 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 acquires the MAC address of the first virtual machine after a short time interval.

For another example, when the function of aggregating and advertising the attribute information of the virtual machines with the same MAC address is enabled for the first time, the first network device may already learn a plurality of pieces of virtual machine information locally with the same MAC address before enabling the function, and only these pieces of virtual machine information are respectively stored in a plurality of routes, and at this time, the first route may be generated and sent in an enabled aggregation advertisement manner.

Under a second possible condition, the first network device first acquires the MAC address of the second virtual machine, and acquires the MAC address of the first virtual machine after acquiring the preset duration of the MAC address of the second virtual machine. The preset time duration is different from the first case, that is, after the MAC address of the second virtual machine is obtained, the MAC addresses of other virtual machines (e.g., the first virtual machine) having the same MAC address are not obtained within the preset time duration set in the first case, and in this case, the first network device may send the 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 local area network information since the first virtual machine has not been discovered. When the first network device acquires the MAC address of the first virtual machine again, the first network device finds that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine, and may send the updated first route. Compared with the third route, the updated first route may carry the MAC address, the virtual local area network information of the first virtual machine, and the virtual local area network information of the second virtual machine. In another case, the updated first route may further include the MAC address and the virtual local area network information of the first virtual machine, but not include the virtual local area network information of the second virtual machine, for example, when the first virtual machine is online, the second virtual machine has been unloaded from the first network device, or migrated to another network device. The virtual machine information carried in the first route sent by the first network device may be virtual local area network information of one or more virtual machines having the same MAC address actually mounted by the first network device when the device sends the route, but the sending of the first route by the first network device is triggered by the fact that the first virtual machine is online.

The third route may include, in addition to the second vlan information of the second virtual machine, vlan information of other virtual machines having the same MAC address, which are found within a preset time period.

For example, in an online scene of a virtual machine, if multiple virtual machines are simultaneously online or are online at a short time interval, the first network device may acquire the MAC addresses of the multiple virtual machines in a short time. Assuming that the MAC addresses of the plurality of virtual machines are the same, the first network device may generate and send a third route including the MAC addresses and the virtual local area network information of the plurality of virtual machines to the second network device. After a long time exceeding a preset time, the first virtual machine is online, the first network device obtains the MAC address of the first virtual machine, and if the MAC address of the first virtual machine is the same as the MAC addresses of the multiple virtual machines, the first network device may add the first virtual local area network information of the first virtual machine to obtain the updated first route.

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 locally as routing information in a route. For example, corresponding to a first route sent to a second network device, the first network device may locally store a second route that includes the same routing information as the first route, the routing information including the MAC address, first virtual local area network information for a first virtual machine, and second virtual local area network information for a second virtual machine.

In the embodiment of the application, for a plurality of virtual machines in different virtual local area networks but having the same MAC address, only one route needs to be stored to record the MAC address and the virtual local area network information of the plurality of virtual machines. That is, for a plurality of virtual machines in different virtual lans but having the same MAC address, a plurality of routing table entries corresponding to the plurality of virtual machines may be recorded in one route, so that the number of routes required to be stored may be reduced.

It should be noted that, if the first route is directly generated by the first network device, the first network device does not store the second route before acquiring the first route. At this time, after the first network device generates the first route, the first network device may generate and store the second route.

If the first route is obtained by updating the third route by the first network device, the first network device stores the route comprising the MAC address and the second virtual local area network information of the second virtual machine before acquiring the first route. At which point the first network device may update the stored route to obtain the second route. Specifically, the first network device may add the first virtual local area network information to the stored route to obtain the updated second route.

The following describes the virtual lan information.

The virtual local area network information is related information for reflecting a virtual local area network in which a virtual machine is located, and specifically may be one or more pieces of virtual local area network attribute information corresponding to the virtual machine. In different networks, the attributes included in the vlan information may be the same or different, and may be designed according to specific needs, as long as it is ensured that the information can reflect the relevant information of the vlan where the virtual machine is located, and different virtual machines can be distinguished from each other by the relevant information of the vlan.

Optionally, the virtual local area network information may include a virtual private network tag (VPN tag) that identifies a VPN in which the virtual machine is located.

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

Optionally, the virtual local area network information may further include any one or more of a Route destination (Route Target) attribute, a virtual local area network tag (VLAN tag), and a MMEC attribute. For 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 included in the first Route, for example, the first virtual local area network information and the second virtual local area network information may each include a virtual private network tag, a Route Target, a VLAN tag, and a MMEC; or, the first virtual local area network information and the second virtual local area network information may both include a virtual private network tag, a Route Target, and an MMEC; or, the first virtual local area network information and the second virtual local area network information may both include a virtual private network tag and a Route Target.

It should be noted that, the issue and the reception of the Route may be controlled by the Route Target attribute. Specifically, after the Route-included virtual local area network information carries the Route Target attribute, the other network device receiving the Route compares the Route Target attribute configured by the other network device with the Route Target attribute in the Route, and stores the Route information in the Route only when the two have the same attribute value, otherwise does not store the Route information in the Route.

In addition, the VLAN tag may be used to identify the VLAN to which the data frame belongs. Specifically, after the VLAN tag is carried in the virtual local area network information included in the route, after the other network device that receives the route stores the route information in the route, when the data frame whose destination address is the MAC address is subsequently forwarded, the VLAN tag may be added to the data frame, so that the data frame may be forwarded in the VLAN identified by the VLAN tag.

Furthermore, the MMEC attribute includes a sequence number, and the sequence number is increased along with the increase of the migration number of the virtual machine. Specifically, virtual machine migration refers to the migration of a virtual machine from a network device to which the virtual machine has access to another network device in the network. The newly migrated network device, sensing that the virtual machine is online, retransmits the route for advertising the MAC address of the virtual machine, which is different from the previously issued route for advertising the MAC address of the virtual machine in that the route includes the sequence number (or value) in the MMEC attribute plus 1. After receiving the route larger than the sequence number in the route currently stored by the other network equipment, the other network equipment updates the stored route according to the route.

When the MMEC attribute is included in the virtual local area network information, taking the example that the first virtual machine is migrated from the first network device to the second network device. If the attribute value of the MMEC included in the first virtual local area network information (corresponding to the first virtual machine) stored in the first network device is the first attribute value, and the first network device receives the fourth route sent by the second network device. The fourth route is generated when the second network device discovers that the first virtual machine is online, and includes the MAC address and third vlan information of the first virtual machine. The attribute value of the MMEC of the first virtual machine included in the third virtual local area network information is a second attribute value. And under the condition that the first attribute value is smaller than the second attribute value, the first network device updates the second route, and specifically, the first network device may delete the first virtual local area network information of the first virtual machine in the locally stored second route. And the first network equipment generates and stores a fifth route according to the fourth route, wherein the fifth route comprises the MAC address and the third virtual local area network information. The updated second route and the stored fifth route belong to two different routes, wherein the second route includes the virtual local area network information of the virtual machine having the MAC address under the first network device, and the fifth route includes 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.

When the first attribute value is smaller than the second attribute value, it is indicated that the third vlan information is new vlan information of the first virtual machine compared to the first vlan information, and at this time, the first virtual machine has been migrated from the first network device to the second network device. Therefore, the first network device may update the stored route corresponding to the first virtual machine, and specifically may delete the first virtual local area network information in the second route and store the fifth route.

In the above situation, before deleting the first vlan information of the first virtual machine, the first network device may first detect whether the first virtual machine still exists locally, and may perform a deletion operation if it is determined that the first virtual machine does not exist locally. Otherwise, an error report or the like may be performed. In addition, the second route may be updated by temporarily masking the first vlan information by setting, etc., in addition to deleting the first vlan information.

In the above situation, the third VLAN information at least needs to include a virtual private network tag and an MMEC attribute, and may further include one or both of a Route Target and a VLAN tag.

The first route may be a route for advertising a MAC address, e.g., the first route may be a MAC/IP Advertisement route. The MAC/IP Advertisement route may be carried in a BGP Update message. In this case, the routing information including the MAC address, the first vlan information, and the second vlan information may exist in a partial field of the MAC/IP Advertisement route, or part of the routing information may directly exist in a partial field of the bgpublish message, and the other part of the routing information exists in the MAC/IP Advertisement route. In other cases, the routing information may exist in other types of routes, and the route may be carried in a message with one or more other routes for transmission, or may be transmitted separately.

In a first possible manner, the MAC/IP Advertisement route may include an EVPN network layer availability information (NLRI) attribute, and the routing information may exist in the EVPN NLRI attribute. For example, the fields included in the EVPN NLRI attribute may be as shown in table 1 below:

TABLE 1

Route identifier (Route distingguicher, RD)
Ethernet Segment Identifier (ESI)
Ethernet tag identity identifier (Ethernet)t Tag Identity document,ETID)
MAC Address Length (MAC Address Length)
MAC Address (MAC Address)
IP Address Length (IP Address Length)
IP Address (IP Address)
Virtual private network tag 1
Route Target 1
VLAN tag 1
MMEC 1
Virtual private network tag 2
Route Target 2
VLAN tag 2
MMEC 2
……
……
Virtual private network tag n
Route Target n
VLAN tag n
MMEC n

Wherein, the route identifier field is used for distinguishing the MAC/IP Advertisement routes of different VXLANs so as to avoid the conflict of the MAC/IP Advertisement routes. The Ethernet segment identifier field is used to uniquely identify the link that the virtual machine is connected to the network device. The ethernet tag identity identifier field is used to identify the VLAN ID that the network device is actually configured with. The MAC address length field is used to indicate the length of the MAC address field, and the MAC address can be determined by combining the MAC address length field and the MAC address field. The IP address length field is used to indicate the length of the IP address field, and both the IP address length field and the IP address field may have a value of 0 in the embodiment of the present application.

As can be seen from table 1, the EVPN NLRI attribute in the MAC/IP Advertisement Route may include one MAC address and a plurality of pieces of virtual local area network information (i.e., virtual private network tag, Route Target, VLAN tag, MMEC), where the plurality of pieces of virtual local area network information are pieces of virtual local area network information of a plurality of virtual machines to which the MAC address belongs. Therefore, the virtual local area network information and the MAC address of a plurality of virtual machines with the same MAC address under different virtual local area networks are carried by one MAC/IP Advertisement route.

Note that, in the embodiments of the present application, the EVPN NLRI attribute is described only by taking table 1 as an example, and table 1 does not limit the embodiments of the present application uniquely. For example, the number of pieces of virtual local area network information actually carried in the MAC/IP Advertisement route may be any, and the attribute field included in each piece of virtual local area network information may also be determined as needed.

In a second possible manner, the Route Target in the routing information may exist in an extended community (extended communities) attribute in the BGP Update message, and other information besides the Route Target in the routing information may exist in an EVPN NLRI attribute. For example, the fields contained in the BGP Update message may be as shown in table 2 below:

TABLE 2

As can be seen from table 2, the BGP Update message may include one MAC address and a plurality of pieces of virtual local area network information (i.e., virtual private network tags, Route Target, VLAN tag, and MMEC), where the plurality of pieces of virtual local area network information are pieces of virtual local area network information of a plurality of virtual machines to which the MAC address belongs. Therefore, one BGP Update message carries the virtual local area network information and the MAC address of a plurality of virtual machines with the same MAC address under different virtual local area networks.

It should be noted that, in the embodiment of the present application, the BGP Update message is described only by taking the above table 2 as an example, and the above table 2 does not only limit the embodiment of the present application.

203: the second network equipment receives the first route sent by the first network equipment.

The first route includes the aforementioned route information, referred to herein as first route information. That is, the first routing information includes the MAC address, the first virtual local area network information, and the second virtual local area network information. The MAC address is an MAC address of a first virtual machine and an MAC address of a second virtual machine connected to the first network device, the first virtual local area network information is information of the first virtual machine, and the second virtual local area network information is information of the second virtual machine.

Further, after receiving the first route sent by the first network device, the second network device may also perform route reflection, that is, may send the first route to the third network device, so that the third network device may perform virtual machine route learning accordingly. In the embodiment of the present application, since the number of routes required to be sent by the first network device is reduced, the number of routes required to be reflected by the second network device is correspondingly reduced, thereby further reducing the number of routes in the network.

204: the second network device stores the first routing information.

It should be noted that, after the first network device sends the first route, the second network device that receives the first route may perform virtual machine route learning accordingly, that is, may store the first route information in the first route.

In particular, the second network device may store the first routing information in a local route. The local route includes a MAC address advertised by the first network device through the first route, first virtual local area network information of the first virtual machine having the MAC address, and second virtual local area network information of the second virtual machine.

In a possible case, if the second network device does not store the route including the MAC address when receiving the first route, the second network device may generate and store the local route including the first route information when receiving the first route.

In another possible case, the second network device already receives a third route sent by the first network device before receiving the first route, where the third route includes the second route information, and the second route information includes the MAC address and the second vlan information, but does not include the first vlan information, and at this time, the second network device adds the second route information to the second route. Then, when the second network device receives the first route, it finds that the local route advertised by the first network device and including the MAC address is already stored locally, and then the local route may be updated according to the received first route, at this time, the second network device updates the second route information in the local route to the first route information, specifically, for example, the second route information may be completely replaced with the first route information, or different parts of the local route information may be partially updated by comparing the first route information and the second route information, for example, the updating is implemented by adding the first virtual local area network information in the local route.

In this way, for a plurality of virtual machines in the same network device, which are in different virtual local area networks but have the same MAC address, only one route needs to be stored to record the MAC address and the virtual local area network information of the plurality of virtual machines, so that the number of routes that need to be stored can be reduced.

If the attribute value of the MMEC attribute of the first virtual machine included in the first routing information is the first attribute value, the second network device may connect with the second network device according to the first virtual machine, generate a fourth route, and send the fourth route to the first network device, where the fourth route includes the MAC address and the third virtual local area network information of the first virtual machine. The third vlan information includes an attribute value of the MMEC attribute of the first virtual machine, which is a second attribute value, where the second attribute value is determined according to the first attribute value, and the second attribute value may be greater than the first attribute value, so as to indicate that the first virtual machine is migrated.

It should be noted that, when the first virtual machine is connected to the second network device, it is described that the first virtual machine is migrated from the first network device to the second network device. Therefore, the second network device may update the attribute value of the MMEC attribute corresponding to the first virtual machine, and specifically, may increase the attribute value of the MMEC attribute of the first virtual machine, that is, 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 may notify the MAC address of the first virtual machine and third virtual local area network information including the second attribute value, where the third virtual local area network information may be carried in a fourth route sent by the second network device to the first network device.

The second network device may also locally store a sixth route that includes the third virtual local area network information. In one case, before the first virtual machine comes online on the second network device, the second network device has discovered that another one or more virtual machines having the same MAC address as the first virtual machine come online and stores the virtual local area network information of the other one or more virtual machines in the sixth route, and then the second network device may update the sixth route by adding the third virtual local area network information when the first virtual machine comes online. In another case, before the first virtual machine comes online on the second network device, the second network device does not load other virtual machines having the MAC address of the first virtual machine, and when the first virtual machine comes online, the second network device locally generates a sixth route and stores the sixth route. In other cases, the sixth route may delete the vlan information of one or more other virtual machines, which may be, for example, virtual machines that were offloaded within a preset time period after the first virtual machine was online, while adding the third vlan information.

In this embodiment of the present application, a first network device obtains a MAC address of a first virtual machine. Then, under the condition that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine and the virtual local area network where the second virtual machine is located is different from the first virtual machine, the first network device obtains a first route, where the first route includes routing information, and the routing information 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. Finally, the first network device sends the first route to the second network device so that the second network device can store the route information. Therefore, for a plurality of virtual machines which are in different virtual local area networks and have the same MAC address, the MAC address and the virtual local area network information of each virtual machine in the plurality of virtual machines can be announced by using one route, namely, the same MAC address under different virtual local area networks can be converged to one route, so that the number of routes in the network can be reduced, and the route transmission performance and the route convergence performance are improved.

For ease of understanding, the MAC address sending method is described below with reference to the network system and the application scenario of different stages shown in fig. 3.

Scene 1 virtual machine online:

virtual machine 1 and virtual machine 2 are simultaneously online at network device 1. When the network device 1 obtains the MAC address of the virtual machine 1 and the MAC address of the virtual machine 2, it is found that the MAC address of the virtual machine 1 is the same as the MAC address of the virtual machine 2, and the virtual lans where the virtual machine 1 and the virtual machine 2 are located are different, the network device 1 generates a route for notifying the MAC address, where the route includes route information, and the route information includes the MAC address, the virtual lan information of the virtual machine 1, and the virtual lan information of the virtual machine 2. Network device 1 takes this route to network device 2 and stores the local route including this route information.

After receiving the route sent by the network device 1, the network device 2 may perform operations such as route reflection, and send the route to other network devices. Meanwhile, the network device 2 may store a local route including route information in the route, the local route corresponding to the network device 1.

Scene 2 adds virtual machines:

after network device 1 sends the route to network device 2, virtual machine 5 is online on network device 1. When the network device 1 obtains the MAC address of the virtual machine 5, and finds that the MAC address of the virtual machine 5 is the same as both the MAC address of the virtual machine 1 and the MAC address of the virtual machine 2, the network device 1 updates the route, and the route information in the updated route includes the MAC address, the virtual local area network information of the virtual machine 1, the virtual local area network information of the virtual machine 2, and the virtual local area network information of the virtual machine 5. The network device 1 takes the updated route to the network device 2 and adds the virtual local area network information of the virtual machine 5 to the previously stored local route.

After receiving the updated route sent by the network device 1, the network device 2 may perform route reflection, that is, send the updated route to other network devices. Meanwhile, the network device 2 may add the virtual local area network information of the virtual machine 5 in the previously stored local route.

Scenario 3 virtual machine migration:

the virtual machine 1 is migrated from the network device 1 to the network device 2. The virtual machine 1 is offline from the network device 1, and after the network device 2 is online again, the network device 2 obtains the MAC address of the virtual machine 1 and the virtual local area network information of the virtual machine 1. The network device 2 discovers that the MAC address advertised by the first network device and the virtual local area network information of the virtual machine 1 are included in the previously stored local route. In this case, the network device 2 deletes the virtual local area network information of the 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 the virtual machine 1. Then, the network device 2 newly generates a local route including the MAC address and the virtual local area network information of the virtual machine 1, and the newly generated local route corresponds to the network device 2. Meanwhile, the network device 2 generates a route for notifying the MAC address, which includes the MAC address and the virtual lan information of the virtual machine 1, and transmits the route to the network device 1.

After receiving the route sent by the network device 2, the network device 1 finds that the MAC address advertised by the route is the same as the MAC address included in the local route thereof, and finds that the attribute value of the MMEC attribute of the virtual machine 1 included in the route is greater than the attribute value of the MMEC attribute of the virtual machine 1 stored in the local route (the route corresponding to the network device 1), then the network device 1 deletes the virtual local area network information of the virtual machine 1 in the local route, and generates a local route (the route corresponding to the network device 2) including the MAC address and the virtual local area network information of the virtual machine 1 in the route.

Fig. 4 is a schematic structural diagram of a network device according to an embodiment of the present application. The network device may be the network device shown in fig. 1, or may be the first network device described in the foregoing fig. 2 embodiment, or may also be the second network device described in the fig. 2 embodiment, or may also be the network device 1 or the network device 2 shown in fig. 3. Referring to fig. 4, the network device may include at least one processor 401 and at least one communication interface 404. The network device may also include a communication bus 402, a memory 403.

The processor 401 may be a microprocessor (including a Central Processing Unit (CPU), etc.), an application-specific integrated circuit (ASIC), or may be one or more integrated circuits for controlling the execution of programs according to the present disclosure.

The communication interface 404 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.

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 disc, a laser disk, a digital versatile disk, a blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 403 may be separate and coupled to the processor 401 through a communication bus 402. The memory 403 may also be integrated with the processor 401.

Communication bus 402 may include a path for communicating information between the above components.

In particular implementations, processor 401 may include one or more CPUs such as CPU0 and CPU1 shown in fig. 4 as an example.

In particular implementations, the network device may include multiple processors, such as processor 401 and processor 405 shown in fig. 4, for one embodiment. 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 for processing data (e.g., computer program instructions).

In a specific implementation, the network device may further include an output device 406 and an input device 407, as an embodiment. An output device 406, which is in communication with the processor 401, may display information in a variety of 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 (projector), or the like. The input device 407 is in communication with the processor 401 and may receive user input in a variety of ways. For example, the input device 407 may be a mouse, a keyboard, a touch screen device, a sensing device, or the like.

The network device may be, for example, a router, a switch, a PE device, a network server, a switch, or a desktop, or may also be other types of communication devices or embedded devices, and the type of the network device is not particularly limited in the embodiments of the present application.

When the network device comprises a memory 403, the memory 403 is used for storing program code 410 for executing the scheme of the application, and the processor 401 is used for executing the program code 410 stored in the memory 403. The network device may implement the operations performed by the first network device or the second network device by the MAC address sending method provided in the embodiment of fig. 2 through the processor 401 and the program code 410 in the memory 403. In other implementation forms, a memory may also exist independently from the network device, and the network device may call the program code stored in the memory when running, so as to implement the operation performed by the first network device or the second network device in the MAC address sending method shown in fig. 2.

Fig. 5 is a schematic structural diagram of a MAC address sending apparatus according to an embodiment of the present application, where the apparatus may be implemented by software, hardware, or a combination of the two as part or all of a network device, and the network device may be the network device shown in fig. 4. Referring to fig. 5, the apparatus 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 a plurality of virtual machines, and the plurality of virtual machines include a first virtual machine and a second virtual machine, and the apparatus includes:

a first obtaining module 501, configured to obtain an MAC address of a first virtual machine;

a second obtaining module 502, configured to obtain a first route under the condition that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine and the virtual local area network where the second virtual machine is located is different from the first virtual machine, where the first route includes routing information, and the routing information 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;

a sending module 503, configured to send the first route to the second network device.

Optionally, the apparatus further comprises:

and the first storage module is used for storing a second route, and the second route comprises route information.

Optionally, the sending module 503 is further configured to:

sending a third route to the second network device, wherein the third route comprises the MAC address and the second virtual local area network information but does not comprise the first virtual local area network information;

the second obtaining module 502 is configured to:

and updating the third route to obtain the first route.

Optionally, the first vlan information comprises a vpn tag.

Alternatively,

if the first network device is located in a VXLAN based on EVPN, the virtual private network tag comprises a VNI; alternatively, the first and second electrodes may be,

if the first network device is located in the SR network or the SRv6 network, the vpn label includes a SID; alternatively, the first and second electrodes may be,

if the first network device is located in an MPLS network, the virtual private network label includes an MPLS label.

Optionally, the first virtual local area network information further includes any one or more of a route destination attribute, a virtual local area network tag, and a MAC migration extension community attribute.

Optionally, the attribute value of the attribute of the MAC migration extended community included in the first virtual local area network information is a first attribute value, and the apparatus further includes:

the receiving module is used for receiving a fourth route, the fourth route comprises an MAC address and third virtual local area network information of the first virtual machine, and an attribute value of an attribute of an MAC migration expansion community of the first virtual machine, which is included in the third virtual local area network information, is a second attribute value;

the updating module is used for deleting the first virtual local area network information in the second route under the condition that the first attribute value is smaller than the second attribute value;

the second storage module is further configured to store a fifth route, where the fifth route includes the MAC address and the third vlan information.

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

In this embodiment of the present application, a first network device obtains a MAC address of a first virtual machine. Then, under the condition that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine and the virtual local area network where the second virtual machine is located is different from the first virtual machine, the first network device obtains a first route, where the first route includes routing information, and the routing information 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. Finally, the first network device sends the first route to the second network device so that the second network device can store the route information. Therefore, for a plurality of virtual machines which are in different virtual local area networks and have the same MAC address, the MAC address and the virtual local area network information of each virtual machine in the plurality of virtual machines can be announced by using one route, namely, the same MAC address under different virtual local area networks can be converged to one route, so that the number of routes in the network can be reduced, and the route transmission performance and the route convergence performance are improved.

Fig. 6 is a schematic structural diagram of a MAC address sending apparatus according to an embodiment of the present application, where the apparatus may be implemented by software, hardware, or a combination of the two as part or all of a network device, and the network device may be the network device shown in fig. 4. Referring to fig. 6, the apparatus may be located at the second network device shown in fig. 2 or the network device 2 shown in fig. 3. The second network equipment and the first network equipment are both located in the network system, the first network equipment is connected with a plurality of virtual machines, the plurality of virtual machines comprise a first virtual machine and a second virtual machine, and the device comprises:

a receiving module 601, configured to receive a first route sent by a first network device, where the first route includes first route information, the first route information includes an MAC address, first virtual local area network information, and second virtual local area network information, the MAC address is an MAC address of a first virtual machine and a second virtual machine connected to the first network device, the first virtual local area network information is information of the first virtual machine, and the second virtual local area network information is information of the second virtual machine;

the storage module 602 is configured to store the first routing information.

Optionally, the storage module 602 is configured to:

the first routing information is stored in the second route.

Optionally, the apparatus further comprises an adding module;

the receiving module 601 is further configured to receive a third route sent by the first network device before receiving the first route, where the third route includes second route information, and the second route information includes a MAC address and second virtual local area network information, and does not include the first virtual local area network information; an adding module for adding the second route information to the second route;

the storage module 602 is configured to:

and the second network equipment updates the second routing information in the second route into the first routing information.

Optionally, the first vlan information comprises a vpn tag.

Alternatively,

if the first network device is located in a VXLAN based on EVPN, the virtual private network tag comprises a VNI; alternatively, the first and second electrodes may be,

if the first network device is located in the SR network or the SRv6 network, the vpn label includes a SID; alternatively, the first and second electrodes may be,

if the first network device is located in an MPLS network, the virtual private network label includes an MPLS label.

Optionally, the first virtual local area network information further includes any one or more of a routing destination attribute, a virtual local area network tag, and a MAC migration extension community.

Optionally, the attribute value of the MAC migration extended community attribute of the first virtual machine included in the first routing information is a first attribute value, and the apparatus further includes:

a sending module, configured to send a fourth route to the first network device according to connection between the first virtual machine and the second network device, where the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, an attribute value of the MMEC of the first virtual machine 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.

Optionally, the apparatus further comprises:

and the sending module is used for sending the first route to the third network equipment.

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

In this embodiment of the application, the second network device receives a first route sent by the first network device, where the first route includes first route information, the first route information includes a MAC address, first virtual local area network information, and second virtual local area network information, the MAC address is a MAC address of a first virtual machine and a second virtual machine connected to the first network device, the first virtual local area network information is information of the first virtual machine, and the second virtual local area network information is information of the second virtual machine. Thereafter, the second network device stores the first routing information. Therefore, for a plurality of virtual machines which are in different virtual local area networks and have the same MAC address, the MAC address and the virtual local area network information of each virtual machine in the plurality of virtual machines can be announced by using one route, namely, the same MAC address under different virtual local area networks can be converged to one route, so that the number of routes in the network can be reduced, and the route transmission performance and the route convergence performance are improved.

It should be noted that: in the MAC address transmitting apparatus provided in the above embodiment, when transmitting a MAC address, only the division of the above functional modules is taken as an example, and in practical applications, the above function allocation may be completed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to complete all or part of the above described functions. In addition, the MAC address sending apparatus provided in the foregoing embodiment and the MAC address sending method embodiment belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiment and are not described herein again.

Fig. 7 is a schematic diagram of a MAC address transceiving system according to an embodiment of the present application. Referring to fig. 7, the system includes a first network device 701 and a second network device 702, where the first network device 701 is connected to a plurality of virtual machines, and the plurality of virtual machines include a first virtual machine and a second virtual machine.

The first network device 701 is configured to obtain an MAC address of a first virtual machine, obtain a first route when the MAC address of the first virtual machine is the same as the MAC address of a second virtual machine and a virtual local area network where the second virtual machine is located is different from the first virtual machine, where the first route includes 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 send the first route to the second network device 702;

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.

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

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

Alternatively,

the first network device 701 is further configured to send a third route to the second network device 702, where the third route includes second routing information, and the second routing information includes the MAC address and second virtual local area network information, but does not include the first virtual local area network information; in this way, the first network device 701 is configured to update the third route to obtain the first route;

the second network device 702 is further configured to receive a 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 routing information in the sixth route to the first routing information.

Optionally, the first vlan information comprises a vpn tag. Illustratively, if the first network device 701 is located in an EVPN-based VXLAN, the virtual private network tag comprises a VNI; alternatively, if the first network device 701 is located in the SR network or the SRv6 network, the vpn label includes a SID; alternatively, if the first network device 701 is located in an MPLS network, the virtual private network label includes an MPLS label.

Optionally, the first virtual local area network information further includes any one or more of a route destination attribute, a virtual local area network tag, and a MAC migration extension community attribute.

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

Optionally, an attribute value of the attribute of the MAC migration extension community included in the first virtual local area network information is a first attribute value;

the second network device 702 is further configured to generate a fourth route according to connection between the first virtual machine and the second network device 702, where the fourth route includes the MAC address and third virtual local area network information of the first virtual machine, an attribute value of a MAC migration extended community attribute of the first virtual machine 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; sending the fourth route to the first network device 701;

the first network device 701 is further configured to receive a fourth route, delete the first vlan information in the second route and store a fifth route when the first attribute value is smaller than the second attribute value, where the fifth route includes the MAC address and the third vlan information.

Optionally, the second network device 702 is further configured to send the first route to a third network device.

In this embodiment of the present application, a first network device first obtains a MAC address of a first virtual machine. Then, under the condition that the MAC address of the first virtual machine is the same as the MAC address of the second virtual machine and the virtual local area network where the second virtual machine is located is different from the first virtual machine, the first network device acquires a first route, wherein the first route comprises first route information, and the first route information comprises 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. The first network device then 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 in different virtual local area networks but with the same MAC address, the first network device may use one route to advertise the MAC address and the virtual local area network information of each of the multiple virtual machines, that is, information of multiple virtual machines belonging to the first network device, having the same MAC address but belonging to different virtual local area networks, may be aggregated into one route, so that the number of routes used for advertising the MAC address of the virtual machine in the network may be reduced, and the routing transmission performance and the routing convergence performance may be improved.

In the above embodiments, the implementation may be wholly or partly realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

The above-mentioned embodiments are provided not to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

31页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种LED灯用自适应局域网地址分配方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类