CN103401954A - Implementation method of virtual DHCP (dynamic host configuration protocol) - Google Patents
Implementation method of virtual DHCP (dynamic host configuration protocol) Download PDFInfo
- Publication number
- CN103401954A CN103401954A CN2013103341431A CN201310334143A CN103401954A CN 103401954 A CN103401954 A CN 103401954A CN 2013103341431 A CN2013103341431 A CN 2013103341431A CN 201310334143 A CN201310334143 A CN 201310334143A CN 103401954 A CN103401954 A CN 103401954A
- Authority
- CN
- China
- Prior art keywords
- address
- dhcp
- virtual
- virtual machine
- control node
- 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
Links
Images
Landscapes
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses an implementation method of a virtual DHCP (dynamic host configuration protocol). The method comprises the following steps of after a control node of a virtual network receives virtual DHCP establishing request information, establishing the configuration information of the virtual DHCP, and also establishing a two-tuple list of an MAC (media access control) address and an IP (internet protocol) address; enabling the control node to send the two-tuple list and the configuration information of the virtual DHCP to at least one agent node, and enabling the agent node to establish a DHCP service; enabling a virtual machine to send the MAC address distribution request information to the control node, enabling the control node to select an unused two-tuple from the two-tuple list, and distributing the MAC address in the unused two-tuple to the virtual machine; enabling the virtual machine to send the IP address distribution request information, finding the IP address corresponding to the MAC address of the virtual machine from the two-tuple list after the agent node receives the information, and distributing the IP address to the virtual machine. The method has the advantages that the virtual DHCP is realized in the virtual network, and the MAC address and the IP address are distributed to the virtual machine.
Description
Technical field
The present invention relates to the virtual networking field, particularly the implementation method of a kind of virtual DHCP.
Background technology
Virtual network is that be the computer network of virtual network link a kind of comprising at least partly.Virtual network link is between two computing equipments, not comprise physical connection, but realize by network virtualization, i.e. connection between two nodes does not need legacy network to build the physical link of required point-to-point, but the logical links of framework on the network platform.Usually the virtual machine that contains One's name is legion based on the virtual network of virtual unit.Virtual machine (Virtual Machine, VM) refer to by software simulation have the complete hardware system function, operate in a complete computer in complete isolation environment.Pass through software virtual machine, just can on a physical host, simulate one or more virtual computer, these virtual machines carry out work fully just as real computer, for example can installing operating system, set up applications, accesses network resource etc.The same with the physics main frame, virtual machine communicates unique IP address of same needs in virtual network.The IP address of virtual machine can, by user oneself definition, also can be distributed to virtual machine by DHCP.
For the network of a plurality of node dynamic access, usually take to use DHCP to carry out the mode of IP address assignment.DHCP(Dynamic Host Configuration Protocol, DynamicHost arranges agreement) be that a kind of network manager of making can manage the communication protocol with automatic IP address allocation concentratedly.In IP network, each equipment that connects Internet needs to distribute unique IP address.DHCP can monitor and the distributing IP address from centre junction point the network manager.When certain computer moves on to other position in network, can automatically receive new IP address.
Along with the develop rapidly of cloud computing technology, virtual networking is also developing rapidly and increasingly mature.Characteristics for virtual machine One's name is legion, node dynamic access, network virtualization in virtual network, the mode of traditional DHCP distributing IP address can't adapt to the demand of virtual network, therefore, be necessary to work out for virtual network the IP address assignment mode that more is suitable for.
Summary of the invention
(1) technical problem to be solved
The object of the present invention is to provide the implementation method of a kind of virtual DHCP, thereby can in virtual network, utilize the DHCP service to be virtual machine distributing IP address.
(2) technical scheme
In order to solve the problems of the technologies described above, the present invention proposes the implementation method of a kind of virtual DHCP, described method comprises:
Control node in S1, virtual network receives virtual DHCP set up request message after, set up virtual DHCP configuration information, and set up two tuples list of MAC Address and IP address, described two tuples list are for preserving the one-to-one relationship of available MAC Address and IP available address;
S2, described control node send at least one agent node in described virtual network by described two tuples list and described virtual DHCP configuration information, and described agent node is set up the DHCP service according to described virtual DHCP configuration information;
S3, when a certain virtual machine adds described virtual network, described virtual machine sends the MAC Address allocation request message to described control node, described control node is from described two tuples list, selecting untapped two tuples, and the MAC Address of inciting somebody to action is wherein distributed to described virtual machine;
S4, described virtual machine are by broadcast transmission IP address assignment request message, after described agent node receives described IP address assignment request message, from described two tuples list, finding out the IP address corresponding with the MAC Address of described virtual machine and it being distributed to described virtual machine.
Optionally, described virtual DHCP sets up request message and comprises the IP available address.
Optionally, step S1 specifically comprises:
Described control node is set up the IP available address in request message according to described virtual DHCP, is the available MAC Address of a correspondence of each IP available address creation, and is saved in described two tuples list.
Optionally, described virtual DHCP sets up request message and comprises gateway ip address and dns address.
Optionally, step S1 specifically comprises:
Described control node is set up gateway ip address and the dns address in request message according to described virtual DHCP, sets up described virtual DHCP configuration information.
Optionally, in step S4, described virtual machine specifically comprises by broadcast transmission IP address assignment request message:
Described virtual machine sends described IP address assignment request message by the mode that sends DHCP DISCOVER broadcast packet.
Optionally, after step S4, further comprise:
S5, when described control node detects described agent node communicating interrupt, described two tuples list and described virtual DHCP configuration information are sent to other agent nodes in described virtual network, and other agent nodes are set up the DHCP service according to described virtual DHCP configuration information.
Optionally, step S5 further comprises:
Described control node and described agent node carry out heart-beat test one time every Fixed Time Interval, if described control node is not received the heartbeat packet that described agent node sends after surpassing the Preset Time interval, are judged to be described agent node communicating interrupt.
Optionally, described Fixed Time Interval is 15 seconds.
Optionally, step S1 further comprises:
Described control node building database, and described two tuples list and described virtual DHCP configuration information are saved in to described database.
(3) beneficial effect
The technical scheme that the present invention proposes can realize virtual DHCP based on the collaborative work of controlling node and agent node in virtual network, and serves as each unique MAC Address and IP address of virtual machine distribution by DHCP.Adopt virtual DHCP to come the distributing IP address greatly to increase work efficiency, save the cost of management maintenance.
The accompanying drawing explanation
Fig. 1 is the realization flow figure of one embodiment of the invention.
Fig. 2 is the schematic diagram of setting up DHCP service A in the embodiment of the present invention 1.
Fig. 3 is the schematic diagram of newly-built agent node in the embodiment of the present invention 1.
Fig. 4 is the schematic diagram of setting up a plurality of virtual DHCP in one embodiment of the invention.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.
The present invention proposes the implementation method of a kind of virtual DHCP, as shown in Figure 1, described method comprises:
Control node in S1, virtual network receives virtual DHCP set up request message after, set up virtual DHCP configuration information, and set up two tuples list of MAC Address and IP address, described two tuples list are for preserving the one-to-one relationship of available MAC Address and IP available address;
S2, described control node send at least one agent node in described virtual network by described two tuples list and described virtual DHCP configuration information, and described agent node is set up the DHCP service according to described virtual DHCP configuration information;
S3, when a certain virtual machine adds described virtual network, described virtual machine sends the MAC Address allocation request message to described control node, described control node is from described two tuples list, selecting untapped two tuples, and the MAC Address of inciting somebody to action is wherein distributed to described virtual machine;
S4, described virtual machine are by broadcast transmission IP address assignment request message, after described agent node receives described IP address assignment request message, from described two tuples list, finding out the IP address corresponding with the MAC Address of described virtual machine and it being distributed to described virtual machine.
The technical scheme that the present invention proposes can realize virtual DHCP based on the collaborative work of controlling node and agent node in virtual network, and serves as each unique MAC Address and IP address of virtual machine distribution by DHCP.Adopt virtual DHCP to come the distributing IP address greatly to increase work efficiency, save the cost of management maintenance.
Below by a specific embodiment, the preferred implementation of described method is illustrated.
Embodiment 1:
At first the user need to set up a virtual network in system, sets up a virtual DHCP then for this virtual network.As shown in Figure 2, the virtual network in the present embodiment comprises host A, host B and host C, and wherein, host A is the control node of this virtual network, and host B and host C are agent node.
The user, when setting up virtual DHCP, at first needs to send virtual DHCP and set up request message to controlling node, and in this request message, the user can provide the information such as IP address of scope, gateway ip address and DNS of title, the IP available address of virtual DHCP.Then this request can send to the control node.In the present embodiment, the user asks the title of the virtual DHCP that sets up to be designated as A.Control node after receiving that virtual DHCP sets up request message, can set up the IP available address in request message according to this virtual DHCP, available MAC Address for a correspondence of each IP available address creation, and be saved in two tuples list (MAC, IP) in, here (MAC, IP) is two tuple result sets, be used to preserving the one-to-one relationship of available MAC Address and IP available address; Simultaneously, control node according to title, gateway ip address and dns address that this virtual DHCP sets up the virtual DHCP in request message, set up virtual DHCP configuration information.In addition, as shown in Figure 2, control all right building database of node, and described two tuples list (MAC, IP) and described virtual DHCP configuration information are saved in described database, to facilitate follow-up searching.
When controlling node, send the order during to agent node of setting up virtual DHCP, described two tuples list (MAC, IP) and described virtual DHCP configuration information can be transmitted over together.As shown in Figure 2, agent node on host B and host C, after receiving the order of controlling node, can be set up the DHCP service processes of response, namely, agent node on host B and host C all can create DHCP service A, and is the virtual machine distributing IP address in this virtual network jointly.
When a certain newly-built virtual machine need to add this virtual network, at first this newly-built virtual machine can send the MAC Address allocation request message to controlling node; After the control node receives request, from (MAC, IP), selecting untapped two tuples, and MAC Address is wherein distributed to this newly-built virtual machine; Then this newly-built virtual machine is set up the Microsoft Loopback Adapter of oneself with this MAC Address.
After this newly-built virtual machine activation, can send dhcp broadcast and carry out IP address requesting; At this moment the DHCP service A that establishes before can receive this request bag, in the configuration file due to the A of DHCP service before, has comprised the corresponding IP of this MAC, so this IP that has specified will distribute to newly-built virtual machine.Here the virtual machine process of obtaining the IP address is identical with traditional DHCP service, that is: virtual machine sends the IP address assignment request message by the mode that sends DHCP DISCOVER broadcast packet; Agent node on host B or host C is after receiving this IP address assignment request message, from in two tuples list (MAC, IP), finding out the IP address corresponding with the MAC Address of this virtual machine, and send it to virtual machine, that is, to virtual machine, reply a DHCP OFFER message; After virtual machine has been accepted the IP address, to network, send a DHCP REQUEST broadcast packet; Last agent node is replied a DHCP ACK message to virtual machine, and so far, the IP address assignment of virtual machine completes.
In order to guarantee the network reliability service, control node and need to confirm that each provides the agent node of DHCP service can keep normal communication always.Therefore, control between node and agent node and can carry out heart-beat test one time every Fixed Time Interval (such as 15 seconds); When a main frame is closed or netting twine is pulled out etc. in situation, control node will find can't with its on agent node carry out communication, at this moment control node and can select another main frame in this virtual network, and from database, taking out described two tuples list and described virtual DHCP configuration information, then send virtual DHCP and set up order to the agent node on another main frame, on another main frame, re-establish the DHCP service, to guarantee the high availability of DHCP service.
As shown in Figure 3, originally by the agent node on host B, set up and provide DHCP service A.The agent node of controlling on node and host B carries out heart-beat test one time every Fixed Time Interval.At a time, control the heartbeat packet that node does not receive that after surpassing the Preset Time interval agent node on host B sends, so judge the agent node communicating interrupt on host B.Therefore, control node from this virtual network, having selected main frame D, from database, taking out the configuration information of (MAC, IP) and DHCP service A, and send to the agent node on main frame D; Then the agent node on main frame D is set up DHCP service A, and is the virtual machine distributing IP address in this virtual network.Above-mentioned mechanism can guarantee always to have in virtual network the agent node of specific quantity that the IP address assignment service is provided, thereby guarantees the high reliability of network.
It should be noted that, in the situation that in system, there are a plurality of virtual networks, the agent node on a certain main frame both can have been set up the virtual DHCP of virtual network A, also can set up the virtual DHCP of virtual network B simultaneously.As shown in Figure 4, in system, there are two virtual networks; One of them virtual network need to be set up DHCP service A, and another virtual network need to be set up DHCP service B; So, on host B and host C, all set up simultaneously DHCP service A and DHCP service B arranged.Owing between virtual network, being mutual isolation, therefore, the newly-built virtual machine in one of them virtual network, its IP address assignment request only can be arrived by the DHCP service reception corresponding to this virtual network.
To sum up, the technical scheme that the present invention proposes can realize virtual DHCP based on the collaborative work of controlling node and agent node in virtual network, and serves as each unique MAC Address and IP address of virtual machine distribution by DHCP.Adopt virtual DHCP to come the distributing IP address greatly to increase work efficiency, save the cost of management maintenance.
The above is only the preferred embodiment of the present invention; it should be pointed out that for the person of ordinary skill of the art, under the prerequisite that does not break away from the technology of the present invention principle; can also make some improvement and replacement, these improvement and replacement also should be considered as protection scope of the present invention.
Claims (10)
1. the implementation method of a virtual DHCP, is characterized in that, described method comprises:
Control node in S1, virtual network receives virtual DHCP set up request message after, set up virtual DHCP configuration information, and set up two tuples list of MAC Address and IP address, described two tuples list are for preserving the one-to-one relationship of available MAC Address and IP available address;
S2, described control node send at least one agent node in described virtual network by described two tuples list and described virtual DHCP configuration information, and described agent node is set up the DHCP service according to described virtual DHCP configuration information;
S3, when a certain virtual machine adds described virtual network, described virtual machine sends the MAC Address allocation request message to described control node, described control node is from described two tuples list, selecting untapped two tuples, and the MAC Address of inciting somebody to action is wherein distributed to described virtual machine;
S4, described virtual machine are by broadcast transmission IP address assignment request message, after described agent node receives described IP address assignment request message, from described two tuples list, finding out the IP address corresponding with the MAC Address of described virtual machine and it being distributed to described virtual machine.
2. the method for claim 1, is characterized in that, described virtual DHCP sets up request message and comprises the IP available address.
3. method as claimed in claim 2, is characterized in that, step S1 specifically comprises:
Described control node is set up the IP available address in request message according to described virtual DHCP, is the available MAC Address of a correspondence of each IP available address creation, and is saved in described two tuples list.
4. method as claimed in claim 1 or 2, is characterized in that, described virtual DHCP sets up request message and comprises gateway ip address and dns address.
5. method as claimed in claim 4, is characterized in that, step S1 specifically comprises:
Described control node is set up gateway ip address and the dns address in request message according to described virtual DHCP, sets up described virtual DHCP configuration information.
6. the method for claim 1, is characterized in that, in step S4, described virtual machine specifically comprises by broadcast transmission IP address assignment request message:
Described virtual machine sends described IP address assignment request message by the mode that sends DHCP DISCOVER broadcast packet.
7. the method for claim 1, is characterized in that, after step S4, further comprises:
S5, when described control node detects described agent node communicating interrupt, described two tuples list and described virtual DHCP configuration information are sent to other agent nodes in described virtual network, and other agent nodes are set up the DHCP service according to described virtual DHCP configuration information.
8. method as claimed in claim 7, is characterized in that, step S5 further comprises:
Described control node and described agent node carry out heart-beat test one time every Fixed Time Interval, if described control node is not received the heartbeat packet that described agent node sends after surpassing the Preset Time interval, are judged to be described agent node communicating interrupt.
9. method as claimed in claim 8, is characterized in that, described Fixed Time Interval is 15 seconds.
10. the method for claim 1, is characterized in that, step S1 further comprises:
Described control node building database, and described two tuples list and described virtual DHCP configuration information are saved in to described database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310334143.1A CN103401954B (en) | 2013-08-02 | 2013-08-02 | The implementation method of virtual DHCP |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310334143.1A CN103401954B (en) | 2013-08-02 | 2013-08-02 | The implementation method of virtual DHCP |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103401954A true CN103401954A (en) | 2013-11-20 |
CN103401954B CN103401954B (en) | 2016-12-28 |
Family
ID=49565476
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310334143.1A Expired - Fee Related CN103401954B (en) | 2013-08-02 | 2013-08-02 | The implementation method of virtual DHCP |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103401954B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450690A (en) * | 2014-08-21 | 2016-03-30 | 国际商业机器公司 | Method executed by virtual machine management program, and virtual machine management system |
CN106375486A (en) * | 2016-11-24 | 2017-02-01 | 国云科技股份有限公司 | System for defining DHCP service by use of cloud platform software |
CN107707689A (en) * | 2017-10-31 | 2018-02-16 | 迈普通信技术股份有限公司 | A kind of DHCP message processing method, Dynamic Host Configuration Protocol server and gateway device |
CN110799944A (en) * | 2017-06-28 | 2020-02-14 | 亚马逊科技公司 | Virtual private network service endpoint |
CN112042170A (en) * | 2018-04-30 | 2020-12-04 | 微软技术许可有限责任公司 | On-node DHCP implementation for virtual machines |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060153188A1 (en) * | 2005-01-07 | 2006-07-13 | Fujitsu Limited | Migration program, information processing apparatus, computer system, and computer-readable recording medium having stored migration program |
CN102685267A (en) * | 2012-05-16 | 2012-09-19 | 上海兆民云计算科技有限公司 | IP (Internet Protocol) address leak preventing method in desktop cloud cluster running state |
CN102710814A (en) * | 2012-06-21 | 2012-10-03 | 奇智软件(北京)有限公司 | Method and device for controlling Internet protocol (IP) address of virtual machine |
CN103037023A (en) * | 2012-11-23 | 2013-04-10 | 中国电信股份有限公司云计算分公司 | Operation method of virtual machine system and virtual machine system |
-
2013
- 2013-08-02 CN CN201310334143.1A patent/CN103401954B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060153188A1 (en) * | 2005-01-07 | 2006-07-13 | Fujitsu Limited | Migration program, information processing apparatus, computer system, and computer-readable recording medium having stored migration program |
CN102685267A (en) * | 2012-05-16 | 2012-09-19 | 上海兆民云计算科技有限公司 | IP (Internet Protocol) address leak preventing method in desktop cloud cluster running state |
CN102710814A (en) * | 2012-06-21 | 2012-10-03 | 奇智软件(北京)有限公司 | Method and device for controlling Internet protocol (IP) address of virtual machine |
CN103037023A (en) * | 2012-11-23 | 2013-04-10 | 中国电信股份有限公司云计算分公司 | Operation method of virtual machine system and virtual machine system |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450690A (en) * | 2014-08-21 | 2016-03-30 | 国际商业机器公司 | Method executed by virtual machine management program, and virtual machine management system |
US10038665B2 (en) | 2014-08-21 | 2018-07-31 | International Business Machines Corporation | Reducing broadcast flooding in a software defined network of a cloud |
CN106375486A (en) * | 2016-11-24 | 2017-02-01 | 国云科技股份有限公司 | System for defining DHCP service by use of cloud platform software |
CN106375486B (en) * | 2016-11-24 | 2019-05-21 | 国云科技股份有限公司 | A kind of system of cloud platform software definition DHCP service |
CN110799944A (en) * | 2017-06-28 | 2020-02-14 | 亚马逊科技公司 | Virtual private network service endpoint |
CN110799944B (en) * | 2017-06-28 | 2023-08-01 | 亚马逊科技公司 | Virtual private network service endpoint |
CN107707689A (en) * | 2017-10-31 | 2018-02-16 | 迈普通信技术股份有限公司 | A kind of DHCP message processing method, Dynamic Host Configuration Protocol server and gateway device |
CN107707689B (en) * | 2017-10-31 | 2020-09-22 | 迈普通信技术股份有限公司 | DHCP message processing method, DHCP server and gateway equipment |
CN112042170A (en) * | 2018-04-30 | 2020-12-04 | 微软技术许可有限责任公司 | On-node DHCP implementation for virtual machines |
CN112042170B (en) * | 2018-04-30 | 2023-10-13 | 微软技术许可有限责任公司 | DHCP implementation on nodes for virtual machines |
Also Published As
Publication number | Publication date |
---|---|
CN103401954B (en) | 2016-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11563669B2 (en) | Method for implementing network virtualization and related apparatus and communications system | |
EP2922238A1 (en) | Resource allocation method | |
EP3086513A1 (en) | Message processing method and gateway | |
CN106452857A (en) | Method for generating configuration information and network control unit | |
CN102025798A (en) | Address allocation processing method, device and system | |
CN103401954B (en) | The implementation method of virtual DHCP | |
CN106612196B (en) | Obtain the method and device of resource | |
CN104301129A (en) | Dynamic host configuration method and system in software defined network | |
CN109495593B (en) | Address allocation method and system | |
CN106936943A (en) | The distribution method and system of virtual machine address | |
CN104980368A (en) | Bandwidth guarantee method and apparatus in software defined network (SDN) | |
CN108011907B (en) | Resource allocation method and device for power distribution and utilization communication network | |
JP2013500653A (en) | Method for providing information, home gateway and home network system | |
CN105979202B (en) | Data transmission method and device | |
CN111464454A (en) | Load sharing method and system for virtual BRAS (broadband remote Access Server) equipment in data center | |
CN104580029A (en) | Address distribution method and device | |
EP2892196B1 (en) | Method, network node and system for implementing point-to-multipoint multicast | |
CN102884762A (en) | Method, devices and system for controlling network paths | |
CN106878481B (en) | Method, device and system for acquiring Internet Protocol (IP) address | |
CN105827496B (en) | Manage the method and device of PE equipment | |
CN106330511B (en) | Network element equipment and method for opening data communication network | |
CN104780229A (en) | Method of setting cloud server IP address through cloud terminal, system and cloud system | |
CN104935614B (en) | Data transmission method and device | |
CN101087232B (en) | An access method, system and device based on Ethernet point-to-point protocol | |
US20160241427A1 (en) | Service Sending, Receiving Methods and Devices |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
PP01 | Preservation of patent right |
Effective date of registration: 20180823 Granted publication date: 20161228 |
|
PP01 | Preservation of patent right | ||
PD01 | Discharge of preservation of patent |
Date of cancellation: 20210823 Granted publication date: 20161228 |
|
PD01 | Discharge of preservation of patent | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20161228 Termination date: 20180802 |
|
CF01 | Termination of patent right due to non-payment of annual fee |