A method and system for updating VTEP table entries of Vxlan, and an electronic device
By recording the correspondence between the VM's identifier and token through the token server, the Vxlan network traffic forwarding black hole problem caused by frequent VM migration is solved, ensuring the accuracy of VTEP table updates and normal traffic forwarding.
Patent Information
- Application Number
- CN202310610065.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-05-26
AI Technical Summary
During the frequent VM migration process, the Vxlan network has a traffic forwarding black hole problem. The existing technology cannot effectively avoid the poor traffic forwarding caused by table update errors.
A token server is introduced to record the correspondence between the VM's identifier and the latest token. VTEP verifies the VM's token information to determine the accuracy of the table entry update, ensuring that the table entry update is consistent with the latest status of the VM.
By verifying the VM's token information, the accuracy of VTEP table updates is ensured, avoiding the traffic forwarding black hole problem caused by VM migration and ensuring normal traffic forwarding.
Smart Images

Figure CN116647495B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication, in particular to a Vxlan VTEP table item updating method and system and electronic equipment. BACKGROUND
[0002] Vxlan (Virtual Extensible Local Area Network) is a network virtualization technology that can penetrate three-layer network to expand the second layer. The standard static Vxlan adopts the method of mac (Media Access Control, local area network address) self-learning. When a VM (Virtual machine) is online, it will actively send a free ARP (Address Resolution Protocol) message, which is flooded in a VNI (Vxlan Network Identifier). The VTEP device learns and records the table item information (mac + vni + VTEP) corresponding to the VM through the ARP message. Subsequent data transmission between VMs uses the unicast method, that is, the VTEP connected by the starting address and the VTEP connected by the destination address are used for forwarding, and no flooding is performed.
[0003] However, this table item learning method, when the VM frequently updates, the device receives the message information corresponding to the VM from different VTEPs (Vxlan Tunnel EndPoint, expandable virtual local area network tunnel endpoint), but the order of receiving may be different from the time order of the original message sending. The information received later may be outdated information. If the table item is updated according to the outdated message information, a traffic forwarding black hole phenomenon will occur. At present, after the VM frequently migrates, how to avoid the traffic forwarding black hole is still a problem to be solved. SUMMARY
[0004] One of the purposes of the present application is to provide a Vxlan VTEP table item updating method to solve or at least partially solve the problem of traffic forwarding black hole caused by frequent migration of VM. The second purpose of the present application is to provide a Vxlan VTEP table item updating system, and the third purpose is to provide an electronic device.
[0005] In order to achieve the above-mentioned purposes, the technical scheme of the present application is as follows:
[0006] A Vxlan VTEP table item updating method applied to a token server, the token server being in communication connection with VTEPs under the same VNI, comprising:
[0007] Recording the correspondence between the VM identifier and the latest token of the VM;
[0008] Receive a request message sent by the VTEP, where the request message includes an identifier of the VM and a first token of the VM;
[0009] Determining whether the first token of the VM is consistent with the latest token corresponding to the identifier of the VM recorded locally;
[0010] When the first token of the VM is consistent with the latest token, confirmation information is sent to the VTEP, so that the VTEP updates the table entry according to the confirmation information and forwards data according to the updated table entry.
[0011] Optionally, the token server is in communication with the VM; before receiving the request information sent by the VTEP, the method further includes:
[0012] Receive new token application information sent by the VM, where the new token application information includes an identifier of the VM; the new token application information is sent by the VM before migrating from the first VTEP to the second VTEP, where both the first VTEP and the second VTEP are under the VNI;
[0013] In response to the new token application information, generating a new token corresponding to the identifier of the VM;
[0014] The new token is sent to the VM, so that the VM adds the new token to the message to be sent.
[0015] Optionally, before receiving the new token application information sent by the VM, the method further includes:
[0016] Receive registration information sent by the VM, where the registration information includes an identifier of the VM, and the registration information is sent by the VM before the VTEP under the VNI goes online for the first time;
[0017] In response to the registration information, generating an initial token corresponding to the identifier of the VM;
[0018] The initial token is sent to the VM, so that the VM adds the initial token to a message to be sent.
[0019] A Vxlan VTEP table entry update method is applied to a VTEP under the same VNI, wherein the VTEP is in communication with a token server, comprising:
[0020] receive a first packet sent by a VM, the first packet being sent by the VM when the VM is online under a first VTEP migrating to a second VTEP, the first VTEP and the second VTEP being under a VNI;
[0021] analyze the first packet to obtain an identity of the VM and a first token of the VM;
[0022] send a request message to the token server, the request message including the identity of the VM and the first token;
[0023] receive an acknowledgement message sent by the token server, the acknowledgement message being sent by the token server when the token server confirms that a latest token corresponding to the identity of the VM recorded locally is consistent with the first token;
[0024] update a table entry according to the acknowledgement message in response to the first packet, and forward data according to the updated table entry.
[0025] Optionally, before receiving the first packet sent by the VM, the method further includes:
[0026] receive a second packet sent by the VM;
[0027] analyze the second packet to obtain the identity of the VM and an initial token of the VM;
[0028] update the table entry in response to the second packet, and forward data according to the updated table entry.
[0029] Optionally, after sending the request message to the token server, the method further includes:
[0030] receive a denial message sent by the token server, the denial message being sent by the token server when the token server confirms that the latest token corresponding to the identity of the VM recorded locally is inconsistent with the first token;
[0031] ignore the first packet according to the denial message, and forward data according to a current table entry.
[0032] A VTEP table entry updating method of Vxlan, applied to a VM, the VM being in communication connection with a token server, and the method including:
[0033] Before migrating from the first VTEP to the second VTEP, sending new token application information to the token server, the new token application information including the identification of the VM; so that the token server generates a new token corresponding to the identification of the VM in response to the token application information, and records the correspondence between the identification of the VM and the new token of the VM locally; the first VTEP and the second VTEP are under the same VNI;
[0034] Receiving the new token sent by the token server;
[0035] Migrating from the first VTEP to the second VTEP, adding the new token to the reserved position of the packet, and re-encapsulating into a first packet;
[0036] Sending the first packet to all VTEPs under the VNI, so that all VTEPs under the VNI determine whether to update the table item.
[0037] Optionally, the above method further comprises:
[0038] Sending registration information to the token server, the registration information including the identification of the VM; so that the token server generates an initial token corresponding to the identification of the VM in response to the registration information, and records the correspondence between the identification of the VM and the initial token of the VM locally; the registration information is sent before the VM is initially online on the VTEP under the VNI;
[0039] Receiving the initial token sent by the token server;
[0040] Adding the initial token to the reserved position of the packet, and re-encapsulating into a second packet;
[0041] Sending the second packet to all VTEPs under the VNI, so that all VTEPs under the VNI determine whether to update the table item.
[0042] A VTEP table item updating system of Vxlan, applied to a token server, the token server being in communication connection with VTEPs under the same VNI, comprising:
[0043] A recording module for recording the correspondence between the identification of the VM and the latest token of the VM;
[0044] A receiving module for receiving request information sent by a VTEP, the request information including the identification of the VM and a first token of the VM;
[0045] A determining module for determining whether the first token of the VM is consistent with the latest token corresponding to the identification of the VM recorded locally;
[0046] send the confirmation information to the VTEP, so that the VTEP updates the table item according to the confirmation information and forwards data according to the updated table item.
[0047] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the VTEP table item updating method of the Vxlan when executing the program.
[0048] The beneficial effects of the present application are:
[0049] In the present application, by recording the correspondence between the VM and the latest token of the VM, after receiving the request information sent by the VTEP and including the identification of the VM and the first token of the VM, it is determined whether the first token of the VM is consistent with the latest token of the VM recorded locally, and in the case that the first token of the VM is consistent with the latest token of the VM corresponding to the identification of the VM recorded locally, the confirmation information is sent to the VTEP, so that the VTEP updates the table item according to the confirmation information and forwards data according to the updated table item, which can make the VTEP only update the table item according to the packet information sent by the VM in the latest online state, and avoid the problem of traffic forwarding black hole caused by the inconsistency between the packet sending and arrival and the table item updating error when the VM frequently migrates. BRIEF DESCRIPTION OF DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0051] Figure 1 is a flow chart of the VTEP table item updating method of the Vxlan described in an embodiment of the present application;
[0052] Figure 2 is an architectural schematic diagram of the VTEP table item updating method of the Vxlan described in an embodiment of the present application;
[0053] Figure 3 is another flow chart of the VTEP table item updating method of the Vxlan described in an embodiment of the present application;
[0054] Figure 4 is still another flow chart of the VTEP table item updating method of the Vxlan described in an embodiment of the present application;
[0055] Figure 5 This is a message comparison diagram of the Vxlan VTEP table entry update method in one embodiment of the present application;
[0056] Figure 6 This is a logical diagram of a method for updating a Vxlan VTEP entry in an embodiment of the present application;
[0057] Figure 7 This is another logical diagram of a method for updating a Vxlan VTEP entry in an embodiment of the present application;
[0058] Figure 8 It is a framework diagram of the Vxlan VTEP table entry update system described in one embodiment of the present application. DETAILED DESCRIPTION
[0059] The following will describe the embodiments of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand the other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for the purpose of illustrating the present application and are not intended to limit the scope of protection of the present application.
[0060] Glossary:
[0061] Vxlan: Virtual Extensible Local Area Network, virtual extended local area network;
[0062] mac: Media Access Control, media access control;
[0063] VM: Virtual machine;
[0064] ARP: Address Resolution Protocol, Address Resolution Protocol;
[0065] VTEP: Vxlan Tunnel End Point, Vxlan tunnel endpoint;
[0066] VNI: Vxlan Network Identifier, Vxlan network identifier. Devices in the same Vxlan are all under the same VNI.
[0067] Vxlan encapsulates the data packet sent by a virtual machine (VM) in UDP, and uses the IP and mac of the physical network as the outer-header, and then transmits on the IP network, and after reaching the destination, the data is sent to the target VM by the tunnel termination point after being decapsulated.
[0068] In the present application, by setting a token server, a token is issued to the VM in the same Vxlan, so that the token information of the VM is carried in the data packet sent by the VM when encapsulating. After receiving the data packet sent by the VM, the VTEP not only learns the original related table item of the VM, but also records the token of the VM. When the VM migrates between the VTEPs in the same Vxlan, a new token needs to be applied from the token server before each migration. The token server always records the correspondence between the VM and the latest token of the VM. After the VM is migrated online, the token information of the VM is added in the sent packet, and the VTEP can check with the token server whether the token of the VM in the received packet is the latest token of the VM. If so, the table item in the packet can be learned, and the token information of the VM is recorded. In this way, the VTEP always correctly updates the table item, avoiding the problem that when the VM frequently migrates, the time sequence of the packet sending and arrival is inconsistent, and the table item is updated incorrectly, causing the traffic forwarding black hole.
[0069] Specifically, referring to Figure 1 and Figure 2 , Figure 1 is a flowchart of the VTEP table item updating method of the Vxlan described in an embodiment of the present application, Figure 2 is an architecture schematic diagram of the VTEP table item updating method of the Vxlan described in an embodiment of the present application, as Figure 2 shown, the VMs transmit data through the VTEP to establish a communication connection; the VMs are in communication connection with the token server; and the VTEP is in communication connection with the token server.
[0070] In an embodiment of the present application, the VTEP table item updating method of the Vxlan is applied to the token server, and can be specifically executed according to the following steps:
[0071] Step S101, record the correspondence between the identification of the VM and the latest token of the VM.
[0072] Specifically, in the same Vxlan, whether the VM is online for the first time or migrates from one VTEP to another VTEP of the same VNI, a token needs to be applied from the token server. After the token server issues the token, it will always record the correspondence between the latest token of the VM and the identification of the VM, providing a basis for whether the subsequent VTEP updates the table item. The identification of the VM can be the mac address of the VM.
[0073] Step S102, receiving the request information sent by the VTEP, the request information including the identification of the VM and the first token of the VM.
[0074] Specifically, the VTEP is in communication connection with the token server, and whether the VTEP updates the table item according to the received message information needs to determine in advance whether the information is outdated information. Therefore, the identification of the VM and the token information (i.e. the first token) of the VM in the received information are added to the request message and sent to the token server for verification by the token server.
[0075] After the token server receives the request information sent by the VTEP, including the identification of the VM and the first token of the VM, the token server verifies the token of the VM in the request information, and continues to execute step S103.
[0076] Step S103, determining whether the first token of the VM is consistent with the latest token corresponding to the identification of the VM recorded locally.
[0077] Specifically, it is determined whether the first token of the VM in the request message is consistent with the latest token corresponding to the identification of the VM recorded locally by the token server. First, the latest token corresponding to the identification is found according to the identification of the VM, and then the first token of the VM in the request message is compared with the found latest token of the VM to determine whether they are consistent.
[0078] Step S104, in the case that the first token of the VM is consistent with the latest token, sending the confirmation information to the VTEP, so that the VTEP updates the table item according to the confirmation information, and forwards the data according to the updated table item.
[0079] Specifically, if the first token of the VM in the request message is consistent with the latest token corresponding to the identification of the VM recorded locally by the token server, it indicates that this is the latest online state of the VM, and the token server sends the confirmation information to the VTEP. After receiving the confirmation information, the VTEP can update the table item according to the confirmation information. For example, after receiving the confirmation message, the relevant table item of the VM is updated according to the received message information.
[0080] In the embodiment, by recording the correspondence between the VM and the latest token of the VM, after receiving the request information sent by the VTEP and including the identification of the VM and the first token of the VM, it is determined whether the first token of the VM is consistent with the latest token corresponding to the identification of the VM recorded locally. In the case that the first token of the VM is consistent with the latest token, the confirmation information is sent to the VTEP, so that the VTEP updates the table item according to the confirmation information, and forwards data according to the updated table item. The VTEP can only update the table item correctly according to the packet information sent by the VM in the latest online state, and the problem of traffic forwarding black hole caused by the inconsistent timing of packet sending and arrival when the VM frequently migrates and the table item is updated incorrectly is avoided.
[0081] In a possible implementation, the token server is in communication connection with the VM. Before receiving the request information sent by the VTEP, the method further includes: receiving new token application information sent by the VM, the new token application information including the identification of the VM; the new token application information is sent by the VM before the VM is migrated from the first VTEP to the second VTEP; and the first VTEP and the second VTEP are both under the same VNI.
[0082] In response to the new token application information, a new token corresponding to the identification of the VM is generated.
[0083] The new token is sent to the VM, so that the VM adds the new token to the packet to be sent.
[0084] In the embodiment, before the VM is migrated from the first VTEP under the same VNI to the second VTEP, the VM needs to send a new token application message to the token server, and the new token application message is used to apply for a new token. After the token server receives the new token application information sent by the VM, a new token corresponding to the identification of the VM is generated in response to the new token application message, and the generated new token is issued to the VM, so that the VM adds the new token information to the packet to be sent. For example, when the VM is migrated from the first VTEP under the same VNI to the second VTEP for online, the new token of the VM is added to the ARP packet to be sent.
[0085] In this way, the VM needs to apply for a new token before each migration and online, and the token server always records the correspondence between the identification of the VM and the latest token of the VM, thereby providing a basis for the VTEP to determine whether to update the table item according to the received packet information.
[0086] In a possible implementation, before receiving the new token application information sent by the VM, the method further includes:
[0087] The registration information sent by the VM is received, and the registration information includes the identification of the VM. The registration information is sent by the VM before the VM is initially online on the VTEP under the VNI.
[0088] generate an initial token corresponding to the identification of the VM in response to the registration information;
[0089] send the initial token to the VM, so that the VM adds the initial token to the packet to be sent.
[0090] In the embodiment, before the VM is initially online on the VTEP under the VNI, the VM needs to apply for an initial token from the token server, and therefore, the registration message is first sent to the token server. After the token server receives the registration information sent by the VM, an initial token corresponding to the identification of the VM is generated in response to the registration information. At this time, the initial token is the latest token of the VM. The initial token of the VM is sent to the VM, so that the VM adds the initial token to the packet to be sent. For example, when the VM is initially online on the VTEP under the VNI, the initial token is added to the ARP packet sent to all VTEPs under the VNI, or the initial token is added to other packets sent by the VM to another VM.
[0091] In the present application, before all VMs are initially online on the VTEP under the VNI, the VM needs to apply for a token from the token server. The token of the VM is the same as the mac address of the VM and can be used as another identification of the VM. The token of each VM is unique and is updated along with the migration of the VM, so as to identify whether the information sent by the VM is outdated.
[0092] Referring to Figure 3 , Figure 3 is another flowchart of the Vxlan VTEP table item updating method described in an embodiment of the present application. In an embodiment of the present application, the Vxlan VTEP table item updating method is applied to VTEPs under the same VNI, and the VTEP is in communication connection with the token server. Specifically, the Vxlan VTEP table item updating method can be executed according to steps S301-S305:
[0093] Step S301, receiving a first packet sent by a VM, the first packet being sent by the VM when the VM is migrated from a first VTEP to a second VTEP for online; the first VTEP and the second VTEP are both under a VNI.
[0094] Specifically, the first VTEP and the second VTEP are both under a VNI, and when the VM is migrated from the first VTEP to the second VTEP for online, the VM sends an ARP packet, i.e., the first packet, to the VTEP in the entire Vxlan. After the VTEP receives the first packet sent by the VM, it is determined to learn and update the table item according to the information in the first packet, and step S302 is continued to be executed.
[0095] Step S302, parsing the first message to obtain the identification of the VM and the first token of the VM.
[0096] Specifically, the identification of the VM can be the mac address of the VM, and the first token of the VM is the latest token of the VM before sending the first message. If the VM frequently migrates, the first token in the first message sent each time the VM is online is not the same. Whether the VTEP updates the table item according to the received first message needs to be judged. Otherwise, if the first message is an outdated message, the table item will not be updated according to the first message, and data will not be forwarded normally, causing a traffic forwarding black hole. Then, step S303 is executed.
[0097] Step S303, sending a request message to the token server, the request message including the identification of the VM and the first token.
[0098] Specifically, after parsing the first message, the obtained identification of the VM and the first token of the VM are added to the request message, and the request message is sent to the token server to verify whether the first token of the VM in the first message is the latest token of the VM.
[0099] Step S304, receiving the confirmation message sent by the token server, the confirmation message being sent by the token server when confirming that the latest token corresponding to the identification of the VM recorded locally is consistent with the first token.
[0100] Specifically, if the token server queries the latest token corresponding to the identification of the VM according to the correspondence between the identification of the VM and the latest token of the VM recorded locally by the token server, and confirms that the first token of the VM in the request message is the latest token of the VM, the token server sends a confirmation message to the VTEP; the VTEP can receive the confirmation message.
[0101] Step S305, updating the table item in response to the first message according to the confirmation message, and forwarding data according to the updated table item.
[0102] Specifically, if the VTEP receives the confirmation message, it means that the information in the first message is the latest information, and the table item needs to be updated. The mac of the VM sending the first message, the VNI, the VTEP connected by the VM, and the first token of the VM are recorded in the table item. After updating the table item, the VTEP can forward data according to the updated table item.
[0103] In the embodiment, the VTEP entry updating method of Vxlan is applied to VTEPs under the same VNI, the VTEPs are in communication connection with the token server, after receiving the first message sent by the VM, the VTEP requests the token server to verify whether the first token in the message is consistent with the latest token of the VM recorded in the token server, after the token server confirms the consistency, the VTEP updates the entry again and forwards data according to the updated entry. In this way, the problem of traffic forwarding black hole caused by the inconsistency between the sending and arrival of the message when the VM frequently migrates is avoided.
[0104] In a feasible implementation, before receiving the first message sent by the VM, the above method further includes:
[0105] receiving a second message sent by the VM;
[0106] parsing the second message to obtain the identifier of the VM and the initial token of the VM;
[0107] updating the entry in response to the second message and forwarding data according to the updated entry.
[0108] Specifically, in the implementation, before receiving the first message sent by the VM, the VM has sent a second message. The second message is sent when the VM is initially online on the VTEP under the VNI, at this time, the VM has not migrated, and the entry of each VTEP does not have the related information of the VM, therefore, before receiving the first message sent by the VM, the VTEP receives the second message sent by the VM first; the second message is parsed to obtain the identifier of the VM and the initial token of the VM; the entry is updated in response to the second message, the related information of the VM initially online and the initial token of the VM are added in the entry, and data is forwarded according to the updated entry.
[0109] In the embodiment, after receiving the second message sent when the VM is initially online on the VTEP under the VNI, the original mac learning method can be executed first to record the mac, vni and VTEP connected by the VM, and then record the initial token of the VM. In subsequent unicast data forwarding, the token information carried by the message is compared with the token information of the VM recorded by the VTEP previously, if they are inconsistent, the token server can be further verified whether the entry needs to be updated, even if no ARP message is received, whether the entry is updated can be determined.
[0110] In a feasible implementation, after sending the request message to the token server, the above method further includes:
[0111] receiving a denial message sent by the token server, the denial message is sent by the token server when confirming that the latest token corresponding to the identifier of the VM recorded locally is inconsistent with the first token;
[0112] According to the denial message, the first packet is ignored, and the data is forwarded according to the current entry.
[0113] In the embodiment, if the token server determines that the token of the VM in the request message is inconsistent with the latest token of the VM recorded locally by the token server, the token server sends a denial message to the VTEP. After receiving the denial message, the VTEP can determine that the first packet is an outdated message, and the entry does not need to be updated. Therefore, the first packet is ignored, and the data is still forwarded according to the original entry, thereby avoiding incorrect updating of the entry and causing a traffic forwarding black hole.
[0114] Referring to Figure 4 , Figure 4 is another flowchart of the Vxlan VTEP entry updating method described in an embodiment of the present application. In an embodiment of the present application, the Vxlan VTEP entry updating method is applied to VMs under the same VNI, and the VMs are in communication connection with a token server.
[0115] Specifically, the Vxlan VTEP entry updating method can be executed according to steps S401-S404.
[0116] Step S401, before migrating from a first VTEP to a second VTEP, sending new token application information to a token server, the new token application information including an identifier of a VM; so that the token server generates a new token corresponding to the identifier of the VM in response to the token application information, and records a correspondence between the identifier of the VM and the new token of the VM locally; the first VTEP and the second VTEP are both under the same VNI.
[0117] Step S402, receiving a new token sent by the token server.
[0118] Specifically, steps S401-S402 can refer to the above embodiments, which will not be described here again.
[0119] Step S403, migrating from the first VTEP to the second VTEP, adding the new token to a reserved position of a packet, and re-encapsulating the packet as a first packet.
[0120] Specifically, the packet encapsulation in the embodiment uses a general Vxlan packet format, and enables a reserved 24-bit reserved in an outer Vxlan header to record token information of the packet. Referring to Figure 5 , Figure 5is a message comparison chart of a VTEP table item updating method of Vxlan in an embodiment of the present application. In the embodiment, the original Vxlan message format is not changed, the 24-bit reserved bit in the outer Vxlan header of the original message is enabled, and the token information of the VM is added, so that the optimization cost is reduced, and the VTEP can conveniently determine whether to update the table item according to the token information of the VM in the message.
[0121] In step S404, the first message is sent to all VTEPs under the VNI, so that all VTEPs under the VNI determine whether to update the table item.
[0122] Before the VM is migrated from the first VTEP to the second VTEP, the latest token issued by the token server is obtained, and when the VM is online after being migrated from the first VTEP to the second VTEP, an ARP message (i.e., the first message) is sent, which is flooded under the VNI, and all VTEPs under the VNI receive the message, and the VTEP can further determine whether to update the table item according to the token in the message.
[0123] In the embodiment, before the VM is migrated from the first VTEP to the second VTEP under the same VNI, a new token is applied to the token server, and when the VM is online after being migrated from the first VTEP to the second VTEP, the latest token information obtained before the migration is added to the ARP message, so that the VTEP determines whether to update the table item according to the received message, provides a basis for the VTEP to always update the table item according to the latest message, and avoids the problem that when the VM is frequently migrated, the time sequence of the message sending and the message arrival is inconsistent, causing a traffic forwarding black hole.
[0124] In a feasible implementation, the above method further includes:
[0125] The registration information is sent to the token server, and the registration information includes the identifier of the VM; the token server generates the initial token corresponding to the identifier of the VM in response to the registration information, and records the correspondence between the identifier of the VM and the initial token of the VM locally, and the registration information is sent before the VM is online on the VTEP under the VNI for the first time;
[0126] The initial token sent by the token server is received;
[0127] The initial token is added to the reserved position of the message, and the second message is re-encapsulated;
[0128] The second message is sent to all VTEPs under the VNI, so that all VTEPs under the VNI determine whether to update the table item.
[0129] In the embodiment, the VM needs to apply for a token from the token server before it is initially online on the VTEP under the VNI, and can be online only after obtaining the initial token, and then sends the second message. The second message is an ARP message sent by the VM when it is initially online on the VTEP under the VNI, to all VTEPs under the VNI. The specific details of the embodiment can be referred to the above examples.
[0130] Referring to Figure 2 , Figure 6 , Figure 7 , Figure 2 is a schematic diagram of the architecture of the method in an embodiment of the application, and further describes the technical solution of the application. Figure 6 is a logic diagram of the VTEP table item updating method of the Vxlan in an embodiment of the application, Figure 7 is another logic diagram of the VTEP table item updating method of the Vxlan in an embodiment of the application.
[0131] As shown in Figure 2 , it is assumed that static Vxlan tunnels are established between VTEP 1, 2, 3, and 4, and the message forwarding uses VNI 100. The migration sequence of VM 4 is VTEP 4-VTEP 2-VTEP 3, and the time sequence of the ARP messages sent by VM 4 when it is successively online is also VTEP 4-VTEP 2-VTEP 3. The time sequence of the messages received by each VTEP can not be consistent, and the message that is last sent can not necessarily arrive last, for example, the sequence of the messages arriving at VTEP 1 is VTEP 4-VTEP 3-VTEP 2. According to the original table item updating method, VTEP 1 records mac4+VNIi100+the corresponding tunnel VTEP 1-VTEP 2, which is obviously wrong. In subsequent traffic data forwarding, because VM 4 has migrated to VTEP 3, VM 4 cannot receive the related traffic sent by VM 1 through VTEP 1 to VM 4, and a traffic forwarding black hole phenomenon will occur.
[0132] Therefore, the application sets a token server in the Vxlan, and establishes a communication connection with the VTEP and the VM. If VM 4 is initially online on the VTEP under the VNI, the table item updating logic is as shown in Figure 6 : VM 4 is online, and then sends a free ARP message, which is flooded under a VNI, that is, all VTEPs receive the message, and according to the message, mac learning is performed, and the mac of the VM 4+VNI 100+VTEP 4 is added in the table item, and the token information of the VM is recorded.
[0133] If the VM is migrated from a first VTEP to a second VTEP under the same VNI as the first VTEP for online, the table item updating logic is as shown in Figure 7As shown: the VM applies for a token to the token server before migration, after the VM receives the new token, the VM migrates, and then connects to the VTEP after migration, and sends a free ARP, the token information (the current new token) of the VM is carried in the message, the ARP message is flooded under a VNI, all VTEPs under the VNI receive the message, the VTEP requests the token server to verify the token carried in the message, the token server verifies whether the token of the VM carried in the message is the latest token of the VM, if the token of the VM carried in the message is consistent with the latest token of the VM, the VTEP updates the table item, re-records the mac+VNI+VTEP of the VM and the token information of the VM, and forwards data according to the new table item; if the token of the VM carried in the message is inconsistent with the latest token of the VM, the VTEP does not update the table item, and forwards data according to the original table item.
[0134] In the embodiment, the token server issues a token for the VM, and the message sent by the VM carries the token information of the VM, whether the token of the VM carried in the message received by the VTEP is consistent with the latest token of the VM is verified, in the case that the token of the VM carried in the message is consistent with the latest token of the VM, the VTEP updates the table item according to the message, which can make the VTEP always correctly update the table item, and avoid the problem that the time sequence of message sending and arrival is inconsistent when the VM frequently migrates, the table item is updated incorrectly, and the traffic forwarding black hole is caused.
[0135] Reference Figure 8 , Figure 8 is a framework diagram of the Vxlan VTEP table item updating system described in an embodiment of the application. As Figure 8 shown, in an embodiment of the application, a Vxlan VTEP table item updating system is proposed, applied to a token server, the Vxlan VTEP table item updating system comprises:
[0136] The recording module is configured to record the correspondence between the identifier of the VM and the latest token of the VM.
[0137] The receiving module is configured to receive the request information sent by the VTEP, the request information comprising the identifier of the VM and the first token of the VM.
[0138] The determining module is configured to determine whether the first token of the VM is consistent with the latest token corresponding to the identifier of the VM recorded locally.
[0139] The sending module is configured to send the confirmation information to the VTEP in the case that the first token of the VM is consistent with the latest token, so that the VTEP updates the table item according to the confirmation information, and forwards data according to the updated table item.
[0140] In the embodiment, by recording the correspondence between the VM and the latest token of the VM, after receiving the request information sent by the VTEP and including the identification of the VM and the first token of the VM, it is first determined whether the first token of the VM is consistent with the latest token of the VM recorded locally, in the case that the first token of the VM is consistent with the latest token corresponding to the identification of the VM recorded locally, the confirmation information is sent to the VTEP, so that the VTEP updates the table item according to the confirmation information, and forwards data according to the updated table item, which can make the VTEP correctly update the table item according to the packet information sent by the VM in the latest online state, and can avoid the problem that the table item is updated incorrectly due to the inconsistency between the packet sending and the packet arrival when the VM frequently migrates, and causes the traffic forwarding black hole.
[0141] In an implementation, the Vxlan VTEP table item updating system further includes:
[0142] The first receiving submodule is configured to receive new token application information sent by the VM, the new token application information including the identification of the VM; the new token application information is sent by the VM before the VM is migrated from the first VTEP to the second VTEP; and the first VTEP and the second VTEP are both under the VNI.
[0143] The first generating module is configured to generate a new token corresponding to the identification of the VM in response to the new token application information.
[0144] The first sending submodule is configured to send the new token to the VM, so that the VM adds the new token to the packet to be sent.
[0145] In an implementation, the Vxlan VTEP table item updating system further includes:
[0146] The second receiving submodule is configured to receive registration information sent by the VM, the registration information including the identification of the VM; and the registration information is sent by the VM before the VM is initially online on the VTEP under the VNI.
[0147] The second generating module is configured to generate an initial token corresponding to the identification of the VM in response to the registration information.
[0148] The second sending submodule is configured to send the initial token to the VM, so that the VM adds the initial token to the packet to be sent.
[0149] In an embodiment of the present application, based on the same inventive concept, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the Vxlan VTEP table item updating method when executing the program.
[0150] The various embodiments in the specification are described in progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between the embodiments can be mutually referred to.
[0151] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can adopt a computer program product in the form of being implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0152] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal device produce a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the function specified in one or more flows and / or blocks.
[0153] These computer program instructions can also be stored in a computer readable memory capable of guiding the computer or other programmable data processing terminal device to work in a specific way, so that the instructions stored in the computer readable memory produce a product including instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the function specified in one or more flows and / or blocks.
[0154] These computer program instructions can also be loaded into a computer or other programmable data processing terminal device, so that a series of operation steps are performed on the computer or other programmable terminal device to produce a computer implemented process, so that the instructions executed on the computer or other programmable terminal device provide a process for implementing the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the function specified in one or more flows and / or blocks.
[0155] Finally, it is to be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0156] The above provides a Vxlan VTEP entry updating method, system and electronic device. The principles and embodiments of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method and core idea of the present application. For those skilled in the art, the specific embodiments and application scope can be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.
[0157] The above embodiments are only preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Any equivalent replacement or transformation of the present application based on the present application is within the protection scope of the present application.
Claims
1. A Vxlan VTEP table entry update method, characterized in that: Applied to a token server, the token server being in communication with a VTEP under the same VNI, the method comprising: Recording the correspondence between the VM identifier and the latest token of the VM; Receive a request message sent by the VTEP, where the request message includes an identifier of the VM and a first token of the VM; Determining whether the first token of the VM is consistent with the latest token corresponding to the identifier of the VM recorded locally; When the first token of the VM is consistent with the latest token, sending confirmation information to the VTEP, so that the VTEP updates the table entry according to the confirmation information and forwards data according to the updated table entry; The token server is in communication with the VM; before receiving the request information sent by the VTEP, the method further includes: Receive new token application information sent by the VM, where the new token application information includes an identifier of the VM; the new token application information is sent by the VM before migrating from the first VTEP to the second VTEP, where both the first VTEP and the second VTEP are under the VNI; In response to the new token application information, generating a new token corresponding to the identifier of the VM; The new token is sent to the VM, so that the VM adds the new token to the message to be sent.
2. The Vxlan VTEP table entry updating method according to claim 1, characterized in that: Before receiving the new token application information sent by the VM, the method further includes: Receive registration information sent by the VM, where the registration information includes an identifier of the VM, and the registration information is sent by the VM before the VTEP under the VNI goes online for the first time; In response to the registration information, generating an initial token corresponding to the identifier of the VM; The initial token is sent to the VM, so that the VM adds the initial token to a message to be sent.
3. A Vxlan VTEP table entry update method, characterized in that: Applied to a VTEP under the same VNI, the VTEP being in communication with a token server, the method comprising: Receive a first message sent by a VM, where the first message is sent when the VM is migrated from a first VTEP to a second VTEP to go online; both the first VTEP and the second VTEP are under the VNI; Parsing the first message to obtain an identifier of the VM and a first token of the VM; Sending a request message to the token server, where the request message includes the identifier of the VM and the first token; Receiving a confirmation message sent by the token server, where the confirmation message is sent by the token server when confirming that the latest token corresponding to the identifier of the VM recorded locally is consistent with the first token; According to the confirmation message, in response to the first message, updating the table entry, and forwarding data according to the updated table entry; Before receiving the first message sent by the VM, the method further includes: receiving a second message sent by the VM; Parsing the second message to obtain the identifier of the VM and the initial token of the VM; In response to the second message, the table entry is updated, and data is forwarded according to the updated table entry.
4. The VTEP table entry updating method according to claim 3, characterized in that: After sending the request message to the token server, the method further includes: receiving a denial message sent by the token server, where the denial message is sent by the token server when confirming that the latest token corresponding to the identifier of the VM recorded locally is inconsistent with the first token; According to the denial message, the first message is ignored, and data is forwarded according to the current entry.
5. A Vxlan VTEP table entry update method, characterized in that: Applied to a VM, the VM being in communication with a token server, the method comprising: Before migrating from the first VTEP to the second VTEP, sending new token application information to the token server, the new token application information including the identifier of the VM; so that the token server generates a new token corresponding to the identifier of the VM in response to the token application information, and locally records the correspondence between the identifier of the VM and the new token of the VM; the first VTEP and the second VTEP are both under the same VNI; Receive a new token sent by the token server; Migrating from the first VTEP to the second VTEP, adding the new token to the message reserved position, and re-encapsulating it into the first message; Sending the first message to all VTEPs under the VNI so that all VTEPs under the VNI determine whether table entries need to be updated; Send registration information to the token server, wherein the registration information includes the identifier of the VM; so that the token server generates an initial token corresponding to the identifier of the VM in response to the registration information, and locally records the correspondence between the identifier of the VM and the initial token of the VM.
6. The VTEP table entry updating method according to claim 5, characterized in that: The method further comprises: The registration information is sent by the VM before the VTEP under the VNI goes online for the first time; Receiving an initial token sent by the token server; Adding the initial token to the reserved position of the message and repackaging it into a second message; The second message is sent to all VTEPs under the VNI, so that all VTEPs under the VNI determine whether the table entry needs to be updated.
7. A Vxlan VTEP table entry update system, characterized in that: Applied to a token server, the token server is in communication with a VTEP under the same VNI, and the system includes: a recording module, configured to record a correspondence between an identifier of a VM and a latest token of the VM; A receiving module, configured to receive a request message sent by a VTEP, wherein the request message includes an identifier of the VM and a first token of the VM; a determination module, configured to determine whether the first token of the VM is consistent with the latest token corresponding to the identifier of the VM recorded locally; a sending module, configured to send confirmation information to the VTEP when the first token of the VM is consistent with the latest token, so that the VTEP updates the table entry according to the confirmation information and forwards data according to the updated table entry; The token server is in communication with the VM; before receiving the request information sent by the VTEP, the method further includes: Receive new token application information sent by the VM, where the new token application information includes an identifier of the VM; the new token application information is sent by the VM before migrating from the first VTEP to the second VTEP, where both the first VTEP and the second VTEP are under the VNI; In response to the new token application information, generating a new token corresponding to the identifier of the VM; The new token is sent to the VM, so that the VM adds the new token to the message to be sent.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the Vxlan VTEP table entry updating method as described in any one of claims 1-2, any one of 3-4, or any one of 5-6 is implemented.
Citation Information
Patent Citations
Managing NIC-encrypted flows for migrating guests or tasks
CN106464674A
Routing information synchronization method and device
CN108777663A