[go: up one dir, main page]

CN108307002A - A kind of DHCP message processing method and processing device - Google Patents

A kind of DHCP message processing method and processing device Download PDF

Info

Publication number
CN108307002A
CN108307002A CN201810438541.0A CN201810438541A CN108307002A CN 108307002 A CN108307002 A CN 108307002A CN 201810438541 A CN201810438541 A CN 201810438541A CN 108307002 A CN108307002 A CN 108307002A
Authority
CN
China
Prior art keywords
dhcp
network
node
address
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.)
Granted
Application number
CN201810438541.0A
Other languages
Chinese (zh)
Other versions
CN108307002B (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

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)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种动态主机配置协议DHCP报文处理方法及装置,所述方法包括:DHCP代理节点从业务网络接收请求,所述请求用于为虚拟机或物理机分配IP地址;所述DHCP代理节点在管理网络中根据所述请求从DHCP服务节点获取IP地址;所述DHCP代理节点向所述虚拟机或物理机发送获取的所述IP地址。本方法通过在数据中心中部署DHCP代理节点,该DHCP代理节点具有将消息或报文在业务网络和管理网络之间的自由转发功能,从而实现了IP地址的自动配置,节约管理成本,并且还避免了管理员手工配置IP地址的操作,提高连接效率。

The invention discloses a dynamic host configuration protocol DHCP message processing method and device, the method comprising: a DHCP agent node receives a request from a service network, and the request is used to assign an IP address to a virtual machine or a physical machine; the DHCP The proxy node obtains the IP address from the DHCP service node according to the request in the management network; the DHCP proxy node sends the acquired IP address to the virtual machine or physical machine. In this method, by deploying a DHCP agent node in the data center, the DHCP agent node has the function of freely forwarding messages or messages between the service network and the management network, thereby realizing the automatic configuration of the IP address, saving management costs, and also It avoids the operation of the administrator to manually configure the IP address, and improves the connection efficiency.

Description

一种DHCP报文处理方法及装置Method and device for processing DHCP messages

技术领域technical field

本申请涉及网络通信技术领域,尤其涉及一种DHCP报文处理方法及装置。The present application relates to the technical field of network communication, in particular to a DHCP message processing method and device.

背景技术Background technique

在数据中心构建过程中,通常会设置至少一个独立的业务区和一个集中的运维管理区。其中,业务区用于部署各种类型的业务系统,而运维管理区用于部署各种软硬件系统的管理和运维平台,并且与业务网络隔离。During the data center construction process, at least one independent business area and one centralized operation and maintenance management area are usually set up. Among them, the business area is used to deploy various types of business systems, while the operation and maintenance management area is used to deploy the management and operation and maintenance platforms of various software and hardware systems, and is isolated from the business network.

具体地,在运维管理区中部署有各种管理节点,在各个业务区部署有用于各类业务系统的虚拟机或者物理机。其中,部署在运维管理区中的各个管理节点用于为业务区的虚拟机或者物理机提供管理和运维平台。Specifically, various management nodes are deployed in the operation and maintenance management area, and virtual machines or physical machines for various business systems are deployed in each business area. Wherein, each management node deployed in the operation and maintenance management area is used to provide a management and operation and maintenance platform for virtual machines or physical machines in the business area.

为实现业务区中虚拟机或物理机的网络互联协议(Internet Protocol,IP)地址的统一管理,通常将用于分配IP地址的动态主机配置协议(Dynamic Host ConfigurationProtocol,DHCP)服务节点部署在运维管理区。当管理员在某个业务区发放一台虚拟机或物理机时,虚拟机或物理机需要通过业务网络发送DHCP请求来获取IP地址。所述DHCP是一种二层网络协议,业务区的业务网络和运维管理区的管理网络二层不通,导致DHCP广播不能从业务区的虚拟机或物理机发送到运维管理区的DHCP服务节点,进而导致虚拟机或物理机无法利用DHCP广播自动配置IP地址。In order to realize the unified management of Internet Protocol (IP) addresses of virtual machines or physical machines in the service area, the Dynamic Host Configuration Protocol (DHCP) service nodes used to allocate IP addresses are usually deployed in the operation and maintenance management area. When an administrator deploys a virtual machine or physical machine in a certain business area, the virtual machine or physical machine needs to send a DHCP request through the business network to obtain an IP address. The DHCP is a layer-2 network protocol. The service network in the business area and the management network in the operation and maintenance management area are disconnected at the second layer, so that the DHCP broadcast cannot be sent from the virtual machine or physical machine in the business area to the DHCP service in the operation and maintenance management area. node, which in turn prevents virtual machines or physical machines from using DHCP broadcasts to automatically configure IP addresses.

发明内容Contents of the invention

本申请通过部署一个DHCP代理节点,使得该DHCP代理节点可以将从业务网络上获取的DHCP广播,通过管理网络转发到位于管理节点上的DHCP服务节点,以解决了因业务网络和管理网络的隔离导致的虚拟机或物理机无法实现IP地址自动配置的问题。This application deploys a DHCP agent node, so that the DHCP agent node can forward the DHCP broadcast obtained from the service network to the DHCP service node located on the management node through the management network, so as to solve the problem of isolation between the service network and the management network As a result, the virtual machine or physical machine cannot realize the automatic configuration of the IP address.

具体地,本申请公开了以下技术方案:Specifically, the application discloses the following technical solutions:

第一方面,本申请提供了一种动态主机配置协议DHCP报文处理方法,所述方法包括:DHCP代理节点从业务网络接收请求,所述请求用于指示为虚拟机或物理机分配IP地址;所述DHCP代理节点将所述请求发送给DHCP服务节点,在管理网络中根据所述请求从DHCP服务节点获取IP地址;以及向所述虚拟机或物理机发送所述IP地址。In a first aspect, the present application provides a dynamic host configuration protocol DHCP message processing method, the method comprising: a DHCP proxy node receives a request from a service network, and the request is used to indicate the allocation of an IP address for a virtual machine or a physical machine; The DHCP proxy node sends the request to the DHCP service node, acquires an IP address from the DHCP service node in the management network according to the request; and sends the IP address to the virtual machine or physical machine.

可选的,所述请求包括DHCP协议中的DHCP Discover广播报文。Optionally, the request includes a DHCP Discover broadcast message in the DHCP protocol.

可选的,所述IP地址可以通过DHCP协议中的DHCP Offer报文承载。Optionally, the IP address may be carried by a DHCP Offer message in the DHCP protocol.

本方面,通过配置DHCP代理节点可以实现管理网络和业务网络之间的消息转发,进而为虚拟机或物理机自动分配IP地址。In this aspect, message forwarding between the management network and the service network can be realized by configuring the DHCP proxy node, and then the virtual machine or the physical machine is automatically assigned an IP address.

结合第一方面,在第一方面的一种实现方式中,所述DHCP代理节点从业务网络接收请求包括:所述DHCP代理节点通过第一网卡接收来自所述虚拟机或物理机的所述请求,所述第一网卡用于接入所述业务网络,以实现所述请求在业务网络中的接收和发送。With reference to the first aspect, in an implementation manner of the first aspect, the receiving the request by the DHCP proxy node from the service network includes: the DHCP proxy node receiving the request from the virtual machine or the physical machine through the first network card , the first network card is used to access the service network, so as to implement receiving and sending of the request in the service network.

结合第一方面,在第一方面的另一种实现方式中,所述DHCP代理节点在管理网络中根据所述请求从DHCP服务节点获取IP地址,包括:所述DHCP代理节点通过第二网卡接收所述DHCP服务节点根据所述请求分配的所述IP地址,所述第二网卡用于接入所述管理网络,以实现所述IP地址在管理网络中的接收和发送。With reference to the first aspect, in another implementation manner of the first aspect, the DHCP proxy node acquires an IP address from the DHCP service node according to the request in the management network, including: the DHCP proxy node receives the IP address through the second network card The DHCP service node allocates the IP address according to the request, and the second network card is used to access the management network, so as to realize receiving and sending of the IP address in the management network.

结合第一方面,在第一方面的又一种实现方式中,所述第一网卡位于所述第二网卡所在的主机上,所述DHCP代理节点部署于所述第二网卡所在的主机。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.

第二方面,本申请还提供了一种DHCP代理节点,包括接收模块和发送模块,其中,所述接收模块,用于从业务网络接收请求,以及在管理网络中根据所述请求从DHCP服务节点获取IP地址,所述请求用于指示为虚拟机或物理机分配IP地址;所述发送模块,用于向所述虚拟机或物理机发送所述IP地址。In a second aspect, the present application also provides a DHCP proxy node, including a receiving module and a sending module, wherein the receiving module is used to receive a request from the service network, and receive a request from the DHCP service node in the management network according to the request Obtaining an IP address, the request is used to indicate to assign an IP address to a virtual machine or a physical machine; the sending module is configured to send the IP address to the virtual machine or a 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, and the first network card is used to access the business network.

结合第二方面,在第二方面的另一种实现方式中,所述接收模块具体用于通过第二网卡接收所述DHCP服务节点根据所述请求分配的所述IP地址,所述第二网卡用于接入所述管理网络。With reference to the second aspect, in another implementation manner of the second aspect, the receiving module is specifically configured to receive the IP address assigned by the DHCP service node according to the request through a second network card, and the second network card Used to access the management network.

结合第二方面,在第二方面的又一种实现方式中,所述第一网卡位于所述第二网卡所在的主机上,所述DHCP代理节点部署于所述第二网卡所在的主机。With reference to the second aspect, in yet 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.

第三方面,本申请还提供了一种数据中心,所述数据中心包括至少一个计算设备,每个所述计算设备包括处理器和存储器,所述至少一个处理器执行用于控制DHCP代理节点、DHCP服务节点和虚拟机,In a third aspect, the present application also provides a data center, the data center includes at least one computing device, each of the computing devices includes a processor and a memory, and the at least one processor executes a method for controlling a DHCP proxy node, DHCP service nodes and virtual machines,

