CN108307002B - DHCP message processing method and device - Google Patents

DHCP message processing method and device Download PDF

Info

Publication number
CN108307002B
CN108307002B CN201810438541.0A CN201810438541A CN108307002B CN 108307002 B CN108307002 B CN 108307002B CN 201810438541 A CN201810438541 A CN 201810438541A CN 108307002 B CN108307002 B CN 108307002B
Authority
CN
China
Prior art keywords
dhcp
network
address
service
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810438541.0A
Other languages
Chinese (zh)
Other versions
CN108307002A (en
Inventor
艾助雄
李有强
秦永钢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201810438541.0A priority Critical patent/CN108307002B/en
Publication of CN108307002A publication Critical patent/CN108307002A/en
Priority to PCT/CN2019/085602 priority patent/WO2019214560A1/en
Application granted granted Critical
Publication of CN108307002B publication Critical patent/CN108307002B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/562Brokering proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for processing a Dynamic Host Configuration Protocol (DHCP) message, wherein the method comprises the steps that a DHCP proxy node receives a request from a service network, and the request is used for distributing an IP address for a virtual machine or a physical machine; the DHCP proxy node acquires an IP address from a DHCP service node in a management network according to the request; and the DHCP proxy node sends the acquired IP address to the virtual machine or the physical machine. The method deploys the DHCP proxy node in the data center, and the DHCP proxy node has the function of freely forwarding the message or the message between the service network and the management network, thereby realizing the automatic configuration of the IP address, saving the management cost, avoiding the operation of manually configuring the IP address by an administrator and improving the connection efficiency.

Description

DHCP message processing method and device
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a DHCP message processing method and apparatus.
Background
During the construction of a data center, at least one independent service area and a centralized operation and maintenance management area are usually set. The operation and maintenance management area is used for deploying management and operation and maintenance platforms of various software and hardware systems and is isolated from the service network.
Specifically, various management nodes are deployed in the operation and maintenance management area, and virtual machines or physical machines for various service systems are deployed in each service area. Each management node deployed in the operation and maintenance management area is used for providing a management and operation and maintenance platform for a virtual machine or a physical machine in the service area.
In order to implement unified management of Internet Protocol (IP) addresses of virtual machines or physical machines in a service area, a Dynamic Host Configuration Protocol (DHCP) service node for allocating the IP addresses is usually deployed in an operation and maintenance management area. When an administrator issues a virtual machine or a physical machine in a certain service area, the virtual machine or the physical machine needs to send a DHCP request through a service network to acquire an IP address. The DHCP is a two-layer network protocol, a service network of a service area is not communicated with a management network of an operation and maintenance management area, so that DHCP broadcast cannot be sent to a DHCP service node of the operation and maintenance management area from a virtual machine or a physical machine of the service area, and further the virtual machine or the physical machine cannot automatically configure an IP address by using the DHCP broadcast.
Disclosure of Invention
By deploying one DHCP proxy node, the DHCP proxy node can forward the DHCP broadcast acquired from the service network to the DHCP service node on the management node through the management network, so that the problem that the IP address cannot be automatically configured by a virtual machine or a physical machine due to the isolation of the service network and the management network is solved.
Specifically, the application discloses the following technical scheme:
receiving a request from a service network by a DHCP proxy node, wherein the request is used for indicating that an IP address is allocated to a virtual machine or a physical machine; the DHCP proxy node sends the request to a DHCP service node, and acquires an IP address from the DHCP service node in a management network according to the request; and sending the IP address to the virtual machine or the physical machine.
Optionally, the request includes a DHCP Discover broadcast message in a DHCP protocol.
Optionally, the IP address may be carried by a DHCP Offer packet in a DHCP protocol.
In the aspect, message forwarding between a management network and a service network can be realized by configuring the DHCP proxy node, so that an IP address is automatically allocated to the virtual machine or the physical machine.
With reference to the first aspect, in an implementation manner of the first aspect, the receiving, by the DHCP proxy node, a request from a service network includes: and the DHCP proxy node receives the request from the virtual machine or the physical machine through a first network card, and the first network card is used for accessing the service network so as to realize the receiving and sending of the request in the service network.
With reference to the first aspect, in another implementation manner of the first aspect, the acquiring, by the DHCP proxy node, an IP address from a DHCP service node according to the request in a management network includes: and the DHCP proxy node receives the IP address distributed by the DHCP service node according to the request through a second network card, and the second network card is used for accessing the management network so as to realize the receiving and sending of the IP address in the management network.
With reference to the first aspect, in yet another implementation manner of the first aspect, the first network card is located on a host where the second network card is located, and the DHCP proxy node is deployed on the host where the second network card is located.
In a second aspect, the present application further provides a DHCP proxy node, including a receiving module and a sending module, where the receiving module is configured to receive a request from a service network, and obtain an IP address from a DHCP service node according to the request in a management network, where the request is used to instruct to allocate an IP address to a virtual machine or a physical machine; and the sending module is used for sending the IP address to the virtual machine or the physical machine.
With reference to the second aspect, in an implementation manner of the second aspect, the receiving module is specifically configured to receive the request from the virtual machine or the physical machine through a first network card, where the first network card is used to access the service network.
With reference to the second aspect, in another implementation manner of the second aspect, the receiving module is specifically configured to receive, through a second network card, the IP address allocated by the DHCP service node according to the request, where the second network card is configured to access the management network.
With reference to the second aspect, in another implementation manner of the second aspect, the first network card is located on a host where the second network card is located, and the DHCP proxy node is deployed on the host where the second network card is located.
In a third aspect, the present application further provides a data center comprising at least one computing device, each of the computing devices comprising a processor and a memory, the at least one processor executing instructions for controlling a DHCP proxy node, a DHCP service node, and a virtual machine,
the DHCP proxy node is used for receiving a request from a service network, acquiring an IP address from a DHCP service node according to the request in a management network, and sending the IP address to a virtual machine or a physical machine, wherein the request is used for indicating that the IP address is allocated to the virtual machine or the physical machine.
With reference to the third aspect, in an implementation manner of the third aspect, the processor is specifically configured to control the DHCP proxy node to receive the request from the virtual machine or the physical machine through a first network card, where the first network card is used to access the service network.
With reference to the third aspect, in another implementation manner of the third aspect, the processor is specifically configured to control the DHCP proxy node to receive, through a second network card, the IP address allocated by the DHCP service node according to the request, where the second network card is used to access the management network.
With reference to the third aspect, in another implementation manner of the third aspect, the first network card is located on a host where the second network card is located, and the DHCP proxy node is deployed on the host where the second network card is located.
In a fourth aspect, the present application further provides a computer storage medium, where the computer storage medium may store instructions, and when the instructions are executed, part or all of the steps of the DHCP message processing method according to the first aspect and the various implementation manners in the first aspect provided in the present application may be implemented.
Wherein the storage medium comprises a memory in the computing device of the third aspect.
In a fifth aspect, the present application further provides a computer program product containing instructions, when the instructions are run on a computer, the computer executes the DHCP message processing method according to the above aspects.
According to the method, the DHCP proxy node is deployed in the data center, and has a free forwarding function of messages or messages between the service network and the management network, for example, the messages of the service network are received and sent through the first network card, and the messages of the management network are received and sent through the second network card, so that the problem that a virtual machine or a physical machine cannot realize automatic IP address configuration due to isolation of the service network and the management network in a cloud platform is solved.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic structural diagram of a data center provided in the present application;
fig. 2 is a flowchart of a DHCP message processing method provided in the present application;
fig. 3 is a schematic diagram of a DHCP lease process provided herein;
fig. 4 is a flowchart of another DHCP message processing method provided in the present application;
fig. 5 is a schematic diagram of DHCP message forwarding according to the present application;
fig. 6 is a schematic structural diagram of a DHCP proxy node according to the present application;
fig. 7 is a schematic structural diagram of a computing device provided in the present application.
Detailed Description
In order to make the technical solutions in the embodiments of the present application better understood and make the above objects, features and advantages of the embodiments of the present application more comprehensible, the technical solutions in the embodiments of the present application are described in further detail below with reference to the accompanying drawings.
First, various functional entities under the technical scenarios and systems of the present application, and technical terms are introduced and described.
As shown in fig. 1, a schematic diagram of a data center structure provided for the embodiment of the present application may be a cloud management platform or a cloud data center, where the data center deploys at least one host (i.e., a computing device), any host of the at least one host may deploy a virtual machine or a management node, and meanwhile, any host of the at least one host may not be virtualized, and is provided as a physical machine to a user to provide a service for the user. For example, fig. 1 illustrates a situation that a virtual machine and a management node are deployed on one host at the same time, in addition, only the virtual machine may be deployed on one host, and the management node is not deployed, which is not limited in this embodiment of the present application.
As shown in the data center shown in fig. 1, an area formed by each management node and a node related to the management node may be referred to as an operation and maintenance management area, and a network formed by the operation and maintenance management area is a management network; an area formed between all the service-related virtual machines and all the service-related physical machines can be called a service area, and a network formed by the service area is a service network. In the operation and maintenance management area, the management node is used for creating and configuring the virtual machine and configuring the physical machine, and the management node comprises a computing node and a network node.
Optionally, the management node in the present application may include a DHCP service node, configured to allocate an IP address and other parameters to the virtual machine or the physical machine. The management node may not include the DHCP service node, which is not limited in this application.
In addition, the service area may also only include a virtual machine, that is, only the virtual machine is used to provide services for the user, which is not limited in the embodiment of the present application.
The host machine where the virtual machine is located and the physical machine are accessed to the service network through the first network card, so that each virtual machine or physical machine can communicate with other virtual machines or physical machines through the service network. Meanwhile, the host where the virtual machine is located and the physical machine are accessed to the management network through the second network card, so that the management node configures the physical machine, creates and configures the virtual machine through the management network. The first network card and the second network card configured on the host realize the isolation of the service network and the management network. The isolation means that a management node in a management network can only perform creation and configuration operations on a virtual machine and cannot intervene in a service. For example, when a virtual machine in a service network performs service transmission, the management node cannot acquire data of the service transmission.
As shown in fig. 1, in the service area, the virtual machines communicate with each other, and establish a service network through the first network card, for example, the virtual machine 1 in the host 1, the virtual machine 2 in the host 2, and the physical machine 3 are respectively accessed to the service network through their respective first network cards, and implement different service functions in the service network.
And a DHCP proxy node is also deployed on the host where the virtual machine is located. The DHCP proxy node is a process on the host, and can respectively monitor the first network card and the second network card on the host, thereby communicating with the virtual machine or the physical machine of the service network and the management node in the management network. The DHCP proxy node forwards the message from the DHCP service node, which is monitored from the second network card, to the first network card, and forwards the message to the virtual machine or the physical machine through the first network card, so that the problem that the virtual machine or the physical machine cannot realize the automatic IP address configuration due to the isolation of a service network and a management network is solved. The DHCP proxy node only monitors the DHCP message, and other messages are discarded, so that the isolation of the service network and the virtual network is not influenced.
Further, to avoid interfering with DHCP requests within the management network, the listening port of the DHCP proxy node may be adjusted to a non-native DHCP protocol-formulated 67,68 port. In fig. 1, a DHCP proxy node deployed in a host where a virtual machine is located is exemplarily depicted, and further, since a physical machine also has a first network card and a second network card, the DHCP proxy node may also be deployed in the physical machine, which is not limited in this application.
Optionally, the technical scheme provided by the application can be applied to an OpenStack cloud platform, wherein the OpenStack is a free open source software cloud computing platform. OpenStack network services are standard services, typically involving the deployment of several programs in multiple network nodes. The main program of the OpenStack network service is a so-called Neutron server, which is a Python background program and provides an OpenStack network Application Programming Interface (API) to tenants of the network service, and transmits tenant requests to a series of plug-ins for processing.
A Neutron server (formerly known as Quantum) runs on the processor nodes to service the networking API and its extensions. Neutron servers may also be used to implement the network model and IP addressing of each port. A Neutron server typically includes at least one Neutron plug-in. Typically, Neutron plug-ins are run on the compute nodes to manage and configure the local virtual switch.
Optionally, in this embodiment, the function of the network management node may be implemented by a Neutron server in an OpenStack cloud platform, or may also be implemented by another computer program, which is not limited in this embodiment.
The DHCP protocol is used to assign IP addresses and some TCP/IP configuration information or network configuration parameters to network devices. DHCP adopts client/server communication mode, client end applies configuration to server, server returns IP address and other relevant configuration information distributed by client end to realize dynamic configuration of IP address and other information. DHCP improves safe, reliable and simple TCP/IP network setting, avoids address conflict in TCP/IP network, and greatly reduces burden of managing IP address setting.
In each embodiment of the present application, the client includes a virtual machine or a physical machine of a service area, which is not limited in this application.
In order to implement automatic assignment of an IP address to a virtual machine or a physical machine by a service node in the case of isolation of a service network and a management network, the present embodiment provides a DHCP message processing method applied to a data center, where the data center includes at least one computing device, each computing device includes a processor and a memory, the at least one computing device is configured to run a DHCP proxy node, a DHCP service node, and a virtual machine,
the DHCP proxy node is deployed on a virtual machine or a physical machine in a service area, a host where the virtual machine is located comprises two network cards, a first network card and a second network card, and the first network card is used for accessing a service network to realize message receiving and sending of the service network; the second network card is used for accessing a management network to realize message receiving and sending of the management network, and the DHCP proxy node is used for monitoring the processes of the first network card and the second network card.
Referring to fig. 2, the method includes the steps of:
step 201: the DHCP proxy node receives a request from a service network, wherein the request is used for indicating that an IP address is allocated to a virtual machine or a physical machine;
specifically, the DHCP proxy node receives the request from a virtual machine or a physical machine through a first network card, where the first network card is used to access the service network.
Wherein, the request comprises a DHCP Discover broadcast message.
Step 202: the DHCP proxy node sends the request to a DHCP service node, and acquires an IP address from the DHCP service node in a management network according to the request;
specifically, the DHCP proxy node sends the request to a DHCP service node through a second network card, and the DHCP proxy node receives the IP address allocated by the DHCP service node according to the request through the second network card, where the second network card is used to access the management network.
The DHCP service node and the DHCP proxy node establish communication connection before acquiring the request.
Step 203: and the DHCP proxy node sends the IP address to the virtual machine or the physical machine.
Specifically, the DHCP proxy node sends the IP address to a virtual machine or a physical machine through a first network card.
The first network card is located on a host where the second network card is located, and the DHCP proxy node is deployed on the host where the second network card is located.
Optionally, the IP address may be sent to the virtual machine in a manner carried by a DHCP Offer message.
In this embodiment, the DHCP proxy node accesses the service network through the first network card, acquires the request sent by the virtual machine from the service network, and then forwards the request to the DHCP service node through the management network, where the DHCP proxy node accesses the management network through the second network card, so as to forward the request packet from the service network to the management network.
Similarly, after receiving the request forwarded by the DHCP proxy node, the DHCP service node allocates an IP address and sends the IP address to the DHCP proxy node through the management network, and after receiving the IP address through the second network card, the DHCP proxy node converts the IP address into the service network and forwards the IP address to the virtual machine or the physical machine through the first network card, thereby implementing forwarding of the IP address from the management network to the service network.
In the method provided by this embodiment, a DHCP proxy node is deployed in a data center, and the DHCP proxy node has a function of freely forwarding a message or a packet between a service network and a management network, for example, the first network card is used to implement message transceiving of the service network, and the second network card is used to implement message transceiving of the management network, so that a problem that a virtual machine or a physical machine cannot implement automatic IP address configuration due to isolation between the service network and the management network in a cloud platform is solved.
The method realizes the automatic configuration of the IP address, saves the management cost, avoids the operation of manually configuring the IP address by an administrator and improves the binding efficiency of the IP address.
In addition, the physical machine or the virtual machine in the service area may obtain information such as a subnet mask, a default gateway address, and a DNS Server address in addition to the IP address from the DHCP service node (i.e., the DHCP Server), and this process is referred to as a DHCP lease process. Because when a virtual or physical machine receives a provided IP address, the DHCP service node will lease the IP address to the virtual or physical machine for a specified period of time.
Further, the DHCP lease procedure can be broadly divided into 4 steps, which are shown in fig. 3: the virtual or physical machine requests an IP address-the server responds-the virtual or physical machine selects an IP address-the server determines a lease.
Based on the DHCP lease process shown in fig. 3, the DHCP message processing method provided in this embodiment is described in detail, and the method may be applied to the data center shown in fig. 1.
The data center includes: the network management node is deployed in the operation and maintenance management area, and comprises at least one DHCP service node, a DHCP proxy node and a virtual machine or a physical machine.
Specifically, as shown in fig. 4, the method includes the steps of:
step 1: a user (administrator or tenant) creates a network and a network management node receives a request for network creation from the user.
Step 2: the network management node creates/initiates a DHCP service node on the operation and maintenance management area for the newly created network, which can serve automatic assignment of IP addresses for the network, e.g., providing IP addresses for the requesting VM/PM.
And step 3: and the network management node acquires the IP address information of the newly created DHCP service node.
And 4, step 4: and the network management node creates a DHCP proxy node for the PM/VM in the newly created network.
Specifically, if the service area does not have a DHCP proxy node, the network management node creates a DHCP proxy node on a physical machine of the service area or a host where a virtual machine of the service area is located. The DHCP proxy node may also be deployed in the form of a master host or a cluster on multiple hosts in the service area, which is not limited in this embodiment.
And 5: and the network management node configures a DHCP service node, and sends information such as an IP address and a port of the newly created DHCP service node to the newly created DHCP proxy node in the step 4 or the original node of the service area, so that the DHCP proxy node establishes communication connection with the DHCP service node by using the IP address allocated by the DHCP service node.
Optionally, the method further includes:
step 6: after receiving the IP address of the DHCP service node, the DHCP proxy node establishes communication connection with the DHCP service node, tests the connectivity of the DHCP proxy node and the DHCP service node, if the network connection is not successful, the process is ended, and error warning information is sent to the data center, so that operation and maintenance personnel can intervene to diagnose fault points.
In this embodiment, the data center is used to select a DHCP service node and a DHCP proxy node for serving the virtual machine or the physical machine, and a communication connection between the DHCP service node and the DHCP proxy node is established through an IP address of the DHCP service node, so that the DHCP proxy node can automatically forward a request from the VM/PM to the DHCP service node after acquiring the request, and receive an IP address fed back by the DHCP service node, thereby automatically establishing a connection relationship between the DHCP service node and the VM/PM, thereby implementing automatic allocation of an IP address, and simultaneously avoiding modifying message content and filling the IP address of the DHCP service node corresponding to the DHCP proxy node.
And 7: the DHCP proxy node starts DHCP broadcast monitoring in the service network, and is used for monitoring request messages broadcast by all clients, such as virtual machines or physical machines, in the range of the DHCP proxy node.
And 8: when a user issues a virtual machine or a physical machine, or the IP address of the virtual machine or the physical machine needs to be refreshed, the user needs to acquire and bind an IP address, that is, broadcasts a DHCP Discover request message to the network.
Specifically, the virtual machine or the physical machine broadcasts a DHCP Discover packet to request an IP address in the data center, which is also referred to as DHCP Discover. Optionally, the source IP address of the DHCP Discover packet is 0.0.0.0; the destination IP address is 255.255.255.255, and the DHCP Discover packet may further include a MAC address and a computer name of the virtual machine or the physical machine, so that the DHCP service node can determine which virtual machine or physical machine sends the request packet.
And step 9: after receiving the DHCP Discover request message, the DHCP proxy node copies the message for forwarding, converts the message from a service network into a management network, and does not modify the message content or fill a DHCP relay field.
Step 10: and the DHCP proxy node sends the copied DHCP Discover request message to a DHCP service node through a management network.
Optionally, the DHCP proxy node sends the request packet to a DHCP service node in a unicast manner through a management network.
Step 11: the DHCP service node receives a DHCP Discover request message sent from the DHCP proxy node, and then processes the request message, specifically, selects an appropriate IP address from an IP address resource pool according to information contained in the DHCP Discover request message, and feeds back the appropriate IP address to the DHCP proxy node in a DHCP response message, for example, a DHCP Offer message.
Specifically, when the DHCP service node receives the information that the client requests the IP address, it searches its own IP address library to find whether there is a valid IP address to provide to the client, if so, the DHCP service node marks the IP address, and then unicast-sends a DHCP Offer packet to the DHCP proxy node (this process is also called DHCP Offer).
Step 12: after receiving a DHCP response message (such as a DHCP Offer message) from the DHCP service node through the service network, the DHCP proxy node transfers the message from the management network to the service network.
Step 13: and the DHCP proxy node sends the DHCP Offer message to a physical machine or a virtual machine through a service network.
Step 14: the physical machine or the virtual machine extracts an IP address from the DHCP Offer message and sends a DHCP response message (such as a DHCP Requst message) to the DHCP proxy node under the condition that the IP address is confirmed not to be occupied; if the IP address is occupied, the step 8 needs to be returned to restart the sending of the DHCP request message.
Specifically, the physical machine or the virtual machine selects an IP address from the received first DHCP Offer message, and generates a DHCP reply message, where the DHCP reply message indicates that the IP address in the DHCP reply message is available. Optionally, the DHCP reply message is a DHCP Request message, and this process is also referred to as DHCP Request.
Step 15: the DHCP proxy node receives a DHCP Request message from a physical machine or a virtual machine through a service network, copies the message for forwarding, and does not modify the content of the message or fill a DHCP relay field.
Step 16: and the DHCP proxy node sends the DHCP Request message to the DHCP service node through the management network.
And step 17: and the DHCP service node receives a DHCP Request message from the DHCP proxy node and sends a DHCP ACK message to the DHCP proxy node through a management network.
Specifically, the last step in the DHCP lease process is for the server to acknowledge the IP lease, also known as DHCP ACK. After receiving the DHCP Request, the DHCP service node feeds back to the physical machine or the virtual machine in the form of a DHCP ACK (DHCP Acknowledge) message, which includes an effective lease of the IP address and other possibly configured information, to indicate a successful acknowledgement. When the physical machine or the virtual machine receives the DHCP ACK, the physical machine or the virtual machine configures an IP address, completes the initialization of the TCP/IP and can communicate on the TCP/IP network.
In addition, if the physical machine or the virtual machine receives the IP address allocated by the DHCP service node and sends a DHCP Request message, the DHCP service node allocating the IP address marks and reserves the IP address, so that the IP address cannot be provided to other DHCP clients for use.
Step 18: and the DHCP proxy node receives a DHCP ACK message from the DHCP service node through the management network, and transfers the DHCP ACK message to the service network after processing.
Step 19: and the DHCP proxy node sends the DHCP ACK message to a client through a service network.
Step 20: and after receiving the DHCP ACK message, the physical machine or the virtual machine binds the requested IP address.
The flow ends.
Referring to fig. 5, a schematic structural diagram for forwarding a DHCP message by a DHCP proxy node is provided in this embodiment.
It should be noted that the DHCP Discover broadcast message, the DHCP Offer message, the DHCPRequest message, and the DHCP ACK message described in this embodiment are all messages in the DHCP protocol, and all have definite definitions, specifically, the role definition for each message in the DHCP protocol is as follows:
DHCP Discover message/packet, when a DHCP client (client) needs to acquire an IP address, the DHCP client broadcasts the packet of the type to a local network.
DHCP Offer message/packet the DHCP service node (server) replies to the DHCP Discover message sent by the DHCP client, and the DHCP Offer packet includes some configuration parameters, such as IP address, to be provided to the client by the DHCP service node.
DHCP Request message/packet, the packet sent to the DHCP server by the DHCP client side is as follows:
(a) the client requests the configuration information provided in the DHCP Offer sent by a particular service node while implicitly rejecting DHCP Offer packets from all other servers.
(b) The client confirms the correctness of the configuration information allocated to the client before at some time, for example, after the operating system of the client is restarted and after a short physical fault of a line.
(c) The client extends the lease of the explicit IP address it has acquired.
And the DHCP ACK message is that the DHCP service node replies a DHCP Request packet or a DHCP Inform packet sent by the DHCP client and contains the configuration information distributed to the client by the DHCP service node.
According to the technical scheme provided by the application, the DHCP proxy node is deployed on the host, so that the DHCP proxy node can forward the DHCP broadcast acquired from the service network to the DHCP service node through the management network, and the problem that the automatic configuration of the IP address cannot be realized by a virtual machine or a physical machine due to the isolation of the service network and the management network is solved.
In addition, the method realizes the centralized allocation of the IP addresses requested by the virtual machines by using the DHCP service nodes, so that the cloud computing platform or the virtualization platform meets the requirements of the current data center and the requirements of centralized operation and maintenance management, the network management nodes can manage the whole data center, a set of management platform is prevented from being deployed in each service area, the management cost is saved, the lease efficiency is improved, and the pressure of manual operation is avoided for a platform administrator through the automatic allocation of the IP addresses.
Referring to fig. 6, a schematic structural diagram of a DHCP proxy node according to the present application is shown, where the DHCP proxy node is deployed on a server or a computing node or a computing device, and is configured to execute the DHCP message processing method corresponding to fig. 2 or fig. 4.
As shown in fig. 6, the DHCP proxy node includes: the receiving module 601, the processing module 602, and the sending module 603, and the DHCP proxy node may further include other functional modules or components, such as a storage module.
The receiving module 601 is configured to receive a request from a service network, where the request is a DHCP Discover broadcast message.
A processing module 602 for converting the request from the service network to the management network.
A sending module 603, configured to send the request to the DHCP service node in a unicast manner.
The receiving module 601 is further configured to obtain an IP address from a DHCP service node in the management network according to the request, where the request is used to indicate that an IP address is allocated to the virtual machine or the physical machine. The IP address can be obtained by means of a DHCP Offer message.
A sending module 603, configured to send the IP address to the virtual machine or the physical machine.
Optionally, in a specific implementation manner of this embodiment, the receiving module 601 is specifically configured to receive the request from the virtual machine or the physical machine through a first network card, where the first network card is used to access the service network.
Optionally, in another specific implementation manner of this embodiment, the receiving module 601 is specifically configured to receive, through a second network card, the IP address allocated by the DHCP service node according to the request, where the second network card is used to access the management network.
The first network card is located on a host where the second network card is located, and the DHCP proxy node is deployed on the host where the second network card is located.
Optionally, in a specific implementation manner of this embodiment, the processing module 602 is specifically configured to transfer the DHCP Offer packet from a management network to a service network; the sending module 603 is specifically configured to send the DHCP Offer message to the virtual machine or the physical machine through the first network card.
Optionally, in a specific implementation manner of this embodiment, the receiving module 601 is further configured to obtain, through a service network, a DHCP Request message from the virtual machine or the physical machine, where the DHCP Request message indicates that an IP address in the DHCP Offer message is available; the processing module 602 is further configured to transfer the DHCP Request message from the service network to the management network; the sending module 603 is further configured to send the DHCP Request message to a DHCP service node through a second network card.
Optionally, in another specific implementation manner of this embodiment, the receiving module 601 is further configured to receive, through the management network, a DHCP ACK packet from the DHCP service node; the processing module 602 is further configured to transfer the DHCP ACK packet from the management network to the service network; the sending module 603 is further configured to send the DHCPACK message to the virtual machine or the physical machine through the first network card, so that the virtual machine or the physical machine binds the IP address after acquiring the DHCP ACK message.
Optionally, in another specific implementation manner of this embodiment, the receiving module 601 is further configured to obtain an IP address of the DHCP service node before obtaining the request packet; the processing module 602 is further configured to establish a connection with the DHCP service node according to the IP address, and test connectivity with the DHCP service node.
In addition, an embodiment of the present application further provides a network management node, for example, a Neutron component deployed in an OpenStack cloud computing platform, where a structure of the network management node may be the same as that of the DHCP proxy node shown in fig. 6, and includes: the device comprises a receiving module, a processing module, a sending module and the like.
The receiving module is used for acquiring a request from network creation of a virtual machine or a physical machine; the processing module is used for creating a DHCP service node for the virtual machine or the physical machine and determining a DHCP proxy node for the virtual machine or the physical machine, wherein the DHCP service node is used for providing an IP address, and the DHCP proxy node is used for sending the IP address to the virtual machine or the physical machine through a management network.
Optionally, the sending module is further configured to send the IP address corresponding to the DHCP service node to a DHCP proxy node, so that the DHCP proxy node establishes a communication connection with the DHCP service node by using the IP address of the DHCP service node.
In addition, the embodiment of the application also provides a DHCP service node which is used for realizing the automatic allocation of the IP address.
Optionally, the structure of the DHCP service node may be the same as the structure of the DHCP proxy node shown in fig. 6, including: the device comprises a receiving module, a processing module, a sending module and the like.
Specifically, the receiving module is configured to receive a DHCP request from a DHCP proxy node; the processing module is used for determining the IP address of the virtual machine or the physical machine according to the DHCP request, and the sending module is used for sending the IP address to the DHCP proxy node through the management network.
Optionally, in another specific implementation manner of this embodiment, the receiving module is further configured to receive a DHCP Request message from a DHCP proxy node, where the DHCP Request message indicates that an IP address allocated by the DHCP service node is available; the processing module is also used for generating an ACK message and sending the ACK message to the DHCP proxy node through the sending module.
It should be noted that, in the embodiments of the present application, the DHCP proxy node may also be referred to as a DHCP relay agent, a DHCP forwarding agent, a DHCP relay, or a DHCP forwarding node, and may also be another proxy module, which is used to implement message transceiving between a service network and a management network on a physical machine.
Fig. 7 is a schematic structural diagram of a computing device provided in an embodiment of the present application, where the computing device includes: a network interface 701, a processor 702, and a memory 703. The processor 702 executes the code in the memory 703 to implement the DHCP proxy node shown in fig. 6 through the network interface 701, including communications between the DHCP proxy node and a DHCP server, a virtual machine, or a physical machine.
Further, the processor 702 may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor may include only a CPU, or may be a combination of a GPU, a Digital Signal Processor (DSP), and a control chip (e.g., a baseband chip) in the transceiver module. In various embodiments of the present application, the CPU may be a single arithmetic core or may include multiple arithmetic cores.
The memory 703 may include a volatile memory (volatile memory), such as a Random Access Memory (RAM); non-volatile memory (non-volatile memory) such as flash memory (flash memory), hard disk (HDD) or solid-state drive (SSD); the memory may also comprise a combination of memories of the kind described above.
In a specific implementation aspect, the present application further provides a data center, where the data center includes at least one computing device or host, each computing device or host includes a processor and a memory, and the at least one computing device or host is configured to run a DHCP proxy node, a DHCP service node, and a virtual machine, so as to implement the DHCP packet processing method in the foregoing embodiment.
Specifically, the DHCP proxy node is configured to receive a request from a service network, obtain an IP address from a DHCP service node in a management network according to the request, and send the IP address to a virtual machine or a physical machine, where the request is used to indicate that the IP address is allocated to the virtual machine or the physical machine.
Optionally, in a specific implementation manner of this embodiment, the processor is specifically configured to control the DHCP proxy node to receive the request from the virtual machine through a first network card, where the first network card is used to access the service network.
Optionally, in another specific implementation manner of this embodiment, the processor is specifically configured to control the DHCP proxy node to receive, through a second network card, the IP address allocated by the DHCP service node according to the request, where the second network card is used to access the management network.
The first network card is located on a host where the second network card is located, and the DHCP proxy node is deployed on the host where the second network card is located.
In a specific implementation, the present application further provides a computer storage medium, where the computer storage medium may store a program, and the program may include some or all of the steps in each embodiment of the DHCP message processing method provided in the present application when executed. The storage medium can be a magnetic disk, an optical disk, a ROM or a RAM.
All functions of the DHCP proxy node, the DHCP service node and the virtual machine can be realized through computer programs.
In addition, in this embodiment, a computer program product is also provided, where the computer program product includes one or more computer instructions, such as a forwarding instruction. When the computer program is loaded and executed by a computer, the procedures or functions according to the above-described embodiments of the present application are wholly or partially generated. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device.
Specifically, when the computer executes the computer program, the following functions can be realized:
the DHCP proxy node receives a request from a service network, wherein the request is used for indicating that an IP address is allocated to the virtual machine; acquiring an IP address from a DHCP service node according to the request in a management network; and sending the IP address to the virtual machine or the physical machine.
In addition, the implementation specifically includes that the DHCP proxy node receives the request from the virtual machine or the physical machine through a first network card, where the first network card is used to access the service network; and the DHCP proxy node receives the IP address distributed by the DHCP service node according to the request through a second network card, and the second network card is used for accessing the management network.
The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one network device, computer, server, or data center to another device, computer, or server by wire or wirelessly.
The present application further provides a terminal, such as a user equipment, a physical machine, or a virtual machine, configured to implement the method steps of sending a DHCP request message, sending an ACK message, and the like in the foregoing embodiment.
In particular, the terminal may include a control node, which may include components such as a receiver, a transmitter, and an antenna, a processor, and a memory. The terminal may also include more or fewer components, or a combination of certain components, or a different arrangement of components, as the present application does not limit.
The control node is configured to broadcast a DHCP request message, such as a DHCP Discover broadcast message, and is configured to request an IP address from a server;
the control node is further configured to receive a DHCP response message from a DHCP proxy node, where the DHCP response message may be a DHCP Offer message, and the DHCP Offer message carries an IP address; the processor is used for extracting an IP address from the DHCP response message and sending a DHCP response message to the DHCP proxy node through the control node under the condition that the IP address is confirmed to be unoccupied; the DHCP reply message may be a DHCP Requst message.
Optionally, if the IP address is occupied, the terminal needs to send a DHCP Discover broadcast message to the DHCP proxy node again, so as to request to obtain a new IP address again.
Optionally, in a specific implementation manner of this embodiment, the control node is further configured to receive a DHCP ACK sent by a DHCP proxy node, where the DHCP ACK is generated and sent by a DHCP service node according to the DHCP Requst packet, and is used to mark that the IP address allocated to the client cannot be used by other devices any more.
And the processor is further used for binding the IP address after receiving the DHCP ACK message.
In addition, the memory stores program instructions, and the program instructions can realize the method flows of sending and receiving the respective messages of the DHCP by the client or the terminal, binding the acquired IP address and the like when being executed. Further, the memory may include volatile memory, such as RAM; may also include non-volatile memory such as flash memory, hard disk HDD or SSD; the memory may also comprise a combination of memories of the kind described above.
The processor may be a CPU, or a combination of a CPU and an NP. The processor may further include a hardware chip. The hardware chip may be an ASIC, a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the embodiments of the apparatus and the hardware device, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the description in the method embodiments.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.

Claims (6)

1. A dynamic host configuration protocol DHCP message processing method is characterized in that the method is applied to a host, the host is a physical machine, the host comprises a virtual machine, a first network card, a second network card and a DHCP proxy node, the DHCP proxy node is a process on the host, the DHCP proxy node is used for monitoring the processes of the first network card and the second network card, the host accesses a service network through the first network card and accesses a management network through the second network card, the service network is isolated from the management network, and the method comprises the following steps:
a DHCP proxy node receives a request from the service network, wherein the request is used for indicating that an IP address is allocated to the virtual machine or the physical machine;
the DHCP proxy node acquires an IP address from a DHCP service node in the management network according to the request;
the DHCP proxy node sends the IP address to the virtual machine or the physical machine;
wherein, the DHCP proxy node obtains an IP address from a DHCP service node according to the request in the management network, including:
and the DHCP proxy node receives the IP address distributed by the DHCP service node according to the request through the second network card.
2. The method of claim 1, wherein receiving the request from the traffic network by the DHCP proxy node comprises:
the DHCP proxy node receives the request from the virtual machine or the physical machine through the first network card.
3. A DHCP proxy node is applied to a host, the host is a physical machine and comprises a virtual machine, a first network card, a second network card and a DHCP proxy node, the DHCP proxy node is a process on the host, the DHCP proxy node is used for monitoring the processes of the first network card and the second network card, the host is accessed into a service network through the first network card and is accessed into a management network through the second network card, the service network is isolated from the management network and comprises a receiving module and a sending module, wherein,
the receiving module is configured to receive a request from the service network, and obtain an IP address from a DHCP service node in the management network according to the request, where the request is used to indicate that an IP address is allocated to the virtual machine or the physical machine;
the sending module is configured to send the IP address to the virtual machine or the physical machine;
the receiving module is specifically configured to receive, through the second network card, the IP address allocated by the DHCP service node according to the request, where the second network card is used to access the management network.
4. The proxy node of claim 3, wherein the receiving module is specifically configured to receive the request from the virtual machine or the physical machine through the first network card.
5. A computing device, comprising a processor and a memory,
the processor executes computer instructions stored in the memory to implement the method of claim 1 or 2.
6. A data center, comprising: the method comprises the steps that computing equipment and a Dynamic Host Configuration Protocol (DHCP) service node are adopted, wherein the computing equipment comprises a DHCP proxy node and a virtual machine;
the computing device is to implement the method of any of claims 1 to 2.
CN201810438541.0A 2018-05-09 2018-05-09 DHCP message processing method and device Active CN108307002B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810438541.0A CN108307002B (en) 2018-05-09 2018-05-09 DHCP message processing method and device
PCT/CN2019/085602 WO2019214560A1 (en) 2018-05-09 2019-05-06 Dhcp packet processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810438541.0A CN108307002B (en) 2018-05-09 2018-05-09 DHCP message processing method and device

Publications (2)

Publication Number Publication Date
CN108307002A CN108307002A (en) 2018-07-20
CN108307002B true CN108307002B (en) 2021-06-22

Family

ID=62846409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810438541.0A Active CN108307002B (en) 2018-05-09 2018-05-09 DHCP message processing method and device

Country Status (2)

Country Link
CN (1) CN108307002B (en)
WO (1) WO2019214560A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108307002B (en) * 2018-05-09 2021-06-22 华为技术有限公司 DHCP message processing method and device
CN110881143B (en) * 2018-09-05 2022-07-19 中兴通讯股份有限公司 Set top box management method, device and equipment and computer readable storage medium
CN109343932A (en) * 2018-09-13 2019-02-15 郑州云海信息技术有限公司 A kind of system and method for batch configuration virtualization system calculate node
CN109862134B (en) * 2019-03-18 2022-02-01 中国联合网络通信集团有限公司 Lease time configuration method and system of IP address and DHCP client
CN111225080B (en) * 2020-01-06 2022-11-08 博为科技有限公司 Method for acquiring gateway down-hanging equipment information
CN111586196B (en) * 2020-04-07 2022-09-06 华云数据控股集团有限公司 Method, device and system for realizing network double stacks of virtual machine
CN114363294B (en) * 2020-09-27 2024-03-15 华为云计算技术有限公司 Management method, device and system of tenant server
CN112491630B (en) * 2020-12-07 2023-08-04 北京华胜天成科技股份有限公司 Bare metal automatic deployment method and device and cloud environment platform
CN112804368B (en) * 2020-12-08 2021-12-17 中国电子科技集团公司第三十研究所 Method and system for automatically allocating IP and testing in batches
CN113162944B (en) * 2021-04-29 2022-08-02 杭州安恒信息安全技术有限公司 Network communication method, device and equipment for security operation platform and security component
CN113406936A (en) * 2021-06-28 2021-09-17 中国科学技术大学 Control system of large scientific device
CN113709207A (en) * 2021-07-17 2021-11-26 济南浪潮数据技术有限公司 Method, system, equipment and medium for installing software in cloud resources
CN114301875A (en) * 2021-12-21 2022-04-08 锐捷网络股份有限公司 Management and control method and device for DHCP proxy side and electronic equipment
CN114944971B (en) * 2022-05-11 2023-07-21 安超云软件有限公司 Method and device for deploying network by using Kubernetes, electronic equipment and storage medium
CN115174669B (en) * 2022-05-25 2023-05-12 南京赛宁信息技术有限公司 Virtual machine distributed agent access method and system in target range environment

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020138614A1 (en) * 2001-03-20 2002-09-26 Hall Dennis W. Method and apparatus to manage network addresses
CN101075962B (en) * 2007-06-26 2010-09-08 中兴通讯股份有限公司 Method and apparatus for realizing DHCP repeater in two-layer network exchanger
CN101330531B (en) * 2008-07-31 2011-01-19 杭州华三通信技术有限公司 Method for processing DHCP address allocation and DHCP relay
CN103944867B (en) * 2013-01-23 2017-09-12 华为技术有限公司 Processing method, the device and system of dynamic host configuration protocol message
CN103458002B (en) * 2013-08-15 2016-11-16 中电长城网际系统应用有限公司 One key dispositions method and device of cloud system
CN103491203B (en) * 2013-09-09 2016-08-31 北京三快在线科技有限公司 A kind of method of virtualization DHCP service, device, system and server
CN103595772A (en) * 2013-11-01 2014-02-19 浪潮电子信息产业股份有限公司 Cloud data center network deployment scheme based on virtual router
CN105025067B (en) * 2014-04-30 2018-12-25 中国银联股份有限公司 A kind of information security technology research platform
US10057342B2 (en) * 2014-09-05 2018-08-21 Qualcomm Incorporated Infrastructure access via neighbor awareness networking data path
CN104468574B (en) * 2014-12-05 2018-03-23 中国联合网络通信集团有限公司 A kind of method, system and device of virtual machine dynamic access IP address
CN105657081B (en) * 2016-04-07 2019-01-18 华为技术有限公司 The method, apparatus and system of DHCP service are provided
CN108307002B (en) * 2018-05-09 2021-06-22 华为技术有限公司 DHCP message processing method and device

Also Published As

Publication number Publication date
CN108307002A (en) 2018-07-20
WO2019214560A1 (en) 2019-11-14

Similar Documents

Publication Publication Date Title
CN108307002B (en) DHCP message processing method and device
EP3264731B1 (en) Method, relay agent, and system for acquiring internet protocol address in network
CN110088732B (en) Data packet processing method, host and system
CN110113441B (en) Computer equipment, system and method for realizing load balance
CN108347493B (en) Hybrid cloud management method and device and computing equipment
US8631100B2 (en) Automatic assignment of hardware addresses within computer networks
US10594586B2 (en) Dialing test method, dialing test system, and computing node
CN108768692B (en) Network creation method, related equipment and system
CN114172905B (en) Cluster network networking method, device, computer equipment and storage medium
EP3664420A1 (en) Managing address spaces across network elements
CN114070723B (en) Virtual network configuration method and system of bare metal server and intelligent network card
US20160248729A1 (en) A movable gateway, a dhcp server and respective methods performed thereby for enabling the gateway to move from a first access point to a second access point
CN106304396B (en) Method, system and related device for discovering wireless controller by access point
CN112042170B (en) DHCP implementation on nodes for virtual machines
EP3267633B1 (en) Information processing system, proxy server, address duplication prevention method, and computer-readable recording medium
EP3048756B1 (en) Management method and apparatus for dynamic host configuration protocol server and relay
CN110247778B (en) Operating system installation method and device, electronic equipment and storage medium
EP3629559B1 (en) Method for configuring forwarding table for user equipment and apparatus
WO2022057487A1 (en) Path identifier allocation method, system, apparatus and device, and storage medium
EP4117251A1 (en) Method, apparatus and system for realizing carrier grade network address translation
CN110636146B (en) User address allocation method and device
WO2015085558A1 (en) Method, device and system for dynamically allocating ip address
CN112543386B (en) Address acquisition method and related equipment
CN113079036A (en) Method and device for determining management VLAN (virtual local area network) of access point equipment and access point equipment
CN113132188B (en) Communication method and network equipment

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