CN103401954B - The implementation method of virtual DHCP - Google Patents
The implementation method of virtual DHCP Download PDFInfo
- Publication number
- CN103401954B CN103401954B CN201310334143.1A CN201310334143A CN103401954B CN 103401954 B CN103401954 B CN 103401954B CN 201310334143 A CN201310334143 A CN 201310334143A CN 103401954 B CN103401954 B CN 103401954B
- Authority
- CN
- China
- Prior art keywords
- address
- dhcp
- virtual
- request message
- virtual machine
- 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.)
- Expired - Fee Related
Links
- 230000000875 corresponding Effects 0.000 claims abstract description 9
- 230000005540 biological transmission Effects 0.000 claims description 5
- 238000004891 communication Methods 0.000 claims description 5
- 239000011800 void material Substances 0.000 claims description 3
- 230000001276 controlling effect Effects 0.000 abstract description 8
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000000034 method Methods 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Abstract
The invention discloses the implementation method of a kind of virtual DHCP, including: after the control node in virtual network receives virtual DHCP foundation request message, set up virtual DHCP configuration information, and set up two tuples list of MAC Address and IP address;Controlling node and two tuples list and virtual DHCP configuration information are sent at least one agent node, agent node sets up DHCP service;Virtual machine sends MAC Address allocation request message to controlling node, controls node and selects untapped two tuples from two tuples list, and MAC Address therein is distributed to virtual machine;Virtual machine sends IP address assignment request message, after agent node receives this message, finds out the IP address corresponding with the MAC Address of virtual machine and distribute to virtual machine from two tuples list.The method can realize virtual DHCP in virtual network, and distributes MAC Address and IP address for virtual machine.
Description
Technical field
The present invention relates to virtual networking field, particularly to the implementation method of a kind of virtual DHCP.
Background technology
Virtual network be a kind of comprising be at least partly the computer network of virtual network link.Virtual network link be
Two are calculated equipment room and are not comprised physical connection, but realized by network virtualization, and the connection between i.e. two nodes is also
Need not the physical link of point-to-point needed for legacy network is built, but the logical links that framework is on the network platform.Base
Virtual network in virtual unit usually contains large number of virtual machine.Virtual machine (Virtual Machine, VM) refers to pass through
Software simulation there is complete hardware system function, the complete computer that operates in a completely isolated environment.Logical
Crossing software virtual machine, just can simulate one or more virtual computer on a physical host, these virtual machines are complete
Entirely it is operated just as real computer, such as, operating system, set up applications, access Internet resources can be installed
Etc..The same with physical host, virtual machine communicates in virtual network and needs also exist for a unique IP address.Virtual machine
IP address can be defined by user oneself, it is also possible to by DHCP come to virtual machine distribute.
For the network of multiple node dynamic access, the side that use DHCP carry out IP address distribution is usually taken
Formula.DHCP(Dynamic Host Configuration Protocol, DynamicHost arranges agreement) it is that one makes network management
Member can manage the communication protocol with automatic IP address allocation concentratedly.In an ip network, the equipment of each connection Internet
Need to distribute unique IP address.DHCP enables network manager from central node monitoring and distribution IP address.When certain meter
When calculation machine moves on to other position in network, can automatically receive new IP address.
Along with developing rapidly of cloud computing technology, virtual networking is also developing rapidly and increasingly mature.For virtual
In network, virtual machine is large number of, the feature of node dynamic access, network virtualization, the mode of traditional DHCP distribution IP address
Cannot adapt to the demand of virtual network, therefore, it is necessary to work out the IP address distribution side being more suitable for for virtual network
Formula.
Summary of the invention
(1) technical problem to be solved
It is an object of the invention to provide the implementation method of a kind of virtual DHCP such that it is able to utilize in virtual network
DHCP service is that virtual machine distributes IP address.
(2) technical scheme
In order to solve above-mentioned technical problem, the present invention proposes the implementation method of a kind of virtual DHCP, and described method includes:
After control node in S1, virtual network receives virtual DHCP foundation request message, set up virtual DHCP configuration
Information, and set up two tuples list of MAC Address and IP address, described two tuples list be used for preserving available MAC Address with can
One-to-one relationship with IP address;
Described two tuples list and described virtual DHCP configuration information are sent to described virtual by S2, described control node
At least one agent node in network, described agent node sets up DHCP service according to described virtual DHCP configuration information;
S3, when a certain virtual machine add described virtual network time, described virtual machine to described control node send MAC Address
Allocation request message, described control node selects untapped two tuples from described two tuples list, and by therein
MAC Address distributes to described virtual machine;
S4, described virtual machine pass through broadcast transmission IP address assignment request message, and described agent node receives described IP
After address assignment request message, from described two tuples list, find out the IP ground corresponding with the MAC Address of described virtual machine
Location also assigns them to described virtual machine.
Optionally, described virtual DHCP sets up and asks message to include IP available address.
Optionally, step S1 specifically includes:
Described control node sets up the IP available address in request message according to described virtual DHCP, for each IP available
The available MAC Address that address creation one is corresponding, and it is saved in described two tuples list.
Optionally, described virtual DHCP sets up and asks message to include gateway ip address and dns address.
Optionally, step S1 specifically includes:
Described control node sets up the gateway ip address in request message and dns address according to described virtual DHCP, sets up
Described virtual DHCP configuration information.
Optionally, in step S4, described virtual machine is specifically included by broadcast transmission IP address assignment request message:
Described virtual machine sends described IP address assignment request by the way of sending DHCP DISCOVER broadcast packet and disappears
Breath.
Optionally, farther include after step S4:
S5, when described control nodal test to described agent node communicating interrupt, by described two tuples list and institute
Stating other agent nodes that virtual DHCP configuration information is sent in described virtual network, other agent nodes are according to described virtual
DHCP configuration information sets up DHCP service.
Optionally, step S5 farther includes:
Described control node and described agent node carry out a heart-beat test every Fixed Time Interval, if described control
Node does not receives the heartbeat packet that described agent node sends after exceeding prefixed time interval, then be judged to that described agent node leads to
News are interrupted.
Optionally, described Fixed Time Interval is 15 seconds.
Optionally, step S1 farther includes:
Described control node sets up data base, and described two tuples list and described virtual DHCP configuration information is preserved
To described data base.
(3) beneficial effect
The technical scheme that the present invention proposes can be based on controlling node and the collaborative work of agent node in virtual network
Realize virtual DHCP, and be that each virtual machine distributes unique MAC Address and IP address by DHCP service.Use virtual
DHCP distributes IP address can be greatly improved work efficiency, saves the cost that management is safeguarded.
Accompanying drawing explanation
Fig. 1 is the flowchart of one embodiment of the invention.
Fig. 2 is the schematic diagram 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 setting up multiple virtual DHCP in one embodiment of the invention.
Detailed description of the invention
Below in conjunction with the accompanying drawings and embodiment, the detailed description of the invention of the present invention is described in further detail.
The present invention proposes the implementation method of a kind of virtual DHCP, as it is shown in figure 1, described method includes:
After control node in S1, virtual network receives virtual DHCP foundation request message, set up virtual DHCP configuration
Information, and set up two tuples list of MAC Address and IP address, described two tuples list be used for preserving available MAC Address with can
One-to-one relationship with IP address;
Described two tuples list and described virtual DHCP configuration information are sent to described virtual by S2, described control node
At least one agent node in network, described agent node sets up DHCP service according to described virtual DHCP configuration information;
S3, when a certain virtual machine add described virtual network time, described virtual machine to described control node send MAC Address
Allocation request message, described control node selects untapped two tuples from described two tuples list, and by therein
MAC Address distributes to described virtual machine;
S4, described virtual machine pass through broadcast transmission IP address assignment request message, and described agent node receives described IP
After address assignment request message, from described two tuples list, find out the IP ground corresponding with the MAC Address of described virtual machine
Location also assigns them to described virtual machine.
The technical scheme that the present invention proposes can be based on controlling node and the collaborative work of agent node in virtual network
Realize virtual DHCP, and be that each virtual machine distributes unique MAC Address and IP address by DHCP service.Use virtual
DHCP distributes IP address can be greatly improved work efficiency, saves the cost that management is safeguarded.
Below by a specific embodiment, the preferred implementation of described method is illustrated.
Embodiment 1:
First user needs to set up a virtual network in systems, then give this virtual network set up one virtual
DHCP.As in figure 2 it is shown, the virtual network in the present embodiment includes host A, host B and host C, wherein, host A is that this is virtual
Network-based control node, host B and host C are agent node.
User is when setting up virtual DHCP, it is necessary first to send virtual DHCP foundation request message, at this to controlling node
In request message, user can provide the title of virtual DHCP, the scope of IP available address, gateway ip address and the IP of DNS
The information such as address.Then this request can be sent to control node.In the present embodiment, user asks the virtual DHCP's of foundation
Title is designated as A.Control node, after receiving virtual DHCP foundation request message, can be set up according to this virtual DHCP and ask in message
IP available address, for the available MAC Address that each IP available address creation one is corresponding, and be saved in two tuples list
In (MAC, IP), (MAC, IP) here is two tuple result sets, for preserving available MAC Address and IP available address
One-to-one relationship;Meanwhile, control node and set up the title of virtual DHCP in request message, gateway IP according to this virtual DHCP
Address and dns address, set up virtual DHCP configuration information.It addition, as in figure 2 it is shown, control node can also set up data base, and
Described two tuples list (MAC, IP) and described virtual DHCP configuration information are saved in described data base, follow-up to facilitate
Search.
When control node send set up the order of virtual DHCP to agent node time, described two tuples list (MAC, IP) with
And described virtual DHCP configuration information can transmit over together.As in figure 2 it is shown, the agent node on host B and host C is receiving
After the order of control node, the DHCP service process of response can be set up, i.e. the agent node on host B and host C all can be created
Build DHCP service A, and be the virtual machine distribution IP address in this virtual network jointly.
When a certain newly-built virtual machine needs to add this virtual network, this newly-built virtual machine first can be to controlling joint
Point sends MAC Address allocation request message;After control node receives request, from (MAC, IP), select one untapped two
Tuple, and MAC Address therein is distributed to this newly-built virtual machine;Then this newly-built virtual machine this MAC ground
The Microsoft Loopback Adapter of oneself is set up in location.
When, after the virtual machine activation that this is newly-built, dhcp broadcast being sent and carry out IP address requesting;At this moment establish before
DHCP service A can receive this request bag, owing to having included the right of this MAC in the configuration file of DHCP service A before
Answer IP, so this most designated good IP will distribute to newly-built virtual machine.Here virtual machine obtains the process of IP address
Identical with traditional DHCP service, it may be assumed that virtual machine sends IP address by the way of sending DHCP DISCOVER broadcast packet and distributes
Request message;Agent node on host B or host C is after receiving this IP address assignment request message, from two tuples list
(MAC, IP) finds out the IP address corresponding with the MAC Address of this virtual machine, and sends it to virtual machine, i.e. to void
A DHCP OFFER message replied by plan machine;After virtual machine receives IP address, send a DHCP REQUEST to network wide
Broadcast bag;Last agent node replys a DHCP ACK message to virtual machine, and so far, the IP address of virtual machine is assigned.
In order to ensure network reliability service, controlling node needs to confirm that each provides the agent node of DHCP service can one
Directly keep normal communication.Therefore, control to carry out one every Fixed Time Interval (such as 15 seconds) between node and agent node
Secondary heart-beat test;When a main frame is closed or netting twine is pulled out, control node it finds that cannot with on it
Agent node carry out communication, at this moment control node and can select another main frame in this virtual network, and take from data base
Go out described two tuples list and described virtual DHCP configuration information, then send virtual DHCP and set up order to another main frame
On agent node, another main frame re-establishes DHCP service, to ensure the high availability of DHCP service.
As it is shown on figure 3, originally set up by the agent node on host B and provide DHCP service A.Control node and host B
On agent node carry out a heart-beat test every Fixed Time Interval.At a time, node is controlled when exceeding default
Between do not receive the heartbeat packet that agent node on host B sends behind interval, then judge in the agent node communication on host B
Disconnected.Therefore, control node from this virtual network, have selected main frame D, from data base, take out (MAC, IP) and DHCP service A
Configuration information, and be sent to the agent node on main frame D;Then the agent node on main frame D sets up DHCP service A, and is
Virtual machine distribution IP address in this virtual network.Above-mentioned mechanism ensure that always certain amount of agency in virtual network
Node provides IP address allocation services, thus ensures the high reliability of network.
It should be noted that in the case of there is multiple virtual network in systems, the agent node on a certain main frame was both
The virtual DHCP of virtual network A can be set up, the virtual DHCP of virtual network B can also be set up simultaneously.As shown in Figure 4, system
Two virtual networks of middle existence;One of them virtual network needs to set up DHCP service A, and another virtual network needs to set up
DHCP service B;Then, host B and host C are set up the most simultaneously there are DHCP service A and DHCP service B.Due to virtual network it
Between be mutually isolated, therefore, for the newly-built virtual machine in one of them virtual network, its IP address assignment request is only
Can be received by the DHCP service corresponding to this virtual network.
To sum up, the technical scheme that the present invention proposes can be based on controlling the collaborative of node and agent node in virtual network
Work realizes virtual DHCP, and is that each virtual machine distributes unique MAC Address and IP address by DHCP service.Use void
Plan DHCP distributes IP address can be greatly improved work efficiency, saves the cost that management is safeguarded.
The above is only the preferred embodiment of the present invention, it is noted that come for those of ordinary skill in the art
Saying, on the premise of without departing from the technology of the present invention principle, it is also possible to make some improvement and replacement, these improve and replace also should
It is considered as protection scope of the present invention.
Claims (8)
1. the implementation method of a virtual DHCP, it is characterised in that described method includes:
After control node in S1, virtual network receives virtual DHCP foundation request message, set up virtual DHCP configuration information,
And set up two tuples list of MAC Address and IP address, described two tuples list are used for preserving available MAC Address and IP available ground
The one-to-one relationship of location;
Described two tuples list and described virtual DHCP configuration information are sent to described virtual network by S2, described control node
In at least one agent node, described agent node sets up DHCP service according to described virtual DHCP configuration information;
S3, when a certain virtual machine add described virtual network time, described virtual machine to described control node send MAC Address distribution
Request message, described control node selects untapped two tuples from described two tuples list, and by MAC therein ground
Described virtual machine is distributed in location;
S4, described virtual machine pass through broadcast transmission IP address assignment request message, and described agent node receives described IP address
After allocation request message, from described two tuples list, find out the IP address corresponding with the MAC Address of described virtual machine also
Assign them to described virtual machine;
Described virtual DHCP sets up request message and includes IP available address;
Step S1 specifically includes:
Described control node sets up the IP available address in request message according to described virtual DHCP, for each IP available address
Create a corresponding available MAC Address, and be saved in described two tuples list.
2. the method for claim 1, it is characterised in that described virtual DHCP sets up request message and includes gateway ip address
And dns address.
3. method as claimed in claim 2, it is characterised in that step S1 specifically includes:
Described control node sets up the gateway ip address in request message and dns address according to described virtual DHCP, sets up described
Virtual DHCP configuration information.
4. the method for claim 1, it is characterised in that in step S4, described virtual machine passes through broadcast transmission IP address
Allocation request message specifically includes:
Described virtual machine sends described IP address assignment request message by the way of sending DHCP DISCOVER broadcast packet.
5. the method for claim 1, it is characterised in that farther include after step S4:
S5, when described control nodal test to described agent node communicating interrupt, by described two tuples list and described void
Intending other agent nodes that DHCP configuration information is sent in described virtual network, other agent nodes are according to described virtual DHCP
Configuration information sets up DHCP service.
6. method as claimed in claim 5, it is characterised in that step S5 farther includes:
Described control node and described agent node carry out a heart-beat test every Fixed Time Interval, if described control node
After exceeding prefixed time interval, do not receive the heartbeat packet that described agent node sends, be then judged in described agent node communication
Disconnected.
7. method as claimed in claim 6, it is characterised in that described Fixed Time Interval is 15 seconds.
8. the method for claim 1, it is characterised in that step S1 farther includes:
Described control node sets up data base, and described two tuples list and described virtual DHCP configuration information are saved in institute
State data base.
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 CN103401954A (en) | 2013-11-20 |
CN103401954B true 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) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450690B (en) | 2014-08-21 | 2019-02-22 | 国际商业机器公司 | The method and virtual machine management system that virtual machine management program executes |
CN106375486B (en) * | 2016-11-24 | 2019-05-21 | 国云科技股份有限公司 | A kind of system of cloud platform software definition DHCP service |
CN107707689B (en) * | 2017-10-31 | 2020-09-22 | 迈普通信技术股份有限公司 | DHCP message processing method, DHCP server and gateway equipment |
US10536431B2 (en) * | 2018-04-30 | 2020-01-14 | Microsoft Technology Licensing | On-node DHCP implementation for virtual machines |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4704043B2 (en) * | 2005-01-07 | 2011-06-15 | 富士通株式会社 | Movement processing program, information processing apparatus, computer system, and computer-readable recording medium storing movement processing program |
-
2013
- 2013-08-02 CN CN201310334143.1A patent/CN103401954B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Also Published As
Publication number | Publication date |
---|---|
CN103401954A (en) | 2013-11-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10601728B2 (en) | Software-defined data center and service cluster scheduling and traffic monitoring method therefor | |
CN103026660B (en) | Network policy configuration method, management equipment and network management centre device | |
US9999030B2 (en) | Resource provisioning method | |
JP6556875B2 (en) | Software-defined data center and service cluster placement method there | |
CN103997414B (en) | Generate method and the network control unit of configuration information | |
CN102067533B (en) | Port grouping for association with virtual interfaces | |
EP2843906B1 (en) | Method, apparatus, and system for data transmission | |
EP3310025B1 (en) | User migration | |
CN104506408A (en) | Data transmission method and device based on SDN | |
CN104104570A (en) | Aggregation processing method in IRF (Intelligent Resilient Framework) system and device | |
CN104283774B (en) | The implementation method and device in a kind of AC ponds | |
EP3086513A1 (en) | Message processing method and gateway | |
CN109586972A (en) | Cut-in method, system and the wideband network gateway of subscriber terminal equipment | |
WO2016169218A1 (en) | Gateway virtualization method and system, and computer storage medium | |
CN104301129A (en) | Dynamic host configuration method and system in software defined network | |
CN103401954B (en) | The implementation method of virtual DHCP | |
CN104301417B (en) | A kind of load-balancing method and device | |
CN106101297B (en) | A kind of message answer method and device | |
CN106936943A (en) | The distribution method and system of virtual machine address | |
CN104812021B (en) | A kind of method and device of AP access AC | |
CN104580029A (en) | Address distribution method and device | |
CN104104749B (en) | The distribution method and device of a kind of tunnel IP address | |
CN105827496B (en) | Manage the method and device of PE equipment | |
CN109088823B (en) | Method and device for realizing terminal interconnection | |
CN102447703B (en) | A kind of heat backup method and system, CGN equipment |
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 |