所述DHCP代理节点,用于从业务网络接收请求,在管理网络中根据所述请求从DHCP服务节点获取IP地址,以及向虚拟机或物理机发送所述IP地址,其中所述请求用于指示为所述虚拟机或物理机分配IP地址。The DHCP proxy node is configured to receive a request from a service network, obtain an IP address from a DHCP service node in the management network according to the request, and send the IP address to a virtual machine or a physical machine, wherein the request is used to indicate Allocate an IP address for the virtual machine or physical machine.

结合第三方面,在第三方面的一种实现方式中,所述处理器具体用于控制所述DHCP代理节点通过第一网卡接收来自所述虚拟机或物理机的所述请求,所述第一网卡用于接入所述业务网络。With reference to the third aspect, in an implementation manner of the third aspect, the processor is specifically configured to control the DHCP agent node to receive the request from the virtual machine or the physical machine through the first network card, and the second A network card is used to access the service network.

结合第三方面,在第三方面的另一种实现方式中,所述处理器具体用于控制所述DHCP代理节点通过第二网卡接收所述DHCP服务节点根据所述请求分配的所述IP地址,所述第二网卡用于接入所述管理网络。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 the IP address assigned by the DHCP service node according to the request through the second network card , the second network card is used to access the management network.

结合第三方面,在第三方面的又一种实现方式中,所述第一网卡位于所述第二网卡所在的主机上,所述DHCP代理节点部署于所述第二网卡所在的主机。With reference to the third aspect, in yet 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.

第四方面,本申请还提供了一种计算机存储介质,该计算机存储介质可存储有指令,该指令执行时可实现本申请提供的第一方面以及第一方面中的各种实现方式所述的DHCP报文处理方法的部分或全部步骤。In the fourth aspect, the present application also provides a computer storage medium, which can store instructions, and when the instructions are executed, the first aspect provided by the present application and the various implementation modes described in the first aspect can be realized. Some or all steps of the DHCP message processing method.

其中,所述存储介质包括第三方面中的所述计算设备中的存储器。Wherein, the storage medium includes the memory in the computing device in the third aspect.

第五方面,本申请还提供了一种包含指令的计算机程序产品,当所述指令在计算机上运行时,所述计算机执行上述各个方面所述的DHCP报文处理方法。In a fifth aspect, the present application further provides a computer program product including instructions, and when the instructions are run on a computer, the computer executes the DHCP message processing method described in the above aspects.

本申请提供的方法,在数据中心中部署DHCP代理节点,该DHCP代理节点具有将消息或报文在业务网络和管理网络之间的自由转发功能,比如通过第一网卡实现业务网络的消息收发,通过第二网卡实现管理网络的消息收发,从而解决了在云平台中,因业务网络和管理网络的隔离导致的虚拟机或物理机无法实现IP地址自动配置的问题,本方法实现了IP地址的自动配置,节约管理成本,并且还避免了管理员手工配置IP地址的操作,提高连接效率。In the method provided by this application, a DHCP agent node is deployed in the data center, and the DHCP agent node has the function of freely forwarding messages or messages between the service network and the management network, such as realizing the message sending and receiving of the service network through the first network card, The second network card is used to realize the message sending and receiving of the management network, thereby solving the problem that the virtual machine or physical machine cannot realize the automatic configuration of the IP address due to the isolation of the business network and the management network in the cloud platform. This method realizes the IP address. Automatic configuration saves management costs and avoids manual configuration of IP addresses by administrators, improving connection efficiency.

附图说明Description of drawings

为了更清楚地说明本申请的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solution of the present application more clearly, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, for those of ordinary skill in the art, on the premise of not paying creative labor, Additional drawings can also be derived from these drawings.

图1为本申请提供的一种数据中心的结构示意图;Fig. 1 is a schematic structural diagram of a data center provided by the present application;

图2为本申请提供的一种DHCP报文处理方法的流程图;Fig. 2 is the flowchart of a kind of DHCP message processing method that the present application provides;

图3为本申请提供的一种DHCP租约过程的示意图;Fig. 3 is a schematic diagram of a DHCP lease process provided by the present application;

图4为本申请提供的另一种DHCP报文处理方法的流程图;Fig. 4 is the flow chart of another kind of DHCP message processing method that the present application provides;

图5为本申请提供的一种DHCP报文转发的示意图;Fig. 5 is a schematic diagram of a DHCP message forwarding provided by the present application;

图6为本申请提供的一种DHCP代理节点的结构示意图;Fig. 6 is a schematic structural diagram of a DHCP proxy node provided by the present application;

图7为本申请提供的一种计算设备的结构示意图。FIG. 7 is a schematic structural diagram of a computing device provided in the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请实施例中的技术方案,并使本申请实施例的上述目的、特征和优点能够更加明显易懂,下面结合附图对本申请实施例中的技术方案作进一步详细的说明。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are described below in conjunction with the accompanying drawings The program is described in further detail.

首先,对本申请的技术场景和系统下的各个功能实体,以及技术术语进行介绍和说明。First, introduce and explain the technical scenarios and system functional entities of this application, as well as technical terms.

如图1所示,为本申请实施例提供的一种数据中心结构示意图,该数据中心可以是一种云管理平台或云数据中心,其中,所述数据中心部署至少一个主机(即计算设备),至少一个主机的任一主机上可以部署虚拟机或管理节点,同时至少一个主机的任一主机也可以不进行虚拟化,作为物理机提供给用户,为用户提供服务。示例性地,图1中绘制出了一个主机上同时部署虚拟机和管理节点的情况,除此之外,一个主机上可以只部署虚拟机,不部署管理节点,本申请实施例对此不做限制。As shown in Figure 1, it is a schematic structural diagram of a data center provided by the embodiment of the present application. The data center may be a cloud management platform or a cloud data center, wherein the data center deploys at least one host (that is, a computing device) , a virtual machine or a management node can be deployed on any host of at least one host, and at the same time, any host of at least one host can also be provided to users as a physical machine without virtualization to provide services for users. Exemplarily, Figure 1 draws a situation where a virtual machine and a management node are deployed on a host at the same time. In addition, only a virtual machine can be deployed on a host without a management node, which is not done in this embodiment of the present application. limit.

如图1所示的数据中心,各个管理节点与管理节点相关的节点组成的区域可以称为运维管理区,其形成的网络为管理网络;将所有业务与业务相关的虚拟机及物理机之间组成的区域可以称为业务区,其形成的网络为业务网络。在运维管理区,管理节点用于虚拟机的创建和配置及物理机的配置,所述管理节点包括计算节点、网络节点。In the data center shown in Figure 1, the area formed by each management node and nodes related to the management node can be called the operation and maintenance management area, and the network formed by it is the management network; all business and business-related virtual machines and physical machines The area formed by the network can be called a service area, and the network formed by it is a service network. In the operation and maintenance management area, management nodes are used to create and configure virtual machines and configure physical machines, and the management nodes include computing nodes and network nodes.

可选的,本申请中的管理节点可以包括DHCP服务节点,用于为虚拟机或物理机分配IP地址以及其他参数。所述管理节点还可以不包括所述DHCP服务节点,本申请对此不予限制。Optionally, the management node in this application may include a DHCP service node for assigning an IP address and other parameters to a virtual machine or a physical machine. The management node may also not include the DHCP service node, which is not limited in this application.

此外,业务区也可以只包含虚拟机,即只利用虚拟机为用户提供服务,本申请实施例对此不做限制。In addition, the service area may only include virtual machines, that is, only virtual machines are used to provide services for users, which is not limited in this embodiment of the present application.

虚拟机所在主机和物理机通过第一网卡接入业务网络,使得每个虚拟机或物理机通过业务网络其它虚拟机或物理机通信。同时,虚拟机所在主机和物理机通过第二网卡接入管理网络,使得管理节点通过管理网络配置物理机、创建和配置虚拟机。主机上配置的第一网卡和第二网卡实现业务网络和管理网络的隔离。所述隔离是指管理网络中的管理节点只能对虚拟机进行创建和配置操作,不能对业务进行干预。例如在业务网络中的虚拟机在进行业务传输时,管理节点不能获取业务传输的数据。The host where the virtual machine is located and the physical machine are connected to the service network through the first network card, so that each virtual machine or physical machine communicates with other virtual machines or physical machines on the service network. At the same time, the host where the virtual machine is located and the physical machine are connected 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 the management nodes in the management network can only create and configure virtual machines, and cannot intervene in services. For example, when a virtual machine in a service network is transmitting services, the management node cannot obtain data transmitted by the services.

如图1所示,在业务区,各个虚拟机之间相互通信,并通过第一网卡建立业务网络,例如主机1中的虚拟机1、主机2中的虚拟机2和物理机3中分别通过各自的第一网卡接入到业务网络,并在该业务网络中实现不同的业务功能。As shown in Figure 1, in the service area, each virtual machine communicates with each other and establishes a service network through the first network card. The respective first network cards are connected to the service network, and realize different service functions in the service network.

虚拟机所在的主机上还部署有DHCP代理节点。该DHCP代理节点为主机上的一个进程,可以对主机上的第一网卡和第二网卡实现分别监听,从而与业务网络的虚拟机或物理机及管理网络中的管理节点通信。该DHCP代理节点将从第二网卡中监听到的来自DHCP服务节点的报文转发至第一网卡,又通过第一网卡将该报文转发至虚拟机或物理机,从而解决了因业务网络和管理网络的隔离导致的虚拟机或物理机无法实现IP地址自动配置的问题。DHCP代理节点只监听DHCP报文,其他报文丢弃,从而不影响业务网络和虚拟网络的隔离。A DHCP proxy node is also deployed on the host where the virtual machine is located. The DHCP agent node is a process on the host, which can monitor the first network card and the second network card on the host respectively, so as to communicate with the virtual machine or physical machine of the service network and the management node in the management network. The DHCP agent node forwards the message from the DHCP service node monitored from the second network card to the first network card, and then forwards the message to the virtual machine or physical machine through the first network card, thereby solving the problem caused by the business network and The virtual machine or physical machine cannot realize the automatic configuration of the IP address caused by the isolation of the management network. The DHCP proxy node only monitors the DHCP message, and discards other messages, so as not to affect the isolation of the service network and the virtual network.

