CN111934969B - Maintenance method and device of MAC forwarding table - Google Patents

Maintenance method and device of MAC forwarding table Download PDF

Info

Publication number
CN111934969B
CN111934969B CN202010739402.9A CN202010739402A CN111934969B CN 111934969 B CN111934969 B CN 111934969B CN 202010739402 A CN202010739402 A CN 202010739402A CN 111934969 B CN111934969 B CN 111934969B
Authority
CN
China
Prior art keywords
virtual machine
mac address
information table
machine information
entry
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010739402.9A
Other languages
Chinese (zh)
Other versions
CN111934969A (en
Inventor
陈小龙
郑金珠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN202010739402.9A priority Critical patent/CN111934969B/en
Publication of CN111934969A publication Critical patent/CN111934969A/en
Application granted granted Critical
Publication of CN111934969B publication Critical patent/CN111934969B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • H04L12/4675Dynamic sharing of VLAN information amongst network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for maintaining an MAC forwarding table, wherein the method comprises the following steps: searching a source MAC address carried by a message from a virtual machine in a self-stored whole-network virtual machine information table; if the source MAC address is found in the whole network virtual machine information table, the destination MAC address of the message is found in an MAC forwarding table; if the destination MAC address is not found in the MAC forwarding table, finding a first unique index identifier corresponding to the destination MAC address in the full-network virtual machine information table; searching a first table item corresponding to the first unique index identifier in the MAC forwarding table; and after the target MAC address replaces the MAC address in the first table entry, forwarding the message according to the first table entry. The scheme can ensure that the message is normally forwarded at this time and subsequently, and further can ensure the user experience.

Description

Maintenance method and device of MAC forwarding table
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for maintaining a Media Access Control (MAC) forwarding table.
Background
A Virtual eXtensible Local Area Network (VXLAN) is an Overlay Network technology established on an Internet Protocol (IP) Network, and is encapsulated by using a method of using a MAC over User Datagram Protocol (UDP), that is, a common ethernet packet is encapsulated in a UDP packet, and the common ethernet packet is transmitted as UDP data.
Fig. 1 shows an architecture diagram of VXLAN, which includes a terminal (e.g., a virtual machine, a server, etc.), an intra-domain local network device (e.g., a network device inside Site (Site) a), a virtual extensible local area network Tunnel endpoint (VXLAN Tunnel End Point, VTEP), and an IP network. The VTEP is an edge device of VXLAN, is connected with a physical network, is distributed with an IP address of the physical network, and is used for encapsulating and decapsulating VXLAN messages, tunnels are established between the VTEPs on the IP network, and the tunnels realize the transmission service that the VXLAN messages pass through the IP network.
VXLAN uses VXLAN Network Identifier (VNI) as a unique Identifier, one VXLAN Network segment sets one VNI, terminals in VXLAN of the same VNI belong to one broadcast domain, terminals in VXLAN of different VNIs cannot communicate directly, and communication needs to be achieved through a gateway. That is, there is only one broadcast domain within a VXLAN network segment. However, in practical applications, since the actual needs of the user may not occupy one VXLAN network segment or divide virtual machines in the same VXLAN network segment into different broadcast domains, it is necessary to set a plurality of isolated broadcast domains in one VXLAN network segment.
Generally, each VTEP may be directly or indirectly connected to a plurality of virtual machines, sometimes a virtual machine may be migrated from one VTEP to another VTEP for service needs, and in order to ensure that the service is not interrupted during the migration of the virtual machine, it is required that MAC forwarding entries corresponding to the virtual machines are not changed before and after the migration. In the actual application process, because the MAC forwarding entries are processed in a covering manner, when a plurality of virtual machines are migrated, the MAC addresses of some MAC forwarding entries may be covered, and at this time, if a message forwarded based on the MAC forwarding entries is received, the MAC forwarding entries can only be learned again, so that a cutoff is generated, and the user experience is greatly influenced.
Disclosure of Invention
The embodiment of the invention provides a method and a device for maintaining an MAC forwarding table, which are used for solving the problem that the user experience is greatly influenced by the generation of flow break in the prior art.
According to the embodiment of the invention, the maintenance method of the MAC forwarding table is provided and is applied to VTEP, and the method comprises the following steps:
searching a source MAC address carried by a message from a virtual machine in a self-stored whole-network virtual machine information table;
if the source MAC address is found in the whole network virtual machine information table, the destination MAC address of the message is found in an MAC forwarding table;
if the destination MAC address is not found in the MAC forwarding table, finding a first unique index identifier corresponding to the destination MAC address in the full-network virtual machine information table;
searching a first table item corresponding to the first unique index identifier in the MAC forwarding table;
and after the target MAC address replaces the MAC address in the first table entry, forwarding the message according to the first table entry.
Optionally, the method further includes:
if the source MAC address is not found in the full-network virtual machine information table, allocating a second unique index identifier to the source MAC address;
adding a second table entry in the full-network virtual machine information table and the first local virtual machine information table, wherein the second table entry comprises the second unique index identifier and the source MAC address;
and broadcasting the message.
Optionally, the method further includes:
synchronizing the first local virtual machine information table to other VTEPs establishing a VXLAN tunnel with the VTEP according to a set period, so that the other VTEPs replace the table items corresponding to the unique index identifier included in the first local virtual machine information table in the whole network virtual machine information table stored by the other VTEPs with the table items of the first local virtual machine information table; alternatively, the first and second electrodes may be,
and if a second local virtual machine information table synchronized by other VTEPs is received, replacing the table entry corresponding to the unique index identifier included in the second local virtual machine information table in the full-network virtual machine information table with the table entry of the second local virtual machine information table.
Optionally, the method further includes:
and if the destination MAC address is found in the MAC forwarding table, forwarding the message according to the first table item of the destination MAC address.
Optionally, after the source MAC address is found in the full-network virtual machine information table, the method further includes:
setting a countdown timer for the source MAC address and starting the countdown timer.
Optionally, the method further includes:
monitoring whether a countdown timer of each MAC address in the information table of the whole network virtual machine returns to zero or not;
and deleting the table entry corresponding to the MAC address of which the countdown timer is reset to zero.
According to the embodiment of the present invention, there is also provided a device for maintaining a MAC forwarding table, which is applied to VTEP, and the device includes:
the first searching module is used for searching a source MAC address carried by a message from the virtual machine in a self-stored whole-network virtual machine information table;
the second searching module is used for searching a destination MAC address of the message in an MAC forwarding table if the source MAC address is searched in the whole network virtual machine information table;
a third searching module, configured to search, if the destination MAC address is not found in the MAC forwarding table, a first unique index identifier corresponding to the destination MAC address in the full-network virtual machine information table;
a fourth searching module, configured to search, in the MAC forwarding table, a first entry corresponding to the first unique index identifier;
and the processing module is used for forwarding the message according to the first table entry after the destination MAC address replaces the MAC address in the first table entry.
Optionally, the method further includes:
the allocation module is used for allocating a second unique index identifier to the source MAC address if the source MAC address is not found in the whole network virtual machine information table;
an adding module, configured to add a second entry in the full-network virtual machine information table and the first local virtual machine information table, where the second entry includes the second unique index identifier and the source MAC address;
and the broadcasting module is used for broadcasting the message.
Optionally, the method further includes:
a synchronization module, configured to synchronize the first local virtual machine information table with other VTEPs that establish a VXLAN tunnel with the VTEP in a set period, so that the other VTEPs replace, in the full-network virtual machine information table stored by the other VTEPs, an entry corresponding to a unique index identifier included in the first local virtual machine information table with an entry of the first local virtual machine information table; alternatively, the first and second electrodes may be,
and a replacing module, configured to replace, if the second local virtual machine information table synchronized with the other VTEP is received, a table entry in the full-network virtual machine information table corresponding to the unique index identifier included in the second local virtual machine information table with a table entry in the second local virtual machine information table.
Optionally, the processing module is further configured to:
and if the destination MAC address is found in the MAC forwarding table, forwarding the message according to the first table item of the destination MAC address.
Optionally, the system further comprises a setting module, configured to:
and after the second searching module searches the source MAC address in the information table of the whole network virtual machine, setting a countdown timer for the source MAC address, and starting the countdown timer.
Optionally, the method further includes:
the monitoring module is used for monitoring whether the countdown timer of each MAC address in the information table of the whole network virtual machine returns to zero or not;
and the deleting module is used for deleting the table entry corresponding to the MAC address of the countdown timer which returns to zero.
According to the embodiment of the invention, the electronic equipment comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor for implementing the above method steps when executing the program stored in the memory.
According to an embodiment of the present invention, there is also provided a computer-readable storage medium having stored therein a computer program, which when executed by a processor, performs the above-mentioned method steps.
The invention has the following beneficial effects:
the embodiment of the invention provides a method and a device for maintaining an MAC forwarding table, which are characterized in that a source MAC address carried by a message from a virtual machine is searched in a self-stored information table of a full-network virtual machine; if the source MAC address is found in the whole network virtual machine information table, the destination MAC address of the message is found in an MAC forwarding table; if the destination MAC address is not found in the MAC forwarding table, finding a first unique index identifier corresponding to the destination MAC address in the full-network virtual machine information table; searching a first table item corresponding to the first unique index identifier in the MAC forwarding table; and after the target MAC address replaces the MAC address in the first table entry, forwarding the message according to the first table entry. In the scheme, a whole-network virtual machine information table can be established, the whole-network virtual machine information table comprises the MAC address of each virtual machine and the unique index identifier corresponding to the MAC address, if the destination MAC address of the message is not found in the MAC forwarding table, the unique index identifier corresponding to the destination MAC address can be found in the whole-network virtual machine information table, then the table entry corresponding to the unique index identifier is found in the MAC forwarding table, the destination MAC address replaces the MAC address in the table entry, so that the table entry corresponding to the destination MAC address can be repaired, finally, the message is forwarded according to the table entry, even if the MAC address in the MAC forwarding table is covered, the MAC address can be repaired, so that the MAC forwarding table entry is ensured to be correct, the message can be normally forwarded at this time and subsequently, and further user experience can be ensured.
Drawings
Fig. 1 is a schematic diagram of the architecture of VXLAN in the prior art;
FIG. 2 is a flowchart of a method for maintaining a MAC forwarding table according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device for maintaining a MAC forwarding table according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device shown in the present application.
Detailed Description
Aiming at the problem that the user experience is greatly influenced by the generation of flow break in the prior art, the embodiment of the invention provides a maintenance method of an MAC forwarding table, which is applied to VTEP, the flow of the method is shown in figure 2, and the execution steps are as follows:
s21: and searching a source MAC address carried by the message from the virtual machine in a self-stored whole-network virtual machine information table.
S22: and if the source MAC address is found in the information table of the full-network virtual machine, the destination MAC address of the message is found in the MAC forwarding table.
If the source MAC address is found in the full-network virtual machine information table, it indicates that the source MAC address has been learned before, and the destination MAC address of the packet can be further found in the MAC forwarding table.
S23: and if the destination MAC address is not found in the MAC forwarding table, finding a first unique index identifier corresponding to the destination MAC address in the whole network virtual machine information table.
And if the destination MAC address is found in the MAC forwarding table, forwarding the message according to the first table item of the destination MAC address.
If the destination MAC address is not found in the MAC forwarding table, the message carries the destination MAC address, which indicates that the virtual machine sending the message has already obtained the MAC address of the destination virtual machine, that is, the VTEP has learned the MAC forwarding table entry corresponding to the destination MAC address before, but the destination MAC address is not found in the MAC forwarding table, which indicates that the destination MAC address in the MAC forwarding table may be covered due to virtual machine migration and the like.
S24: and searching a first table item corresponding to the first unique index identification in the MAC forwarding table.
Since VTEP has learned the destination MAC address before, there must be an entry corresponding to the destination MAC address in the MAC forwarding entry, and thus there must be an entry corresponding to the first unique index identifier, which may be defined as the first entry.
S25: and after replacing the MAC address in the first table entry with the destination MAC address, forwarding the message according to the first table entry.
Because the MAC address in the first entry is covered, the destination MAC address can be substituted for the MAC address in the first entry, so that the first entry is repaired, and then the packet is forwarded according to the first entry.
In the scheme, a whole-network virtual machine information table can be established, the whole-network virtual machine information table comprises the MAC address of each virtual machine and the unique index identifier corresponding to the MAC address, if the destination MAC address of the message is not found in the MAC forwarding table, the unique index identifier corresponding to the destination MAC address can be found in the whole-network virtual machine information table, then the table entry corresponding to the unique index identifier is found in the MAC forwarding table, the destination MAC address replaces the MAC address in the table entry, so that the table entry corresponding to the destination MAC address can be repaired, finally, the message is forwarded according to the table entry, even if the MAC address in the MAC forwarding table is covered, the MAC address can be repaired, so that the MAC forwarding table entry is ensured to be correct, the message can be normally forwarded at this time and subsequently, and further user experience can be ensured.
Optionally, the method further includes:
if the source MAC address is not found in the full-network virtual machine information table, allocating a second unique index identifier for the source MAC address;
adding a second table item in the full-network virtual machine information table and the first local virtual machine information table, wherein the second table item comprises a second unique index identifier and a source MAC address;
and broadcasting the message.
If the source MAC address is not found in the information table of the full-network virtual machine, the source MAC address is not learned before, the virtual machine corresponding to the source MAC address may be newly created or migrated, may assign a unique index identifier to the source MAC address, the unique index identifier can be defined as a second unique index identifier, the second unique index identifier is different from all unique index identifiers included in the full-network virtual machine information table, the VTEP can also set a local virtual machine information table, the native virtual machine information table may be defined as a first virtual machine information table, and then an entry including a second unique index identification and a source MAC address is added to the full network virtual machine information table and the first native virtual machine information table, the entry may be defined as a second entry, and since the source MAC address has not been learned before, the message is an addressing message, and thus the message may be broadcast to learn the MAC address of the destination virtual machine.
Optionally, the method further includes:
synchronizing the first local virtual machine information table to other VTEPs establishing a VXLAN tunnel with the VTEP according to a set period so that the other VTEPs replace the table items corresponding to the unique index identifier included in the first local virtual machine information table in the whole network virtual machine information table stored by the other VTEPs with the table items of the first local virtual machine information table; alternatively, the first and second electrodes may be,
and if a second local virtual machine information table synchronized by other VTEPs is received, replacing the table entry corresponding to the unique index identifier included in the second local virtual machine information table in the full-network virtual machine information table with the table entry of the second local virtual machine information table.
In order to ensure that other VTEPs establishing a VXLAN tunnel with the VTEP acquire a correct whole network virtual machine information table, the first local machine virtual machine information table can be synchronized to other VTEPs, and after the other VTEPs receive the first local machine virtual machine information table, the own whole network virtual machine information table can be updated based on the first local machine virtual machine information table; meanwhile, the VTEP may also receive a local virtual machine information table synchronized with other VTEPs, where the local virtual machine information table may be defined as a second local virtual machine information table, and the VTEP may update its own network-wide virtual machine information table based on the second local virtual machine information table.
When synchronizing the local virtual machine information table, the synchronization may be performed based on an Update (Update) message in a Border Gateway Protocol (BGP), and specifically, the local virtual machine information table may be carried in an extended community field in an Update message.
Optionally, after finding the source MAC address in the full-network virtual machine information table, the method further includes:
a countdown timer is set for the source MAC address and started.
Correspondingly, the method further comprises the following steps:
monitoring whether a countdown timer of each MAC address in the information table of the whole network virtual machine returns to zero or not;
and deleting the table entry corresponding to the MAC address of which the countdown timer is reset to zero.
After the source MAC address is found in the whole network virtual machine information table, a countdown timer can be set for the source MAC address each time, whether the countdown timer of each MAC address in the whole network virtual machine information table returns to zero or not is monitored, and the table entry corresponding to the MAC address with the countdown timer returning to zero is deleted, so that the table entries in the whole network virtual machine information table can be aged regularly, effective table entries are guaranteed to be stored in the whole network virtual machine information table, and hardware resources of VTEP are saved.
Based on the same inventive concept, an embodiment of the present invention provides a device for maintaining a MAC forwarding table, which is applied in VTEP, and the structure of the device is shown in fig. 3, and includes:
the first searching module 31 is configured to search a source MAC address carried by a packet from a virtual machine in a full-network virtual machine information table stored in the first searching module;
the second searching module 32 is configured to search a destination MAC address of the packet in the MAC forwarding table if the source MAC address is found in the full-network virtual machine information table;
a third searching module 33, configured to search, if the destination MAC address is not found in the MAC forwarding table, a first unique index identifier corresponding to the destination MAC address in the full-network virtual machine information table;
a fourth searching module 34, configured to search a first table entry corresponding to the first unique index identifier in the MAC forwarding table;
the processing module 35 is configured to forward the packet according to the first table entry after replacing the MAC address in the first table entry with the destination MAC address.
In the scheme, a whole-network virtual machine information table can be established, the whole-network virtual machine information table comprises the MAC address of each virtual machine and the unique index identifier corresponding to the MAC address, if the destination MAC address of the message is not found in the MAC forwarding table, the unique index identifier corresponding to the destination MAC address can be found in the whole-network virtual machine information table, then the table entry corresponding to the unique index identifier is found in the MAC forwarding table, the destination MAC address replaces the MAC address in the table entry, so that the table entry corresponding to the destination MAC address can be repaired, finally, the message is forwarded according to the table entry, even if the MAC address in the MAC forwarding table is covered, the MAC address can be repaired, so that the MAC forwarding table entry is ensured to be correct, the message can be normally forwarded at this time and subsequently, and further user experience can be ensured.
Optionally, the apparatus further comprises:
the distribution module is used for distributing a second unique index identifier for the source MAC address if the source MAC address is not found in the whole network virtual machine information table;
the adding module is used for adding a second table item in the full-network virtual machine information table and the first local virtual machine information table, wherein the second table item comprises a second unique index identifier and a source MAC address;
and the broadcast module is used for broadcasting the message.
Optionally, the apparatus further comprises:
the synchronization module is used for synchronizing the first local virtual machine information table with other VTEPs establishing a VXLAN tunnel with the VTEP in a set period so that the other VTEPs replace the table items corresponding to the unique index identifier included in the first local virtual machine information table in the whole network virtual machine information table stored by the other VTEPs with the table items of the first local virtual machine information table; alternatively, the first and second electrodes may be,
and the replacing module is used for replacing the table entry corresponding to the unique index identifier included in the second local virtual machine information table in the full-network virtual machine information table with the table entry of the second local virtual machine information table if the second local virtual machine information table synchronized by other VTEPs is received.
Optionally, the processing module is further configured to:
and if the destination MAC address is found in the MAC forwarding table, forwarding the message according to the first table item of the destination MAC address.
Optionally, the system further comprises a setting module, configured to:
and after the second searching module searches the source MAC address in the whole network virtual machine information table, setting a countdown timer for the source MAC address and starting the countdown timer.
Optionally, the apparatus further comprises:
the monitoring module is used for monitoring whether the countdown timer of each MAC address in the information table of the virtual machine in the whole network returns to zero;
and the deleting module is used for deleting the table entry corresponding to the MAC address of the countdown timer which returns to zero.
An electronic device is further provided in the embodiment of the present application, please refer to fig. 4, which includes a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 complete communication with each other through the communication bus 440.
A memory 430 for storing computer programs;
the processor 410 is configured to implement the maintenance method of the MAC forwarding table in any of the above embodiments when executing the program stored in the memory 430.
The communication interface 420 is used for communication between the above-described electronic device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In the scheme, a whole-network virtual machine information table can be established, the whole-network virtual machine information table comprises the MAC address of each virtual machine and the unique index identifier corresponding to the MAC address, if the destination MAC address of the message is not found in the MAC forwarding table, the unique index identifier corresponding to the destination MAC address can be found in the whole-network virtual machine information table, then the table entry corresponding to the unique index identifier is found in the MAC forwarding table, the destination MAC address replaces the MAC address in the table entry, so that the table entry corresponding to the destination MAC address can be repaired, finally, the message is forwarded according to the table entry, even if the MAC address in the MAC forwarding table is covered, the MAC address can be repaired, so that the MAC forwarding table entry is ensured to be correct, the message can be normally forwarded at this time and subsequently, and further user experience can be ensured.
Accordingly, an embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer is caused to execute the method for maintaining a MAC forwarding table in any of the foregoing embodiments.
In the scheme, a whole-network virtual machine information table can be established, the whole-network virtual machine information table comprises the MAC address of each virtual machine and the unique index identifier corresponding to the MAC address, if the destination MAC address of the message is not found in the MAC forwarding table, the unique index identifier corresponding to the destination MAC address can be found in the whole-network virtual machine information table, then the table entry corresponding to the unique index identifier is found in the MAC forwarding table, the destination MAC address replaces the MAC address in the table entry, so that the table entry corresponding to the destination MAC address can be repaired, finally, the message is forwarded according to the table entry, even if the MAC address in the MAC forwarding table is covered, the MAC address can be repaired, so that the MAC forwarding table entry is ensured to be correct, the message can be normally forwarded at this time and subsequently, and further user experience can be ensured.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While alternative embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following appended claims be interpreted as including alternative embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (14)

1. A maintenance method of a Media Access Control (MAC) forwarding table is applied to a virtual extensible local area network (VTEP) terminal, and is characterized by comprising the following steps:
searching a source Media Access Control (MAC) address carried by a message from a virtual machine in a self-stored whole-network virtual machine information table;
if the source MAC address is found in the whole network virtual machine information table, the destination MAC address of the message is found in an MAC forwarding table;
if the destination MAC address is not found in the MAC forwarding table, finding a first unique index identifier corresponding to the destination MAC address in the full-network virtual machine information table;
searching a first table item corresponding to the first unique index identifier in the MAC forwarding table;
and after the target MAC address replaces the MAC address in the first table entry, forwarding the message according to the first table entry.
2. The method of claim 1, further comprising:
if the source MAC address is not found in the full-network virtual machine information table, allocating a second unique index identifier to the source MAC address;
adding a second table entry in the full-network virtual machine information table and the first local virtual machine information table, wherein the second table entry comprises the second unique index identifier and the source MAC address;
and broadcasting the message.
3. The method of claim 2, further comprising:
synchronizing the first local virtual machine information table to other VTEPs establishing a virtual extensible local area network VXLAN tunnel with the VTEP according to a set period, so that the other VTEPs replace the table items corresponding to the unique index identifier included in the first local virtual machine information table in the whole network virtual machine information table stored by the other VTEPs with the table items of the first local virtual machine information table; alternatively, the first and second electrodes may be,
and if a second local virtual machine information table synchronized by other VTEPs is received, replacing the table entry corresponding to the unique index identifier included in the second local virtual machine information table in the full-network virtual machine information table with the table entry of the second local virtual machine information table.
4. The method of claim 1, further comprising:
and if the destination MAC address is found in the MAC forwarding table, forwarding the message according to the first table item of the destination MAC address.
5. The method according to any of claims 1-4, wherein after finding the source MAC address in the full-network virtual machine information table, further comprising:
setting a countdown timer for the source MAC address and starting the countdown timer.
6. The method of claim 5, further comprising:
monitoring whether a countdown timer of each MAC address in the information table of the whole network virtual machine returns to zero or not;
and deleting the table entry corresponding to the MAC address of which the countdown timer is reset to zero.
7. An apparatus for maintaining a MAC forwarding table, applied in a VTEP, the apparatus comprising:
the first searching module is used for searching a source MAC address carried by a message from the virtual machine in a self-stored whole-network virtual machine information table;
the second searching module is used for searching a destination MAC address of the message in an MAC forwarding table if the source MAC address is searched in the whole network virtual machine information table;
a third searching module, configured to search, if the destination MAC address is not found in the MAC forwarding table, a first unique index identifier corresponding to the destination MAC address in the full-network virtual machine information table;
a fourth searching module, configured to search, in the MAC forwarding table, a first entry corresponding to the first unique index identifier;
and the processing module is used for forwarding the message according to the first table entry after the destination MAC address replaces the MAC address in the first table entry.
8. The apparatus of claim 7, further comprising:
the allocation module is used for allocating a second unique index identifier to the source MAC address if the source MAC address is not found in the whole network virtual machine information table;
an adding module, configured to add a second entry in the full-network virtual machine information table and the first local virtual machine information table, where the second entry includes the second unique index identifier and the source MAC address;
and the broadcasting module is used for broadcasting the message.
9. The apparatus of claim 8, further comprising:
a synchronization module, configured to synchronize the first local virtual machine information table with other VTEPs that establish a virtual extensible local area network VXLAN tunnel with the VTEP at a set period, so that the other VTEPs replace, in the full-network virtual machine information table stored by the other VTEPs, an entry corresponding to a unique index identifier included in the first local virtual machine information table with an entry of the first local virtual machine information table; alternatively, the first and second electrodes may be,
and a replacing module, configured to replace, if the second local virtual machine information table synchronized with the other VTEP is received, a table entry in the full-network virtual machine information table corresponding to the unique index identifier included in the second local virtual machine information table with a table entry in the second local virtual machine information table.
10. The apparatus of claim 7, wherein the processing module is further configured to:
and if the destination MAC address is found in the MAC forwarding table, forwarding the message according to the first table item of the destination MAC address.
11. The apparatus of any of claims 7-10, further comprising a setup module to:
and after the second searching module searches the source MAC address in the information table of the whole network virtual machine, setting a countdown timer for the source MAC address, and starting the countdown timer.
12. The apparatus of claim 11, further comprising:
the monitoring module is used for monitoring whether the countdown timer of each MAC address in the information table of the whole network virtual machine returns to zero or not;
and the deleting module is used for deleting the table entry corresponding to the MAC address of the countdown timer which returns to zero.
13. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-6 when executing a program stored on a memory.
14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN202010739402.9A 2020-07-28 2020-07-28 Maintenance method and device of MAC forwarding table Active CN111934969B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010739402.9A CN111934969B (en) 2020-07-28 2020-07-28 Maintenance method and device of MAC forwarding table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010739402.9A CN111934969B (en) 2020-07-28 2020-07-28 Maintenance method and device of MAC forwarding table

Publications (2)

Publication Number Publication Date
CN111934969A CN111934969A (en) 2020-11-13
CN111934969B true CN111934969B (en) 2022-03-18

Family

ID=73315840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010739402.9A Active CN111934969B (en) 2020-07-28 2020-07-28 Maintenance method and device of MAC forwarding table

Country Status (1)

Country Link
CN (1) CN111934969B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113472912B (en) * 2021-06-10 2022-08-26 中国联合网络通信集团有限公司 ARP cache table item updating method, VTEP, VM and device
CN114374641B (en) * 2021-12-23 2023-06-16 锐捷网络股份有限公司 Three-layer message forwarding method and device
CN114520800B (en) * 2022-01-07 2024-04-16 锐捷网络股份有限公司 Method and device for updating MAC address table

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996948A (en) * 2006-12-28 2007-07-11 杭州华为三康技术有限公司 Message forwarding method and device based on the media access control layer
CN107547535A (en) * 2017-08-24 2018-01-05 新华三技术有限公司 The MAC address learning method, apparatus and the network equipment of attack protection
CN107786450A (en) * 2017-10-17 2018-03-09 新华三技术有限公司 A kind of data message transmission method, device and machinable medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9071629B2 (en) * 2011-01-07 2015-06-30 Jeda Networks, Inc. Methods for the interconnection of fibre channel over ethernet devices using shortest path bridging

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996948A (en) * 2006-12-28 2007-07-11 杭州华为三康技术有限公司 Message forwarding method and device based on the media access control layer
CN107547535A (en) * 2017-08-24 2018-01-05 新华三技术有限公司 The MAC address learning method, apparatus and the network equipment of attack protection
CN107786450A (en) * 2017-10-17 2018-03-09 新华三技术有限公司 A kind of data message transmission method, device and machinable medium

Also Published As

Publication number Publication date
CN111934969A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN111934969B (en) Maintenance method and device of MAC forwarding table
CN107547349B (en) Virtual machine migration method and device
US10298538B2 (en) Address resolution
US10771431B2 (en) Synchronizing IP information of virtual machines
US8842577B2 (en) Enabling media access control address mobility in an ethernet virtual private network
US20150195137A1 (en) Virtual group policy based filtering within an overlay network
CN110460684B (en) Broadcast domain isolation method and device for VXLAN (virtual extensible local area network) in same network segment
RU2619206C2 (en) Method for providing name service within industrial communication system and router
CN103974380A (en) Terminal access position keep-alive method and device
US10574570B2 (en) Communication processing method and apparatus
CN106921578B (en) Method and device for generating forwarding table item
CN109412925B (en) Forwarding table item updating method based on VTEP and VTEP
CN109547350B (en) Route learning method and gateway equipment
CN111147382B (en) Message forwarding method and device
CN112511401B (en) Network connection method, device, equipment and medium
CN112866114B (en) Multicast message processing method and device
CN111726429B (en) Communication method, device, equipment and medium
CN103746768A (en) Data packet identification method and equipment thereof
CN104426759A (en) Host machine router acquiring method, host machine router acquiring device, and host machine router acquiring system
CN111800338A (en) Cross-AS EVPN route interaction method and device
US9985926B2 (en) Address acquiring method and network virtualization edge device
CN113132506B (en) Message processing method and device based on super virtual local area network
CN113286011B (en) IP address allocation method and device based on VXLAN
CN107294989B (en) Method and device for preventing ARP gateway spoofing
US11996952B2 (en) Information synchronization method, terminal and information synchronization system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant