CN113890867A - Communication address allocation method and device, electronic equipment and storage medium - Google Patents

Communication address allocation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113890867A
CN113890867A CN202111203397.0A CN202111203397A CN113890867A CN 113890867 A CN113890867 A CN 113890867A CN 202111203397 A CN202111203397 A CN 202111203397A CN 113890867 A CN113890867 A CN 113890867A
Authority
CN
China
Prior art keywords
address
target
request message
communication
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.)
Pending
Application number
CN202111203397.0A
Other languages
Chinese (zh)
Inventor
徐继浩
赵瑞雪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202111203397.0A priority Critical patent/CN113890867A/en
Publication of CN113890867A publication Critical patent/CN113890867A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling

Abstract

The application discloses a communication address allocation method and device, electronic equipment and a storage medium. The method comprises the following steps: intercepting an address request message under the condition that a virtual machine is monitored to send the address request message; inquiring target processing equipment corresponding to the address request message from the message flow table; sending the address request message to the target processing equipment through a target network tunnel arranged between the forwarding equipment and the target processing equipment; and receiving an address response message fed back by the target processing equipment according to the address request message, and sending the address response message to the virtual machine so that the virtual machine carries out network communication based on a target communication address carried in the address response message. The address request message is forwarded by adopting the network tunnel between the forwarding equipment and the processing equipment, so that the address request message is sent in a point-to-point mode, a virtual machine is not required to broadcast the address request message, and the efficiency and the safety of address allocation are improved.

Description

Communication address allocation method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for allocating a communication address, an electronic device, and a storage medium.
Background
In a virtualization scenario, because the virtualization management system needs to manage a large number of virtual machines, each virtual machine needs to configure an IP address to communicate with other virtual machines or an external network. The virtual machine in the existing virtualization management system needs to log in the virtual machine to manually configure the IP address, which brings great trouble to the administrator of the virtualization management system, and needs to plan the IP address in advance, otherwise, IP address conflict is easily caused. Therefore, the virtualization management system urgently needs to automatically allocate an IP address to the virtual machine in a DHCP manner, so as to implement a DHCP function. The following problems may occur if IP addresses are allocated by the conventional DHCP method: firstly, a computing node running a virtual machine needs to be in the same local area network with a DHCP server in a virtualization management system, and limitation is brought to the networking scale of the virtualization management system; secondly, the DHCP server in the virtualization management system can also receive DHCP requests from other devices in the network other than the virtual machine managed by the virtualization management system, which causes the situation that assignable IP addresses of the virtual machine are occupied, and the DHCP server in the virtualization may be attacked maliciously, which results in a network security problem.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present application provides a communication address allocation method, apparatus, electronic device and storage medium.
According to an aspect of the embodiments of the present application, there is provided a method for allocating a communication address, which is applied to a forwarding device in a virtualization management system, the method including:
intercepting an address request message under the condition that a virtual machine is monitored to send the address request message, wherein the address request message is used for acquiring a communication address of the virtual machine;
inquiring target processing equipment corresponding to the address request message from a message flow table, wherein the target processing equipment is deployed in the virtualization management system and is used for distributing a communication address for the virtual machine;
sending the address request message to the target processing device through a target network tunnel arranged between the forwarding device and the target processing device;
and receiving an address response message fed back by the target processing equipment according to the address request message, and sending the address response message to the virtual machine so that the virtual machine carries out network communication based on a target communication address carried in the address response message.
Further, before passing the address request packet through a target network tunnel disposed between the forwarding device and the target processing device, the method further includes:
receiving a plurality of tunnel initialization instructions sent by processing equipment deployed in different local area networks;
and establishing a network tunnel between the forwarding equipment and each processing equipment according to the tunnel initialization instruction.
Further, before querying a target processing device corresponding to the address request packet from a packet flow table, the method further includes:
acquiring preset message content;
and establishing a corresponding relation between the preset message content and the processing equipment according to a preset matching rule, and generating the message flow table based on the corresponding relation.
According to still another aspect of the embodiments of the present application, there is provided a method for allocating a communication address, which is applied to a processing device in a virtualization management system, the method including:
receiving an address request message sent by forwarding equipment based on a target network tunnel, wherein the target network tunnel is a network tunnel arranged between the forwarding equipment and the target processing equipment;
acquiring a target communication address meeting the address request message from a preset address pool;
generating an initial response message corresponding to the address request message, and carrying the target communication address in the initial response message to obtain an address response message;
and sending the address response message to the forwarding equipment through the target network tunnel so that the forwarding equipment sends the address request message to a virtual machine, so that the virtual machine performs network communication based on a target communication address carried in the address response message.
Further, before receiving the address request packet sent by the forwarding device based on the target network tunnel, the method further includes:
sending a tunnel initialization instruction to a plurality of candidate forwarding devices so that the candidate forwarding devices establish network tunnels between the candidate forwarding devices and processing devices according to the tunnel initialization instruction;
after the network tunnel is monitored to be established, sending a debugging message to the candidate forwarding equipment based on the network tunnel;
and after receiving a response message fed back by the candidate forwarding equipment according to the debugging message, determining that the network tunnel is effective.
Further, the obtaining the target communication address satisfying the address request message from the preset address pool includes:
acquiring the distribution state corresponding to each communication address in the preset address pool;
determining the communication address of which the allocation state belongs to the non-allocation state as a candidate communication address;
acquiring message content based on the address request message;
and determining the communication address meeting the message content in the candidate communication addresses as a target communication address.
According to still another aspect of the embodiments of the present application, there is provided a communication address allocating apparatus, including:
the monitoring module is used for intercepting an address request message under the condition that the virtual machine is monitored to send the address request message, wherein the address request message is used for acquiring a communication address of the virtual machine;
the query module is configured to query, from a message flow table, a target processing device corresponding to the address request message, where the target processing device is deployed in the virtualization management system, and the target processing device is configured to allocate a communication address to the virtual machine;
a sending module, configured to send the address request packet to the target processing device through a target network tunnel disposed between a forwarding device and the target processing device;
and the forwarding module is used for receiving an address response message fed back by the target processing equipment according to the address request message and sending the address response message to the virtual machine so that the virtual machine performs network communication based on a target communication address carried in the address response message.
According to still another aspect of the embodiments of the present application, there is provided a communication address allocating apparatus, including:
a monitoring module, configured to receive an address request packet sent by a forwarding device based on a target network tunnel, where the target network tunnel is a network tunnel disposed between the forwarding device and the target processing device;
the acquisition module is used for acquiring a target communication address meeting the address request message from a preset address pool;
a generating module, configured to generate an initial response message corresponding to the address request message, and carry the target communication address in the initial response message to obtain an address response message;
and the sending module is used for sending the address response message to the forwarding equipment through the target network tunnel so that the forwarding equipment sends the address request message to the virtual machine, and the virtual machine performs network communication based on a target communication address carried in the address response message.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that executes the above steps when the program is executed.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the steps of the method by running the program stored in the memory.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of the above method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method and the device, the address request message sent by the virtual machine is intercepted, the processing equipment corresponding to the address request message is determined from the message flow table, and meanwhile the address request message is forwarded by adopting the network tunnel between the forwarding equipment and the processing equipment, so that the address request message is sent in a point-to-point mode, the virtual machine is not required to broadcast the address request message, and the efficiency and the safety of address allocation are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic diagram of a virtualization management system according to an embodiment of the present application;
fig. 2 is a flowchart of a communication address allocation method according to an embodiment of the present application;
fig. 3 is a flowchart of a method for allocating communication addresses according to another embodiment of the present application;
fig. 4 is a block diagram of an apparatus for allocating a communication address according to an embodiment of the present application;
fig. 5 is a block diagram of an apparatus for assigning a communication address according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments, and the illustrative embodiments and descriptions thereof of the present application are used for explaining the present application and do not constitute a limitation to the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another similar entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the prior art, the method for automatically acquiring the IP address is that equipment in the network is used as a DHCP client to automatically allocate the IP address to the equipment in the network through a DHCP server, and the method is suitable for large and medium-sized networks, improves the automation degree and reduces the workload of IP address allocation and maintenance of network administrators.
DHCP is an abbreviation for Dynamic Host Configuration Protocol (Dynamic Host allocation Protocol), which is a network management Protocol existing in the application layer, and with the help of DHCP, any device or node in the network can be dynamically allocated an IP address so that they can communicate using this IP address. The DHCP is divided into a client and a server, and the process of acquiring the IP address by the DHCP client comprises the following stages:
(1) and (5) a discovery phase.
The DHCP client side searches the DHCP server by sending a DHCP-DISCOVER message. The DHCP client side sends DHCP-DISCOVER messages in a broadcasting mode, and all DHCP servers receiving the DHCP-DISCOVER messages send response messages.
(2) A providing stage.
The DHCP server which receives the DHCP-DISCOVER message can select a proper IP address to send to the DHCP client through the DHCP-OFFER message.
(3) And (4) selecting.
After receiving the DHCP-OFFER message, the DHCP client only receives the first received DHCP-OFFER message, and then sends a DHCP-REQUEST request message in a broadcasting mode to inform the selected DHCP server.
(4) And (5) a confirmation stage.
After receiving the DHCP-REQUEST message sent by the client, the DHCP server sends a DHCP-ACK message to respond and informs the client of using the allocated IP address.
Automatic assignment of IP addresses to devices in a network by way of DHCP provides significant benefits to IP address assignment, but also has some disadvantages. Since the DHCP client may send a DHCP-DISCOVER message in a broadcast manner, when there are multiple DHCP servers in the network, the client may obtain IP addresses of other network segments. The DHCP server is communicated with the client end across different routers, and IP address allocation can be carried out only in a local area network. In addition, the DHCP server may also receive a DHCP request from another device in the network other than the virtual machine managed by the virtualization management system, and the IP address assignable to the virtual machine may be occupied.
Based on this, an embodiment of the present application provides a virtualization management system, and fig. 1 is a schematic diagram of a virtualization management system provided in an embodiment of the present application, as shown in fig. 1, the virtualization management system provided in an embodiment of the present application includes: a virtual machine 101 and a management system 102, the management system 102 including: a forwarding device 103 and a processing device 104, wherein the forwarding device 103 may be a virtual host, and the processing device 104 may be a server, etc.
In this embodiment of the application, VXLAN interworking modules are deployed in both the forwarding device 103 and the processing device 104, and the processing device 104 further includes an address management module.
In this embodiment of the application, the virtual machine 101 sends an address request message to the forwarding device 103, and after the forwarding device 103 receives the address request message, the VXLAN interworking module in the forwarding device 103 parses the address request message, determines the message content of the address request message, and queries a target processing device corresponding to the query message content in a message flow table. The address request message is then sent to the target processing device through the target network tunnel between the forwarding device 103 and the target processing device. After receiving the address request message, the VXLAN interworking module of the target processing equipment analyzes the address request message, and sends the analyzed address request message to the address management module so that the address management module can allocate an available IP address.
The embodiment of the application completes the allocation of the IP address of the virtual machine in the virtualization management system by designing the VXLAN intercommunication module and the address management module. A VXLAN intercommunication module is designed, and a point-to-point VXLAN tunnel is established between forwarding equipment and processing equipment through an initialization instruction of the VXLAN intercommunication module. And sending the message to the processing equipment point to point through the VXLAN tunnel, and not sending the message in a broadcasting mode. And the address management module replaces the DHCPserver to respond to the address request message and allocate the IP address.
The embodiment of the application provides a communication address allocation method and device, electronic equipment and a storage medium. The method provided by the embodiment of the invention can be applied to any required electronic equipment, for example, the electronic equipment can be electronic equipment such as a server and a terminal, and the method is not particularly limited herein, and is hereinafter simply referred to as electronic equipment for convenience in description.
According to an aspect of the embodiments of the present application, a method embodiment of a communication address allocation method is provided, which is applied to a forwarding device in a virtualization management system, and fig. 2 is a flowchart of the communication address allocation method provided in the embodiment of the present application, and as shown in fig. 2, the method includes:
step S11, intercepting the address request message when it is monitored that the virtual machine sends the address request message, where the address request message is used to obtain a communication address of the virtual machine.
In this embodiment of the present application, when a virtual machine needs to configure a communication address, the virtual machine sends an address request packet to a forwarding device in a virtualization management system, where the address request packet includes: a source port number, a destination port number, and so on, wherein the source port number is a port number of the virtual machine, and the destination port number is a port number requested to be accessed by the virtual machine.
It should be noted that, the forwarding device in the embodiment of the present application monitors the address request packet sent by the virtual machine, and aims to forward the address request packet, so that the address request packet of the virtual machine is not sent in a broadcast manner any more, which is beneficial to improving subsequent address allocation efficiency.
Step S12, querying a target processing device corresponding to the address request packet from the packet flow table, where the target processing device is deployed in the virtualization management system, and the target processing device is used to allocate a communication address for the virtual machine.
In the embodiment of the present application, after monitoring an address request packet, a forwarding device intercepts the address request packet, analyzes the address request packet to obtain a packet content, and then matches the packet content with each entry in a packet flow table, where each entry carries a packet processing mode and a processing device, and the packet processing mode may be a priority transmission sequence, an encapsulation mode, and the like of a packet. And if the message flow table has an entry matched with the message content, processing the address request message according to the message processing mode in the entry, and simultaneously determining the target processing equipment corresponding to the address request message.
In this embodiment of the present application, before querying a target processing device corresponding to an address request message from a message flow table, a method for generating the message flow table is further provided, where the method further includes the following steps a1-a 2:
step A1, obtaining the content of the preset message.
Step A2, establishing a corresponding relation between the preset message content and the processing device according to the preset matching rule, and generating a message flow table based on the corresponding relation.
In the embodiment of the application, the preset message content can be obtained according to the user uploading operation, and the preset message content includes information of a plurality of virtual machines acquired in advance, such as port numbers of the virtual machines, local area networks where the virtual machines are located, and then the preset message content is obtained by combining the information based on the virtual machines. And then establishing a corresponding relation between the preset message content and the processing equipment according to a preset matching rule. The preset matching rule may be that the message contents are divided, and the message contents belonging to the same type correspond to the same processing device.
The format of the message flow table is Match information:
Ethernet type:0x0800
IP protocol:17
UDP source port:67,mask:0xffff
UDP destination port:68,mask:0xffff
Instruction information:
Write acions:
Output interface:VXLAN。
step S13, the address request message is sent to the target processing device through the target network tunnel set between the forwarding device and the target processing device.
In the embodiment of the application, the target network tunnel is a VXLAN tunnel, and the VXLAN tunnel is adopted to send the address request message to the processing device point to point, so that the message sending efficiency is ensured, the address request message does not need to be sent in a broadcasting mode, and the safety of the message in the sending process is effectively ensured by adopting the VXLAN tunnel sending mode.
The embodiment of the present application further provides a process for establishing a network tunnel, which mainly includes the following steps B1-B2:
and step B1, receiving a tunnel initialization instruction sent by a plurality of processing devices deployed in different local area networks.
And step B2, establishing the network tunnel between the forwarding device and each processing device according to the tunnel initialization instruction.
According to the embodiment of the application, the network tunnel is established according to the tunnel initialization instructions sent by the processing devices deployed in different local area networks, so that the forwarding device and the processing node can be not in the same local area network, and the address allocation of the virtual machine is not limited to be performed in one local area network.
And step S14, receiving an address response message fed back by the target processing device according to the address request message, and sending the address response message to the virtual machine, so that the virtual machine performs network communication based on the target communication address carried in the address response message.
In the embodiment of the application, the address request message sent by the virtual machine is intercepted, the processing equipment corresponding to the address request message is determined from the message flow table, and the address request message is forwarded by adopting the network tunnel between the forwarding equipment and the processing equipment, so that the address request message is sent in a point-to-point mode, the virtual machine is not required to broadcast the address request message, and the efficiency and the safety of address allocation are improved.
Fig. 3 is a flowchart of a communication address allocation method provided in an embodiment of the present application, which is applied to a processing device in a virtualization management system, and as shown in fig. 3, the method may include the following steps:
step S21, receiving the address request message sent by the forwarding device based on the target network tunnel, where the target network tunnel is a network tunnel disposed between the forwarding device and the target processing device.
In this embodiment of the present application, before receiving an address request packet sent by a forwarding device based on a target network tunnel, the method further includes the following steps C1-C3:
step C1, sending a tunnel initialization instruction to multiple candidate forwarding devices, so that the candidate forwarding devices establish a network tunnel between the candidate forwarding devices and the processing device according to the tunnel initialization instruction.
And step C2, after the network tunnel is established, sending a debugging message to the candidate forwarding equipment based on the network tunnel.
And step C3, after receiving the response message fed back by the candidate forwarding device according to the debugging message, determining that the network tunnel is effective.
In the embodiment of the application, after sending the tunnel initialization instruction to the multiple candidate forwarding devices, the processing device monitors the progress of the candidate forwarding devices in constructing the network tunnel according to the tunnel initialization instruction, and sends a debugging message through the network tunnel when the construction is completed, so as to test the network tunnel, and if a response message fed back by the candidate forwarding devices according to the debugging message is received, it is determined that the established network tunnel is valid.
And step S22, obtaining the target communication address meeting the address request message from the preset address pool.
In the embodiment of the present application, obtaining a target communication address satisfying an address request message from a preset address pool includes the following steps D1-D4:
and D1, acquiring the distribution state corresponding to each communication address in the preset address pool.
Step D2, the communication address whose allocation state belongs to the non-allocation state is determined as the candidate communication address.
And D3, acquiring the message content based on the address request message.
And D4, determining the communication address meeting the message content in the candidate communication addresses as the target communication address.
In the embodiment of the application, a preset address pool in a processing device stores a plurality of communication addresses, then the allocation state of each communication address is inquired, the communication address of which the allocation state belongs to non-allocation is determined as a candidate communication address, then the candidate communication address is matched with the message content, specifically, port information and a physical address can be obtained from the message content, and then the communication address matched with the port information and the physical address is selected from the candidate communication address as a target communication address.
And step S23, generating an initial response message corresponding to the address request message, and carrying the target communication address in the initial response message to obtain the address response message.
Step S24, sending the address response message to the forwarding device through the target network tunnel, so that the forwarding device sends the address request message to the virtual machine, so that the virtual machine performs network communication based on the target communication address carried in the address response message.
In the embodiment of the application, the processing device receives the address request message through the target network tunnel, so that the address request message of the virtual machine cannot be corresponded by other processing devices of the local area network, the safety of address allocation of the virtual machine is ensured, and meanwhile, the target processing device cannot respond to other address request messages in the network.
Fig. 4 is a block diagram of an apparatus for allocating a communication address according to an embodiment of the present disclosure, which may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two. As shown in fig. 4, the apparatus includes:
the monitoring module 41 is configured to intercept an address request message when it is monitored that the virtual machine sends the address request message, where the address request message is used to request the virtualization management system to allocate a communication address to the virtual machine;
the query module 42 is configured to query, from the message flow table, a target processing device corresponding to the address request message, where the target processing device is deployed in the virtualization management system, and the target processing device is configured to allocate a communication address to the virtual machine;
a sending module 43, configured to send the address request packet to the target processing device through a target network tunnel disposed between the forwarding device and the target processing device;
and the forwarding module 44 is configured to receive an address response message fed back by the target processing device according to the address request message, and send the address response message to the virtual machine, so that the virtual machine performs network communication based on the target communication address carried in the address response message.
In this embodiment of the present application, the apparatus for allocating a communication address further includes a processing module, configured to receive a tunnel initialization instruction sent by a plurality of processing devices deployed in different local area networks; and establishing a network tunnel between the forwarding equipment and each processing equipment according to the tunnel initialization instruction.
In this embodiment of the present application, the apparatus for allocating a communication address further includes: the acquisition module is used for acquiring the content of the preset message; and establishing a corresponding relation between the preset message content and the processing equipment according to the preset matching rule, and generating a message flow table based on the corresponding relation.
Fig. 5 is a block diagram of an apparatus for allocating a communication address according to an embodiment of the present disclosure, where the apparatus may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two. As shown in fig. 5, the apparatus includes:
a monitoring module 51, configured to receive an address request packet sent by a forwarding device based on a target network tunnel, where the target network tunnel is a network tunnel disposed between the forwarding device and a target processing device;
an obtaining module 52, configured to obtain a target communication address satisfying the address request message from a preset address pool;
a generating module 53, configured to generate an initial response message corresponding to the address request message, and carry the target communication address in the initial response message, so as to obtain an address response message;
the sending module 54 is configured to send the address response packet to the forwarding device through the target network tunnel, so that the forwarding device sends the address request packet to the virtual machine, so that the virtual machine performs network communication based on the target communication address carried in the address response packet.
In this embodiment of the present application, the apparatus for allocating a communication address further includes a processing module, configured to send a tunnel initialization instruction to a plurality of candidate forwarding devices, so that the candidate forwarding devices establish a network tunnel between the candidate forwarding devices and the processing device according to the tunnel initialization instruction; after the completion of the establishment of the network tunnel is monitored, a debugging message is sent to the candidate forwarding equipment based on the network tunnel; and after receiving a response message fed back by the candidate forwarding equipment according to the debugging message, determining that the network tunnel is effective.
In this embodiment of the present application, the obtaining module 52 is configured to obtain an allocation state corresponding to each communication address in a preset address pool; determining a communication address of which the allocation state belongs to the non-allocation state as a candidate communication address; acquiring message content based on the address request message; and determining the communication address meeting the message content in the candidate communication addresses as a target communication address.
An embodiment of the present application further provides an electronic device, as shown in fig. 6, the electronic device may include: the system comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above embodiments when executing the computer program stored in the memory 1503.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the method for allocating a communication address as described in any one of the above embodiments.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for assigning a communication address as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A communication address allocation method is applied to forwarding equipment in a virtualization management system, and is characterized in that the method comprises the following steps:
intercepting an address request message under the condition that a virtual machine is monitored to send the address request message, wherein the address request message is used for acquiring a communication address of the virtual machine;
inquiring target processing equipment corresponding to the address request message from a message flow table, wherein the target processing equipment is deployed in the virtualization management system and is used for distributing a communication address for the virtual machine;
sending the address request message to the target processing device through a target network tunnel arranged between the forwarding device and the target processing device;
and receiving an address response message fed back by the target processing equipment according to the address request message, and sending the address response message to the virtual machine so that the virtual machine carries out network communication based on a target communication address carried in the address response message.
2. The method of claim 1, wherein before passing the address request packet through a target network tunnel disposed between the forwarding device and the target processing device, the method further comprises:
receiving a plurality of tunnel initialization instructions sent by processing equipment deployed in different local area networks;
and establishing a network tunnel between the forwarding equipment and each processing equipment according to the tunnel initialization instruction.
3. The method of claim 2, wherein before querying a message flow table for a target processing device corresponding to the address request message, the method further comprises:
acquiring preset message content;
and establishing a corresponding relation between the preset message content and the processing equipment according to a preset matching rule, and generating the message flow table based on the corresponding relation.
4. A communication address allocation method is applied to a processing device in a virtualization management system, and is characterized by comprising the following steps:
receiving an address request message sent by forwarding equipment based on a target network tunnel, wherein the target network tunnel is a network tunnel arranged between the forwarding equipment and the target processing equipment;
acquiring a target communication address meeting the address request message from a preset address pool;
generating an initial response message corresponding to the address request message, and carrying the target communication address in the initial response message to obtain an address response message;
and sending the address response message to the forwarding equipment through the target network tunnel so that the forwarding equipment sends the address request message to a virtual machine, so that the virtual machine performs network communication based on a target communication address carried in the address response message.
5. The method of claim 4, wherein before receiving the address request message sent by the forwarding device based on the target network tunnel, the method further comprises:
sending a tunnel initialization instruction to a plurality of candidate forwarding devices so that the candidate forwarding devices establish network tunnels between the candidate forwarding devices and processing devices according to the tunnel initialization instruction;
after the network tunnel is monitored to be established, sending a debugging message to the candidate forwarding equipment based on the network tunnel;
and after receiving a response message fed back by the candidate forwarding equipment according to the debugging message, determining that the network tunnel is effective.
6. The method according to claim 4, wherein the obtaining the target communication address satisfying the address request message from a preset address pool comprises:
acquiring the distribution state corresponding to each communication address in the preset address pool;
determining the communication address of which the allocation state belongs to the non-allocation state as a candidate communication address;
acquiring message content based on the address request message;
and determining the communication address meeting the message content in the candidate communication addresses as a target communication address.
7. An apparatus for assigning a communication address, comprising:
the monitoring module is used for intercepting an address request message under the condition that the virtual machine is monitored to send the address request message, wherein the address request message is used for acquiring a communication address of the virtual machine;
the query module is configured to query, from a message flow table, a target processing device corresponding to the address request message, where the target processing device is deployed in the virtualization management system, and the target processing device is configured to allocate a communication address to the virtual machine;
a sending module, configured to send the address request packet to the target processing device through a target network tunnel disposed between a forwarding device and the target processing device;
and the forwarding module is used for receiving an address response message fed back by the target processing equipment according to the address request message and sending the address response message to the virtual machine so that the virtual machine performs network communication based on a target communication address carried in the address response message.
8. An apparatus for assigning a communication address, comprising:
a monitoring module, configured to receive an address request packet sent by a forwarding device based on a target network tunnel, where the target network tunnel is a network tunnel disposed between the forwarding device and the target processing device;
the acquisition module is used for acquiring a target communication address meeting the address request message from a preset address pool;
a generating module, configured to generate an initial response message corresponding to the address request message, and carry the target communication address in the initial response message to obtain an address response message;
and the sending module is used for sending the address response message to the forwarding equipment through the target network tunnel so that the forwarding equipment sends the address request message to the virtual machine, and the virtual machine performs network communication based on a target communication address carried in the address response message.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is operative to perform the method steps of any of the preceding claims 1 to 7.
10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any of claims 1-7 by executing a program stored on a memory.
CN202111203397.0A 2021-10-15 2021-10-15 Communication address allocation method and device, electronic equipment and storage medium Pending CN113890867A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111203397.0A CN113890867A (en) 2021-10-15 2021-10-15 Communication address allocation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111203397.0A CN113890867A (en) 2021-10-15 2021-10-15 Communication address allocation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113890867A true CN113890867A (en) 2022-01-04