进一步地,为了避免与管理网络内部的DHCP请求相干扰,可将该DHCP代理节点的监听端口调整为非原生DHCP协议制定的67,68端口。图1中,示例性地绘制出部署在虚拟机所在主机的DHCP代理节点,进一步地,由于物理机同样具有第一网卡和第二网卡,所以DHCP代理节点也可以部署在物理机上,本申请对此不做限制。Further, in order to avoid interference with the DHCP request inside the management network, the listening port of the DHCP proxy node can be adjusted to ports 67 and 68 specified by the non-native DHCP protocol. In Fig. 1, the DHCP proxy node deployed on the host where the virtual machine is located is exemplarily drawn. Further, since the physical machine also has the first network card and the second network card, the DHCP proxy node can also be deployed on the physical machine. This is not limited.

可选的,本申请提供的技术方案可以应用于OpenStack云平台,其中,OpenStack是一个免费的开源软件云计算平台。OpenStack网络业务是标准业务,通常涉及若干个程序在多个网络节点中的部署。OpenStack网络业务的主要程序是所谓的Neutron服务器,所述Neutron服务器是一种Python后台程序,将OpenStack网络应用编程接口(applicationprogramming interface,API)提供给网络业务的租户,并将租户请求传递给一系列插件进行处理。Optionally, the technical solutions provided in this application can be applied to the OpenStack cloud platform, wherein OpenStack is a free open source software cloud computing platform. OpenStack network services are standard services, usually involving the deployment of several programs on multiple network nodes. The main program of the OpenStack network service is the so-called Neutron server. The Neutron server is a Python background program that provides the OpenStack network application programming interface (application programming interface, API) to the tenant of the network service, and passes the tenant request to a series of The plugin handles it.

Neutron服务器(原来称为Quantum)在处理器节点上运行,以服务组网API及其拓展。Neutron服务器也可以用于执行网络模型以及每个端口的IP寻址。Neutron服务器通常包括至少一个Neutron插件。通常Neutron插件在计算节点上运行,以管理和配置本地虚拟交换机。Neutron servers (formerly known as Quantum) run on processor nodes to serve the networking API and its extensions. The Neutron server can also be used to implement the network model as well as the IP addressing of each port. A Neutron server usually includes at least one Neutron plugin. Typically Neutron plugins run on compute nodes to manage and configure local virtual switches.

可选的,本实施例中,网络管理节点的功能可以通过OpenStack云平台中的Neutron服务器来实现,或者还可以通过其它计算机程序实现,本实施例对此不进行限制。Optionally, in this embodiment, the function of the network management node may be implemented by a Neutron server in the OpenStack cloud platform, or may also be implemented by other computer programs, which is not limited in this embodiment.

DHCP协议用于向网络设备分配IP地址及一些TCP/IP配置信息或网络配置参数。DHCP采用客户端/服务器通信模式,由客户端向服务器提出配置申请,服务器返回客户端分配的IP地址等相应的配置信息,以实现IP地址等信息的动态配置。DHCP提高安全、可靠且简单的TCP/IP网络设置,避免了TCP/IP网络中地址的冲突,同时也大大降低了管理IP地址设置的负担。The DHCP protocol is used to assign IP addresses and some TCP/IP configuration information or network configuration parameters to network devices. DHCP adopts the client/server communication mode. The client submits a configuration request to the server, and the server returns the corresponding configuration information such as the IP address assigned by the client to realize the dynamic configuration of the IP address and other information. DHCP improves safe, reliable and simple TCP/IP network settings, avoids address conflicts in TCP/IP networks, and greatly reduces the burden of managing IP address settings.

其中,本申请各实施例中,所述客户端包括业务区的虚拟机或者物理机,本申请对此不予限定。Wherein, in each embodiment of the present application, the client includes a virtual machine or a physical machine in the service area, which is not limited in the present application.

为了实现在业务网络和管理网络的隔离的情况下,服务节点向虚拟机或物理机自动分配IP地址,本实施例提供了一种DHCP报文处理方法,该方法应用于数据中心,所述数据中心包括至少一个计算设备,每个计算设备包括处理器和存储器,所述至少一个计算设备用于运行DHCP代理节点、DHCP服务节点和虚拟机,In order to realize that the service node automatically assigns an IP address to a virtual machine or a physical machine when the service network and the management network are isolated, this embodiment provides a DHCP packet processing method, which is applied to a data center, and the data The center includes at least one computing device, each computing device includes a processor and a memory, and the at least one computing device is used to run a DHCP agent node, a DHCP service node and a virtual machine,

其中,所述DHCP代理节点部署在业务区的虚拟机或物理机上,虚拟机所在的主机包括两个网卡,第一网卡和第二网卡,所述第一网卡用于接入业务网络,实现业务网络的消息收发;所述第二网卡用于接入管理网络,实现管理网络的消息收发,所述DHCP代理节点用于监听第一网卡和第二网卡的进程。Wherein, the DHCP agent node is deployed on a virtual machine or a physical machine in the service area, and the host where the virtual machine is located includes two network cards, a first network card and a second network card, and the first network card is used to access the service network to realize service Network message sending and receiving; the second network card is used to access the management network to realize the management network message sending and receiving, and the DHCP proxy node is used to monitor the processes of the first network card and the second network card.

参加图2,所述方法包括以下步骤:With reference to Figure 2, the method comprises the following steps:

步骤201:DHCP代理节点从业务网络接收请求,所述请求用于指示为虚拟机或物理机分配IP地址;Step 201: the DHCP agent node receives a request from the service network, and the request is used to indicate the allocation of an IP address for a virtual machine or a physical machine;

具体地,所述DHCP代理节点通过第一网卡接收来自虚拟机或物理机的所述请求,所述第一网卡用于接入所述业务网络。Specifically, the DHCP proxy node receives the request from the virtual machine or the physical machine through the first network card, where the first network card is used to access the service network.

其中,所述请求包括DHCP Discover广播报文。Wherein, the request includes a DHCP Discover broadcast message.

步骤202:DHCP代理节点将所述请求发送给DHCP服务节点,在管理网络中根据所述请求从DHCP服务节点获取IP地址;Step 202: the DHCP proxy node sends the request to the DHCP service node, and obtains an IP address from the DHCP service node in the management network according to the request;

具体地,所述DHCP代理节点通过第二网卡将所述请求发送给DHCP服务节点,以及所述DHCP代理节点通过第二网卡接收所述DHCP服务节点根据所述请求分配的所述IP地址,所述第二网卡用于接入所述管理网络。Specifically, the DHCP proxy node sends the request to the DHCP service node through the second network card, and the DHCP proxy node receives the IP address assigned by the DHCP service node according to the request through the second network card, so The second network card is used to access the management network.

所述DHCP服务节点与DHCP代理节点在获取请求之前已经建立了通信连接。The DHCP service node and the DHCP proxy node have established a communication connection before obtaining the request.

步骤203:DHCP代理节点向所述虚拟机或物理机发送所述IP地址。Step 203: the DHCP proxy node sends the IP address to the virtual machine or physical machine.

具体地,所述DHCP代理节点通过第一网卡将所述IP地址发送给虚拟机或物理机。Specifically, the DHCP proxy node sends the IP address to the virtual machine or the physical machine through the first network card.

其中,所述第一网卡位于所述第二网卡所在的主机上,所述DHCP代理节点部署于所述第二网卡所在的主机。Wherein, the first network card is located on the 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.

可选的,所述IP地址可以以DHCP Offer报文携带的方式发送给虚拟机。Optionally, the IP address may be sent to the virtual machine in a manner carried in a DHCP Offer message.

本实施例中,DHCP代理节点通过第一网卡接入业务网络,从业务网络中获取虚拟机发送的请求,然后将该请求通过管理网络转发给DHCP服务节点,其中,所述DHCP代理节点通过第二网卡接入管理网络,实现请求报文从业务网络到管理网络之间的转发。In this embodiment, the DHCP proxy node accesses the service network through the first network card, obtains 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, wherein the DHCP proxy node passes the first The second network card is connected to the management network to realize the forwarding of request messages from the service network to the management network.

同理地,当DHCP服务节点接收到来自DHCP代理节点转发的请求之后,分配IP地址,并通过管理网络发送给DHCP代理节点,所述DHCP代理节点通过第二网卡接收该IP地址之后,再将该IP地址转换到业务网络,并通过第一网卡将该IP地址转发给所述虚拟机或物理机,从而实现了IP地址从管理网络到业务网络之间的转发。Similarly, after the DHCP service node receives the request forwarded from the DHCP proxy node, it allocates an IP address and sends it to the DHCP proxy node through the management network, and after the DHCP proxy node receives the IP address through the second network card, it assigns the IP address The IP address is converted to the service network, and the IP address is forwarded to the virtual machine or the physical machine through the first network card, thereby realizing the forwarding of the IP address from the management network to the service network.

