CN105872117A - Method and system for obtaining MAC address and virtual machine manager - Google Patents
Method and system for obtaining MAC address and virtual machine manager Download PDFInfo
- Publication number
- CN105872117A CN105872117A CN201510701345.4A CN201510701345A CN105872117A CN 105872117 A CN105872117 A CN 105872117A CN 201510701345 A CN201510701345 A CN 201510701345A CN 105872117 A CN105872117 A CN 105872117A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- address
- arp
- mac address
- bag
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
Abstract
The embodiment of the invention provides a method and system for obtaining MAC address and a virtual machine manager. The method mainly comprises: the virtual machine manager captures an address resolution protocol (ARP) request packet sent by a virtual machine; the protocol IP address between goal networks is extracted in the ARP request packet; a media access control MAC address corresponding to the goal IP address is obtained according to a presetting algorithm and the goal IP address; a corresponding ARP response packet of the MAC address with the goal IP address is generated; and the ARP response packet is sent to the virtual machine. Compared with the prior art, the method and system for obtaining MAC address and the virtual machine manager are able to inhibit the further broadcast of the ARP request so as to avoid causing the ARP broadcast storm in the condition of ensuring that the virtual machine obtains the correct MAC address.
Description
Technical field
The present embodiments relate to Internet technical field, particularly relate to a kind of side obtaining MAC Address
Method, virtual machine manager and system.
Background technology
MAC (Media Access Control, media interviews control) address is intended to indicate that the Internet
The identifier of each website upper, ARP (Address Resolution Protocol, assist by address resolution
View) it is a kind of according to IP (Internet Protocol, IP(Internet Protocol)) address acquisition MAC Address
Agreement.Under virtualized environment, when source virtual machine needs to communicate with purpose virtual machine, need first to obtain
Know IP address and the MAC Address of purpose virtual machine, and source virtual machine often can only know that purpose is virtual
The IP address of machine, and the MAC Address of purpose virtual machine can not be known, such as, source virtual machine first
Secondary access purpose virtual machine, so not having storage purpose virtual machine in the arp cache of source virtual machine
IP address and MAC Address.In this case it is necessary to it is virtual to utilize ARP protocol to obtain purpose
The MAC Address of machine.
In prior art, the specific implementation utilizing ARP protocol to obtain MAC Address is: source is empty
Plan machine other virtual machines in LAN by the way of broadcast send ARP request bag;Receive
The virtual machine of ARP request bag can detect the purpose IP address of this ARP request bag whether with self IP
Address is mated;If testing result is not for mate, then this ARP request bag can be abandoned by this virtual machine;
If testing result is coupling, then this virtual machine can be anti-by the arp response bag carrying own MAC address
Feed source virtual machine;After source virtual machine receives arp response bag, can be by the IP ground of purpose virtual machine
Location and MAC Address store to arp cache a period of time, and utilize the IP ground of purpose virtual machine
Location and MAC Address realize the communication between purpose virtual machine.
Owing to source virtual machine is the MAC ground obtaining purpose virtual machine by the way of broadcast ARP request
Location, so when LAN is contained within substantial amounts of virtual machine, source virtual machine will broadcast arp in a large number
Request bag, thus be likely to cause ARP broadcast storm.Additionally, when hacker wants local area network
In the essential information of each virtual machine when being analyzed, also can broadcast ARP request bag in a large number, from
And cause ARP broadcast storm.Therefore, under virtualized environment, how to avoid ARP broadcast storm
It it is current a great problem.
Summary of the invention
The embodiment of the present invention provides a kind of and obtains the method for MAC Address, virtual machine manager and system,
It is easily generated ARP broadcast storm during in order to solve and prior art obtains under virtualized environment MAC Address
Problem.
First aspect, the embodiment of the present invention provides a kind of method obtaining MAC Address, including:
Virtual machine manager intercepts and captures the ARP request bag that virtual machine sends;
Purpose IP(Internet Protocol) IP address is extracted from described ARP request bag;
According to the media interviews that preset algorithm is corresponding with purpose IP address described in described purpose IP address acquisition
Control MAC Address;
Generate the arp response bag carrying MAC Address corresponding to described purpose IP address;
Described arp response bag is sent to described virtual machine.
Second aspect, the embodiment of the present invention provides a kind of virtual machine manager, including:
Intercept and capture unit, for intercepting and capturing the ARP request bag that virtual machine sends;
Extraction unit, for extracting between purpose net from the described ARP request bag that described intercepting and capturing unit is intercepted and captured
Protocol IP address;
Acquiring unit, obtains for the described purpose IP address extracted according to preset algorithm and described extraction unit
Take the MAC address that described purpose IP address is corresponding;
Signal generating unit, corresponding for generating the described purpose IP address carrying the acquisition of described acquiring unit
The arp response bag of MAC Address;
Transmitting element, is sent to described virtual for the described arp response bag described signal generating unit generated
Machine.
The third aspect, the embodiment of the present invention provides a kind of system obtaining MAC Address, described system bag
Including: virtual machine manager and address administration platform, wherein, described virtual machine manager includes such as second party
Virtual machine manager described in face;
Described address administration platform, for distributing IP(Internet Protocol) IP address for virtual machine;
Described address administration platform, is additionally operable to according to IP ground described in preset algorithm and described IP address acquisition
The MAC address that location is corresponding, and described MAC Address is distributed to described virtual machine.
What the embodiment of the present invention provided obtains the method for MAC Address, virtual machine manager and system, energy
Enough when the virtual machine existed in certain physical machine sends ARP request bag, it is positioned at this physical machine and operating system
Between intermediate software layer (i.e. virtual machine manager) can directly intercept and capture ARP request bag, and calculate with
The MAC Address that purpose IP address in ARP request bag is corresponding, finally will carry this MAC Address
Arp response bag feed back to this virtual machine.It follows that obtain the process of MAC Address at virtual machine
In, all ARP request bags sent due to virtual machine are all intercepted and captured by virtual machine manager, so will not
By all virtual machines in ARP request packet broadcast to LAN, thus when the virtual machine quantity in LAN
Time more, do not have in a large amount of ARP request wraps in LAN the situation carrying out broadcasting, and then avoid
The generation of broadcast storm.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality
Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that under,
Accompanying drawing during face describes is some embodiments of the present invention, for those of ordinary skill in the art,
On the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
The flow chart of a kind of method obtaining MAC Address that Fig. 1 provides for the embodiment of the present invention;
The composition frame chart of a kind of virtual machine manager that Fig. 2 provides for the embodiment of the present invention;
The composition frame chart of the another kind of virtual machine manager that Fig. 3 provides for the embodiment of the present invention;
A kind of system schematic obtaining MAC Address that Fig. 4 provides for the embodiment of the present invention.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this
Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on
Embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise
The every other embodiment obtained, broadly falls into the scope of protection of the invention.
Embodiments provide a kind of method obtaining MAC Address, as it is shown in figure 1, the method
Including:
101, virtual machine manager intercepts and captures the ARP request bag that virtual machine sends.
Wherein, virtual machine refer to be simulated by software, there is complete hardware system function, operate in
Complete computer in one completely isolated environment.In actual applications, the internal memory of virtual machine, CPU
(Central Processing Unit, central processing unit) and disk are all by operating in physical machine and software system
Intermediate software layer virtual machine manager (hypervisor) between system is its distribution, between virtual machine
Communication also can be managed by hypervisor.Therefore, in hypervisor detects LAN, there is void
When plan machine sends ARP request bag, all ARP request bags that this virtual machine sends can be intercepted and captured, in order to after
Continue and directly do arp response process according to ARP request bag.
102, from ARP request bag, purpose IP address is extracted.
Wherein, in ARP request bag, storage has the IP address (i.e. source IP address) of source virtual machine, source empty
The MAC Address of plan machine, the IP address (i.e. purpose IP address) of purpose virtual machine and purpose virtual machine
MAC Address is (when the MAC Address of purpose virtual machine is unknown, and for broadcast request purpose virtual machine
During MAC Address, the MAC Address of purpose virtual machine is often arranged to FF-FF-FF-FF-FF-FF)
Etc. essential information, so by ARP request bag is resolved, can therefrom extract purpose IP ground
Location.
103, according to the MAC Address that preset algorithm is corresponding with purpose IP address acquisition purpose IP address.
Why hypervisor can go out the MAC Address of purpose virtual machine according to purpose IP address computation,
Being because before purpose virtual machine activation, address administration platform is assigned with an IP first to purpose virtual machine
Address, then calculate the MAC Address of corresponding IP address according to preset algorithm, finally will calculate
MAC Address distributes to this purpose virtual machine.Additionally, due to purpose virtual machine wants to carry out network service,
Need could be realized by Microsoft Loopback Adapter, so Microsoft Loopback Adapter to be distribution IP address and MAC Address.
Wherein, the IP address of Microsoft Loopback Adapter is identical with the IP address of purpose virtual machine, the MAC ground of Microsoft Loopback Adapter
Location is identical with the MAC Address of purpose virtual machine.
It should be noted that similar with purpose virtual machine, other virtual machines before being initiated, address
Management platform can be also its distribution IP address and MAC Address according to preset algorithm, then according to virtual machine
IP address and MAC Address IP address and the MAC Address of corresponding Microsoft Loopback Adapter are set.
104, the arp response bag of MAC Address corresponding to purpose IP address is carried in generation.
Due to source virtual machine (i.e. virtual machine in step 101) send ARP request bag purpose be in order to
Obtain the MAC Address of purpose virtual machine, so when hypervisor calculates corresponding mesh according to preset algorithm
IP address MAC Address after, the arp response bag carrying MAC Address can be generated, in order to will
This arp response bag is sent to source virtual machine, for source virtual machine according to MAC Address in arp response bag with
Purpose virtual machine carries out data interaction.
Wherein, at the virtual pusher side of purpose in the arp response bag and prior art of the generation of hypervisor side
The arp response bag generated is identical.
105, arp response bag is sent to virtual machine.
Mention at step 104, after generating the arp response bag carrying MAC Address, hypervisor
Need to be sent to this arp response bag virtual machine (i.e. source virtual machine in step 104), in order to source is empty
Plan machine obtains the MAC Address of purpose virtual machine from arp response bag, thus according to this MAC Address
Directly access purpose virtual machine.
Additionally, after source virtual machine obtains the MAC Address of purpose virtual machine, can be by purpose virtual machine
IP address and MAC Address store in arp cache, and store a period of time, in order to follow-up directly from
Arp cache obtains the MAC Address of purpose virtual machine, thus improves the speed obtaining MAC Address.
It should be noted that source virtual machine and purpose virtual machine in the embodiment of the present invention may be located at same
In individual physical machine, it is also possible to be positioned at different physical machine.But, no matter it is positioned at same physical machine,
Or the most different physical machine, when source virtual machine outside broadcast ARP request bag, all can by with source virtual machine
The hypervisor belonging to a physical machine together is intercepted and captured.
The method obtaining MAC Address that the embodiment of the present invention provides, it is possible within there is certain physical machine
When virtual machine sends ARP request bag, the intermediate software layer between this physical machine and operating system is (i.e.
Virtual machine manager) can directly intercept and capture ARP request bag, and calculate and the purpose in ARP request bag
The MAC Address that IP address is corresponding, finally feeds back to the arp response bag carrying this MAC Address
This virtual machine.It follows that during virtual machine obtains MAC Address, owing to virtual machine sends
All ARP request bags all intercepted and captured by virtual machine manager, so will not be by ARP request packet broadcast
All virtual machines to LAN, thus when the virtual machine quantity in LAN is more, do not have
A large amount of ARP request carry out situation about broadcasting in wrapping in LAN, and then avoid the generation of broadcast storm.
Additionally, due to hypervisor has intercepted and captured all ARP request bags that source virtual machine sends, so its
His virtual machine will not receive ARP request bag, thus avoid non-purpose virtual machine receive ARP please
After seeking bag, actively can send pseudo-MAC Address to source virtual machine, and then prevent to some extent ARP
Deception.
Further, in above-mentioned steps 103, according to preset algorithm and purpose IP address acquisition purpose IP
The concrete methods of realizing of the MAC Address that address is corresponding is: rear three bytes of purpose IP address mapped
To rear three bytes of MAC Address, obtain the MAC Address that purpose IP address is corresponding.
Mentioning in the above-described embodiments, before each virtual machine activation, address administration platform is according to presetting
Algorithm is that each virtual machine is assigned with IP address and MAC Address.This preset algorithm can be: by IP ground
Rear three bytes of location are mapped to rear three bytes of MAC Address, by three fixing bytes (in advance
Changeless three bytes set) it is mapped to first three byte of MAC Address.Therefore, when
After hypervisor extracts purpose IP address from ARP request bag, can be by rear the three of this purpose IP address
Individual byte is mapped to rear three bytes of the MAC Address of corresponding purpose IP address, by three fixing words
Joint is mapped to first three byte of this MAC Address, thus obtains the MAC corresponding with purpose IP address
Address, and then the arp response bag carrying MAC Address can be fed back to virtual machine.
It should be noted that owing to IP address the most decimally represents, MAC Address is typically with 16
System represents, so when using rear three bytes of IP address as rear three bytes of MAC Address,
Need by decimal scale, rear three byte content of IP address are converted to hexadecimal, add known,
First three byte of fixing MAC Address, the standard compliant MAC Address of final acquisition.
Exemplary, purpose IP address is 192.168.1.21, and first three byte of MAC Address is
00-23-5A, then using rear three bytes of purpose IP address as after rear three bytes of MAC Address,
The final MAC Address obtained is 00-23-5A-A8-1-15.
Further, for above-mentioned steps 101 is intercepted and captured the concrete real of the ARP request bag of virtual machine transmission
Existing mode can be:
The ARP packet that a1, intercepting and capturing virtual machine send.
In actual applications, hypervisor can monitor the virtual machine belonged to together with it in physical machine in real time and sends out
The packet that virtual machine in the packet seen off, and other physical machine sends over, and to these
Packet processes accordingly.Concrete, hypervisor can first intercept and capture each packet of process,
Then judge whether the packet intercepted and captured is ARP packet;If the packet intercepted and captured is not ARP data
Bag, then the packet of these intercepting and capturing can be carried out continuing transmission process by hypervisor;If the packet intercepted and captured
For ARP packet, then hypervisor will not carry out continuing transmission process to the packet of these intercepting and capturing, and
The processing mode that the packet of these intercepting and capturing is carried out described in step a2-a3 can be processed.
A2, judge whether ARP packet is ARP request bag.
When the packet that hypervisor determines intercepting and capturing is ARP packet, this ARP can be determined whether
Whether packet is ARP request bag.
Wherein, it is judged that whether ARP packet is that the specific implementation of ARP request bag can be: root
Judge whether ARP packet is ARP request bag according to the content of operation code in ARP packet.
Concrete, the opcode field in ARP packet is for identifying the operation class of this ARP packet
Type, i.e. may be used for identifying this ARP packet is ARP request bag, or arp response bag, or
Other kinds of packet (such as RARP request bag, RARP respond packet).Therefore, hypervisor can
Directly judge whether this ARP packet is ARP request bag according to the content in operation code.In reality
In application, when the content in operation code is " 1 ", represent that this ARP packet is ARP request bag;
When the content in operation code is " 2 ", represent that this ARP packet is arp response bag;Work as operation code
In content when being " 3 ", represent that this ARP packet is RARP request bag;In in operation code
When holding for " 4 ", represent that this ARP packet is RARP respond packet.Therefore, hypervisor can pass through
Judge whether the content in operation code is that " 1 " determines whether this ARP packet is ARP request bag.
If a3 ARP packet is ARP request bag, then retain ARP request bag.
When the ARP packet that hypervisor determines acquisition is ARP request bag, need to be retained
Come, process without it is carried out continuing transmission, in order to avoid producing ARP by suppression ARP request
Broadcast storm.When the ARP packet that hypervisor determines acquisition is not ARP request bag, can be right
It carries out continuing transmission and processes.
Further, owing to, in said method embodiment, hypervisor has inhibited ARP request bag
Broadcast further to other virtual machines, so other virtual machines do not receive ARP request bag, thus
Tend not to there are other virtual machines under normal circumstances and send the situation of arp response bag to source virtual machine.
But, the operation principle of ARP protocol not only includes that have sent ARP request just receives arp response, also
Including receiving external arp response at any time, thus update the arp cache of this locality.Therefore, attacking
On the premise of person is not received by the ARP request bag that source virtual machine sends, usually can be actively to source virtual machine
Send pseudo-arp response bag (i.e. carrying IP address and the respond packet of MAC Address of mistake corresponding relation),
Thus cause ARP to cheat.
Therefore, in order to avoid ARP to cheat further, an alternative embodiment of the invention also proposed following
Scheme: when the ARP packet that hypervisor determines acquisition is arp response bag, abandon this ARP
Respond packet.It follows that after hypervisor abandons the arp response bag that virtual machine sends, should connect
The virtual machine receiving this arp response bag cannot receive this arp response bag, can only receive
The normal arp response bag that hypervisor sends, thus avoid because receiving what other virtual machines sent
Pseudo-arp response bag and cause ARP to cheat.
Further, according to said method embodiment, an alternative embodiment of the invention additionally provides one
Virtual machine manager, as in figure 2 it is shown, this virtual machine manager includes: intercept and capture unit 21, extraction unit
22, acquiring unit 23, signal generating unit 24 and transmitting element 25.Wherein,
Intercept and capture unit 21, for intercepting and capturing the ARP request bag that virtual machine sends;
Extraction unit 22, assists between purpose net for extracting from the ARP request bag intercepting and capturing unit 21 intercepting and capturing
View IP address;
Acquiring unit 23, for the purpose IP address acquisition extracted according to preset algorithm and extraction unit 22
The MAC address that purpose IP address is corresponding;
Signal generating unit 24, for generating the MAC that the purpose IP address carrying acquiring unit 23 acquisition is corresponding
The arp response bag of address;
Transmitting element 25, is sent to virtual machine for arp response bag signal generating unit 24 generated.
The virtual machine manager that the embodiment of the present invention provides, it is possible to the virtual machine within there is certain physical machine is sent out
Intermediate software layer (i.e. virtual machine pipe when sending ARP request bag, between this physical machine and operating system
Reason device) can directly intercept and capture ARP request bag, and calculate and the purpose IP address phase in ARP request bag
Corresponding MAC Address, finally feeds back to this virtual machine by the arp response bag carrying this MAC Address.
It follows that during virtual machine obtains MAC Address, all ARP sent due to virtual machine
Request bag is all intercepted and captured by virtual machine manager, so will not be by ARP request packet broadcast to LAN
All virtual machines, thus when the virtual machine quantity in LAN is more, do not have a large amount of ARP request
Carry out situation about broadcasting in wrapping in LAN, and then avoid the generation of broadcast storm.
Additionally, due to virtual machine manager has intercepted and captured all ARP request bags that source virtual machine sends, so
Other virtual machines will not receive ARP request bag, thus avoid non-purpose virtual machine and receive ARP
After request bag, actively can send pseudo-MAC Address to source virtual machine, and then prevent to some extent
ARP cheats.
Further, acquiring unit 23, for being mapped to MAC by rear three bytes of purpose IP address
Rear three bytes of address, obtain the MAC Address that purpose IP address is corresponding.
Further, as it is shown on figure 3, intercept and capture unit 21, including:
Interception module 211, for intercepting and capturing the ARP packet that virtual machine sends;
Judge module 212, in the ARP packet obtained according to interception module 211 in operation code
Holding and judge whether ARP packet is ARP request bag, operation code is for identifying the operation of ARP packet
Type;
Reservation module 213, for when the judged result of judge module 212 be ARP packet be ARP
During request bag, retain ARP request bag.
Further, as it is shown on figure 3, intercept and capture unit 21, also include:
Discard module 214, for when the ARP number that the judged result of judge module 212 is virtual machine transmission
During according to bag for arp response bag, abandon the arp response bag that virtual machine sends.
It should be noted that above-described embodiment can realize correlation function by hardware processor.
Further, an alternative embodiment of the invention additionally provides a kind of system obtaining MAC Address,
As shown in Figure 4, this system includes: virtual machine manager 31 and address administration platform 32.Wherein, empty
Plan machine manager 31 includes virtual machine manager 31 as shown in Figure 2 or Figure 3;
Address administration platform 32, for distributing IP(Internet Protocol) IP address for virtual machine;
Address administration platform 32, is additionally operable to the matchmaker corresponding with IP address acquisition IP address according to preset algorithm
Body access control MAC addresses, and MAC Address is distributed to virtual machine.
Concrete, before each virtual machine activation in a local network, need to set IP address and MAC
Address, in order to communicate with other virtual machines upon actuation.In actual applications, each virtual machine
IP address and MAC Address can be distributed by the address administration platform in LAN.Concrete, address is managed
First platform can distribute an IP address for virtual machine, then calculates should IP by preset algorithm
The MAC Address of address, finally distributes to this virtual machine by the MAC Address calculated.
It should be noted that the IP address that address administration platform is virtual machine distribution can be A class address,
Can also be B class address, it is also possible to for C class address, do not limit at this.
Additionally, due to the network service between virtual machine needs could be realized by Microsoft Loopback Adapter, so working as
For set up virtual machine IP address and MAC Address after, there is provision of the virtual net of corresponding virtual machine
The IP address of card and MAC Address.
Concrete, when address administration platform is after virtual machine distributes IP address and MAC Address, can be straight
Connect the Microsoft Loopback Adapter that this MAC Address is distributed to corresponding virtual machine.In order to enable this virtual machine to receive and dispatch
Packet, in addition it is also necessary to the IP address distributed for this virtual machine is arranged on Microsoft Loopback Adapter, i.e. needs virtual
The IP address of network interface card is identical with the IP address of corresponding virtual machine.In actual applications, set for Microsoft Loopback Adapter
The method putting IP address mainly has two kinds.
Wherein, first method is: before virtual machine activation, by IP address and the MAC of virtual machine
DHCP Server is write in address, and (Dynamic Host Configure Protocol Server, DynamicHost is joined
Put protocol server) configuration file in the middle of;When, after virtual machine activation, the system of virtual machine can be to DHCP
The IP address of Server request Microsoft Loopback Adapter;Now, DHCP Server can search in configuration file with
The IP address that the MAC Address of this Microsoft Loopback Adapter is corresponding, and this void is distributed in the IP address found
Intend network interface card.
Second method is: before virtual machine activation, and the initializtion script for virtual machine adds a merit
Can, i.e. after virtual machine activation, when initializing, read configuration file (this configuration pre-set
In file, storage has the corresponding relation of IP address and MAC Address), and be virtual based on this configuration file
The IP address of the corresponding known MAC Address of network card configuration.
It should be noted that the virtual machine manager in the embodiment of the present invention is hypervisor.At LAN
In, there are multiple physical machine, each physical machine to be contained within a virtual machine manager and at least one virtual machine.
Additionally, also have one in LAN for virtual machine distribution IP address and the address administration platform of MAC Address.
Therefore, containing an address administration platform and at least one Virtual Machine Manager in the system of the embodiment of the present invention
Device.
The system obtaining MAC Address that the embodiment of the present invention provides, it is possible within there is certain physical machine
When virtual machine sends ARP request bag, the intermediate software layer between this physical machine and operating system is (i.e.
Virtual machine manager) can directly intercept and capture ARP request bag, and calculate and the purpose in ARP request bag
The MAC Address that IP address is corresponding, finally feeds back to the arp response bag carrying this MAC Address
This virtual machine.It follows that during virtual machine obtains MAC Address, owing to virtual machine sends
All ARP request bags all intercepted and captured by virtual machine manager, so will not be by ARP request packet broadcast
All virtual machines to LAN, thus when the virtual machine quantity in LAN is more, do not have
A large amount of ARP request carry out situation about broadcasting in wrapping in LAN, and then avoid the generation of broadcast storm.
Device embodiment described above is only schematically, wherein said illustrates as separating component
Unit can be or may not be physically separate, the parts shown as unit can be or
Person may not be physical location, i.e. may be located at a place, or can also be distributed to multiple network
On unit.Some or all of module therein can be selected according to the actual needs to realize the present embodiment
The purpose of scheme.Those of ordinary skill in the art are not in the case of paying performing creative labour, the most permissible
Understand and implement.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive each reality
The mode of executing can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly
Part.Based on such understanding, the portion that prior art is contributed by technique scheme the most in other words
Dividing and can embody with the form of software product, this computer software product can be stored in computer can
Read in storage medium, such as ROM/RAM, magnetic disc, CD etc., including some instructions with so that one
Computer equipment (can be personal computer, server, or the network equipment etc.) performs each to be implemented
The method described in some part of example or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, rather than to it
Limit;Although the present invention being described in detail with reference to previous embodiment, the ordinary skill of this area
Personnel it is understood that the technical scheme described in foregoing embodiments still can be modified by it, or
Person carries out equivalent to wherein portion of techniques feature;And these amendments or replacement, do not make corresponding skill
The essence of art scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.
Claims (9)
1. the method obtaining MAC Address, it is characterised in that described method includes:
Virtual machine manager intercepts and captures the ARP request bag that virtual machine sends;
Purpose IP(Internet Protocol) IP address is extracted from described ARP request bag;
According to the media interviews that preset algorithm is corresponding with purpose IP address described in described purpose IP address acquisition
Control MAC Address;
Generate the arp response bag carrying MAC Address corresponding to described purpose IP address;
Described arp response bag is sent to described virtual machine.
Method the most according to claim 1, it is characterised in that described according to preset algorithm with described
The MAC Address that purpose IP address described in purpose IP address acquisition is corresponding, including:
Rear three bytes of described purpose IP address are mapped to rear three bytes of MAC Address, obtain
The MAC Address that described purpose IP address is corresponding.
Method the most according to claim 1 and 2, it is characterised in that described intercepting and capturing virtual machine sends
ARP request bag, including:
Intercept and capture the ARP packet that described virtual machine sends;
Judge whether described ARP packet is ARP according to the content of operation code in described ARP packet
Request bag, described operation code is for identifying the action type of ARP packet;
If described ARP packet is ARP request bag, then retain.
Method the most according to claim 3, it is characterised in that if the ARP that described virtual machine sends
Packet is arp response bag, and the most described method farther includes:
Abandon the described arp response bag that described virtual machine sends.
5. a virtual machine manager, it is characterised in that described virtual machine manager includes:
Intercept and capture unit, for intercepting and capturing the ARP request bag that virtual machine sends;
Extraction unit, for extracting between purpose net from the described ARP request bag that described intercepting and capturing unit is intercepted and captured
Protocol IP address;
Acquiring unit, obtains for the described purpose IP address extracted according to preset algorithm and described extraction unit
Take the MAC address that described purpose IP address is corresponding;
Signal generating unit, corresponding for generating the described purpose IP address carrying the acquisition of described acquiring unit
The arp response bag of MAC Address;
Transmitting element, is sent to described virtual for the described arp response bag described signal generating unit generated
Machine.
Virtual machine manager the most according to claim 5, it is characterised in that described acquiring unit,
For rear three bytes of described purpose IP address being mapped to rear three bytes of MAC Address, obtain
The MAC Address that described purpose IP address is corresponding.
7. according to the virtual machine manager described in claim 5 or 6, it is characterised in that described intercepting and capturing list
Unit, including:
Interception module, for intercepting and capturing the ARP packet that described virtual machine sends;
Judge module, in the described ARP packet obtained according to described interception module in operation code
Holding and judge whether described ARP packet is ARP request bag, described operation code is used for identifying ARP data
The action type of bag;
Reservation module, for when the judged result of described judge module be described ARP packet be ARP
During request bag, retain described ARP request bag.
Virtual machine manager the most according to claim 7, it is characterised in that described intercepting and capturing unit,
Farther include:
Discard module, for when the ARP number that the judged result of described judge module is the transmission of described virtual machine
During according to bag for arp response bag, abandon the described arp response bag that described virtual machine sends.
9. the system obtaining MAC Address, it is characterised in that described system includes: virtual machine pipe
Reason device and address administration platform, wherein, described virtual machine manager includes as appointed in claim 5 to 8
One described virtual machine manager;
Described address administration platform, for distributing IP(Internet Protocol) IP address for virtual machine;
Described address administration platform, is additionally operable to according to IP ground described in preset algorithm and described IP address acquisition
The MAC address that location is corresponding, and described MAC Address is distributed to described virtual machine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510701345.4A CN105872117A (en) | 2015-10-26 | 2015-10-26 | Method and system for obtaining MAC address and virtual machine manager |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510701345.4A CN105872117A (en) | 2015-10-26 | 2015-10-26 | Method and system for obtaining MAC address and virtual machine manager |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105872117A true CN105872117A (en) | 2016-08-17 |
Family
ID=56624277
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510701345.4A Pending CN105872117A (en) | 2015-10-26 | 2015-10-26 | Method and system for obtaining MAC address and virtual machine manager |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105872117A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106878320A (en) * | 2017-03-09 | 2017-06-20 | 郑州云海信息技术有限公司 | A kind of method and apparatus for preventing IP address spoofing |
CN108881178A (en) * | 2018-05-29 | 2018-11-23 | 网易(杭州)网络有限公司 | Method for sending information and device, equipment, storage medium and electronic device |
CN112866435A (en) * | 2021-02-23 | 2021-05-28 | 中国联合网络通信集团有限公司 | MAC address aging processing method and equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102355417A (en) * | 2011-10-08 | 2012-02-15 | 杭州华三通信技术有限公司 | Data center two-layer interconnection method and device |
CN103227757A (en) * | 2012-08-31 | 2013-07-31 | 杭州华三通信技术有限公司 | Message forwarding method and equipment |
US20130232492A1 (en) * | 2010-10-19 | 2013-09-05 | Zte Corporation | Method and system for realizing virtual machine mobility |
CN103404084A (en) * | 2012-11-21 | 2013-11-20 | 华为技术有限公司 | MAC address forced forwarding device and method |
-
2015
- 2015-10-26 CN CN201510701345.4A patent/CN105872117A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130232492A1 (en) * | 2010-10-19 | 2013-09-05 | Zte Corporation | Method and system for realizing virtual machine mobility |
CN102355417A (en) * | 2011-10-08 | 2012-02-15 | 杭州华三通信技术有限公司 | Data center two-layer interconnection method and device |
CN103227757A (en) * | 2012-08-31 | 2013-07-31 | 杭州华三通信技术有限公司 | Message forwarding method and equipment |
CN103404084A (en) * | 2012-11-21 | 2013-11-20 | 华为技术有限公司 | MAC address forced forwarding device and method |
Non-Patent Citations (1)
Title |
---|
董玢: "嵌入式Linux安全网关***部分功能模块的设计与实现", 《中国优秀硕士学位论文全文数据库》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106878320A (en) * | 2017-03-09 | 2017-06-20 | 郑州云海信息技术有限公司 | A kind of method and apparatus for preventing IP address spoofing |
CN108881178A (en) * | 2018-05-29 | 2018-11-23 | 网易(杭州)网络有限公司 | Method for sending information and device, equipment, storage medium and electronic device |
CN112866435A (en) * | 2021-02-23 | 2021-05-28 | 中国联合网络通信集团有限公司 | MAC address aging processing method and equipment |
CN112866435B (en) * | 2021-02-23 | 2022-09-27 | 中国联合网络通信集团有限公司 | MAC address aging processing method and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20170132031A1 (en) | Method, system and device for managing virtual machine software in cloud environment | |
CN106170947B (en) | A kind of alarm information processing method, relevant device and system | |
US7921197B2 (en) | Dynamic configuration of virtual machines | |
CN111612461B (en) | Interaction method and device based on electronic certificates and electronic equipment | |
CN104169937B (en) | Chance system scans | |
CN103516547B (en) | A kind of network parameter distribution method and device | |
CN106301829A (en) | A kind of method and apparatus of Network dilatation | |
CN106302434A (en) | Server adaptation method, device and system | |
US8825750B2 (en) | Application server management system, application server management method, management apparatus, application server and computer program | |
CN103281203A (en) | Ecos (Embedded Configurable Operating System) system-based DHCP (Dynamic Host Configuration Protocol) address assignment management method | |
CN106301822A (en) | A kind of methods, devices and systems that AP is configured | |
CN101149665B (en) | Method for mapping an iSCSI target name to a storage resource and computation system | |
TW201250464A (en) | System and method for monitoring virtual machines | |
CN105991361A (en) | Monitoring method and monitoring system for cloud servers in cloud computing platform | |
CN105872117A (en) | Method and system for obtaining MAC address and virtual machine manager | |
CN103095722A (en) | Method for updating network security table and network device and dynamic host configuration protocol (DHCP) server | |
CN107209711A (en) | For the test system for the computer for testing the computer system in test network | |
CN107995321A (en) | A kind of VPN client acts on behalf of the method and device of DNS | |
CN104090824A (en) | Method, device and system for communication dispatching based on Tuxedo middleware | |
CN106101171A (en) | Server method of attachment and device | |
US20140089496A1 (en) | Apparatus and method for monitoring web application telecommunication data by user | |
CN112822146A (en) | Network connection monitoring method, device, system and computer readable storage medium | |
CN103023726B (en) | Method and system for testing maximum mainframe connection number of network storage device | |
CN113129002A (en) | Data processing method and equipment | |
CN106231003B (en) | A kind of address distribution method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160817 |
|
WD01 | Invention patent application deemed withdrawn after publication |