CN113472912B - ARP cache table item updating method, VTEP, VM and device - Google Patents
ARP cache table item updating method, VTEP, VM and device Download PDFInfo
- Publication number
- CN113472912B CN113472912B CN202110648817.XA CN202110648817A CN113472912B CN 113472912 B CN113472912 B CN 113472912B CN 202110648817 A CN202110648817 A CN 202110648817A CN 113472912 B CN113472912 B CN 113472912B
- Authority
- CN
- China
- Prior art keywords
- arp
- subnet
- address
- cache table
- request message
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000004044 response Effects 0.000 claims abstract description 114
- 230000015654 memory Effects 0.000 claims description 11
- 238000011144 upstream manufacturing Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 6
- 238000010276 construction Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000002955 isolation Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005538 encapsulation Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4641—Virtual LANs, VLANs, e.g. virtual private networks [VPN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/255—Maintenance or indexing of mapping tables
- H04L61/2553—Binding renewal aspects, e.g. using keep-alive messages
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/2592—Translation of Internet protocol [IP] addresses using tunnelling or encapsulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides an updating method of an ARP cache table item, a VTEP, a VM and a device, wherein the method comprises the following steps: receiving a first subnet ARP request message sent by a lower VM (virtual machine), wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN network segment as the lower VM; acquiring all ARP cache table entries which meet the first subnet ARP request message in a local ARP cache table; constructing a subnet ARP response message according to all the ARP cache table entries; and sending the subnet ARP response message to the downstream VM so that the downstream VM updates a corresponding ARP cache table entry in a local ARP cache table according to the subnet ARP response message. The method, the VTEP, the VMs and the device can solve the problems that in the related art, when the VM needs to communicate with other VMs which are not in an ARP cache each time, an ARP request needs to be sent to each VM independently, ARP broadcast flow is easy to cause, and consumption of network resources is large.
Description
Technical Field
The present invention relates to the field of network technologies, and in particular, to an updating method, a VTEP, a VM, and an apparatus for an ARP cache entry.
Background
In a VXLAN (Virtual eXtensible LAN) Network, when different VMs (Virtual machines) belonging to the same VNI (VXLAN Network Identifier) in the same Network segment communicate with each other, a Media Access Control (MAC) Address of the other VM must be obtained first, if the ARP (Address Resolution Protocol) cache table of the VM does not have the MAC Address of the VM of the other VM, the VM sends out an ARP request, after receiving the ARP request, the upper VTEP (LAN Tunnel End Point, VXLAN Tunnel End Point) sends the ARP request to all other VTEPs belonging to the VNI, after receiving the ARP request, the other VTEPs broadcast the request in the range of the lower VNI, and after receiving the ARP request, the requested VM sends out an ARP response, and the source VM obtains the MAC Address of the source VM, and then the other VMs can communicate with each other VM. The above-mentioned procedure is required to be performed when the VM communicates with other VMs not in the ARP cache table every time, resulting in ARP broadcast traffic in the VXLAN network and a large consumption of network resources.
Disclosure of Invention
The present invention provides an ARP cache entry updating method, a VTEP, a VM, and a device, which are used to solve the problems that in the related art, when a VM needs to communicate with other VMs not in an ARP cache each time, an ARP request needs to be sent separately for each VM, which easily causes ARP broadcast traffic and consumes large network resources.
In a first aspect, an embodiment of the present invention provides an updating method for an ARP cache entry, which is applied to a current VTEP, and the method includes:
receiving a first subnet ARP request message sent by a lower VM (virtual machine), wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN network segment as the lower VM;
acquiring all ARP cache table entries which meet the first subnet ARP request message in a local ARP cache table;
constructing a subnet ARP response message according to all the ARP cache table entries;
and sending the subnet ARP response message to the downstream VM so that the downstream VM updates a corresponding ARP cache table entry in a local ARP cache table according to the subnet ARP response message.
Preferably, the source IP address of the first subnet ARP request message is the IP address of the lower VM, the source MAC address is the MAC address of the lower VM, the destination IP address is the VXLAN network segment address to which the lower VM belongs, the subnet mask is subnet mask information corresponding to the VXLAN network segment address, the destination MAC address is a broadcast MAC address, and the OP correspondence value is 0x 0003;
before obtaining all ARP cache entries in the local ARP cache table that satisfy the first subnet ARP request packet, the method further includes:
generating a second subnet ARP request message with a source IP address as a self IP address, a source MAC address as a self MAC address, a target IP address as the VXLAN network segment address, a subnet mask as the subnet mask information, a target MAC address as the broadcast MAC address and an OP corresponding value of 0x0003 according to a prestored subnet ARP request message format;
sending the second subnet ARP request message to all other VTEPs;
and receiving ARP response messages returned by the other VTEPs, and updating corresponding ARP cache table entries in the local ARP cache table according to the received ARP response messages.
Preferably, before obtaining all ARP cache entries in the local ARP cache table that satisfy the first subnet ARP request packet, the method further includes:
judging whether an address table item of the lower VM exists in a local MAC address table or not;
if not, establishing the address table item of the down-connection VM in the local MAC address table.
Preferably, before constructing a subnet ARP response packet according to all ARP cache entries, the method further includes:
expanding the pre-stored ARP message format, increasing the address number field and the content address field, and using the ARP message format with the increased address number field and the increased content address field as a subnet ARP response message format;
constructing a subnet ARP response message according to all the ARP cache table entries, which specifically comprises the following steps:
and constructing a subnet ARP response message according to the subnet ARP response message format and all ARP cache table entries.
Preferably, the constructing a subnet ARP response packet according to the subnet ARP response packet format and all ARP cache entries specifically includes:
acquiring a first number of IP and MAC address pairs which can be accommodated by the content address field in the subnet ARP response message format to the maximum extent;
acquiring a second number of IP and MAC address pairs in all ARP cache table entries;
if the second number is less than or equal to the first number, constructing a subnet ARP response message with a source IP address of a self IP address, a source MAC address of a self MAC address, a target IP address of the lower VM, a target MAC address of the lower VM, the second number of addresses and content addresses of the IP addresses and the MAC addresses in all ARP cache table entries;
if the second number is larger than the first number, the subnet ARP response messages are constructed in sequence until the IP addresses and the MAC addresses in all the ARP cache table entries are added into the content addresses in the corresponding subnet ARP response messages.
In a second aspect, an embodiment of the present invention provides an updating method for an ARP cache entry, which is applied to a current VM, and the method includes:
sending a first subnet ARP request message to an upstream VTEP, wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN segment as the VTEP, so that after receiving the first subnet ARP request message, the VTEP acquires all ARP cache table entries in a local ARP cache table of the VTEP, which meet the first subnet ARP request message, and constructs a subnet ARP response message according to all the ARP cache table entries;
and receiving the subnet ARP response message sent by the VTEP, and updating a corresponding ARP cache table entry in a local ARP cache table according to the subnet ARP response message.
Preferably, before the sending the first subnet ARP request packet to the VTEP connected upstream, the method further includes:
and generating a first subnet ARP request message with a source IP address of a self IP address, a source MAC address of a self MAC address, a target IP address of a VXLAN network segment address of the self, a subnet mask of subnet mask information corresponding to the VXLAN network segment address, a target MAC address of a broadcast MAC address and an OP corresponding value of 0x0003 according to a pre-stored subnet ARP request message format.
In a third aspect, an embodiment of the present invention provides a VTEP, including:
the first receiving module is used for receiving a first subnet ARP request message sent by a lower VM (virtual machine), wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN network segment as the lower VM;
a first obtaining module, connected to the first receiving module, for obtaining all ARP cache table entries in the local ARP cache table that satisfy the first subnet ARP request message;
a response message construction module, connected to the first acquisition module, for constructing a subnet ARP response message according to all the ARP cache table entries;
and the first sending module is connected with the response message construction module and used for sending the subnet ARP response message to the downlink VM so that the downlink VM updates a corresponding ARP cache table entry in a local ARP cache table according to the subnet ARP response message.
In a fourth aspect, an embodiment of the present invention provides a VM, including:
a second sending module, configured to send a first subnet ARP request message to an upstream VTEP, where the first subnet ARP request message is used to request address information of other VMs belonging to the same VXLAN network segment as the VTEP itself, so that after the VTEP receives the first subnet ARP request message, the VTEP obtains all ARP cache entries in its local ARP cache table that satisfy the first subnet ARP request message, and constructs a subnet ARP response message according to all ARP cache entries;
and the second receiving module is connected with the second sending module and used for receiving the subnet ARP response message sent by the VTEP and updating the corresponding ARP cache table entry in the local ARP cache table according to the subnet ARP response message.
In a fifth aspect, an embodiment of the present invention provides an apparatus for updating an ARP cache entry, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to implement the method for updating an ARP cache entry according to the first aspect or the second aspect.
According to the method for updating the ARP cache table entries, the VTEP, the VMs and the device provided by the embodiment of the invention, after each VM is online, a first subnet ARP request message can be sent to the connected VTEP so as to obtain the MAC addresses and IP addresses of all other VMs in the subnet. After receiving a first subnet ARP request message sent by a lower-link VM, a VTEP acquires all ARP cache table entries which meet the subnet ARP request message in a local ARP cache table, wherein the local ARP cache table of the VTEP can store all or enough MAC addresses and IP addresses of online VMs in the subnet in advance, the VTEP constructs a subnet ARP response message according to all the ARP cache table entries which meet the subnet ARP request message, and sends the subnet ARP response message to the lower-link VM so that the lower-link VM updates the corresponding ARP cache table entries in the local ARP cache table according to the subnet ARP response message, thereby being capable of storing all or enough MAC addresses and IP addresses of the online VMs in the subnet in the local cache table, avoiding sending ARP requests aiming at each VM independently in subsequent communication, and solving the problem that when the VM in the related technology communicates with other VMs which are not in the ARP cache each time, the method needs to send the ARP request for each VM separately, which easily causes the problems of ARP broadcast flow and large consumption of network resources.
Drawings
FIG. 1: a flow chart of a method for updating an ARP cache entry according to embodiment 1 of the present invention;
FIG. 2: a flow chart of a method for updating an ARP cache entry according to embodiment 2 of the present invention;
FIG. 3: is a schematic structural diagram of a VTEP in embodiment 3 of the invention;
FIG. 4: is a schematic structural diagram of a VM in embodiment 4 of the present invention;
FIG. 5: a schematic structural diagram of an apparatus for updating an ARP cache entry in embodiment 5 of the present invention is shown.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the following detailed description will be made with reference to the accompanying drawings.
It is to be understood that the specific embodiments and figures described herein are merely illustrative of the invention and are not limiting of the invention.
It is to be understood that the embodiments and features of the embodiments can be combined with each other without conflict.
It is to be understood that, for the convenience of description, only parts related to the present invention are shown in the drawings of the present invention, and parts not related to the present invention are not shown in the drawings.
It should be understood that each unit and module related in the embodiments of the present invention may correspond to only one physical structure, may also be composed of multiple physical structures, or multiple units and modules may also be integrated into one physical structure.
It will be understood that, without conflict, the functions, steps, etc. noted in the flowchart and block diagrams of the present invention may occur in an order different from that noted in the figures.
It is to be understood that the flowchart and block diagrams of the present invention illustrate the architecture, functionality, and operation of possible implementations of systems, apparatus, devices and methods according to various embodiments of the present invention. Each block in the flowchart or block diagrams may represent a unit, module, segment, code, which comprises executable instructions for implementing the specified function(s). Furthermore, each block or combination of blocks in the block diagrams and flowchart illustrations can be implemented by a hardware-based system that performs the specified functions or by a combination of hardware and computer instructions.
It is to be understood that the units and modules involved in the embodiments of the present invention may be implemented by software, and may also be implemented by hardware, for example, the units and modules may be located in a processor.
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, a brief description will be given below of some technical terms involved in the embodiments of the present invention.
VXLAN: the Virtual Private Network (VPN) technology is based on an IP Network and adopts a MAC in UDP encapsulation form. VXLAN can provide two-layer interconnection for dispersed physical sites based on existing service provider or enterprise IP networks and can provide service isolation for different tenants.
VTEP: the VTEP may be an independent physical device or a server where the virtual machine is located.
VM: multiple virtual machines can be created on one server, and different virtual machines can belong to different VXLANs. Virtual machines belonging to the same VXLAN are in the same logic two-layer network and are communicated with each other in two layers; two levels of isolation between virtual machines belonging to different VXLANs. VXLAN is identified by VXLAN ID, also known as VNI, which is 24 bits long.
VXLAN tunnel: a point-to-point logical tunnel between two VTEPs. After encapsulating a VXLAN header, a UDP header and an IP header for a data frame, the VTEP forwards the encapsulated message to a far-end VTEP through a VXLAN tunnel, and the far-end VTEP decapsulates the encapsulated message.
Example 1:
this embodiment provides an updating method of an ARP cache entry, which is applied to a current VTEP, and as shown in fig. 1, the method includes:
step S102: and receiving a first subnet ARP request message sent by the lower VM, wherein the first subnet ARP request message is used for requesting the address information of other VMs belonging to the same VXLAN segment as the lower VM.
In this embodiment, the formats of the subnet ARP request messages are pre-stored in the downlink VM and the current VTEP, and the downlink VM generates the first subnet ARP request message according to the pre-stored format of the subnet ARP request message. The subnet ARP request message is based on the existing ARP message, namely the existing ARP message format is expanded, a 4-byte subnet mask field is added, the ARP message format added with the subnet mask field is used as the subnet ARP request message format, meanwhile, the numerical range of the operation type OP is expanded, the OP of the existing ARP message is two bytes and is mainly used for indicating whether the current packet is a request packet or a response packet, and the corresponding values are 0x0001 and 0x0002 respectively. The subnet ARP request message is used for requesting to acquire the MAC addresses and the IP addresses of all other VMs in the subnet.
In this embodiment, the source IP address of the first subnet ARP request packet is an IP address of the downlink VM, the source MAC address is an MAC address of the downlink VM, the destination IP address is a VXLAN network segment address to which the downlink VM belongs, the subnet mask is subnet mask information corresponding to the VXLAN network segment address, the destination MAC address is a broadcast MAC address, and the OP correspondence value is 0x 0003. Assuming that the VM1 is connected to the VTEP1, the VM1 may send a first subnet ARP request message to the VTEP1 after being connected to the internet, where the first subnet ARP request message is an extended ARP message, and a corresponding value in the OP indication is 0x0003, which indicates that ARP requests are sent to all VMs in the network segment in the second layer, a destination MAC address in the message is a broadcast MAC address, a destination IP address is a network segment address, subnet mask information is added, a source MAC address is a MAC address of the VM1, and a source IP address is an IP address of the VM 1.
Step S104: and acquiring all ARP cache table entries which meet the ARP request message of the first subnet in the local ARP cache table.
In this embodiment, the local ARP cache table of the VTEP may store the MAC addresses and IP addresses of all online VMs in the subnet in advance, or the VTEP may obtain the MAC addresses and IP addresses of all online VMs in the subnet in advance through the following steps:
generating a second subnet ARP request message with a source IP address as a self IP address, a source MAC address as a self MAC address, a target IP address as a VXLAN network segment address, subnet mask as subnet mask information, a target MAC address as a broadcast MAC address and an OP corresponding value of 0x0003 according to a pre-stored subnet ARP request message format;
sending a second subnet ARP request message to all other VTEPs;
and receiving ARP response messages returned by other VTEPs, and updating corresponding ARP cache table entries in the local ARP cache table according to the received ARP response messages.
In this embodiment, when the VTEP receives the first subnet ARP request packet sent by the downstream VM, the VTEP may also forward the first subnet ARP request packet to all other VTEPs, and the downstream VM updates the corresponding ARP cache entry in the local ARP cache table according to the received ARP response packet. Since one VTEP may have multiple VMs connected downstream, in order to further reduce ARP broadcast traffic and save network resources, the VTEP may send the second subnet ARP request packet by itself to obtain the MAC addresses and IP addresses of all online VMs in the subnet, thereby preventing each VM connected downstream from sending subnet ARP request packets to other VTEPs.
In this embodiment, when receiving a first subnet ARP request packet sent by a downstream VM, a VTEP may determine whether an address entry of the downstream VM exists in a local MAC address table, and if not, learn a corresponding relationship between an MAC of the downstream VM, a VNI, and a packet access interface (i.e., a physical interface corresponding to a two-layer subinterface), and establish the address entry of the downstream VM in the local MAC address table.
Step S106: constructing a subnet ARP response message according to all ARP cache table entries;
in this embodiment, the subnet ARP response packet is based on the existing ARP packet, that is, the existing ARP packet format is extended, the address number field and the content address field are added, the ARP packet format with the address number field and the content address field added is used as the subnet ARP response packet format, and meanwhile, the numerical range of the operation type OP is extended, which may be other numerical values except 0x0001, 0x0002 and the numerical values corresponding to the subnet ARP request packet, and is preferably 0x 0004. The content address field can be set to be of indefinite length, the number of occupied bytes is determined according to the number of the specifically sent IP and MAC address pairs, in order to avoid unlimited expansion, the number of the IP and MAC address pairs which can be accommodated in the content address field can be set to be the maximum, and the VTEP constructs a subnet ARP response message according to the subnet ARP response message format and all ARP cache table entries.
Optionally, constructing the subnet ARP response packet according to the subnet ARP response packet format and all ARP cache entries may specifically include:
acquiring a first number of IP and MAC address pairs which can be accommodated by a content address field in a subnet ARP response message format to the maximum extent;
acquiring a second number of IP and MAC address pairs in all ARP cache table entries;
if the second number is less than or equal to the first number, constructing a subnet ARP response message with a source IP address as a self IP address, a source MAC address as a self MAC address, a target IP address as an IP address of a lower-link VM, a target MAC address as an MAC address of the lower-link VM, a second number of addresses and all IP addresses and MAC addresses in all ARP cache table entries as content addresses;
if the second number is larger than the first number, constructing subnet ARP response messages in sequence until all IP addresses and MAC addresses in ARP cache table entries are added into content addresses in the corresponding subnet ARP response messages.
In this embodiment, if one subnet ARP response packet cannot accommodate the MAC addresses and IP addresses of all online VMs in the subnet, the VTEP may construct a plurality of subnet ARP response packets, where the source IP address of each subnet ARP response packet is the own IP address, the source MAC address is the own MAC address, the destination IP address is the IP address of the connected-down VM, the destination MAC address is the MAC address of the connected-down VM, the number of addresses is the second number, and the content address of each subnet ARP response packet includes different IP and MAC address pairs.
Step S108: and sending a subnet ARP response message to the downstream VM so that the downstream VM updates a corresponding ARP cache table entry in a local ARP cache table of the downstream VM according to the subnet ARP response message.
In this embodiment, after receiving the subnet ARP response message, the downstream VM may extract the IP address and the MAC address in the subnet ARP response message, and store them in the local ARP cache table.
According to the method for updating the ARP cache table entries provided by the embodiment of the invention, after each VM is online, a first subnet ARP request message can be sent to an uplink VTEP so as to acquire the MAC addresses and IP addresses of all other VMs in the subnet. After receiving a first subnet ARP request message sent by a lower-link VM, a VTEP acquires all ARP cache table entries which meet the subnet ARP request message in a local ARP cache table, wherein the local ARP cache table of the VTEP can store all or enough MAC addresses and IP addresses of online VMs in the subnet in advance, the VTEP constructs a subnet ARP response message according to all the ARP cache table entries which meet the subnet ARP request message, and sends the subnet ARP response message to the lower-link VM so that the lower-link VM updates the corresponding ARP cache table entries in the local ARP cache table according to the subnet ARP response message, thereby being capable of storing all or enough MAC addresses and IP addresses of the online VMs in the subnet in the local cache table, avoiding sending ARP requests aiming at each VM independently in subsequent communication, and solving the problem that when the VM in the related technology communicates with other VMs which are not in the ARP cache each time, the method needs to send the ARP request for each VM separately, which easily causes the problems of ARP broadcast flow and large consumption of network resources.
Example 2:
as shown in fig. 2, this embodiment provides an updating method for an ARP cache entry, which is applied to a current VM, and the method includes:
step S202: sending a first subnet ARP request message to an upstream VTEP, wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN segment as the VTEP, so that after receiving the first subnet ARP request message, the VTEP acquires all ARP cache table entries meeting the first subnet ARP request message in a local ARP cache table of the VTEP, and constructs a subnet ARP response message according to all the ARP cache table entries;
step S204: and receiving a subnet ARP response message sent by the VTEP, and updating a corresponding ARP cache table item in a local ARP cache table of the VTEP according to the subnet ARP response message.
Optionally, before sending the first subnet ARP request packet to the VTEP connected upstream, the method may further include:
and generating a first subnet ARP request message with a source IP address of a self IP address, a source MAC address of a self MAC address, a target IP address of a VXLAN network segment address of the self, a subnet mask of subnet mask information corresponding to the VXLAN network segment address, a target MAC address of a broadcast MAC address and an OP corresponding value of 0x0003 according to a pre-stored subnet ARP request message format.
Example 3:
as shown in fig. 3, the present embodiment provides a VTEP, including:
a first receiving module 12, configured to receive a first subnet ARP request message sent by a downstream VM, where the first subnet ARP request message is used to request address information of other VMs belonging to the same VXLAN network segment as the downstream VM;
a first obtaining module 14, connected to the first receiving module 12, configured to obtain all ARP cache entries in the local ARP cache table that satisfy the first subnet ARP request packet;
a response message construction module 16, connected to the first obtaining module 14, for constructing a subnet ARP response message according to all ARP cache table entries;
and the first sending module 18 is connected to the response message constructing module 16, and is configured to send a subnet ARP response message to the downstream VM, so that the downstream VM updates a corresponding ARP cache entry in its local ARP cache entry according to the subnet ARP response message.
Optionally, the source IP address of the first subnet ARP request packet is an IP address of the downlink VM, the source MAC address is an MAC address of the downlink VM, the destination IP address is a VXLAN network segment address to which the downlink VM belongs, the subnet mask is subnet mask information corresponding to the VXLAN network segment address, the destination MAC address is a broadcast MAC address, and the OP correspondence value is 0x 0003.
Optionally, the method may further include:
the first generation module is used for generating a second subnet ARP request message with a source IP address of the IP address, a source MAC address of the MAC address, a target IP address of the VXLAN network segment address, subnet mask of the subnet mask information, a broadcast MAC address of the target MAC address and OP corresponding numerical value of 0x0003 according to a prestored subnet ARP request message format;
a third sending module, configured to send a second subnet ARP request packet to all other VTEPs;
and the third receiving module is used for receiving the ARP response messages returned by other VTEPs and updating the corresponding ARP cache table entries in the local ARP cache table according to the received ARP response messages.
Optionally, the method may further include:
the judging module is used for judging whether an address table item of the offline VM exists in the local MAC address table or not;
and the address table item establishing module is used for establishing the address table item of the downlink VM in the local MAC address table if the address table item is not established in the local MAC address table.
Optionally, the method may further include:
the format extension module is used for extending the pre-stored ARP message format, increasing the address number field and the content address field, and taking the ARP message format with the increased address number field and the increased content address field as a subnet ARP response message format;
optionally, the response packet constructing module 16 is specifically configured to construct the subnet ARP response packet according to the subnet ARP response packet format and all ARP cache entries.
Optionally, the response packet constructing module 16 specifically includes:
a first obtaining unit, configured to obtain a first number of IP and MAC address pairs that can be maximally accommodated by a content address field in a subnet ARP response packet format;
a second obtaining unit, configured to obtain a second number of IP and MAC address pairs in all ARP cache entries;
a first constructing unit, configured to construct a subnet ARP response packet with a source IP address being a self IP address, a source MAC address being a self MAC address, a destination IP address being an IP address of a downstream VM, a destination MAC address being an MAC address of the downstream VM, an address number being a second number, and content addresses being IP addresses and MAC addresses in all ARP cache entries if the second number is less than or equal to the first number;
and the second construction unit is used for constructing the subnet ARP response messages in sequence if the second number is larger than the first number until all the IP addresses and the MAC addresses in all the ARP cache table entries are added into the content addresses in the corresponding subnet ARP response messages.
Example 4:
as shown in fig. 4, the present embodiment provides a VM, including:
a second sending module 32, configured to send a first subnet ARP request message to an upstream VTEP, where the first subnet ARP request message is used to request address information of other VMs belonging to the same VXLAN network segment as the VTEP itself, so that after the VTEP receives the first subnet ARP request message, the VTEP obtains all ARP cache entries in its local ARP cache table that satisfy the first subnet ARP request message, and constructs a subnet ARP response message according to all ARP cache entries;
and the second receiving module 34 is connected to the second sending module 32, and is configured to receive the subnet ARP response packet sent by the VTEP, and update a corresponding ARP cache entry in the local ARP cache table according to the subnet ARP response packet.
Optionally, the method may further include:
and the second generation module is used for generating a first subnet ARP request message with a source IP address of the first subnet ARP request message as an IP address of the first subnet, a source MAC address of the first subnet as an MAC address of the first subnet, a destination IP address of the first subnet as a VXLAN network segment address of the first subnet, subnet mask information corresponding to the VXLAN network segment address of the first subnet, a broadcast MAC address of the destination MAC address and OP corresponding numerical value of 0x0003 according to a prestored subnet ARP request message format.
Example 5:
referring to fig. 5, the present embodiment provides an apparatus for updating an ARP cache entry, including a memory 21 and a processor 22, where the memory 21 stores a computer program, and the processor 22 is configured to run the computer program to execute the method for updating an ARP cache entry in embodiment 1 or embodiment 2.
The memory 21 is connected to the processor 22, the memory 21 may be a flash memory, a read-only memory or other memories, and the processor 22 may be a central processing unit or a single chip microcomputer.
In the method for updating ARP cache entries, the VTEP, the VMs, and the apparatus provided in embodiments 2 to 5, after each VM comes online, each VM may send a first subnet ARP request packet to the VTEP that is connected upstream, so as to obtain MAC addresses and IP addresses of all other VMs in the subnet. After receiving a first subnet ARP request message sent by a lower-link VM, a VTEP acquires all ARP cache table entries which meet the subnet ARP request message in a local ARP cache table, wherein the local ARP cache table of the VTEP can store all or enough MAC addresses and IP addresses of online VMs in the subnet in advance, the VTEP constructs a subnet ARP response message according to all the ARP cache table entries which meet the subnet ARP request message, and sends the subnet ARP response message to the lower-link VM so that the lower-link VM updates the corresponding ARP cache table entries in the local ARP cache table according to the subnet ARP response message, thereby being capable of storing all or enough MAC addresses and IP addresses of the online VMs in the subnet in the local cache table, avoiding sending ARP requests aiming at each VM independently in subsequent communication, and solving the problem that when the VM in the related technology communicates with other VMs which are not in the ARP cache each time, the method needs to send the ARP request for each VM separately, which easily causes the problems of ARP broadcast flow and large consumption of network resources.
It will be understood that the above embodiments are merely exemplary embodiments adopted to illustrate the principles of the present invention, and the present invention is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.
Claims (8)
1. A method for updating ARP cache table entries is applied to a current VTEP, and is characterized by comprising the following steps:
receiving a first subnet ARP request message sent by a lower VM (virtual machine), wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN network segment as the lower VM;
acquiring all ARP cache table entries which meet the first subnet ARP request message in a local ARP cache table;
constructing a subnet ARP response message according to all the ARP cache table entries;
sending the subnet ARP response message to the downstream VM so that the downstream VM updates a corresponding ARP cache table entry in a local ARP cache table of the downstream VM according to the subnet ARP response message;
the source IP address of the first subnet ARP request message is the IP address of the downlink VM, the source MAC address is the MAC address of the downlink VM, the destination IP address is the VXLAN network segment address to which the downlink VM belongs, the subnet mask is subnet mask information corresponding to the VXLAN network segment address, the destination MAC address is a broadcast MAC address, and the OP correspondence value is 0x 0003;
before obtaining all ARP cache entries in the local ARP cache table that satisfy the first subnet ARP request packet, the method further includes:
generating a second subnet ARP request message with a source IP address as a self IP address, a source MAC address as a self MAC address, a target IP address as a VXLAN network segment address, a subnet mask as the subnet mask information, a target MAC address as the broadcast MAC address and an OP corresponding value of 0x0003 according to a prestored subnet ARP request message format;
sending the second subnet ARP request message to all other VTEPs;
and receiving ARP response messages returned by the other VTEPs, and updating corresponding ARP cache table entries in the local ARP cache table according to the received ARP response messages.
2. The method according to claim 1, wherein before obtaining all ARP cache entries in the local ARP cache table that satisfy the first subnet ARP request packet, the method further comprises:
judging whether an address table item of the lower VM exists in a local MAC address table or not;
if not, establishing the address table item of the down-connection VM in the local MAC address table.
3. The method according to claim 1, wherein before constructing a subnet ARP response packet according to all ARP cache entries, the method further comprises:
expanding the pre-stored ARP message format, increasing the address number field and the content address field, and using the ARP message format with the increased address number field and the increased content address field as a subnet ARP response message format;
constructing a subnet ARP response message according to all the ARP cache table entries, which specifically comprises the following steps:
and constructing a subnet ARP response message according to the subnet ARP response message format and all ARP cache table entries.
4. The method according to claim 3, wherein constructing a subnet ARP response packet according to the subnet ARP response packet format and all ARP cache entries includes:
acquiring a first number of IP and MAC address pairs which can be accommodated by the content address field in the subnet ARP response message format to the maximum extent;
acquiring a second number of IP and MAC address pairs in all ARP cache table entries;
if the second number is less than or equal to the first number, constructing a subnet ARP response message with a source IP address of a self IP address, a source MAC address of a self MAC address, a target IP address of the lower VM, a target MAC address of the lower VM, the second number of addresses and content addresses of the IP addresses and the MAC addresses in all ARP cache table entries;
if the second number is larger than the first number, the subnet ARP response messages are constructed in sequence until the IP addresses and the MAC addresses in all the ARP cache table entries are added into the content addresses in the corresponding subnet ARP response messages.
5. An updating method of ARP cache table entries is applied to a current VM, and is characterized by comprising the following steps:
sending a first subnet ARP request message to an upstream VTEP, wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN segment as the VTEP, so that after receiving the first subnet ARP request message, the VTEP acquires all ARP cache table entries in a local ARP cache table of the VTEP, which meet the first subnet ARP request message, and constructs a subnet ARP response message according to all the ARP cache table entries;
receiving the subnet ARP response message sent by the VTEP, and updating a corresponding ARP cache table item in a local ARP cache table according to the subnet ARP response message;
before the sending the first subnet ARP request message to the VTEP connected upstream, the method further includes:
and generating a first subnet ARP request message with a source IP address of a self IP address, a source MAC address of a self MAC address, a target IP address of a VXLAN network segment address of the self, a subnet mask of subnet mask information corresponding to the VXLAN network segment address, a target MAC address of a broadcast MAC address and an OP corresponding value of 0x0003 according to a pre-stored subnet ARP request message format.
6. A VTEP, comprising:
the first receiving module is used for receiving a first subnet ARP request message sent by a lower VM (virtual machine), wherein the first subnet ARP request message is used for requesting address information of other VMs belonging to the same VXLAN network segment as the lower VM;
a first obtaining module, connected to the first receiving module, for obtaining all ARP cache entries in a local ARP cache table that satisfy the first subnet ARP request packet;
a response message construction module, connected to the first acquisition module, for constructing a subnet ARP response message according to all the ARP cache table entries;
the first sending module is connected with the response message construction module and used for sending the subnet ARP response message to the downstream VM so that the downstream VM updates a corresponding ARP cache table entry in a local ARP cache table of the downstream VM according to the subnet ARP response message;
the source IP address of the first subnet ARP request message is the IP address of the downlink VM, the source MAC address is the MAC address of the downlink VM, the destination IP address is the VXLAN network segment address to which the downlink VM belongs, the subnet mask is subnet mask information corresponding to the VXLAN network segment address, the destination MAC address is a broadcast MAC address, and the OP correspondence value is 0x 0003;
the VTEP further comprises:
a first generating module, configured to generate, according to a pre-stored subnet ARP request message format, a second subnet ARP request message with a source IP address being a self IP address, a source MAC address being a self MAC address, a destination IP address being the VXLAN network segment address, a subnet mask being the subnet mask information, a destination MAC address being the broadcast MAC address, and an OP correspondence value of 0x 0003;
a third sending module, configured to send the second subnet ARP request packet to all other VTEPs;
and the third receiving module is used for receiving the ARP response messages returned by the other VTEPs and updating the corresponding ARP cache table entries in the local ARP cache table according to the received ARP response messages.
7. A VM, comprising:
a second sending module, configured to send a first subnet ARP request message to an upstream VTEP, where the first subnet ARP request message is used to request address information of other VMs belonging to the same VXLAN network segment as the VTEP itself, so that after the VTEP receives the first subnet ARP request message, the VTEP obtains all ARP cache entries in its local ARP cache table that satisfy the first subnet ARP request message, and constructs a subnet ARP response message according to all ARP cache entries;
a second receiving module, connected to the second sending module, for receiving the subnet ARP response packet sent by the VTEP, and updating a corresponding ARP cache entry in its local ARP cache table according to the subnet ARP response packet;
the VM further includes:
and the second generation module is used for generating a first subnet ARP request message with a source IP address of the first subnet ARP request message as an IP address of the first subnet, a source MAC address of the first subnet as an MAC address of the first subnet, a destination IP address of the first subnet as a VXLAN network segment address of the first subnet, subnet mask of the first subnet as subnet mask information corresponding to the VXLAN network segment address, a broadcast MAC address of the destination MAC address and an OP corresponding value of 0x0003 according to a prestored subnet ARP request message format.
8. An apparatus for updating ARP cache entry, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the method for updating ARP cache entry according to any of claims 1-4, or to implement the method for updating ARP cache entry according to claim 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110648817.XA CN113472912B (en) | 2021-06-10 | 2021-06-10 | ARP cache table item updating method, VTEP, VM and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110648817.XA CN113472912B (en) | 2021-06-10 | 2021-06-10 | ARP cache table item updating method, VTEP, VM and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113472912A CN113472912A (en) | 2021-10-01 |
CN113472912B true CN113472912B (en) | 2022-08-26 |
Family
ID=77869623
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110648817.XA Active CN113472912B (en) | 2021-06-10 | 2021-06-10 | ARP cache table item updating method, VTEP, VM and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113472912B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114520800B (en) * | 2022-01-07 | 2024-04-16 | 锐捷网络股份有限公司 | Method and device for updating MAC address table |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102143068A (en) * | 2011-03-01 | 2011-08-03 | 华为技术有限公司 | Method, device and system for learning MAC (Media Access Control) address |
CN103973833A (en) * | 2014-05-05 | 2014-08-06 | 杭州华三通信技术有限公司 | Method and device for updating ARP cache |
CN106899706A (en) * | 2017-01-11 | 2017-06-27 | 新华三技术有限公司 | One kind floods suppressing method and device |
CN107800625A (en) * | 2016-08-30 | 2018-03-13 | 新华三技术有限公司 | A kind of message forwarding method and device |
CN109257265A (en) * | 2018-08-10 | 2019-01-22 | 锐捷网络股份有限公司 | One kind floods suppressing method, VXLAN bridge, gateway and system |
CN111934969A (en) * | 2020-07-28 | 2020-11-13 | 锐捷网络股份有限公司 | Maintenance method and device of MAC forwarding table |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3070887B1 (en) * | 2013-12-11 | 2017-08-09 | Huawei Technologies Co., Ltd. | Communication method, device and system for virtual extensible local area network |
US10693833B2 (en) * | 2017-03-07 | 2020-06-23 | Nicira, Inc. | Address resolution suppression in a logical network |
-
2021
- 2021-06-10 CN CN202110648817.XA patent/CN113472912B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102143068A (en) * | 2011-03-01 | 2011-08-03 | 华为技术有限公司 | Method, device and system for learning MAC (Media Access Control) address |
CN103973833A (en) * | 2014-05-05 | 2014-08-06 | 杭州华三通信技术有限公司 | Method and device for updating ARP cache |
CN107800625A (en) * | 2016-08-30 | 2018-03-13 | 新华三技术有限公司 | A kind of message forwarding method and device |
CN106899706A (en) * | 2017-01-11 | 2017-06-27 | 新华三技术有限公司 | One kind floods suppressing method and device |
CN109257265A (en) * | 2018-08-10 | 2019-01-22 | 锐捷网络股份有限公司 | One kind floods suppressing method, VXLAN bridge, gateway and system |
CN111934969A (en) * | 2020-07-28 | 2020-11-13 | 锐捷网络股份有限公司 | Maintenance method and device of MAC forwarding table |
Also Published As
Publication number | Publication date |
---|---|
CN113472912A (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109257265B (en) | Flooding suppression method, VXLAN bridge, gateway and system | |
TWI744359B (en) | Method for data transmission and network equipment | |
US11374857B2 (en) | Network device management method and apparatus, and system for indicating a network device to perform management operation | |
WO2020156166A1 (en) | Packet processing method and device | |
CN110213148B (en) | Data transmission method, system and device | |
CN113872845B (en) | Method for establishing VXLAN tunnel and related equipment | |
CN112134776B (en) | Method for generating multicast forwarding table item and access gateway | |
US20230370375A1 (en) | Data processing method and system, encapsulation node, and de-encapsulation node | |
US11936614B2 (en) | Method and apparatus for sending reply packet, computing device, and storage medium | |
CN112565476A (en) | Virtual machine creation method, ARP proxy gateway and VTEP | |
CN113472912B (en) | ARP cache table item updating method, VTEP, VM and device | |
CN113595849B (en) | Message forwarding method, sending end VTEP and gateway VTEP | |
CN113037883B (en) | Method and device for updating MAC address table entries | |
CN113254148A (en) | Virtual machine migration method and cloud management platform | |
EP4024807A1 (en) | Message sending method and apparatus | |
CN108306825A (en) | A kind of equivalence forwarding-table item generation method and VTEP equipment | |
WO2023273957A1 (en) | Computing power release method and apparatus, and computing power update method and apparatus | |
CN113938446B (en) | Multicast table item synchronization method and device based on MLAG environment | |
CN107689881B (en) | Message processing method and device | |
CN112994928B (en) | Virtual machine management method, device and system | |
CN113300931B (en) | Virtual machine migration discovery method and VTEP | |
CN113438333A (en) | Network address allocation method, device and equipment | |
CN114221895A (en) | Data transmission method, device and network equipment | |
CN105897949A (en) | Method and system for directly accessing data center internal network | |
CN108259292B (en) | Method and device for establishing tunnel |
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 |