本实施例提供的方法,在数据中心中部署DHCP代理节点,该DHCP代理节点具有将消息或报文在业务网络和管理网络之间的自由转发功能,比如通过第一网卡实现业务网络的消息收发,通过第二网卡实现管理网络的消息收发,从而解决了在云平台中,因业务网络和管理网络的隔离导致的虚拟机或物理机无法实现IP地址自动配置的问题。In the method provided by this embodiment, a DHCP agent node is deployed in the data center, and the DHCP agent node has the function of freely forwarding messages or messages between the service network and the management network, such as realizing the message sending and receiving of the service network through the first network card , through the second network card to realize the message sending and receiving of the management network, thereby solving the problem that the virtual machine or the physical machine cannot realize the automatic configuration of the IP address due to the isolation of the business network and the management network in the cloud platform.

本方法实现了IP地址的自动配置,节约管理成本,并且还避免了管理员手工配置IP地址的操作,提高了IP地址绑定效率。The method realizes the automatic configuration of the IP address, saves the management cost, avoids the manual configuration of the IP address by the administrator, and improves the binding efficiency of the IP address.

此外,业务区的物理机或者虚拟机除了可以从DHCP服务节点(即DHCP Server)获得IP地址外,还可以获得子网掩码、默认网关地址、DNS服务器地址等信息,以上这个过程称为DHCP租约过程。因为当虚拟机或者物理机接收提供的IP地址时,DHCP服务节点将会把IP地址租用给虚拟机或者物理机一段指定的时间。In addition, the physical machine or virtual machine in the service area can not only obtain the IP address from the DHCP service node (DHCP Server), but also obtain the subnet mask, default gateway address, DNS server address and other information. The above process is called DHCP lease process. Because when the virtual machine or physical machine receives the provided IP address, the DHCP service node will lease the IP address to the virtual machine or physical machine for a specified period of time.

进一步地,所述DHCP租约过程概况地可以分为4个步骤,参见图3分别为:虚拟机或者物理机请求IP地址——服务器响应——虚拟机或者物理机选择IP地址——服务器确定租约。Further, the DHCP lease process can be roughly divided into four steps, as shown in FIG. 3 : the virtual machine or physical machine requests an IP address—the server responds—the virtual machine or physical machine selects an IP address—the server determines the lease .

基于图3所示的DHCP租约过程,对本实施例提供的一种DHCP报文处理方法进行详细的介绍,该方法可以应用于图1所示的数据中心。Based on the DHCP lease process shown in FIG. 3 , a DHCP packet processing method provided in this embodiment is introduced in detail. The method can be applied to the data center shown in FIG. 1 .

所述数据中心包括:部署在运维管理区的网络管理节点,至少一个DHCP服务节点,DHCP代理节点和虚拟机或物理机。The data center includes: a network management node deployed in an operation and maintenance management area, at least one DHCP service node, a DHCP proxy node, and a virtual machine or a physical machine.

具体地,如图4所示,所述方法包括以下步骤:Specifically, as shown in Figure 4, the method includes the following steps:

步骤1:用户(管理员或者租户)创建一个网络,网络管理节点接收来自用户的网络创建的请求。Step 1: A user (administrator or tenant) creates a network, and the network management node receives a network creation request from the user.

步骤2:网络管理节点为新创建的网络在运维管理区上创建/启动一个DHCP服务节点,该DHCP服务节点可服务于该网络的IP地址自动分配,例如为请求的VM/PM提供IP地址。Step 2: The network management node creates/starts a DHCP service node in the operation and maintenance management area for the newly created network. The DHCP service node can serve the automatic allocation of IP addresses of the network, such as providing IP addresses for the requested VM/PM .

步骤3:网络管理节点获取新创建的DHCP服务节点的IP地址信息。Step 3: The network management node obtains the IP address information of the newly created DHCP service node.

步骤4:网络管理节点在新创建的网络中为所述PM/VM创建一个DHCP代理节点。Step 4: The network management node creates a DHCP proxy node for the PM/VM in the newly created network.

具体地,若业务区不具有DHCP代理节点,则网络管理节点在该业务区的一个物理机或该业务区的虚拟机所在的主机上创建一个DHCP代理节点。DHCP代理节点还可以以主备或者集群的形式部署在业务区的多个主机,本实施例对此不做限制。Specifically, if the service area does not have a DHCP proxy node, the network management node creates a DHCP proxy node on a host where a physical machine in the service area or a virtual machine in the service area is located. The DHCP proxy node can also be deployed on multiple hosts in the service area in the form of active/standby or cluster, which is not limited in this embodiment.

步骤5:网络管理节点配置DHCP服务节点,将新创建的DHCP服务节点的IP地址、端口等信息发送给步骤4中新创建的DHCP代理节点或该业务区原有的节点,以使所述DHCP代理节点利用所述DHCP服务节点分配的IP地址与其建立通信连接。Step 5: the network management node configures the DHCP service node, and sends information such as the IP address and the port of the newly created DHCP service node to the newly created DHCP proxy node in step 4 or the original node in the service area, so that the DHCP The proxy node establishes a communication connection with the IP address assigned by the DHCP service node.

可选的,所述方法还包括:Optionally, the method also includes:

步骤6:DHCP代理节点接收到所述DHCP服务节点的IP地址之后,与DHCP服务节点建立通信连接,并测试其与DHCP服务节点的连通性,如果网络连接不通,则流程结束,以及向数据中心发送出错的告警信息,以便运维人员可以介入诊断故障点。Step 6: After the DHCP agent node receives the IP address of the DHCP service node, it establishes a communication connection with the DHCP service node, and tests its connectivity with the DHCP service node. Send error alarm information so that operation and maintenance personnel can intervene to diagnose the fault point.

本实施例中,利用数据中心为虚拟机或物理机选择服务的DHCP服务节点和DHCP代理节点,并通过DHCP服务节点的IP地址建立DHCP服务节点和DHCP代理节点之间的通信连接,使得DHCP代理节点在获取来自VM/PM的请求之后,就可以将该请求自动转发给DHCP服务节点,并接收所述DHCP服务节点反馈的IP地址,从而自动地建立起DHCP服务节点与VM/PM的连接关系,从而实现IP地址的自动分配,同时避免修改报文内容和填充DHCP代理节所对应的DHCP服务节点的IP地址。In this embodiment, use the data center to select the DHCP service node and the DHCP agent node serving for the virtual machine or the physical machine, and establish the communication connection between the DHCP service node and the DHCP agent node through the IP address of the DHCP service node, so that the DHCP agent After the node obtains the request from the VM/PM, it can automatically forward the request to the DHCP service node and receive the IP address fed back by the DHCP service node, thereby automatically establishing the connection relationship between the DHCP service node and the VM/PM , so as to realize the automatic allocation of IP addresses, and avoid modifying the content of the message and filling the IP address of the DHCP service node corresponding to the DHCP agent section.

步骤7:DHCP代理节点在业务网络启动DHCP广播监听,用于监听其所在范围内所有客户端,例如虚拟机或物理机,广播的请求报文。Step 7: The DHCP agent node starts the DHCP broadcast monitoring on the service network to monitor the request messages broadcast by all clients within its range, such as virtual machines or physical machines.

步骤8:当用户发放一个虚拟机或者物理机,或虚拟机或者物理机的IP地址需要刷新时,则需要获取并绑定一个IP地址,即向网络广播DHCP Discover请求报文。Step 8: When the 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, it needs to obtain and bind an IP address, that is, broadcast a DHCP Discover request message to the network.

具体地,虚拟机或物理机在数据中心广播一个DHCP Discover包以请求IP地址,此过程也称为DHCP Discover。可选的,所述DHCP Discover包的源IP地址为0.0.0.0;目的IP地址为255.255.255.255,该DHCP Discover包还可以包含虚拟机或物理机的MAC地址和计算机名,以使DHCP服务节点能够确定是由哪个虚拟机或物理机发送的请求报文。Specifically, a virtual machine or a physical machine broadcasts a DHCP Discover packet in the data center to request an IP address, and this process is also called 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 can also include the MAC address and computer name of a virtual machine or a physical machine, so that the DHCP service node It can be determined which virtual machine or physical machine sent the request packet.

步骤9:DHCP代理节点收到DHCP Discover请求报文后,拷贝该报文以备转发,将所述报文从业务网络转换为管理网络,并且不修改报文内容,也不填充DHCP relay字段。Step 9: After receiving the DHCP Discover request message, the DHCP proxy node copies the message for forwarding, converts the message from the service network to the management network, and does not modify the content of the message or fill in the DHCP relay field.

步骤10:DHCP代理节点通过管理网络将所述拷贝的DHCP Discover请求报文发送给DHCP服务节点。Step 10: The DHCP proxy node sends the copied DHCP Discover request message to the DHCP service node through the management network.

可选的,所述DHCP代理节点通过管理网络将所述请求报文以单播的形式发送给DHCP服务节点。Optionally, the DHCP proxy node sends the request message to the DHCP service node in unicast form through the management network.

步骤11:DHCP服务节点接收来自DHCP代理节点发送的DHCP Discover请求报文,然后对该请求报文进行处理,具体地,根据DHCP Discover请求报文中包含的信息从IP地址资源池中选取合适的IP地址,并以DHCP响应报文,例如DHCP Offer报文的方式反馈给所述DHCP代理节点。Step 11: The DHCP service node receives the DHCP Discover request message sent from the DHCP agent node, and then processes the request message, specifically, selects a suitable IP address resource pool according to the information contained in the DHCP Discover request message. The IP address is fed back to the DHCP proxy node in the form of a DHCP response message, such as a DHCP Offer message.

具体地,当DHCP服务节点接收到客户端请求IP地址的信息时,就在自己的IP地址库中查找是否有合法的IP地址提供给客户端,如果有,DHCP服务节点就将此IP地址做上标记,然后单播发送一个DHCP Offer包给DHCP代理节点(此过程又称DHCP Offer)。Specifically, when the DHCP service node receives the information that the client requests an IP address, it searches in its own IP address library whether there is a legal IP address provided to the client, and if so, the DHCP service node uses this IP address as mark, and then unicast sends a DHCP Offer packet to the DHCP agent node (this process is also called DHCP Offer).