Family

ID=79003001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111203397.0A Pending CN113890867A (en) 2021-10-15 2021-10-15 Communication address allocation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113890867A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102497378A (en) * 2011-12-15 2012-06-13 杭州华三通信技术有限公司 Method and device for dynamically choosing DHCP server for client terminal
CN102752413A (en) * 2012-07-02 2012-10-24 杭州华三通信技术有限公司 Method for selecting DHCP (dynamic host configuration protocol) server and network equipment
CN102833174A (en) * 2012-09-17 2012-12-19 北京星网锐捷网络技术有限公司 Tunnel forwarding method and device as well as network equipment
WO2015085788A1 (en) * 2013-12-10 2015-06-18 华为技术有限公司 Method and apparatus for processing dynamic host configuration protocol message
CN106936943A (en) * 2017-03-21 2017-07-07 深信服科技股份有限公司 The distribution method and system of virtual machine address
CN108667957A (en) * 2018-05-21 2018-10-16 联想(北京)有限公司 IP address distribution method, the first electronic equipment and first server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102497378A (en) * 2011-12-15 2012-06-13 杭州华三通信技术有限公司 Method and device for dynamically choosing DHCP server for client terminal
CN102752413A (en) * 2012-07-02 2012-10-24 杭州华三通信技术有限公司 Method for selecting DHCP (dynamic host configuration protocol) server and network equipment
CN102833174A (en) * 2012-09-17 2012-12-19 北京星网锐捷网络技术有限公司 Tunnel forwarding method and device as well as network equipment
WO2015085788A1 (en) * 2013-12-10 2015-06-18 华为技术有限公司 Method and apparatus for processing dynamic host configuration protocol message
CN106936943A (en) * 2017-03-21 2017-07-07 深信服科技股份有限公司 The distribution method and system of virtual machine address
CN108667957A (en) * 2018-05-21 2018-10-16 联想(北京)有限公司 IP address distribution method, the first electronic equipment and first server