步骤12:DHCP代理节点通过业务网络接收到来自DHCP服务节点的DHCP响应报文(比如DHCP Offer报文)后,将所述报文从管理网络转移到业务网络。Step 12: After receiving the 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.

步骤13:DHCP代理节点通过业务网络将所述DHCP Offer报文发送给物理机或虚拟机。Step 13: The DHCP proxy node sends the DHCP Offer message to the physical machine or the virtual machine through the service network.

步骤14:所述物理机或虚拟机从DHCP Offer报文中提取IP地址,并且在确认该IP地址没有被占用的情况下发送DHCP应答报文(例如DHCP Requst报文)到DHCP代理节点;如果该IP地址被占用,则需要回到步骤8重新开始DHCP请求报文的发送。Step 14: the physical machine or virtual machine extracts the IP address from the DHCP Offer message, and sends a DHCP response message (such as a DHCP Requst message) to the DHCP proxy node when confirming that the IP address is not occupied; if If the IP address is occupied, it is necessary to return to step 8 to restart sending the DHCP request message.

具体地,物理机或虚拟机从收到的第一个DHCP Offer报文中选择IP地址,并生成DHCP应答报文,所述DHCP应答报文表示所述DHCP响应报文中的IP地址可用。可选的,所述DHCP应答报文为DHCP Request报文,此过程也称为DHCP Request。Specifically, the physical machine or the virtual machine selects an IP address from the received first DHCP Offer message, and generates a DHCP response message, where the DHCP response message indicates that the IP address in the DHCP response message is available. Optionally, the DHCP response message is a DHCP Request message, and this process is also called a DHCP Request.

步骤15:DHCP代理节点通过业务网络接收来自物理机或虚拟机的DHCP Request报文,拷贝该报文以备转发,并且不修改该报文内容,也不填充DHCP relay字段。Step 15: The DHCP proxy node receives the DHCP Request message from the physical machine or virtual machine through the service network, copies the message for forwarding, and does not modify the content of the message or fill in the DHCP relay field.

步骤16:DHCP代理节点将DHCP Request报文通过管理网络发送到DHCP服务节点。Step 16: The DHCP proxy node sends the DHCP Request message to the DHCP service node through the management network.

步骤17:DHCP服务节点接收来自DHCP代理节点的DHCP Request报文,并通过管理网络发送DHCP ACK报文给所述DHCP代理节点。Step 17: The DHCP service node receives the DHCP Request message from the DHCP proxy node, and sends a DHCP ACK message to the DHCP proxy node through the management network.

具体地,DHCP租约过程中的最后一步为服务器确认IP租约,也称为DHCP ACK。DHCP服务节点在接收到DHCP Request后,以DHCP ACK(DHCP Acknowledge)消息的形式反馈给物理机或虚拟机,表示成功确认,该DHCP ACK消息中包含IP地址的有效租约和其他可能配置的信息。当物理机或虚拟机收到DHCP ACK时,它就配置了IP地址,完成了TCP/IP的初始化,从而可以在TCP/IP网络上通信了。Specifically, the last step in the DHCP lease process is to confirm the IP lease for the server, also known as DHCP ACK. After the DHCP service node receives the DHCP Request, it will feed back to the physical machine or virtual machine in the form of a DHCP ACK (DHCP Acknowledge) message, indicating successful confirmation. The DHCP ACK message contains the effective lease of the IP address and other possible configuration information. When the physical machine or virtual machine receives the DHCP ACK, it configures the IP address and completes the initialization of TCP/IP, so that it can communicate on the TCP/IP network.

另外,如果物理机或虚拟机接受了DHCP服务节点分配的IP地址,发送了DHCPRequest报文,则分配该IP地址的DHCP服务节点会将该IP地址标记和保留,使得该IP地址不能再提供给其它DHCP客户端使用。In addition, if the physical machine or virtual machine accepts the IP address allocated by the DHCP service node and sends a DHCPRequest message, the DHCP service node that allocates the IP address will mark and reserve the IP address so that the IP address can no longer be provided to Used by other DHCP clients.

步骤18:DHCP代理节点通过管理网络接收来自DHCP服务节点的DHCP ACK报文,处理后将该DHCP ACK报文转移到业务网络。Step 18: The DHCP proxy node receives the DHCP ACK message from the DHCP service node through the management network, and transfers the DHCP ACK message to the service network after processing.

步骤19:DHCP代理节点将所述DHCP ACK报文通过业务网络发送给客户端。Step 19: The DHCP proxy node sends the DHCP ACK message to the client through the service network.

步骤20:物理机或虚拟机接收到所述DHCP ACK报文后,对请求的IP地址进行绑定。Step 20: After receiving the DHCP ACK message, the physical machine or the virtual machine binds the requested IP address.

流程结束。The process ends.

参见图5,为本实施例提供的一种DHCP代理节点转发DHCP报文的结构示意图。Referring to FIG. 5 , it is a schematic structural diagram of a DHCP proxy node forwarding a DHCP message provided by this embodiment.

需要说明的是,本实施例中所述的DHCP Discover广播报文、DHCP Offer报文、DHCPRequest报文以及DHCP ACK报文均为在DHCP协议中的报文,且都具有明确的定义,具体地,DHCP协议中对各报文的作用定义如下:It should be noted that the DHCP Discover broadcast message, DHCP Offer message, DHCPRequest message and DHCP ACK message described in this embodiment are all messages in the DHCP protocol, and all have clear definitions, specifically , the function of each message in the DHCP protocol is defined as follows:

DHCP Discover报文/包:DHCP客户端(client)在需要获取IP地址时,向本地网络广播此类型的包。DHCP Discover packet/package: When the DHCP client (client) needs to obtain an IP address, it broadcasts this type of packet to the local network.

DHCP Offer报文/包:DHCP服务节点(server)回复DHCP客户端发出的DHCPDiscover报文,且DHCP Offer包里包含了DHCP服务节点将要提供给客户端的一些配置参数,例如IP地址。DHCP Offer message/package: The DHCP service node (server) replies to the DHCPDiscover message sent by the DHCP client, and the DHCP Offer package contains some configuration parameters that the DHCP service node will provide to the client, such as an IP address.

DHCP Request报文/包:DHCP客户端在以下情况下发送给DHCP服务器的包:DHCP Request message/packet: the package sent by the DHCP client to the DHCP server under the following circumstances:

(a)客户端请求一个特定的服务节点发送的DHCP Offer中提供的配置信息,同时暗示的拒绝其他所有服务器的DHCP Offer包。(a) The client requests the configuration information provided in the DHCP Offer sent by a specific service node, and at the same time implicitly rejects the DHCP Offer packets from all other servers.

(b)客户端在某些时候确认之前分配给自己的配置信息的正确性,比如客户端的操作系统重启后,短暂的线路物理故障后。(b) The client confirms the correctness of the configuration information assigned to itself at certain times, such as after the operating system of the client is restarted or after a short-term physical failure of the line.

(c)客户端延续其已经获得的明确的IP地址的租期。(c) The client renews the lease of the explicit IP address it has acquired.

DHCP ACK报文:DHCP服务节点回复DHCP客户端发送的DHCP Request包或者DHCPInform包,里面包含了DHCP服务节点分配给客户端的配置信息。DHCP ACK message: The DHCP service node replies to the DHCP Request packet or DHCPInform packet sent by the DHCP client, which contains the configuration information assigned to the client by the DHCP service node.

本申请提供的技术方案,在主机上部署DHCP代理节点,使得该DHCP代理节点可以将从业务网络上获取的DHCP广播通过管理网络转发到DHCP服务节点,以解决了因业务网络和管理网络的隔离导致的虚拟机或物理机无法实现IP地址自动配置的问题。In the technical solution provided by this application, a DHCP agent node is deployed on the host, so that the DHCP agent node can forward the DHCP broadcast obtained from the service network to the DHCP service node through the management network, so as to solve the problem of isolation between the service network and the management network As a result, the virtual machine or physical machine cannot realize the automatic configuration of the IP address.

此外,本方法利用DHCP服务节点实现了对虚拟机请求的IP地址进行集中分配,使得云计算平台或者虚拟化平台满足当前数据中心的要求,运维管理集中的要求,进而使得网络管理节点可以统管整个数据中心,避免了在每个业务区都部署一套管理平台,节约了管理成本,进而提高了租约效率,并且通过IP地址自动化配置也使得平台管理员避免了手工操作的压力。In addition, this method uses the DHCP service node to realize the centralized allocation of the IP address requested by the virtual machine, so that the cloud computing platform or virtualization platform meets the requirements of the current data center and the requirements of centralized operation and maintenance management, so that the network management node can manage The entire data center avoids deploying a management platform in each business area, which saves management costs and improves lease efficiency, and the automatic configuration of IP addresses also enables platform administrators to avoid the pressure of manual operations.

参见图6,为本申请DHCP代理节点的结构示意图,所述DHCP代理节点部署在服务器或者计算节点或计算设备上,用于执行图2或图4对应的DHCP报文处理方法。Referring to FIG. 6 , it is a schematic structural diagram of a DHCP proxy node of the present application, and the DHCP proxy node is deployed on a server or a computing node or a computing device, and is used to execute the DHCP message processing method corresponding to FIG. 2 or FIG. 4 .

如图6所示,该DHCP代理节点包括:接收模块601、处理模块602和发送模块603,此外,该DHCP代理节点还可以包括其它功能模块或部件,例如存储模块等。As shown in FIG. 6 , the DHCP proxy node includes: a receiving module 601 , a processing module 602 and a sending module 603 . In addition, the DHCP proxy node may also include other functional modules or components, such as a storage module.

其中,接收模块601,用于从业务网络接收请求,所述请求为DHCP Discover广播报文。Wherein, the receiving module 601 is configured to receive a request from a service network, and the request is a DHCP Discover broadcast message.

处理模块602,用于将所述请求从业务网络转换到管理网络。The processing module 602 is configured to convert the request from the service network to the management network.

发送模块603,用于将所述请求以单播的形式发送给DHCP服务节点。The sending module 603 is configured to send the request to the DHCP service node in unicast form.

接收模块601,还用于在管理网络中根据所述请求从DHCP服务节点获取IP地址,所述请求用于指示为虚拟机或物理机分配IP地址。其中,所述IP地址可以通过DHCP Offer报文的方式获得。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, and the request is used to indicate to assign an IP address to a virtual machine or a physical machine. Wherein, the IP address may be obtained through a DHCP Offer message.

发送模块603,用于向所述虚拟机或物理机发送所述IP地址。A sending module 603, configured to send the IP address to the virtual machine or the physical machine.

可选的,在本实施例的一种具体的实现方式中,所述接收模块601,具体用于通过第一网卡接收来自虚拟机或物理机的所述请求,所述第一网卡用于接入所述业务网络。Optionally, in a specific implementation manner of this embodiment, the receiving module 601 is specifically configured to receive the request from a virtual machine or a physical machine through a first network card, and the first network card is used to receive into the business network.

可选的,在本实施例的另一种具体的实现方式中,所述接收模块601,具体用于通过第二网卡接收所述DHCP服务节点根据所述请求分配的所述IP地址,所述第二网卡用于接入所述管理网络。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 assigned by the DHCP service node according to the request, the The second network card is used to access the management network.

其中,所述第一网卡位于所述第二网卡所在的主机上,所述DHCP代理节点部署于所述第二网卡所在的主机。Wherein, the first network card is located on the 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.

可选的,在本实施例的一种具体的实现方式中,处理模块602,具体用于将所述DHCP Offer报文从管理网络转移到业务网络;发送模块603,具体用于通过第一网卡将DHCPOffer报文发送给虚拟机或物理机。Optionally, in a specific implementation of this embodiment, the processing module 602 is specifically configured to transfer the DHCP Offer message from the management network to the service network; the sending module 603 is specifically configured to pass the first network card Send the DHCPOffer message to the virtual machine or physical machine.

可选的,在本实施例的一种具体的实现方式中,接收模块601,还用于通过业务网络获取来自所述虚拟机或物理机的DHCP Request报文,所述DHCP Request报文表示DHCPOffer报文中的IP地址可用;处理模块602,还用于将所述DHCP Request报文从所述业务网络转移到所述管理网络;发送模块603,还用于通过第二网卡将所述DHCP Request报文发送给DHCP服务节点。Optionally, in a specific implementation of this embodiment, the receiving module 601 is also configured to obtain a DHCP Request message from the virtual machine or the physical machine through the service network, and the DHCP Request message indicates that the DHCP Offer The IP address in the message is available; the processing module 602 is also used to transfer the DHCP Request message from the service network to the management network; the sending module 603 is also used to transfer the DHCP Request message through the second network card The message is sent to the DHCP service node.

可选的,在本实施例的又一种具体的实现方式中,接收模块601,还用于通过所述管理网络接收来自所述DHCP服务节点的DHCP ACK报文;处理模块602,还用于将所述DHCPACK报文从所述管理网络转移到所述业务网络;发送模块603,还用于通过第一网卡将所述DHCPACK报文发送给所述虚拟机或物理机,以使所述虚拟机或物理机在获取所述DHCP ACK报文后绑定所述IP地址。Optionally, in yet another specific implementation of this embodiment, the receiving module 601 is also configured to receive the DHCP ACK message from the DHCP service node through the management network; the processing module 602 is also configured to Transfer the DHCPACK message 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 physical machine through the first network card, so that the virtual machine The machine or the physical machine binds the IP address after obtaining the DHCP ACK message.

可选的,在本实施例的又一种具体的实现方式中,接收模块601,还用于在获取来请求报文之前,获取所述DHCP服务节点的IP地址;处理模块602,还用于根据所述IP地址与所述DHCP服务节点建立连接,并测试与所述DHCP服务节点之间的连通性。Optionally, in yet another specific implementation of this embodiment, the receiving module 601 is also used to obtain the IP address of the DHCP service node before obtaining the request message; the processing module 602 is also used to Establish a connection with the DHCP service node according to the IP address, and test connectivity with the DHCP service node.

此外,本申请实施例还提供一种网络管理节点,例如部署在OpenStack云计算平台中的Neutron组件,该网络管理节点的结构可以与图6所示的DHCP代理节点结构相同,例如包括:接收模块、处理模块和发送模块等。In addition, the embodiment of the present application also provides a network management node, such as the Neutron component deployed in the OpenStack cloud computing platform, the structure of the network management node may be the same as that of the DHCP agent node shown in Figure 6, for example, including: a receiving module , processing module and sending module, etc.

所述接收模块用于获取来自虚拟机或物理机的网络创建的请求;处理模块用于为所述虚拟机或物理机创建一个DHCP服务节点,以及为所述虚拟机或物理机确定一个DHCP代理节点,其中,所述DHCP服务节点用于提供IP地址,所述DHCP代理节点用于将所述IP地址通过管理网络发送给所述虚拟机或物理机。The receiving module is used to obtain a network creation request from a virtual machine or a physical machine; the processing module is used to create a DHCP service node for the virtual machine or the physical machine, and determine a DHCP agent for the virtual machine or the physical machine node, wherein the DHCP service node is used to provide an IP address, and the DHCP proxy node is used to send the IP address to the virtual machine or physical machine through a management network.

可选的,所述发送模块还用于将所述DHCP服务节点对应的IP地址发送给DHCP代理节点,以使所述DHCP代理节点利用所述DHCP服务节点的IP地址与其建立通信连接。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 uses the IP address of the DHCP service node to establish a communication connection with it.

另外,本申请实施例还提供一种DHCP服务节点,用于实现IP地址的自动分配。In addition, the embodiment of the present application also provides a DHCP service node, which is used to implement automatic allocation of IP addresses.

可选的,该DHCP服务节点的结构可以与图6所示的DHCP代理节点结构相同,例如包括:接收模块、处理模块和发送模块等。Optionally, the structure of the DHCP service node may be the same as that of the DHCP agent node shown in FIG. 6 , for example, including: a receiving module, a processing module, and a sending module.

具体地,接收模块用于接收来自DHCP代理节点的DHCP请求;处理模块用于根据所述DHCP请求确定虚拟机或物理机的IP地址,发送模块用于将所述IP地址通过管理网络发送给DHCP代理节点。Specifically, the receiving module is used to receive the DHCP request from the DHCP agent node; the processing module is used to determine the IP address of the virtual machine or the physical machine according to the DHCP request, and the sending module is used to send the IP address to the DHCP server through the management network agent node.

可选的,在本实施例的又一种具体的实现方式中,所述接收模块还用于接收来自DHCP代理节点的DHCP Request报文,所述DHCP Request报文表示所述DHCP服务节点分配的IP地址可用;所述处理模块还用于生成ACK报文并通过发送模块将该ACK报文发送给DHCP代理节点。Optionally, in yet another specific implementation manner of this embodiment, the receiving module is further configured to receive a DHCP Request message from a DHCP agent node, and the DHCP Request message indicates that the DHCP service node allocates The IP address is available; the processing module is also used to generate an ACK message and send the ACK message to the DHCP proxy node through the sending module.

需要说明的是,本申请各实施例中所述DHCP代理节点还可以称为DHCP中继代理,DHCP转发代理,DHCP中继,或DHCP转发节点等,还可以是其它代理模块,用于实现物理机上业务网络和管理网络之间的消息收发。It should be noted that the DHCP proxy node described in each embodiment of the present application can also be called a DHCP relay agent, a DHCP forwarding agent, a DHCP relay, or a DHCP forwarding node, etc., and can also be other proxy modules for implementing physical Messaging between the onboard business network and the management network.

图7为本申请实施例提供的一种计算设备的结构示意图,该计算设备包括:网络接口701、处理器702和存储器703。处理器702执行存储器703中的代码,通过网络接口701来实现图6所示的DHCP代理节点,包括DHCP代理节点与DHCP服务器、虚拟机或物理机之间的通信传输。FIG. 7 is a schematic structural diagram of a computing device provided by an embodiment of the present application. 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, and implements the DHCP proxy node shown in FIG. 6 through the network interface 701, including the communication transmission between the DHCP proxy node and a DHCP server, a virtual machine or a physical machine.

进一步地,所述处理器702可以由集成电路(integrated circuit,IC)组成,例如可以由单颗封装的IC所组成,也可以由连接多颗相同功能或不同功能的封装IC而组成。举例来说,处理器可以仅包括CPU,也可以是GPU、数字信号处理器(digital signalprocessor,DSP)、及收发模块中的控制芯片(例如基带芯片)的组合。在本申请的各种实施方式中,CPU可以是单运算核心,也可以包括多运算核心。Further, the processor 702 may be composed of an integrated circuit (integrated circuit, IC), for example, may be composed of a single packaged IC, or may be composed of multiple packaged ICs connected with the same function or different functions. For example, the processor may only include a CPU, or may be a combination of a GPU, a digital signal processor (DSP), and a control chip (such as a baseband chip) in the transceiver module. In various implementation manners of the present application, the CPU may be a single computing core, or may include multiple computing cores.

所述存储器703可以包括易失性存储器(volatile memory),例如随机存取内存(randomaccess memory,RAM);还可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-statedrive,SSD);所述存储器还可以包括上述种类的存储器的组合。The memory 703 may include a volatile memory (volatile memory), such as a random access memory (random access memory, RAM); it may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory) , a hard disk drive (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD); the storage may also include a combination of the above types of storage.