Similar Documents

Publication Publication Date Title
CN108449282B (en) Load balancing method and device
EP3664420B1 (en) Managing address spaces across network elements
US11075948B2 (en) Method and system for virtual machine aware policy management
CN111460460B (en) Task access method, device, proxy server and machine-readable storage medium
US20140204803A1 (en) Automated network service discovery and communication
US9621512B2 (en) Dynamic network action based on DHCP notification
CN110677405A (en) Data processing method and device, electronic equipment and storage medium
CN110012118B (en) Method and controller for providing Network Address Translation (NAT) service
US20200304456A1 (en) Network and Network Management Method
CN114070723A (en) Virtual network configuration method and system of bare metal server and intelligent network card
US10608942B1 (en) Reducing routes based on network traffic utilization
WO2014142258A1 (en) Communication system, control device, address allocation method, and program
CN108667957B (en) IP address allocation method, first electronic device and first server
US9450909B2 (en) Method of and a processing device handling a protocol address in a network
US10243920B1 (en) Internet protocol address reassignment between virtual machine instances
CN113608865A (en) Flow control method, device, system, electronic equipment and storage medium
US20180123879A1 (en) Method for Configuring Forwarding Table for User Equipment, Apparatus, and System
CN110247778B (en) Operating system installation method and device, electronic equipment and storage medium
WO2023221708A1 (en) Pdn dialing method, system and apparatus, multi-pdn dialing configuration method, system and apparatus, and device and storage medium
US10778574B2 (en) Smart network interface peripheral cards
CN113890867A (en) Communication address allocation method and device, electronic equipment and storage medium
CN109698845B (en) Data transmission method, server, unloading card and storage medium
CN113904871B (en) Access method of network slice, PCF entity, terminal and communication system
CN107070725A (en) A kind of method that server two-level management intermodule communication is shaken hands
US7418488B1 (en) Network address assignment server with configuration updating capability

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