在具体实现层面,本申请还提供了一种数据中心,所述数据中心包括至少一个计算设备或主机,每个计算设备或者主机中包括处理器和存储器,所述至少一个计算设备或者主机用于运行DHCP代理节点、DHCP服务节点和虚拟机,以实现前述实施例中所述的DHCP报文处理方法。At the specific implementation level, the present application also provides a data center, 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 used to The DHCP agent node, the DHCP service node and the virtual machine are run to implement the method for processing the DHCP packet described in the foregoing embodiments.

具体地,所述DHCP代理节点用于从业务网络接收请求,在管理网络中根据所述请求从DHCP服务节点获取IP地址,以及向虚拟机或物理机发送所述IP地址,其中所述请求用于指示为所述虚拟机或物理机分配IP地址。Specifically, the DHCP agent node is used to receive a request from a service network, obtain an IP address from a DHCP service node in the management network according to the request, and send the IP address to a virtual machine or a physical machine, wherein the request uses Instructing to assign an IP address to the virtual machine or physical machine.

可选的,在本实施例的一种具体的实现方式中,所述处理器具体用于控制所述DHCP代理节点通过第一网卡接收来自所述虚拟机的所述请求,所述第一网卡用于接入所述业务网络。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, and the first network card Used to access the service network.

可选的,在本实施例的又一种具体的实现方式中,所述处理器具体用于控制所述DHCP代理节点通过第二网卡接收所述DHCP服务节点根据所述请求分配的所述IP地址,所述第二网卡用于接入所述管理网络。Optionally, in yet another specific implementation manner of this embodiment, the processor is specifically configured to control the DHCP proxy node to receive the IP address allocated by the DHCP service node according to the request through the second network card. address, the second network card is used to access the management network.

其中,所述第一网卡位于所述第二网卡所在的主机上,所述DHCP代理节点部署于所述第二网卡所在的主机。Wherein, the first network card is located on the 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.

具体实现中,本申请还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可包括本申请提供的DHCP报文处理方法的各实施例中的部分或全部步骤。所述的存储介质可为磁碟、光盘、ROM或RAM等。In a specific implementation, the present application also provides a computer storage medium, wherein 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 by the present application when executed. . The storage medium can be a magnetic disk, an optical disk, a ROM or a RAM, and the like.

其中,所述DHCP代理节点、DHCP服务节点、虚拟机的所有功能都可以通过计算机程序来实现。Wherein, all functions of the DHCP agent node, the DHCP service node, and the virtual machine can be realized by computer programs.

另外,本实施例中,还提供一种计算机程序产品,该计算机程序产品包括一个或多个计算机指令,例如转发指令等。在计算机加载和执行所述计算机程序时,全部或部分地产生按照本申请上述实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。In addition, in this embodiment, a computer program product is also provided, and the computer program product includes one or more computer instructions, such as forwarding instructions and the like. When the computer loads and executes the computer program, all or part of the processes or functions according to the above-mentioned embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.

具体地,所述计算机执行所述计算机程序时,可实现以下功能:Specifically, when the computer executes the computer program, the following functions can be realized:

DHCP代理节点从业务网络接收请求,所述请求用于指示为虚拟机分配IP地址;在管理网络中根据所述请求从DHCP服务节点获取IP地址;以及向所述虚拟机或物理机发送所述IP地址。The DHCP agent node receives a request from the service network, and the request is used to indicate that an IP address is assigned to the virtual machine; obtains the IP address from the DHCP service node in the management network according to the request; and sends the virtual machine or the physical machine the IP address.

此外,具体地实现包括,所述DHCP代理节点通过第一网卡接收来自所述虚拟机或物理机的所述请求,所述第一网卡用于接入所述业务网络;以及,所述DHCP代理节点通过第二网卡接收所述DHCP服务节点根据所述请求分配的所述IP地址,所述第二网卡用于接入所述管理网络。In addition, the specific implementation includes that the DHCP agent node receives the request from the virtual machine or the physical machine through the first network card, and the first network card is used to access the service network; and the DHCP agent The node receives the IP address assigned by the DHCP service node according to the request through a second network card, where the second network card is used to access the management network.

所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网络设备、计算机、服务器或数据中心通过有线或无线方式向另一个设备、计算机或服务器进行传输。The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, such as from a network device, computer, server, or data center Wired or wireless transmission to another device, computer or server.

本申请还提供了一种终端,例如用户设备、物理机或者虚拟机,用于实现前述实施例中的DHCP请求报文的发送,以及DHCP request报文、ACK报文的发送等方法步骤。The present application also provides a terminal, such as a user equipment, a physical machine or a virtual machine, which is used to implement method steps such as sending a DHCP request message and sending a DHCP request message and an ACK message in the foregoing embodiments.

具体地,所述终端可以包括控制节点、处理器和存储器,所述控制节点可以包括接收机、发射机与天线等部件。所述终端还可以包括更多或更少的部件,或者组合某些部件,或者不同的部件布置,本申请对此不进行限定。Specifically, the terminal may include a control node, a processor, and a memory, and the control node may include components such as a receiver, a transmitter, and an antenna. The terminal may also include more or fewer components, or combine certain components, or arrange different components, which is not limited in this application.

其中,所述控制节点,用于向广播DHCP请求报文,例如DHCP Discover广播报文,用于向服务器请求IP地址;Wherein, the control node is used to broadcast a DHCP request message, such as a DHCP Discover broadcast message, which is used to request an IP address from a server;

所述控制节点,还用于接收来自DHCP代理节点的DHCP响应报文,所述DHCP响应报文可以是DHCP Offer报文,且该DHCP Offer报文中携带IP地址;所述处理器,用于从所述DHCP响应报文中提取IP地址,并且在确认该IP地址没有被占用的情况下通过所述控制节点发送DHCP应答报文给DHCP代理节点;其中,所述DHCP应答报文可以是DHCP Requst报文。The control node is also configured to receive a DHCP response message from a DHCP agent node, the DHCP response message may be a DHCP Offer message, and the DHCP Offer message carries an IP address; the processor is used to Extract the IP address from the DHCP response message, and send a DHCP response message to the DHCP agent node through the control node when the IP address is confirmed to be unoccupied; wherein, the DHCP response message may be DHCP Request message.

可选的,如果该IP地址被占用,则终端需要重新向DHCP代理节点发送DHCPDiscover广播报文,以便重新请求获取新的IP地址。Optionally, if the IP address is occupied, the terminal needs to resend a DHCPDiscover broadcast message to the DHCP proxy node, so as to re-request for obtaining a new IP address.

可选的,在本实施例的一种具体的实现方式中,所述控制节点,还用于接收到来自DHCP代理节点发送的DHCP ACK,所述DHCP ACK是DHCP服务节点根据所述DHCP Requst报文生成并发送的,用于标记该分配给客户端的IP地址不能再被其它设备使用。Optionally, in a specific implementation of this embodiment, the control node is further configured to receive the DHCP ACK sent from the DHCP agent node, the DHCP ACK is the DHCP service node according to the DHCP Request report This file is generated and sent to mark that the IP address assigned to the client can no longer be used by other devices.

所述处理器,还用于在接收到所述DHCP ACK报文后,对所述IP地址进行绑定。The processor is further configured to bind the IP address after receiving the DHCP ACK message.

另外,所述存储器中存储有程序指令,该程序指令执行时可实现上述客户端或终端对DHCP各自报文的发送和接收,以及对获取的IP地址进行绑定等方法流程。进一步地,所述存储器可以包括易失性存储器,例如RAM;还可以包括非易失性存储器,例如flashmemory,硬盘HDD或SSD;所述存储器还可以包括上述种类的存储器的组合。In addition, program instructions are stored in the memory, and when the program instructions are executed, the above-mentioned client or terminal can realize the sending and receiving of the respective DHCP messages, and the binding of the obtained IP address and other method processes. Further, the memory may include a volatile memory, such as RAM; it may also include a non-volatile memory, such as flashmemory, hard disk HDD or SSD; the memory may also include a combination of the above types of memory.

所述处理器可以是CPU,或者CPU和NP的组合。处理器还可以进一步包括硬件芯片。上述硬件芯片可以是ASIC,可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(genericarray logic,GAL)或其任意组合。The processor may be a CPU, or a combination of CPU and NP. The processor may further include hardware chips. The aforementioned hardware chip may be an ASIC, a programmable logic device (programmable logic device, PLD) or a combination thereof. The aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a generic array logic (generic array logic, GAL) or any combination thereof.

本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。Those skilled in the art can clearly understand that the technologies in the embodiments of the present invention can be implemented by means of software plus a necessary general-purpose hardware platform. Based on this understanding, the essence of the technical solutions in the embodiments of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM , magnetic disk, optical disk, etc., including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.

本说明书中各个实施例之间相同相似的部分互相参见即可。尤其,对于上述装置和硬件设备的实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例中的说明即可。For the same and similar parts among the various embodiments in this specification, refer to each other. In particular, for the embodiments of the above-mentioned apparatus and hardware equipment, because they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, refer to the description in the method embodiments.

以上所述的本发明实施方式并不构成对本发明保护范围的限定。The embodiments of the present invention described above are not intended to limit the protection scope of the present invention.

Claims (10)

1. a kind of dynamic host configuration protocol DHCP message processing method, which is characterized in that the method includes:
DHCP proxy node is received from business network and is asked, and the request is used to indicate for virtual machine or physical machine distribution IP Location;
The DHCP proxy node obtains IP address according to the request in managing network from DHCP service node;
The DHCP proxy node sends the IP address to the virtual machine or physical machine.
2. according to the method described in claim 1, it is characterized in that, the DHCP proxy node receives request bag from business network It includes:
The DHCP proxy node by the first network interface card receive the request from the virtual machine or physical machine, described first Network interface card is for accessing the business network.
3. method according to claim 1 or 2, which is characterized in that DHCP proxy node basis in managing network The request obtains IP address from DHCP service node, including:
The DHCP proxy node receives the IP of the DHCP service node according to the request distribution by the second network interface card Address, second network interface card is for accessing the management network.
4. according to the method described in claim 3, it is characterized in that, first network interface card is located at the master where second network interface card On machine, the DHCP proxy node deployment is in the host where second network interface card.
5. a kind of DHCP proxy node, which is characterized in that including receiving module and sending module, wherein
The receiving module is asked for being received from business network, and is taken from DHCP according to the request in managing network Business node obtains IP address, and the request is used to indicate distributes IP address for virtual machine or physical machine;
The sending module, for sending the IP address to the virtual machine or physical machine.
6. agent node according to claim 5, which is characterized in that
The receiving module is specifically used for receiving the request from the virtual machine or physical machine, institute by the first network interface card The first network interface card is stated for accessing the business network.
7. agent node according to claim 5 or 6, which is characterized in that
The receiving module, specifically for receiving institute of the DHCP service node according to the request distribution by the second network interface card IP address is stated, second network interface card is for accessing the management network.
8. agent node according to claim 7, which is characterized in that
First network interface card is located on the host where second network interface card, and the DHCP proxy node deployment is in second net Host where blocking.
9. a kind of computing device, which is characterized in that the computing device includes processor and memory, and the processor executes institute The computer instruction of memory storage is stated to realize that dynamic host configuration protocol DHCP agent node, the DHCP proxy node are used 1 to 4 any one of them method is required in perform claim.
10. a kind of data center, which is characterized in that dynamic host configuration protocol DHCP agent node, DHCP service node and void Quasi- machine is deployed in respectively on one or more computing devices of the data center, and the DHCP proxy node is used for perform claim It is required that 1 to 4 any one of them method.
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 true CN108307002A (en) 2018-07-20
CN108307002B 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)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109343932A (en) * 2018-09-13 2019-02-15 郑州云海信息技术有限公司 A system and method for batch configuration of virtualized system computing nodes
CN109862134A (en) * 2019-03-18 2019-06-07 中国联合网络通信集团有限公司 A lease time configuration method and system for an IP address
WO2019214560A1 (en) * 2018-05-09 2019-11-14 华为技术有限公司 Dhcp packet processing method and device
CN110881143A (en) * 2018-09-05 2020-03-13 中兴通讯股份有限公司 Set top box management method, device and equipment and computer readable storage medium
CN111225080A (en) * 2020-01-06 2020-06-02 博为科技有限公司 A method for acquiring information of devices attached to a gateway
CN111586196A (en) * 2020-04-07 2020-08-25 无锡华云数据技术服务有限公司 A method, device and system for realizing virtual machine network dual stack
CN112804368A (en) * 2020-12-08 2021-05-14 中国电子科技集团公司第三十研究所 Method and system for automatically allocating IP and testing in batches
CN113406936A (en) * 2021-06-28 2021-09-17 中国科学技术大学 Control system of large scientific device
CN114301875A (en) * 2021-12-21 2022-04-08 锐捷网络股份有限公司 Management and control method and device for DHCP proxy side and electronic equipment
CN114363294A (en) * 2020-09-27 2022-04-15 华为云计算技术有限公司 Tenant server management method, device and system
CN118264645A (en) * 2024-04-12 2024-06-28 广州通则康威科技股份有限公司 A method and system for allocating addresses of devices connected to routers based on DHCP

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491630B (en) * 2020-12-07 2023-08-04 北京华胜天成科技股份有限公司 Bare metal automatic deployment method and device and cloud environment platform
CN113162944B (en) * 2021-04-29 2022-08-02 杭州安恒信息安全技术有限公司 Network communication method, device and device for security operation platform and security component
CN113709207A (en) * 2021-07-17 2021-11-26 济南浪潮数据技术有限公司 Method, system, equipment and medium for installing software in cloud resources
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

Citations (7)

* 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
CN101075962A (en) * 2007-06-26 2007-11-21 中兴通讯股份有限公司 Method and apparatus for realizing DHCP repeater in two-layer network exchanger
CN101330531A (en) * 2008-07-31 2008-12-24 杭州华三通信技术有限公司 DHCP address allocation processing method and DHCP relay
CN103458002A (en) * 2013-08-15 2013-12-18 中电长城网际系统应用有限公司 One-key deployment method and device for cloud system
CN103491203A (en) * 2013-09-09 2014-01-01 北京三快在线科技有限公司 Virtualization DHCP service method, device, system and server
CN103595772A (en) * 2013-11-01 2014-02-19 浪潮电子信息产业股份有限公司 Cloud data center network deployment scheme based on virtual router
CN104468574A (en) * 2014-12-05 2015-03-25 中国联合网络通信集团有限公司 Dynamic IP address acquisition method, system and device for virtual machines

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103944867B (en) * 2013-01-23 2017-09-12 华为技术有限公司 Processing method, the device and system of dynamic host configuration protocol message
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
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

Patent Citations (7)

* 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
CN101075962A (en) * 2007-06-26 2007-11-21 中兴通讯股份有限公司 Method and apparatus for realizing DHCP repeater in two-layer network exchanger
CN101330531A (en) * 2008-07-31 2008-12-24 杭州华三通信技术有限公司 DHCP address allocation processing method and DHCP relay
CN103458002A (en) * 2013-08-15 2013-12-18 中电长城网际系统应用有限公司 One-key deployment method and device for cloud system
CN103491203A (en) * 2013-09-09 2014-01-01 北京三快在线科技有限公司 Virtualization DHCP service method, device, system and server
CN103595772A (en) * 2013-11-01 2014-02-19 浪潮电子信息产业股份有限公司 Cloud data center network deployment scheme based on virtual router
CN104468574A (en) * 2014-12-05 2015-03-25 中国联合网络通信集团有限公司 Dynamic IP address acquisition method, system and device for virtual machines

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019214560A1 (en) * 2018-05-09 2019-11-14 华为技术有限公司 Dhcp packet processing method and device
CN110881143A (en) * 2018-09-05 2020-03-13 中兴通讯股份有限公司 Set top box management method, device and equipment and computer readable storage medium
CN109343932A (en) * 2018-09-13 2019-02-15 郑州云海信息技术有限公司 A system and method for batch configuration of virtualized system computing nodes
CN109862134A (en) * 2019-03-18 2019-06-07 中国联合网络通信集团有限公司 A lease time configuration method and system for an IP address
CN111225080A (en) * 2020-01-06 2020-06-02 博为科技有限公司 A method for acquiring information of devices attached to a gateway
CN111225080B (en) * 2020-01-06 2022-11-08 博为科技有限公司 Method for acquiring gateway down-hanging equipment information
CN111586196A (en) * 2020-04-07 2020-08-25 无锡华云数据技术服务有限公司 A method, device and system for realizing virtual machine network dual stack
CN111586196B (en) * 2020-04-07 2022-09-06 华云数据控股集团有限公司 A method, device and system for realizing virtual machine network dual stack
CN114363294A (en) * 2020-09-27 2022-04-15 华为云计算技术有限公司 Tenant server management method, device and system
CN114363294B (en) * 2020-09-27 2024-03-15 华为云计算技术有限公司 A management method, device and system for a tenant server
CN112804368A (en) * 2020-12-08 2021-05-14 中国电子科技集团公司第三十研究所 Method and system for automatically allocating IP and testing in batches
CN112804368B (en) * 2020-12-08 2021-12-17 中国电子科技集团公司第三十研究所 A method and system for automatically assigning IP and batch testing
CN113406936A (en) * 2021-06-28 2021-09-17 中国科学技术大学 Control system of large scientific device
CN114301875A (en) * 2021-12-21 2022-04-08 锐捷网络股份有限公司 Management and control method and device for DHCP proxy side and electronic equipment
CN118264645A (en) * 2024-04-12 2024-06-28 广州通则康威科技股份有限公司 A method and system for allocating addresses of devices connected to routers based on DHCP

Also Published As

Publication number Publication date
WO2019214560A1 (en) 2019-11-14
CN108307002B (en) 2021-06-22

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
CN102202104B (en) Managing distributed address pools within network devices
US8631100B2 (en) Automatic assignment of hardware addresses within computer networks
CN102647486B (en) Address allocation method, device and system
US20180083968A1 (en) Method and system for authorizing service of user, and apparatus
CN101217448B (en) Method and system to realize gateway dynamic load sharing
CN105657081A (en) DHCP (dynamic host configuration protocol) service providing method, device and system
CN105591820A (en) A highly scalable container network management system and method
CN113825251B (en) Session establishment method, device, system and computer storage medium
CN103428306B (en) Network element device loading method, equipment and system
CN104468574A (en) Dynamic IP address acquisition method, system and device for virtual machines
CN107241454B (en) A method, device, AAA server and SDN controller for implementing address management
CN107769939B (en) Network element management method, network management, gateway network element and system in data communication network
CN102801798B (en) Method and device for distributing IP (Internet Protocol) address
CN112654049A (en) Method for configuring wireless communication coverage extension system and wireless communication coverage extension system for implementing same
CN105591848A (en) Authentication method and device of IPv6 stateless automatic configuration
EP3048756B1 (en) Management method and apparatus for dynamic host configuration protocol server and relay
CN100518126C (en) Method and Router for Configuring GRE Tunnel
CN111669309B (en) A method for establishing VxLAN, wireless controller and switch
US11153118B2 (en) Technique for executing a service in a local area network through a wide area communication network
WO2015085558A1 (en) Method, device and system for dynamically allocating ip address
CN112543386B (en) Address acquisition method and related equipment
WO2022083610A1 (en) Ip address allocation method, apparatus and system
CN104662860A (en) Method and device for processing control rules

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