CN104038422B - Message forwarding method and gateway - Google Patents

Message forwarding method and gateway Download PDF

Info

Publication number
CN104038422B
CN104038422B CN201310074555.6A CN201310074555A CN104038422B CN 104038422 B CN104038422 B CN 104038422B CN 201310074555 A CN201310074555 A CN 201310074555A CN 104038422 B CN104038422 B CN 104038422B
Authority
CN
China
Prior art keywords
address
gateway
virtual machine
mac
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310074555.6A
Other languages
Chinese (zh)
Other versions
CN104038422A (en
Inventor
郑合文
汪洋
吴钦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201711000834.2A priority Critical patent/CN107920020B/en
Priority to CN201310074555.6A priority patent/CN104038422B/en
Priority to PCT/CN2014/072604 priority patent/WO2014135024A1/en
Publication of CN104038422A publication Critical patent/CN104038422A/en
Application granted granted Critical
Publication of CN104038422B publication Critical patent/CN104038422B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/59Network arrangements, protocols or services for addressing or naming using proxies for addressing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Abstract

The embodiment of the present invention provides a kind of message forwarding method and gateway.This method includes:First gateway receives the Ether frame for the first bearing IP packet that the first virtual machine is sent, the first source IP address field, the first MAC Address field, the first target MAC (Media Access Control) address field and the first purpose IP address field are carried in the Ether frame, wherein, the value of first source IP address field is the IP address of the first virtual machine, the value of first source MAC field is the MAC Address of the first virtual machine, the mark of the gateway of value second of first target MAC (Media Access Control) address field, the value of the first purpose IP address field are the IP address of the second virtual machine;The value of first source MAC field of the Ether frame of the first bearing IP packet is revised as the mark of the first gateway by the first gateway, obtains the Ether frame of the second bearing IP packet;The Ether frame of second bearing IP packet is sent to the second gateway by the first gateway.The present invention is used for saving the resource of gateway, improves the efficiency of message forwarding.

Description

Message forwarding method and gateway
Technical field
The present embodiments relate to communication technical field, more particularly to a kind of message forwarding method and gateway.
Background technology
There is multi-tenant isolation requirement in existing carrier network, multiple tenants have parallel address space, mutually not Influence.In general, the data center included under different operators(Data Center, hereinafter referred to as DC)Network is not With, and an operator can have multiple DC networks, different DC networks can be that different tenants service, and a tenant There can be multiple virtual machines(Virtual Machine, hereinafter referred to as VM), multiple VM can be distributed in different physical servers On, and different physical servers may represent different DC networks, i.e. DC networks are the networks where physical server, multiple The tunnel communication that VM can be established by server, because the tunneling technique that different physical servers uses is different, therefore To be communicated between multiple VM just needs isomery virtual network gateway to realize the different internetwork intercommunications of DC.
In the prior art, the gateway in DC networks is forwarded during Ether frame between VM, it is necessary to learn to send VM and receive VM Media access control(Media Access Control, hereinafter referred to as MAC)Address, especially gateway into DC networks it is multiple VM is sent under the scene of Ether frame, and gateway needs to learn the MAC Address of multiple VM in the DC networks, so as to cause the net of DC networks Pass resource occupation is serious, and forward efficiency is low.
The content of the invention
The embodiment of the present invention provides a kind of message forwarding method and gateway, to save the resource of gateway, improves message and turns The efficiency of hair.
First aspect of the embodiment of the present invention provides a kind of message forwarding method, including:
The Ether frame for the first carrying Internet protocol IP message that first gateway the first virtual machine of reception is sent, described first The first source IP address field, the first source MAC address field, the first mesh are carried in the Ether frame of bearing IP packet MAC Address field and the first purpose IP address field, wherein, the value of the first source IP address field is virtual for described first The IP address of machine, the value of the first source MAC field are the MAC Address of first virtual machine, the MAC of first mesh The value of address field is the mark of the second gateway corresponding to the second virtual machine, and the value of the first purpose IP address field is described The IP address of second virtual machine;
First gateway is by the value of the first source MAC field in the Ether frame of first bearing IP packet The mark of first gateway is revised as by the MAC Address of first virtual machine, obtains the Ether frame of the second bearing IP packet;
The Ether frame of second bearing IP packet is sent to described by first gateway according to the mark of second gateway Second gateway.
With reference to described in a first aspect, in the first possible embodiment of first aspect, receiving first gateway After the Ether frame for first bearing IP packet that first virtual machine is sent, methods described also includes:
First gateway, first virtual machine according to the ether frame recording of first bearing IP packet of reception The virtual machine of corresponding relation first of the MAC Address of IP address and first virtual machine.
With reference to the possible embodiment of the first of first aspect or first aspect, second in first aspect is possible In embodiment, before first gateway receives the Ether frame for first bearing IP packet that the first virtual machine is sent, institute Stating method also includes:
First gateway receives the first carrying ARP request message that first virtual machine is sent Ether frame, it is described first carrying ARP request message Ether frame in carry the second source MAC field, the second target MAC (Media Access Control) address Field, the second sender Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address Field and the second target Target MAC Address fields, the value of the 2nd Sender IP address fields are virtual for described first The value of the IP address of machine, the value of the second source MAC field and the 2nd Sender MAC Address fields is described The MAC Address of first virtual machine, the values of the second target Target IP address fields for second virtual machine IP Location, the value of the second target MAC (Media Access Control) address field is broadcast MAC address, and the value of the 2nd Target MAC Address fields is Unknown Unknow MAC Address;
First gateway, first virtual machine according to the ether frame recording of the first of reception the carrying ARP request message The corresponding relation of the MAC Address of IP address and first virtual machine;
First gateway carries the second source MAC word in the Ether frame of ARP request message by described first The value of section and the value of the 2nd Sender MAC Address fields are revised as described the by the MAC Address of first virtual machine The mark of one gateway, obtain the Ether frame of amended second carrying ARP request message;
The Ether frame of described second carrying ARP request message is broadcast to the second gateway by first gateway, and described second Gateway is located at second data center's DC networks, and first gateway and first virtual machine are located at the first DC networks, and tenant rents With first virtual machine and the virtual machine rented in the 2nd DC networks.
With reference to second of possible embodiment of first aspect, in the third possible embodiment of first aspect In, after the Ether frame of the described second carrying ARP request message is broadcast to the second gateway by first gateway, methods described is also Including:
First gateway receives the Ether frame for the first carrying arp response message that second gateway is sent, and described the The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd are carried in the Ether frame of one carrying arp response message Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address field, the values of the 3rd Sender IP address fields are the IP address of second virtual machine, the 3rd source The value of the value of MAC Address field and the 3rd Sender MAC Address fields is the mark of second gateway, and described The value of three Target IP address fields be first virtual machine IP address, the value of the 3rd target MAC (Media Access Control) address field and The value of the 3rd Target MAC Address fields is the mark of first gateway;
First gateway is according to the IP address of first virtual machine prestored and the MAC of first virtual machine The corresponding relation of address, by the value of the 3rd target MAC (Media Access Control) address field of the Ether frame of the described first carrying arp response message First virtual machine is revised as by the mark of first gateway with the value of the 3rd Target MAC Address fields MAC Address, obtain the Ether frame of the second carrying arp response message;
First gateway is according to the IP address of first virtual machine and the MAC Address of first virtual machine, by institute The Ether frame for stating the second carrying arp response message is sent to first virtual machine.
With reference to the possible embodiment of the first of first aspect or first aspect, the 4th kind in first aspect is possible In embodiment, first gateway receive first bearing IP packet that first virtual machine is sent Ether frame it Before, methods described also includes:
First gateway receives the 3rd carrying ARP request message that first virtual machine is sent Ether frame, the described 3rd carries the 4th source MAC field of carrying, the 4th target MAC (Media Access Control) address in the Ether frame of ARP request message Field, the 4th Sender IP address fields, the 4th Sender MAC Address field, the 4th Target IP address fields and the 4th Target MAC Address fields, the value of the 4th Sender IP address fields is the IP address of first virtual machine, described The value of the value of 4th source MAC field and the 4th Sender MAC Address fields is the MAC of first virtual machine Address, the values of the 4th target Target IP address fields are the IP address of second virtual machine, the 4th purpose The value of MAC Address field is broadcast MAC address, and the value of the 4th Target MAC Address sections is unknown MAC Address;
First gateway sends the first request of the MAC Address for obtaining second virtual machine to information collection server Message, the IP address of second virtual machine is carried in first request message;
First gateway receive described information acquisition server according to the mark of second gateway prestored with The first response message that the IP address corresponding relation of second virtual machine returns, described the is carried in first response message The mark of two gateways;
First gateway to first virtual machine send the 4th carrying arp response message Ether frame, the described 4th Carry and the mark of second gateway is carried in the Ether frame of arp response message, so that first virtual machine is by described first The value of the first target MAC (Media Access Control) address field in the Ether frame of bearing IP packet is filled with the mark of second gateway.
Second aspect of the embodiment of the present invention provides a kind of message forwarding method, including:
Second gateway receives the Ether frame for the second carrying Internet protocol IP message that the first gateway is sent, and described second holds Carry in the Ether frame of IP messages and carry the first source IP address field, the first source MAC address field, the first purpose MAC Address field and the first purpose IP address field, the value of the first source IP address field are the IP of first virtual machine Address, the value of the first source MAC field are the mark of first gateway, the first target MAC (Media Access Control) address field It is worth for the mark of second gateway corresponding to the second virtual machine, the value of the first purpose IP address field is empty for described second The IP address of plan machine;
Second gateway is according to the IP address of second virtual machine prestored and the MAC of second virtual machine The corresponding relation of address, by the value of the first target MAC (Media Access Control) address field in the Ether frame of second bearing IP packet by described The mark of second gateway is revised as the MAC Address of second virtual machine, obtains the Ether frame of the 3rd bearing IP packet;
Second gateway is according to the IP address of second virtual machine and the MAC Address of second virtual machine, by institute The Ether frame for stating the 3rd bearing IP packet is sent to second virtual machine.
With reference to second aspect, in the first possible embodiment of second aspect, second gateway receives first Before the Ether frame for the second carrying Internet protocol IP message that gateway is sent, methods described also includes:
Second gateway receive the second carrying ARP request message that first gateway is sent with Too frame, it is described second carrying ARP request message Ether frame in carry the second source MAC field, the second target MAC (Media Access Control) address word Section, the 2nd Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address fields and Two target Target MAC Address fields, the values of the 2nd Sender IP address fields for first virtual machine IP The value of location, the value of the second source MAC field and the 2nd Sender MAC Address fields is first gateway Mark, the values of the second target Target IP address fields is the IP address of second virtual machine, second purpose The value of MAC Address field is broadcast MAC address;The value of the 2nd Target MAC Address fields is unknown MAC Address;
Second gateway is by the Ether frame of the described second carrying ARP request message into second data center's DC networks Virtual machine is broadcasted, and first gateway and first virtual machine are located at the first DC networks, second gateway and described second Virtual machine is located at the 2nd DC networks, and tenant rents first virtual machine and rented virtual in the 2nd DC networks Machine.
With reference to the first possible embodiment of second aspect, in second of possible embodiment of second aspect In, second gateway is by the Ether frame of the described second carrying ARP request message into the second data center DC networks After virtual machine broadcast, methods described also includes:
Second gateway receives the Ether frame for the 3rd carrying arp response message that second virtual machine is sent, described The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd are carried in the Ether frame of 3rd carrying arp response message Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address field, the values of the 3rd Sender IP address fields are the IP address of second virtual machine, the 3rd source The value of the value of MAC Address field and the 3rd Sender MAC Address fields is the MAC Address of second virtual machine, institute The value for stating the 3rd Target IP address fields is the IP address of first virtual machine, the 3rd target MAC (Media Access Control) address field The value of value and the 3rd Target MAC Address fields is the mark of first gateway;
Second gateway carries the 3rd source MAC word in the Ether frame of arp response message by the described 3rd The value of section and the value of the 3rd Sender MAC Address fields are revised as described the by the MAC Address of second virtual machine The mark of two gateways, obtain the Ether frame of the first carrying arp response message;
The Ether frame of described first carrying arp response message is sent to first gateway by second gateway.
With reference to second aspect, in the third possible embodiment of first aspect, described in second gateway receives Before the Ether frame for the second carrying Internet protocol IP message that first gateway is sent, methods described also includes:
Second gateway receives the Ether frame for the 4th carrying ARP request message that second virtual machine is sent, described The 5th source MAC field, the 5th target MAC (Media Access Control) address field, the 5th are carried in the Ether frame of 4th carrying ARP request message Sender MAC Address field, the 5th Target MAC Address field, the 5th Sender IP address fields and the 5th Target IP address field, the value of the 5th source MAC field and the value of the 5th Sender MAC Address fields are described The MAC Address of second virtual machine, the value of the target MAC (Media Access Control) address field are broadcast MAC address, the 5th Sender IP The value of location field is the IP address of second virtual machine, and the value of the 5th Target IP address fields is empty for described first The IP address of plan machine, the value of the 5th target MAC (Media Access Control) address field is unknown MAC Address;
Second gateway carries the 5th source MAC word in the Ether frame of ARP request message by the described 4th The value of section and the value of the 5th Sender MAC Address fields are revised as described the by the MAC Address of second virtual machine The mark of two gateways, and the 4th message is sent to information collection server, carry second gateway in the 4th message The corresponding relation of mark and the IP address of second virtual machine, so that described information acquisition server records second gateway Mark and second virtual machine IP address corresponding relation.
With reference to second aspect, in the 4th kind of possible embodiment of second aspect, described in second gateway receives Before the Ether frame for the second carrying Internet protocol IP message that first gateway is sent, methods described also includes:
Second gateway sends the 5th message to information collection server, and the second virtual machine is carried in the 5th message The mark of the corresponding relation of the IP address of second virtual machine and second gateway, so that described information acquisition server is remembered Record the mark of second gateway and the IP address corresponding relation of second virtual machine.
The third aspect of the embodiment of the present invention provides a kind of gateway, including:
First receiving module, the ether of the first carrying Internet protocol IP message sent for receiving the first virtual machine Frame, the first source IP address field, the first source MAC address are carried in the Ether frame of first bearing IP packet Field, the first target MAC (Media Access Control) address field and the first purpose IP address field, wherein, the value of the first source IP address field is The IP address of first virtual machine, the value of the first source MAC field are the MAC Address of first virtual machine, institute State the first target MAC (Media Access Control) address field value be the second gateway corresponding to the second virtual machine mark, first purpose IP address The value of field is the IP address of second virtual machine;
First modified module, for by the first source MAC word in the Ether frame of first bearing IP packet The value of section is revised as the mark of first gateway by the MAC Address of first virtual machine, obtains the second bearing IP packet Ether frame;
First sending module, for the mark according to second gateway, the Ether frame of the second bearing IP packet is sent To second gateway.
With reference to the third aspect, in the first possible embodiment of the third aspect, the gateway also includes:
First logging modle, the Ether frame of first bearing IP packet sent for receiving first virtual machine it Afterwards, the IP address of the first virtual machine and first void according to the ether frame recording of first bearing IP packet of reception The virtual machine of corresponding relation first of the MAC Address of plan machine.
With reference to the possible embodiment of the first of the third aspect or the third aspect, second in the third aspect is possible In embodiment, the gateway also includes:
Second receiving module, for receive the first virtual machine send first bearing IP packet Ether frame before, The Ether frame for the first carrying ARP request message that first virtual machine is sent is received, described first holds Carry in the Ether frame of ARP request message and carry the second source MAC field, the second target MAC (Media Access Control) address field, the second sender Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address fields and the second target Target MAC Address fields, the value of the 2nd Sender IP address fields is the IP address of first virtual machine, described The value of the value of second source MAC field and the 2nd Sender MAC Address fields is the MAC of first virtual machine Address, the values of the second target Target IP address fields are the IP address of second virtual machine, second purpose The value of MAC Address field is broadcast MAC address, and the value of the 2nd Target MAC Address fields is for unknown Unknow MAC Location;
Second logging modle, it is empty for described in the ether frame recording according to the first of reception the carrying ARP request message first The corresponding relation of the MAC Address of the IP address of plan machine and first virtual machine;
Second modified module, for by the second source MAC in the Ether frame of the described first carrying ARP request message The value of the value of location field and the 2nd Sender MAC Address fields is revised as institute by the MAC Address of first virtual machine The mark of the first gateway is stated, obtains the Ether frame of amended second carrying ARP request message;
Broadcast module, for the Ether frame of the described second carrying ARP request message to be broadcast into the second gateway, described second Gateway is located at second data center's DC networks, and first gateway and first virtual machine are located at the first DC networks, and tenant rents With first virtual machine and the virtual machine rented in the 2nd DC networks.
With reference to the possible embodiment of the first of the third aspect or the third aspect, the third in the third aspect is possible In embodiment, the gateway also includes:
3rd receiving module, for by described second carrying ARP request message Ether frame be broadcast to the second gateway it Afterwards, the Ether frame for the first carrying arp response message that second gateway is sent, the first carrying arp response message are received Ether frame in carry the 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender IP address fields, the Three Sender MAC Address fields, the 3rd Target IP address fields and the 3rd Target MAC Address fields, the described 3rd The value of Sender IP address fields is the IP address of second virtual machine, the value of the 3rd source MAC field and described The value of 3rd Sender MAC Address fields is the mark of second gateway, the 3rd Target IP address fields It is worth for the IP address of first virtual machine, the value of the 3rd target MAC (Media Access Control) address field and the 3rd Target MAC The value of location field is the mark of first gateway;
3rd modified module, for the IP address according to first virtual machine prestored and first virtual machine MAC Address corresponding relation, by described first carrying arp response message Ether frame the 3rd target MAC (Media Access Control) address word The value of section and the value of the 3rd Target MAC Address fields are revised as first void by the mark of first gateway The MAC Address of plan machine, obtain the Ether frame of the second carrying arp response message;
Second sending module, for the IP address of first virtual machine and the MAC Address of first virtual machine, by institute The Ether frame for stating the second carrying arp response message is sent to first virtual machine.
With reference to the possible embodiment of the first of the third aspect or the third aspect, in the 4th kind of possibility of the third aspect Embodiment in, the gateway also includes:
4th receiving module, for receiving the Ether frame for first bearing IP packet that first virtual machine is sent Before, the Ether frame for the 3rd carrying ARP request message that reception first virtual machine is sent, the described 3rd Carry and the 4th source MAC field, the 4th target MAC (Media Access Control) address field, the 4th Sender are carried in the Ether frame of ARP request message IP address field, the 4th Sender MAC Address field, the 4th Target IP address fields and the 4th Target MAC Address words Section, the values of the 4th Sender IP address fields are the IP address of first virtual machine, the 4th source MAC word Section value and the 4th Sender MAC Address fields value be first virtual machine MAC Address, the 4th mesh The value for marking Target IP address fields is the IP address of second virtual machine, and the value of the 4th target MAC (Media Access Control) address field is Broadcast MAC address, the value of the 4th Target MAC Address sections is unknown MAC Address;
3rd sending module, the of the MAC Address of second virtual machine is obtained for being sent to information collection server One request message, the IP address of second virtual machine is carried in first request message;
5th receiving module, for receiving mark of the described information acquisition server according to second gateway prestored Know the first response message returned with the IP address corresponding relation of second virtual machine, institute is carried in first response message State the mark of the second gateway;
4th sending module, it is described for sending the Ether frame of the 4th carrying arp response message to first virtual machine The mark of second gateway is carried in the Ether frame of 4th carrying arp response message, so that first virtual machine is by described in The value of the first target MAC (Media Access Control) address field in the Ether frame of first bearing IP packet is filled with the mark of second gateway Know.
Fourth aspect of the embodiment of the present invention provides a kind of gateway, including:
First receiving module, the Ether frame of the second carrying Internet protocol IP message sent for receiving the first gateway, The first source IP address field, the first source MAC address word are carried in the Ether frame of second bearing IP packet Section, the first target MAC (Media Access Control) address field and the first purpose IP address field, the value of the first source IP address field is described first The IP address of virtual machine, the value of the first source MAC field are the mark of first gateway, the MAC of first mesh The value of address field is the mark of second gateway corresponding to the second virtual machine, and the value of the first purpose IP address field is The IP address of second virtual machine;
First modified module, for the IP address according to second virtual machine prestored and second virtual machine MAC Address corresponding relation, by the value of the first target MAC (Media Access Control) address field in the Ether frame of second bearing IP packet by The mark of second gateway is revised as the MAC Address of second virtual machine, obtains the Ether frame of the 3rd bearing IP packet;
First sending module, for the IP address according to second virtual machine and the MAC Address of second virtual machine, The Ether frame of 3rd bearing IP packet is sent to second virtual machine.
With reference to fourth aspect, in the first possible embodiment of fourth aspect, the gateway also includes:
Second receiving module, the ether of the second carrying Internet protocol IP message sent for receiving the first gateway Before frame, the Ether frame for the second carrying ARP request message that reception first gateway is sent, described second Carry in the Ether frame of ARP request message and carry the second source MAC field, the second target MAC (Media Access Control) address field, the 2nd Sender IP address field, the 2nd Sender MAC Address field, the second target Target IP address fields and the second target Target MAC Address field, the values of the 2nd Sender IP address fields are the IP address of first virtual machine, second source The value of the value of MAC Address field and the 2nd Sender MAC Address fields is the mark of first gateway, and described The value of two target Target IP address fields is the IP address of second virtual machine, the second target MAC (Media Access Control) address field It is worth for broadcast MAC address;The value of the 2nd Target MAC Address fields is unknown MAC Address;
First broadcast module, for by the Ether frame of the described second carrying ARP request message to second data center's DC nets Virtual machine broadcast in network, first gateway and first virtual machine are located at the first DC networks, second gateway and institute State the second virtual machine and be located at the 2nd DC networks, tenant rents first virtual machine and rented in the 2nd DC networks Virtual machine.
With reference to the first possible embodiment of fourth aspect, in second of possible embodiment of fourth aspect In, the gateway also includes:
3rd receiving module, for by the Ether frame of the described second carrying ARP request message to second data center After virtual machine broadcast in DC networks, the Ether frame for the 3rd carrying arp response message that second virtual machine is sent is received, The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the are carried in the Ether frame of the 3rd carrying arp response message Three Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address field, the values of the 3rd Sender IP address fields are the IP address of second virtual machine, the 3rd source The value of the value of MAC Address field and the 3rd Sender MAC Address fields is the MAC Address of second virtual machine, institute The value for stating the 3rd Target IP address fields is the IP address of first virtual machine, the 3rd target MAC (Media Access Control) address field The value of value and the 3rd Target MAC Address fields is the mark of first gateway;
Second modified module, for by the 3rd source MAC in the Ether frame of the described 3rd carrying arp response message The value of the value of location field and the 3rd Sender MAC Address fields is revised as institute by the MAC Address of second virtual machine The mark of the second gateway is stated, obtains the Ether frame of the first carrying arp response message;
Second sending module, for the Ether frame of the described first carrying arp response message to be sent into first gateway.
With reference to fourth aspect, in the third possible embodiment of fourth aspect, the gateway also includes:
4th receiving module, for receiving the second carrying Internet protocol IP message of the first gateway transmission Ether frame before, receive the Ether frame of the 4th carrying ARP request message that second virtual machine is sent, the 4th carrying The 5th source MAC field, the 5th target MAC (Media Access Control) address field, the 5th Sender MAC are carried in the Ether frame of ARP request message Address field, the 5th Target MAC Address field, the 5th Sender IP address fields and the 5th Target IP address words Section, the value of the 5th source MAC field and the value of the 5th Sender MAC Address fields are described second virtual The MAC Address of machine, the value of the target MAC (Media Access Control) address field is broadcast MAC address, the 5th Sender IP address fields It is the IP of first virtual machine to be worth for the IP address of second virtual machine, the value of the 5th Target IP address fields Address, the value of the 5th target MAC (Media Access Control) address field is unknown MAC Address;
3rd sending module, for by the 5th source MAC in the Ether frame of the described 4th carrying ARP request message The value of the value of location field and the 5th Sender MAC Address fields is revised as institute by the MAC Address of second virtual machine State the mark of the second gateway, and send the 4th message to information collection server, second net is carried in the 4th message The corresponding relation of the mark of pass and the IP address of second virtual machine, so that described information acquisition server records described second The mark of gateway and the IP address corresponding relation of second virtual machine.
With reference to fourth aspect, in the 4th kind of possible embodiment of fourth aspect, the gateway also includes:
4th sending module, for receiving the second carrying Internet protocol IP message of the first gateway transmission Ether frame before, send the 5th message to information collection server, second virtual machine carried in the 5th message The corresponding relation of the IP address of MAC Address and second virtual machine and the mark of second gateway, so that described information is adopted Collect the mark of the second gateway described in server record and the IP address corresponding relation of second virtual machine.
Message forwarding method and gateway provided in an embodiment of the present invention, the first gateway is by the Ether frame of the first bearing IP packet In MAC Address replace with the mark of the first gateway and be transmitted to the second gateway, the mesh of the Ether frame of first bearing IP packet MAC Address be the second gateway mark so that the second gateway is according to the IP address and second of the second virtual machine prestored The corresponding relation of the MAC Address of virtual machine, by the value of the target MAC (Media Access Control) address field in the Ether frame of the second bearing IP packet by The MAC Address that the mark of two gateways is revised as the second virtual machine is sent to the second virtual machine, so as to greatly reduce DC gateways institute The MAC address entries to be learnt, DC gateway resources are saved, improve forward efficiency.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of schematic flow sheet of message forwarding method embodiment one provided by the invention;
Fig. 2 is a kind of schematic flow sheet of message forwarding method embodiment three provided by the invention;
Fig. 3 is a kind of schematic flow sheet of message forwarding method example IV provided by the invention;
Fig. 4 is a kind of schematic flow sheet of message forwarding method embodiment five provided by the invention;
Fig. 5 is a kind of schematic flow sheet of message forwarding method embodiment six provided by the invention;
Fig. 6 is a kind of schematic flow sheet of message forwarding method embodiment seven provided by the invention;
Fig. 7 is a kind of schematic flow sheet of message forwarding method embodiment eight provided by the invention;
Fig. 8 is a kind of schematic flow sheet of message forwarding method embodiment nine provided by the invention;
Fig. 9 is a kind of schematic flow sheet of message forwarding method embodiment ten provided by the invention;
Figure 10 is a kind of structural representation of message forward gateway embodiment one provided by the invention;
Figure 11 is a kind of structural representation of message forward gateway embodiment two provided by the invention;
Figure 12 is a kind of structural representation of message forward gateway embodiment three provided by the invention;
Figure 13 is a kind of structural representation of message forward gateway example IV provided by the invention;
Figure 14 is a kind of structural representation of message forward gateway embodiment five provided by the invention;
Figure 15 is a kind of structural representation of message forward gateway embodiment six provided by the invention;
Figure 16 is a kind of structural representation of message forward gateway embodiment seven provided by the invention;
Figure 17 is a kind of structural representation of message forward gateway embodiment eight provided by the invention;
Figure 18 is a kind of structural representation of message forward gateway embodiment nine provided by the invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is a kind of schematic flow sheet of message forwarding method embodiment one provided by the invention, as shown in figure, the party Method includes:
S101:First gateway receives the first carrying Internet protocol that the first virtual machine is sent(Internet Protocol, hereinafter referred to as IP)The Ether frame of message, the first source IP address word is carried in the Ether frame of first bearing IP packet Section, the first source medium education(Media Access Control, hereinafter referred to as MAC)The MAC of address field, first mesh Location field and the first purpose IP address field, wherein, the value of above-mentioned first source IP address field is the IP address of the first virtual machine, The value of above-mentioned first source MAC field is the MAC Address of the first virtual machine, and the value of above-mentioned first target MAC (Media Access Control) address field is The mark of second gateway corresponding to second virtual machine, the value of above-mentioned first purpose IP address field are the IP of second virtual machine Address.
S102:First gateway is by the first source MAC field in the Ether frame of first bearing IP packet Value is revised as the mark of first gateway by the MAC Address of first virtual machine, obtains the ether of the second bearing IP packet Frame.
S103:The Ether frame of second bearing IP packet is sent to by the first gateway according to the mark of above-mentioned second gateway Two gateways.
Specifically, the first gateway is the gateway of DC1 networks, the second gateway is the gateway of DC2 networks, wherein, DC1 networks and DC2 networks respectively use different tunneling techniques;And first virtual machine be present on the server in DC1 networks, second is virtual Machine is present on the server in DC2 networks, wherein, the first virtual machine can be source virtual machine, and the second virtual machine can be mesh Virtual machine;Herein, it will be assumed that the first virtual machine is VM1, and the second virtual machine is VM2, because to be carried out between VM1 and VM2 Communication, and between virtual machine it is the tunnel communication established by server, but tunnel used by DC1 networks and DC2 networks Road technology is different, therefore IP messages are mutually transferred between VM1 and VM2 just needs to realize by isomery virtual network gateway Intercommunication between DC1 networks and DC2 networks, wherein, VM1 refers to the first virtual machine in all embodiments afterwards, and VM2 is equal Refer to the second virtual machine.
In general, the transmission of IP messages is transmitted by the form of Ether frame between VM1 and VM2, i.e. IP messages are It is carried on Ether frame and is transmitted, an Ether frame is made up of ether frame head, Ether frame load and frame check three parts, with Too frame head is made up of the ether frame type field of source MAC field, target MAC (Media Access Control) address field and 2 bytes, works as Ether frame Contents value in type field is hexadecimal 0x0806, then it represents that the Ether frame load is an address resolution protocol (Address Resolution Protocol, hereinafter referred to as ARP)Message;When the contents value in ether frame type field is ten The 0x0800 of senary, then it represents that the Ether frame load is an IP message;First virtual machine sends first to the first gateway and held The Ether frame of IP messages is carried, the first source IP address field, the first source MAC word are carried in the Ether frame of the bearing IP packet Section, the first target MAC (Media Access Control) address field and the first purpose IP address field, and the first source MAC field of the Ether frame It is worth the MAC Address for VM1, it is assumed herein that be MAC1, and the VM1 mentioned below in all embodiments MAC Address is MAC1, the value of the first source IP address field are VM1 IP address, it is assumed herein that be 10.0.0.10, and implementation all below The VM1 mentioned in example IP address is 10.0.0.10;The value of first purpose IP address field is VM2 IP address, false herein It is set to 10.0.0.20, and the VM2 mentioned below in all embodiments IP address is 10.0.0.20, VM2 MAC Address It is MAC4;The value of first target MAC (Media Access Control) address field is the mark of the second gateway, it is assumed herein that being MAC3, and is owned below Embodiment in the mark of the second gateway be MAC3..
Further, after the first gateway receives the Ether frame for the first bearing IP packet that VM1 is sent, by first carrying IP The Ether frame of message is modified, and it is source MAC for the Ether frame that the Ether frame to bearing IP packet herein, which is modified, The value of address field is modified, that is, is revised as the mark of the first gateway, obtains the Ether frame of the second bearing IP packet, wherein, The mark of first gateway can be the MAC Address of the second gateway or other marks;Afterwards, the first gateway is held second The Ether frame for carrying IP messages is sent to the second gateway, and the mark of the second gateway can be the MAC Address of the second gateway, can also Identified for others, in the present invention, the mark of the second gateway is by taking the MAC Address of the second gateway as an example;Second gateway receives The Ether frame for the second bearing IP packet that first gateway is sent, the second gateway is according to its VM2 prestored IP address and VM2 MAC Address between corresponding relation, i.e. 10.0.0.20 and MAC4 corresponding relation, by above-mentioned second bearing IP packet with The value of the first target MAC (Media Access Control) address field too in frame is revised as VM2 MAC Address by the MAC Address of the second gateway, i.e., from MAC3 MAC4 is revised as, and the Ether frame of second bearing IP packet is sent to VM2 by the second gateway, now between VM1 and VM2 Communication just completes.
In the prior art, the Ether frame of the first bearing IP packet of VM1 transmissions needs to learn to the first gateway, now the first gateway Practise the MAC Address of the VM1 under DC1 networks;When the first gateway needs the Ether frame of the bearing IP packet being sent to VM2, because Now the first gateway and VM1 do not know VM2 MAC Address, do not know this reaches VM2 by which gateway yet, because one Individual operator may have multiple DC networks, then just have multiple gateways, and each gateway also has multiple virtual machines, thus, it is supposed that opposite end There are multiple virtual machines in network DC2(VM2, VM3, VM4 etc.), in this communication, the first gateway needs to learn opposite end DC2 networks Under VM2 MAC Address, just the Ether frame of the bearing IP packet can be accurately sent to VM2, when next VM1 and VM3 are carried out During communication, the first gateway is except the MAC Address of VM1 under DC1 networks to be learnt, it is also necessary to learning under DC2 networks VM3 MAC Location, that is to say, that when the VMs different under the DC2 networks of opposite end of the VM1 under DC1 networks is communicated, then the first gateway is with regard to necessary Learn opposite end difference VM MAC Address;And it is assumed herein that a kind of simply situation, if VM3 belongs to DC3 networks, first Gateway also needs to learn DC3 gateway address and VM3 gateway address, and a kind of the worst situation, exactly the first gateway need to learn The MAC Address of all virtual machines under all DC networks in opposite end is practised, and prior art can not support so big MAC table at all ;In the present invention, that communicated with VM1 is VM2 or VM3, the Ether frame for the bearing IP packet that the first gateway learns Target MAC (Media Access Control) address be only the second gateway MAC Address, without spend study opposite end DC networks under all virtual machines MAC Address, therefore the MAC Address that learns of the first gateway is only the MAC Address and opposite end DC network gateways of the VM under DC1 networks MAC Address, greatly reduce the first gateway MAC address entries to be learnt.
In the method that the present embodiment provides, the first gateway replaces the MAC Address in the Ether frame of the first bearing IP packet Mark for the first gateway is simultaneously transmitted to the second gateway, and the target MAC (Media Access Control) address of the Ether frame of first bearing IP packet is second The mark of gateway so that the second gateway is according to the IP address of the second virtual machine prestored and the MAC Address of the second virtual machine Corresponding relation, the value of the target MAC (Media Access Control) address field in the Ether frame of the second bearing IP packet is repaiied by the mark of the second gateway The MAC Address for being changed to the second virtual machine is sent to the second virtual machine, so as to greatly reduce the DC gateways MAC table to be learnt , DC gateway resources are saved, improve forward efficiency.
In embodiments of the invention two, on the basis of embodiment illustrated in fig. 1, i.e. the first gateway receives the first virtual machine After the Ether frame of the bearing IP packet of transmission, the first gateway can also be to the IP address of the first virtual machine and pair of MAC Address It should be related to and be recorded, including:First gateway is according to the ether frame recording of first bearing IP packet of reception The corresponding relation of the MAC Address of the IP address of first virtual machine and first virtual machine
Specifically, above-mentioned first virtual machine(VM1)It is sent in the Ether frame of the first bearing IP packet of the first gateway also The first source IP address field and the first source MAC field are carried, the value of the first source IP address field is empty for above-mentioned first The IP address of the IP address of plan machine, i.e. VM1, i.e. 10.0.0.10, the value of the first source MAC field are virtual for above-mentioned first The MAC Address of the MAC Address of machine, i.e. VM1, as MAC1.
Further, after the first gateway receives the Ether frame for the first bearing IP packet that VM1 is sent, with recording VM1 IP The corresponding relation of location and VM1 MAC Address, that is, record 10.0.0.10 and MAC1 corresponding relation.
Fig. 2 is a kind of schematic flow sheet of message forwarding method embodiment three provided by the invention, in above-described embodiment one On the basis of embodiment two, the present embodiment further provides the process that the first virtual machine confirms the second virtual machine MAC Address, The Ether frame of the first carrying ARP request message is sent to the first gateway particular by the first virtual machine, the first gateway broadcasts should Ether frame, and second virtual machine return to the mode of the Ether frame of the 3rd carrying arp response message and determine that this method is specifically wrapped Include:
S201:Above-mentioned first gateway receives the Ether frame for the first carrying ARP request message that above-mentioned first virtual machine is sent, The second source MAC field, the second target MAC (Media Access Control) address field, the are carried in the Ether frame of above-mentioned first carrying ARP request message Two Sender IP address fields, the 2nd Sender MAC Address field, the 2nd Target IP address fields and the 2nd Target MAC Address field, the values of above-mentioned 2nd Sender IP address fields are the IP address of above-mentioned first virtual machine, above-mentioned second source The value of the value of MAC Address field and above-mentioned 2nd Sender MAC Address fields is the MAC Address of above-mentioned first virtual machine, on The value for stating the 2nd Target IP address fields is the IP address of above-mentioned second virtual machine, above-mentioned second target MAC (Media Access Control) address field It is worth for broadcast MAC address, the value of above-mentioned 2nd Target MAC Address fields is unknown MAC Address.
Specifically, if to transmit IP messages between VM1 and VM2, VM1 is except it is to be understood that VM2 IP under correspondent network Outside location, it is also necessary to know the MAC Address of VM2 under correspondent network, therefore, send the first bearing IP packet Ether frame it Before, it is necessary to the Ether frame of the first carrying ARP request message is sent to obtain the MAC Address of VM2 under correspondent network.
Further, VM1 sends the Ether frame of the first carrying ARP request message to the first gateway, the carrying ARP request report The Ether frame of text is made up of ether frame head, Ether frame load and frame check field three parts, and ether frame head is by source MAC word The ether frame type field composition of section, target MAC (Media Access Control) address field and 2 bytes, the contents value in ether frame type field For hexadecimal 0x0806 when, illustrate that Ether frame load below is ARP request message, unlike IP messages, ARP please Message is asked to carry the 2nd Sender IP address fields, the 2nd Sender MAC Address field, the 2nd Target IP address words Section and the 2nd Target MAC Address fields, the second source MAC field and the second target MAC (Media Access Control) address field are in ether frame head Address field in;Wherein, the value of the 2nd Sender IP address fields be VM1 IP address, i.e. 10.0.0.10;Second source The value of the value of MAC Address field and the 2nd SenderMAC address fields is VM1 MAC Address, i.e. MAC1;2nd Target The value of IP address field be VM2 IP address, i.e. 10.0.0.20;The value of second target MAC (Media Access Control) address field is broadcast MAC address, It is FF herein:FF:FF:FF:FF:FF;The value of 2nd Target MAC Address fields is unknown MAC Address, i.e., 00:00:00: 00:00:00。
S202:Above-mentioned first gateway is according to the first of reception the above-mentioned first virtual machine of ether frame recording for carrying ARP messages IP address and above-mentioned first virtual machine MAC Address corresponding relation.
S203:Above-mentioned first gateway carries the second source MAC word in the Ether frame of ARP request message by above-mentioned first The value of section and the value of the 2nd Sender MAC Address fields are revised as above-mentioned first net by the MAC Address of above-mentioned first virtual machine The mark of pass, obtain the Ether frame of amended second carrying ARP request message.
S204:The Ether frame of second carrying ARP request message is broadcast to above-mentioned second gateway by above-mentioned first gateway, above-mentioned Second gateway is located at second data center's DC networks, and the first gateway and the first virtual machine are located at the first DC networks, and tenant rents the One virtual machine and the virtual machine rented in the 2nd DC networks.
Specifically, the first gateway receives the Ether frame for the first carrying ARP request message that VM1 is sent, and record VM1 IP The corresponding relation of address and VM1 MAC Address, that is, record 10.0.0.10 and MAC1 corresponding relation;Afterwards, the first gateway will The value and the 2nd Sender MAC Address of the second source MAC field in the Ether frame of above-mentioned first carrying ARP request message The value of field is revised as the mark of above-mentioned first gateway by the MAC Address of above-mentioned first virtual machine, i.e. the MAC of the first gateway Location, i.e., the value of the value of the second source MAC field and the 2nd Sender MAC Address fields is revised as MAC2 by MAC1, laid equal stress on New to calculate Ether frame check field, other fields are not made an amendment;Wherein, this mark can be the MAC Address of gateway oneself, or Person is based on the unique IP address generation of its whole network or other rule generations can be with as long as be with uniqueness in network Can, i.e., the whole network can uniquely identify;Here IP messages can be that IPv4 messages can also be IPv6 messages.
Further, the Ether frame of the second carrying ARP request message is broadcast to the second gateway, the second gateway by the first gateway Positioned at the 2nd DC networks, the first gateway and the first virtual machine are located at the first DC networks, and tenant rents the first virtual machine and rented Virtual machine in 2nd DC networks;Now the second gateway can receives the Ether frame of above-mentioned second carrying ARP request message, and Other virtual machines Ether frame of the second carrying ARP request message being broadcast under DC2 networks;VM2 receives this and second held After the Ether frame for carrying ARP request message, it will be considered that the MAC Address that IP address is VM1 corresponding to 10.0.0.10 is MAC2;Second Gateway and VM2 will be considered that the value of VM1 MAC Address field is MAC2, then subsequently issue the ether of the bearing IP packet of the address The target MAC (Media Access Control) address field of frame can also be filled with MAC2, such as:When VM2 sends the Ether frame of bearing IP packet to the second gateway When, the second gateway receive VM2 transmission carrying IP messages Ether frame after by the source MAC of the Ether frame of the bearing IP packet The value of location field is revised as MAC3 by MAC4, and the value for carrying the target MAC (Media Access Control) address field of the Ether frame of the IP messages is exactly MAC2, i.e. the first gateway MAC Address;Purpose IP is VM1 IP address, i.e. 10.0.0.10, the second gateway directly holds according to this The Ether frame of the amended bearing IP packet is sent to first by the value for carrying the target MAC (Media Access Control) address field of the Ether frame of IP messages Gateway, and then the first gateway is according to the value of the purpose IP address field of the Ether frame of the amended bearing IP packet and in advance The 10.0.0.10 and MAC1 of storage corresponding relation, the virtual machine for determining the final reception of the Ether frame of the bearing IP packet are VM1, and then the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet is revised as MAC1 by the first gateway, afterwards, by this The Ether frame of bearing IP packet is sent to VM1.
Further, for the second gateway and VM2, being sent by any first virtual machine for the first gateway is come from The values of source MAC field of Ether frame of all carrying ARP request messages be MAC2, i.e., VM1 MAC Address passes through The modification of one gateway realizes MAC Address to the second gateway and VM2 and hidden.
In the method that the present embodiment provides, the first carrying ARP request message is sent to the first gateway by the first virtual machine Ether frame, the first gateway records the MAC Address of the first virtual machine and the corresponding relation of IP address after receiving the Ether frame, and The value of the value of second source MAC field of the Ether frame and the 2nd Sender MAC Address fields is revised as the first gateway MAC Address so that the MAC Address for the first virtual machine that the second gateway learns is the MAC Address of the first gateway, and not The MAC Address of the first virtual machine in itself, i.e., for the second gateway, come from the first gateway by under DC1 networks appoint The value and second of second source MAC field of the Ether frame for all carrying ARP request messages that one first virtual machine is sent The value of Sender MAC Address fields is all the MAC Address of the first gateway, i.e. the second gateway does not have to other institutes under study DC1 networks There is the MAC Address of virtual machine, need to only learn the MAC Address of virtual machine and the MAC Address of the first gateway under DC2 networks, So as to reduce the MAC address entries of the study of the second gateway, so as to save DC gateway resources, forward efficiency is improved.
Fig. 3 is a kind of schematic flow sheet of message forwarding method example IV provided by the invention, as shown in figure 3, upper On the basis of stating embodiment 2, the present embodiment further provides the mistake that the first virtual machine confirms the second virtual machine MAC Address Journey, particular by the second gateway after the Ether frame of the second carrying ARP request message of the first gateway transmission is received, second The Ether frame that gateway returns to the first carrying arp response message determines that this method specifically includes to the mode of the first gateway:
S301:Above-mentioned first gateway receives the Ether frame for the first carrying arp response message that above-mentioned second gateway is sent, on State and the 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd are carried in the Ether frame of the first carrying arp response message Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address field, the values of above-mentioned 3rd Sender IP address fields are the IP address of above-mentioned second virtual machine, above-mentioned 3rd source The value of the value of MAC Address field and above-mentioned 3rd Sender MAC Address fields is the mark of above-mentioned second gateway, and above-mentioned The value of three Target IP address fields be above-mentioned first virtual machine IP address, the value of above-mentioned 3rd target MAC (Media Access Control) address field and The value of above-mentioned 3rd Target MAC Address fields is the mark of above-mentioned first gateway.
Specifically, the Ether frame of the second carrying ARP request message is broadcast to all DC of VM1 tenants by the first gateway After gateway in network, therefore the second gateway also have received the Ether frame of the second carrying ARP request message, and by this The Ether frame of two carrying ARP request messages is broadcast to all virtual machines in DC2 networks, but because second carrying ARP please Ask and the 2nd Target IP address fields are contained in the Ether frame of message, and the value of the 2nd Target IP address fields is VM2 IP address, i.e. 10.0.0.20, therefore, only VM2 can send the Ether frame of the first carrying arp response message to the first net Close, but the Ether frame of the first carrying arp response message is had to when going out DC2 networks by the second gateway, the second gateway Value in the 3rd source MAC field and the 3rd Sender MAC Address fields in the Ether frame can be modified, therefore First gateway can receive the Ether frame for the first carrying arp response message for coming from the transmission of the second gateway, and this first holds Carry and the 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender are carried in the Ether frame of arp response message IP address field, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address words Section, the values of the 3rd Sender IP address fields are VM2 IP address, i.e. 10.0.0.20, the value of the 3rd source MAC field and The value of 3rd Sender MAC Address fields is the MAC Address of second gateway, i.e. MAC3, the 3rd Target IP address The value of field be VM1 IP address, i.e. 10.0.0.10, the value and the 3rd Target MAC Address of the 3rd target MAC (Media Access Control) address field The value of field be the first gateway MAC Address, i.e. MAC2.
S302:IP address and above-mentioned first virtual machine of above-mentioned first gateway according to above-mentioned first virtual machine prestored MAC Address corresponding relation, by above-mentioned first carrying arp response message Ether frame above-mentioned 3rd target MAC (Media Access Control) address word The value of section and the value of above-mentioned 3rd Target MAC Address fields are revised as above-mentioned first void by the mark of above-mentioned first gateway The MAC Address of plan machine, obtain the Ether frame of the second carrying arp response message.
S303:Above-mentioned first gateway according to the IP address of above-mentioned first virtual machine and the MAC Address of above-mentioned first virtual machine, The Ether frame of above-mentioned second carrying arp response message is sent to above-mentioned first virtual machine.
Specifically, as it was previously stated, the first gateway can record VM1 IP address pass corresponding with the MAC Address of the VM1 System, i.e. 10.0.0.10 and MAC1 corresponding relation, the first gateway are receiving the first carrying arp response of the second gateway transmission After the Ether frame of message, the value according to the 3rd TargetIP address fields in Ether frame is understood, and, prestore 10.0.0.10 with MAC1 corresponding relation, MAC1 is found, and by the 3rd mesh of the Ether frame of the first carrying arp response message The value of MAC Address field and the value of the 3rd Target MAC Address fields be revised as first by the MAC Address of the first gateway The MAC Address of virtual machine, will this first carrying arp response message Ether frame the 3rd target MAC (Media Access Control) address field value and The value of 3rd Target MAC Address fields is revised as MAC1 by original MAC2, obtain the second carrying arp response message with Too frame.
Further, the first gateway carries arp response message according to VM1 IP address and VM1 MAC Address by second Ether frame be sent to VM1;After VM1 receives the Ether frame of the second carrying arp response message, it will be considered that IP address is 10.0.0.20 the MAC Address of the second virtual machine is MAC3, then subsequently issues the target MAC (Media Access Control) address meeting of the IP messages of the address MAC3 is filled with, such as:When VM1 sends the Ether frame of bearing IP packet to the first gateway, the first gateway receives VM1 transmissions Bearing IP packet Ether frame after the value of the source MAC field of the Ether frame of the bearing IP packet is revised as by MAC1 MAC2, and it is exactly MAC3 to carry the value filled in the target MAC (Media Access Control) address field of the Ether frame of the IP messages, purpose IP is VM2's IP address, i.e. 10.0.0.20, the first gateway is directly according to the value of the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet The Ether frame of the amended bearing IP packet is sent to the second gateway, and then the second gateway is according to the amended carrying IP The value of the purpose IP address field of the Ether frame of message and the 10.0.0.20 and MAC4 corresponding relation prestored, it is determined that The virtual machine of the final reception of the Ether frame of the bearing IP packet is VM2, so by the second gateway by the bearing IP packet with The target MAC (Media Access Control) address field of too frame is revised as MAC4, afterwards, the Ether frame of the bearing IP packet is sent into VM2.
Further, for the first gateway and VM1, being sent by any second virtual machine for the second gateway is come from The values of target MAC (Media Access Control) address field of Ether frame of all carrying arp response messages be MAC3.
In the method that the present embodiment provides, the first carrying arp response report of the second gateway transmission is received by the first gateway The Ether frame of text so that the MAC Address for the second virtual machine that the first gateway learns is the MAC Address of the second gateway, and simultaneously The MAC Address of the second virtual machine in itself, i.e., for the first gateway, come from the second gateway by under DC2 networks The value of 3rd target MAC (Media Access Control) address field of the Ether frame for all carrying arp response messages that any second virtual machine is sent and the The value of three Target MAC Address fields is all the MAC Address of the second gateway, i.e. the first gateway does not have to own under study DC2 networks The MAC Address of virtual machine, it need to only learn the MAC Address of virtual machine and the MAC Address of the second gateway under DC1 networks, from And reduce the MAC address entries of the study of the first gateway, so as to save DC gateway resources, improve forward efficiency.
Fig. 4 is a kind of schematic flow sheet of message forwarding method embodiment five provided by the invention, as shown in figure 4, this reality Apply example and provide another process that the first virtual machine confirms the second virtual machine MAC Address, particular by the first virtual machine to the One gateway sends the Ether frame of the 3rd carrying ARP request message, and the first gateway is by the 4th source MAC field in the Ether frame Value be revised as the mark of the first gateway after, be sent to information collection server, information collection server sends the first response and disappeared Cease what is determined to the mode of the first gateway, this method specifically includes:
S401:Above-mentioned first gateway receives the 3rd carrying ARP request that above-mentioned first virtual machine is sent The Ether frame of message, the above-mentioned 3rd carries the 4th source MAC field of carrying, the 4th purpose in the Ether frame of ARP request message MAC Address field, the 4th Sender IP address fields, the 4th Sender MAC Address field, the 4th Target IP address words Section and the 4th Target MAC Address fields, the value of above-mentioned 4th Sender IP address fields are the IP of above-mentioned first virtual machine Address, the value of above-mentioned 4th source MAC field and the value of above-mentioned 4th Sender MAC Address fields are above-mentioned first empty The MAC Address of plan machine, the values of above-mentioned 4th Target IP address fields are the IP address of above-mentioned second virtual machine, the above-mentioned 4th The value of target MAC (Media Access Control) address field is unknown MAC Address.
Specifically, if to transmit IP messages between VM1 and VM2, VM1 is except it is to be understood that VM2 IP under correspondent network Outside location, it is also necessary to know the MAC Address of VM2 under correspondent network, therefore, before the Ether frame of bearing IP packet is sent, just Need to send the Ether frame for carrying ARP request message to obtain the MAC Address of VM2 under correspondent network.
Further, VM1 sends the 3rd Ether frame for carrying ARP request message and asked to the first gateway, the 3rd carrying ARP The Ether frame of message is asked to be made up of ether frame head, Ether frame load and frame check field three parts, ether frame head is by source MAC The ether frame type field composition of location field, target MAC (Media Access Control) address field and 2 bytes, in ether frame type field When capacitance is hexadecimal 0x0806, illustrate that Ether frame load below is ARP request message, the ARP request message carries 4th source MAC field, the 4th target MAC (Media Access Control) address field, the 4th Sender IP address fields, the 4th Sender MAC Address field, the 4th Target IP address fields and the 4th Target MAC Address fields, the 4th source MAC field and Four target MAC (Media Access Control) address fields are in Ether frame leading address field;Wherein, the value of the 4th Sender IP address fields is VM1's IP address, i.e. 10.0.0.10;The value of the value of 4th source MAC field and the 4th Sender MAC Address fields is VM1's MAC Address, i.e. MAC1;The value of 4th Target IP address fields be VM2 IP address, i.e. 10.0.0.20;The MAC of 4th mesh The value of address field is broadcast MAC address, is herein FF:FF:FF:FF:FF:FF;The value of 4th Target MAC Address fields For unknown MAC Address, i.e., 00:00:00:00:00:00.
S402:Above-mentioned first gateway sends the of the MAC Address that obtains above-mentioned second virtual machine to information collection server One request message, the IP address of above-mentioned second virtual machine is carried in above-mentioned first request message.
S403:Above-mentioned first gateway receives mark of the above- mentioned information acquisition server according to above-mentioned second gateway prestored Know the first response message returned with the IP address corresponding relation of above-mentioned second virtual machine, carried in above-mentioned first response message State the mark of the second gateway.
S404:First gateway sends the Ether frame of the 4th carrying arp response message, the 4th carrying to the first virtual machine The mark of the second gateway is carried in the Ether frame of arp response message, so that above-mentioned first virtual machine is by the first bearing IP packet The value of the first target MAC (Media Access Control) address field in Ether frame is filled with the mark of the second gateway.
Specifically, the first gateway receives the Ether frame for the 3rd carrying ARP request message that VM1 is sent, and record VM1 IP The corresponding relation of address and VM1 MAC Address, that is, record 10.0.0.10 and MAC1 corresponding relation;Afterwards, the first gateway will The value and the 4th Sender MAC Address of the 4th source MAC field in the Ether frame of above-mentioned 3rd carrying ARP request message The value of field is revised as the mark of above-mentioned first gateway by the MAC Address of above-mentioned first virtual machine, i.e. the MAC of the first gateway Location, i.e., the value of the value of the 4th source MAC field and the 4th Sender MAC Address fields is revised as MAC2 by MAC1, its In, this locally mark can be gateway oneself MAC Address, either based on the generation of its whole network unique IP address or other Rule generation can be so that as long as having uniqueness in network, i.e. the whole network can uniquely identify;Here IP messages can be IPv4 messages can also be IPv6 messages.
Further, the first gateway is asked to information collection server sends the MAC Address for obtaining the second virtual machine first Message is sought, the IP address of the second virtual machine is carried in first request message;Information collection server receives first request and disappeared After breath, prestored according to the IP address of the second virtual machine carried in the first request message and information collection server The mark of two gateways and the IP address corresponding relation of the second virtual machine, inquire about the MAC Address of its corresponding second gateway, and by the The MAC Address of two gateways carries and the first gateway is sent in the first response message.
Further, the first response message that the first gateway is sent according to information collection server, rebuilds the 4th Carry the Ether frame of arp response message and be sent to VM1, the Ether frame of the 4th carrying arp response message carries the second gateway Mark;After VM1 receives the Ether frame of the 4th carrying arp response message, it will be considered that IP address is 10.0.0.20 second is empty The MAC Address of plan machine is MAC3, then MAC3 can be filled with by subsequently issuing the target MAC (Media Access Control) address of the IP messages of the address, such as:When When VM1 sends the Ether frame of bearing IP packet to the first gateway, the first gateway receives the ether of the bearing IP packet of VM1 transmissions The value of the source MAC field of the Ether frame of the bearing IP packet is revised as MAC2 by MAC1 after frame, and carries the IP messages Ether frame target MAC (Media Access Control) address field in the field value filled be exactly MAC3, Target IP are VM2 IP address, i.e., 10.0.0.20, after the first gateway directly changes this according to the value of the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet The Ether frame of bearing IP packet be sent to the second gateway, and then the second gateway is according to the ether of the amended bearing IP packet The value of the Target IP address fields of frame and the 10.0.0.20 and MAC4 corresponding relation prestored, determine carrying IP The virtual machine of the final reception of the Ether frame of message is VM2, and then by the second gateway by the mesh of the Ether frame of the bearing IP packet MAC Address field be revised as MAC4, afterwards, the Ether frame of the bearing IP packet is sent to VM2.
Further, for the first gateway and VM1, the second virtual machine for being learnt by information collection server MAC Address be only the second gateway MAC Address, i.e. VM2 MAC Address realizes hiding to VM1 and the first gateway, that is, Say that any virtual machine is sent to the second gateway and by carrying ARP request of second gateway forwards to server under the DC2 networks of opposite end The source MAC and Sender MAC Address of the Ether frame of message are MAC3.
In the method that the present embodiment provides, the 3rd carrying ARP request is sent to information collection server by the first gateway The Ether frame of message, information collection server according to the IP address of the second virtual machine prestored with the MAC of the second gateway The corresponding relation of location, the IP address pass corresponding with the MAC Address of the second gateway for carrying the second virtual machine is sent to the first gateway The response message of system, to cause the first gateway to send the Ether frame of carrying arp response message to the first void according to the response message Plan machine, and cause the MAC Address of the second virtual machine that the first gateway learns to be the MAC Address of the second gateway, and be not The MAC Address of second virtual machine in itself, i.e. the first gateway do not have to the MAC Address of all virtual machines under study DC2 networks, only need to learn The MAC Address of virtual machine and the MAC Address of the second gateway under DC1 networks are practised, so as to reduce the study of the first gateway MAC address entries, so as to save DC gateway resources, improve forward efficiency.
Fig. 5 is a kind of schematic flow sheet of message forwarding method embodiment six provided by the invention, as shown in figure 5, the party Method includes:
S501:Second gateway receives the Ether frame for the second bearing IP packet that the first gateway is sent, above-mentioned second carrying IP The first source IP address field, the first MAC Address field, the first target MAC (Media Access Control) address field and first are carried in the Ether frame of message Purpose IP address field, the value of above-mentioned first source IP address field are the IP address of the first virtual machine, the first source MAC field Value be the first gateway mark, the value of above-mentioned first target MAC (Media Access Control) address field is the second gateway corresponding to the second virtual machine Mark, the value of above-mentioned first purpose IP address field are the IP address of above-mentioned second virtual machine.
Specifically, the first gateway is the gateway of DC1 networks, the second gateway is the gateway of DC2 networks, wherein, DC1 networks and DC2 networks respectively use different tunneling techniques;And first virtual machine be present on the server in DC1 networks, second is virtual Machine is present on the server in DC2 networks, wherein, the first virtual machine can be source virtual machine, and the second virtual machine can be mesh Virtual machine;Herein, it will be assumed that the first virtual machine is VM1, and the second virtual machine is VM2, because to be carried out between VM1 and VM2 Communication, and between virtual machine it is the tunnel communication established by server, but tunnel used by DC1 networks and DC2 networks Road technology is different, therefore IP messages are mutually transferred between VM1 and VM2 just needs to realize by isomery virtual network gateway Intercommunication between DC1 networks and DC2 networks.
In general, the transmission of IP messages is transmitted by the form of Ether frame between VM1 and VM2, i.e. IP messages are It is carried on Ether frame and is transmitted, an Ether frame is made up of ether frame head, Ether frame load and frame check three parts, with Too frame head is made up of the Ether frame type of source MAC field, target MAC (Media Access Control) address field and 2 bytes, when Ether frame type For hexadecimal 0x0806 when, illustrate that Ether frame load below is ARP messages, and Sender IP are carried in ARP messages Field and Target IP fields;When Ether frame types value is hexadecimal 0x0800, show that Ether frame load is reported for IP Text;First virtual machine sends the Ether frame of the first bearing IP packet to the first gateway, and to the Ether frame of the first bearing IP packet Source MAC modify, obtain the Ether frame of the second bearing IP packet, carried in the Ether frame of second bearing IP packet First source IP address field, the first source MAC field, the first target MAC (Media Access Control) address field and the first purpose IP address field, And the value of the first source IP address field is the IP address of the first virtual machine, and the value of the first source MAC field is the first gateway Mark, the value of the first target MAC (Media Access Control) address field is the mark of the second gateway corresponding to the second virtual machine, the first purpose IP address The value of field is the IP address of second virtual machine.
S502:IP address and above-mentioned second virtual machine of above-mentioned second gateway according to above-mentioned second virtual machine prestored MAC Address corresponding relation, by the value of the first target MAC (Media Access Control) address field in the Ether frame of above-mentioned second bearing IP packet by The mark of above-mentioned second gateway is revised as the MAC Address of above-mentioned second virtual machine, obtains the Ether frame of the 3rd bearing IP packet.
S503:Above-mentioned second gateway according to the IP address of above-mentioned second virtual machine and the MAC Address of above-mentioned second virtual machine, The Ether frame of above-mentioned 3rd bearing IP packet is sent to above-mentioned second virtual machine.
Further, after the second gateway receives the Ether frame for the second bearing IP packet that the first gateway is sent, according to this The second virtual machine that the value of the first purpose IP address field and the second gateway prestore in the Ether frame of two bearing IP packets IP address and MAC Address between corresponding relation, i.e. 10.0.0.20 and MAC4 corresponding relation, IP is carried by above-mentioned second The value of the first target MAC (Media Access Control) address field in the Ether frame of message is revised as VM2 MAC Address by the MAC Address of the second gateway, Be revised as MAC4 from MAC3, and the Ether frame of second bearing IP packet be sent to VM2 by the second gateway, now VM1 with Communication between VM2 just completes.
In the prior art, the Ether frame of VM1 transmissions bearing IP packet needs to learn to the first gateway, now the first gateway The MAC Address of VM1 under DC1 networks;When the first gateway needs the Ether frame of the bearing IP packet being sent to VM2, because this When the first gateway and VM1 do not know VM2 MAC Address, do not know this reaches VM2 by which gateway, because one yet Operator may have multiple DC networks, then just have multiple gateways, and each gateway also has multiple VM, thus, it is supposed that correspondent network DC2 Under have multiple virtual machines(VM2, VM3, VM4 etc.), in this communication, the first gateway needs to learn the VM2 under the DC2 networks of opposite end MAC Address, just the Ether frame of the bearing IP packet can be accurately sent to VM2, when next VM1 is communicated with VM3, First gateway is except the MAC Address of VM1 under DC1 networks to be learnt, it is also necessary to learns the MAC Address of VM3 under DC2 networks, also It is to say, when the VMs different under the DC2 networks of opposite end of the VM1 under DC1 networks is communicated, then the first gateway just has to study pair Hold different VM MAC Address;And it is assumed herein that simply a kind of situation, if VM3 belongs to DC3 networks, the first gateway also needs Learn DC3 gateway address and VM3 gateway address, a kind of the worst situation, exactly the first gateway need to learn opposite end institute There is the MAC Address of all virtual machines under DC networks, and prior art can not support so big MAC address entries at all;And at this In invention, that communicated with VM1 is VM2 or VM3, the purpose of the Ether frame for the bearing IP packet that the first gateway learns MAC Address is only the MAC Address of the second gateway, the MAC Address without spending all virtual machines under study opposite end DC networks, because The MAC Address that this first gateway learns only is the MAC Address of the virtual machine under DC1 networks and the MAC of opposite end DC networks Location, greatly reduce the first gateway MAC address entries to be learnt.
In the method that the present embodiment provides, the Ether frame of the second bearing IP packet is transmitted to by the second net by the first gateway Close, and the value of the first target MAC (Media Access Control) address field of the Ether frame of second bearing IP packet for the second gateway MAC Address and Be not the MAC Address of the virtual machine of opposite end second so that the second gateway according to the IP address of the second virtual machine prestored with The corresponding relation of the MAC Address of second virtual machine, by the first target MAC (Media Access Control) address field in the Ether frame of the second bearing IP packet Value the MAC Address of the second virtual machine is revised as by the MAC Address of the second gateway, obtain the Ether frame of the 3rd bearing IP packet, So as to which the Ether frame of the 3rd bearing IP packet is accurately sent into the second virtual machine, wanted so as to greatly reduce the first gateway The MAC address entries of study, so as to save DC gateway resources, improve forward efficiency.
Fig. 6 is a kind of schematic flow sheet of message forwarding method embodiment seven provided by the invention, in embodiment illustrated in fig. 5 On the basis of, the second of the transmission of the first gateway Ether frame for carrying ARP request message is received by the second gateway, and by the second net Pass is broadcast to the second virtual machine.Specifically include:
S601:Above-mentioned second gateway receives the Ether frame for the second carrying ARP request message that first gateway is sent, on State and the second source MAC field, the second target MAC (Media Access Control) address field, second are carried in the Ether frame of the second carrying ARP request message Sender IP address fields, the 2nd Sender MAC Address field, the 2nd Target IP address fields and the 2nd Target MAC Address field, the values of above-mentioned 2nd Sender IP address fields are the IP address of above-mentioned first virtual machine, above-mentioned second source The value of the value of MAC Address field and above-mentioned 2nd Sender MAC Address fields is the mark of above-mentioned first gateway, and above-mentioned The value of two Target IP address fields is the IP address of above-mentioned second virtual machine, and the value of above-mentioned second target MAC (Media Access Control) address field is Broadcast MAC address;The value of above-mentioned 2nd Target MAC Address fields is unknown MAC Address.
S602:Void of above-mentioned second gateway by the Ether frame of the above-mentioned second carrying ARP request message into the 2nd DC networks Plan machine is broadcasted, and the first gateway and the first virtual machine are located at the first DC networks, and the second gateway and the second virtual machine are located at the 2nd DC nets Network, tenant rent the first virtual machine and the virtual machine rented in the 2nd DC networks.
Specifically, the first gateway receives the Ether frame for the first carrying ARP request message that VM1 is sent, the carrying ARP request The first source MAC field, the first target MAC (Media Access Control) address field, the first Sender IP address words are carried in the Ether frame of message Section, the first Sender MAC Address field, the first Target IP address fields and the first Target MAC Address fields, this The value of one Sender IP address fields is VM1 IP address, it is assumed herein that be 10.0.0.10, and below in all embodiments VM1 IP address is 10.0.0.10;The value of above-mentioned first source MAC field and the first Sender MAC Address fields Value is VM1 MAC Address, it is assumed herein that be MAC1, and VM1 MAC Address is MAC1 in embodiments all below; The value of first Target IP address fields be VM2 IP address, i.e. 10.0.0.20;The value of first target MAC (Media Access Control) address field is Broadcast MAC address;The value of above-mentioned first Target MAC Address fields is unknown MAC Address.
First gateway is after the Ether frame of the first carrying ARP request message of VM1 transmissions is received, with recording VM1 MAC Location and the corresponding relation of IP address, that is, record 10.0.0.10 and MAC1 corresponding relation, and changes the carrying ARP request report The value of the value of the first source MAC field and the first Sender MAC Address fields is the MAC of the first gateway in the Ether frame of text Address, it is assumed herein that be MAC2, and the MAC Address of the first gateway is MAC2 in all embodiments below, so as to obtain The Ether frame of two carrying ARP request messages;The Ether frame for the second carrying ARP request message that second gateway receives is through first The Ether frame of the amended carrying ARP request message of gateway, wherein, carried in the Ether frame of the second carrying ARP request message Second source MAC field, the second target MAC (Media Access Control) address field, the 2nd Sender IP address fields, the 2nd Sender MAC Location field, the 2nd TargetIP address fields and the 2nd Target MAC Address fields, the value of the 2nd Sender IP address fields For VM1 IP address, i.e. 10.0.0.10;The value of the value of second source MAC field and the 2nd Sender MAC Address fields is equal For the MAC Address of the first gateway, i.e. MAC2;The value of 2nd Target IP address fields is the IP address of the second virtual machine, i.e., 10.0.0.20;The value of second target MAC (Media Access Control) address field is broadcast MAC address;The value of 2nd Target MAC Address fields is not Know MAC Address.
Further, the second gateway is virtual into the 2nd DC networks by the Ether frame of the second carrying ARP request message Machine is broadcasted, and the first gateway and the first virtual machine are located at the first DC networks, and the second gateway and the second virtual machine are located at the 2nd DC networks, Tenant rents the first virtual machine and the virtual machine rented in the 2nd DC networks;Now VM2 receives the second carrying ARP request report After the Ether frame of text, it will be considered that the MAC Address that IP address is VM1 corresponding to 10.0.0.10 is MAC2, i.e. the second gateway and VM2 The value that will be considered that VM1 MAC Address field is MAC2, then subsequently issues the purpose of the Ether frame of the bearing IP packet of the address MAC Address field can also be filled with MAC2, such as:When VM2 sends the Ether frame for carrying IP messages to the second gateway, the second net After the Ether frame for closing the carrying IP messages for receiving VM2 transmissions, by the source MAC field of the Ether frame of the bearing IP packet Value is revised as the MAC Address of the second gateway, i.e. MAC3 by MAC4, and carries the target MAC (Media Access Control) address word of the Ether frame of the IP messages That the value of section is filled with is MAC2, and purpose IP is VM1 IP address, i.e. 10.0.0.10, the second gateway is directly according to carrying IP The Ether frame of the amended bearing IP packet is sent to the first net by the value of the target MAC (Media Access Control) address field of the Ether frame of message Close, and then the first gateway is deposited according to the value of the purpose IP address field of the Ether frame of the amended bearing IP packet and in advance The 10.0.0.10 and MAC1 of storage corresponding relation, the virtual machine for determining the final reception of the Ether frame of the bearing IP packet are VM1, and then the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet is revised as MAC1 by the first gateway, afterwards, by this The Ether frame of bearing IP packet is sent to VM1.
Further, for the second gateway and VM2, being sent by any first virtual machine for the first gateway is come from The values of source MAC field of Ether frame of all carrying ARP request messages be MAC2.
In the method that the present embodiment provides, the first carrying ARP request message is sent to the first gateway by the first virtual machine Ether frame, the first gateway records the MAC Address of the first virtual machine and the corresponding relation of IP address after receiving the Ether frame, and The value of the value of first source MAC field of the Ether frame and the first Sender MAC Address fields is revised as the first gateway MAC Address, obtain the Ether frame of the second carrying ARP request message so that the MAC for the first virtual machine that the second gateway learns Address is the MAC Address of the first gateway, and is not the MAC Address of the first virtual machine in itself, i.e., for the second gateway, Come from the Ether frame of all carrying ARP request messages sent by any first virtual machine under DC1 networks of the first gateway Source MAC field value and Sender MAC Address fields value all be the first gateway MAC Address, i.e. the second gateway is not With the MAC Address of all virtual machines under study DC1 networks, it need to only learn the MAC Address and the first net of virtual machine under DC2 networks The MAC Address of pass, so as to reduce the MAC address entries of the study of the second gateway, so as to save DC gateway resources, improve forwarding Efficiency.
Fig. 7 is a kind of schematic flow sheet of message forwarding method embodiment eight provided by the invention, as shown in fig. 7, passing through After second gateway receives the Ether frame for the 3rd carrying arp response message that the second virtual machine is sent, the second gateway can also be right The IP address of second virtual machine and MAC corresponding relation are recorded, so as to receive the second carrying IP of the first gateway transmission The Ether frame of message, the second gateway can be repaiied according to the corresponding relation recorded to the Ether frame purpose MAC fields received Change.Specifically include:
S701:Above-mentioned second gateway receives the Ether frame for the 3rd carrying arp response message that above-mentioned second virtual machine is sent, The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the are carried in the Ether frame of above-mentioned 3rd carrying arp response message Three Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address field, the values of above-mentioned 3rd Sender IP address fields are the IP address of above-mentioned second virtual machine, above-mentioned 3rd source The value of the value of MAC Address field and above-mentioned 3rd Sender MAC Address fields is the MAC Address of above-mentioned second virtual machine, on The value for stating the 3rd Target IP address fields is the IP address of above-mentioned first virtual machine, above-mentioned 3rd target MAC (Media Access Control) address field The value of value and above-mentioned 3rd Target MAC Address fields is the mark of above-mentioned first gateway.
Specifically, the Ether frame of the second carrying ARP request message is broadcast to all DC of VM1 tenants by the first gateway After gateway in network, therefore the second gateway also have received the Ether frame of the second carrying ARP request message, and by this The Ether frame of two carrying ARP request messages is broadcast to all virtual machines in DC2 networks, but because second carrying ARP please Ask and the 2nd Target IP address fields are contained in the Ether frame of message, and the value of the 2nd Target IP address fields VM2 IP address, i.e. 10.0.0.20, therefore, only VM2 can send the Ether frame of the 3rd carrying arp response message to the second net Close, and the 3rd source MAC field, the 3rd target MAC (Media Access Control) address word are carried in the Ether frame of the 3rd carrying arp response message Section, the 3rd Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address fields, the value of above-mentioned 3rd Sender IP address fields are the second virtual machine VM2 IP address, i.e., 10.0.0.20;The value of the value of above-mentioned 3rd source MAC field and above-mentioned 3rd Sender MAC Address fields is above-mentioned Two virtual machine VM2 MAC Address, i.e. MAC2;The value of above-mentioned 3rd Target IP address fields is above-mentioned first virtual machine VM1 IP address, i.e. 10.0.0.10;The value and above-mentioned 3rd Target MAC Address fields of above-mentioned 3rd target MAC (Media Access Control) address field Value be above-mentioned first gateway MAC Address, i.e. MAC2.
S702:Above-mentioned second gateway carries the 3rd source MAC word in the Ether frame of arp response message by the above-mentioned 3rd The value of section and the value of above-mentioned 3rd Sender MAC Address fields are revised as above-mentioned the by the MAC Address of above-mentioned second virtual machine The mark of two gateways, obtain the Ether frame of the first carrying arp response message.
S703:The Ether frame of above-mentioned first carrying arp response message is sent to above-mentioned first gateway by above-mentioned second gateway.
Specifically, after the second gateway receives the Ether frame of the 3rd carrying arp response message of VM2 transmissions, record second is empty The corresponding relation of plan machine VM2 MAC Address and VM2 IP address, that is, 10.0.0.20 and MAC4 corresponding relation is recorded, and will The value and the 3rd Sender MAC Address field of 3rd source MAC field of the Ether frame of the 3rd carrying arp response message Value is revised as the MAC Address of the second gateway by the second virtual machine VM2 MAC Address, i.e., by the 3rd carrying arp response message The value of 3rd source MAC field of Ether frame and the value of the 3rd Sender MAC Address fields are revised as MAC3 by MAC4, obtain To the Ether frame of the first carrying arp response message;Afterwards, the second gateway sends the Ether frame of the first carrying arp response message To above-mentioned first gateway.
Further, as it was previously stated, the first gateway can record the IP address of the first virtual machine and first virtual machine The corresponding relation of the corresponding relation of MAC Address, i.e. 10.0.0.10 and MAC1, the first gateway are receiving the transmission of the second gateway After the Ether frame of first carrying arp response message, the value according to the first Target IP address fields in Ether frame is understood, and, in advance The 10.0.0.10 and MAC1 corresponding relation first stored, finds MAC1, and by the Ether frame of the first carrying arp response message The value of the 3rd target MAC (Media Access Control) address field and the value of the 3rd Target MAC Address fields repaiied by the MAC Address of the first gateway Be changed to VM1 MAC Address, will this first carrying arp response message Ether frame the 3rd target MAC (Media Access Control) address field value and The value of 3rd Target MAC Address fields is revised as MAC1 by original MAC2, obtain the second carrying arp response message with Too frame.
Further, the first gateway is held according to the IP address of the first virtual machine and the MAC Address of the first virtual machine by second The Ether frame for carrying arp response message is sent to the first virtual machine, that is, is sent to VM1;VM1 receives the second carrying arp response report After the Ether frame of text, the MAC Address that will be considered that the second virtual machine that IP address is 10.0.0.20 is MAC3, then subsequently issues this The target MAC (Media Access Control) address of the IP messages of address can be filled with MAC3, such as:I.e. when VM1 sends the Ether frame for carrying IP messages to the During one gateway, the first gateway is received the Ether frame of the bearing IP packet after the Ether frames of the carrying IP messages of VM1 transmissions The value of source MAC field is revised as MAC2 by MAC1, and carries the value of the target MAC (Media Access Control) address field of the Ether frame of the IP messages It is exactly MAC3, the value of purpose IP address field is VM2 IP address, i.e. 10.0.0.20, the first gateway is directly according to carrying IP The Ether frame of the amended bearing IP packet is sent to the second net by the value of the target MAC (Media Access Control) address field of the Ether frame of message Close, and then the second gateway is according to the value of the Target IP address fields of the Ether frame of the amended bearing IP packet and pre- The 10.0.0.20 and MAC4 corresponding relation first stored, determine the virtual machine of the final reception of the Ether frame of the bearing IP packet For VM2, and then the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet is revised as MAC4 by the second gateway, afterwards, will The Ether frame of the bearing IP packet is sent to VM2.
Further, for the first gateway and VM1, being sent by any second virtual machine for the second gateway is come from All modifications after the value of source MAC field of Ether frame of carrying arp response message be MAC3.
In the method that the present embodiment provides, the 3rd carrying arp response message is sent to the second gateway by the second virtual machine Ether frame, the second gateway records the MAC Address of the second virtual machine and the corresponding relation of IP address after receiving the Ether frame, and The value of the value of 3rd source MAC field of the Ether frame and the 3rd Sender MAC Address fields is revised as the second gateway MAC Address so that the MAC Address for the second virtual machine that the first gateway learns is the MAC Address of the second gateway, and not The MAC Address of the second virtual machine in itself, i.e., for the first gateway, come from the second gateway by under DC2 networks appoint The value and Sender MAC of the source MAC field of the Ether frame for all carrying arp response messages that one second virtual machine is sent The value of address field is all the MAC Address of the second gateway, i.e. the first gateway does not have to the MAC of all virtual machines under study DC2 networks Address, it need to only learn the MAC Address of virtual machine and the MAC Address of the second gateway under DC1 networks, so as to reduce first The MAC address entries of the study of gateway, so as to save DC gateway resources, improve forward efficiency.
Fig. 8 is a kind of schematic flow sheet of message forwarding method embodiment nine provided by the invention, as shown in figure 8, upper On the basis of stating embodiment, the present embodiment further provides another mistake that the first virtual machine confirms the second virtual machine MAC Address Journey, the Ether frame of the 4th carrying ARP request message is sent to the second gateway particular by the second virtual machine, the second gateway should After the 5th source MAC in Ether frame is revised as the mark of the second gateway, by the MAC Address of the second gateway and the second virtual machine Corresponding relation be sent to information collection server, information collection server records the corresponding relation, and the corresponding relation is sent out Give what the mode of the first gateway determined, this method specifically includes:
S801:Above-mentioned second gateway receives the Ether frame for the 4th carrying ARP request message that above-mentioned second virtual machine is sent, The 5th source MAC field, the 5th target MAC (Media Access Control) address field, the are carried in the Ether frame of above-mentioned 4th carrying ARP request message Five Sender MAC Address fields, the 5th Target MAC Address field, the 5th Sender IP address fields and the 5th Target IP address fields, the value of above-mentioned 5th source MAC field and the value of above-mentioned 5th Sender MAC Address fields are equal For the MAC Address of above-mentioned second virtual machine, the value of above-mentioned 5th target MAC (Media Access Control) address field is broadcast MAC address, the above-mentioned 5th The value of Sender IP address fields is the IP address of above-mentioned second virtual machine, and the value of above-mentioned 5th Target IP address fields is The IP address of above-mentioned first virtual machine, the value of above-mentioned 5th Target MAC Address fields is unknown MAC Address.
Specifically, VM2 sends the Ether frame of the 4th carrying ARP request message to the second gateway, the 4th carrying ARP request The 5th source MAC field, the 5th target MAC (Media Access Control) address field, the 5th Sender MAC Address words are carried in the Ether frame of message Section, the 5th Target MAC Address field, the 5th Sender IP address fields and the 5th Target IP address fields, its In, the value of the value of the 5th source MAC field and the 5th Sender MAC Address fields is VM2 MAC Address, i.e. MAC4; The value of 5th target MAC (Media Access Control) address field is broadcast MAC address;The value of 5th Sender IP address fields is VM2 IP address, That is 10.0.0.20;The value of 5th Target IP address fields be VM1 IP address, i.e. 10.0.0.10;5th Target MAC The value of address field is unknown MAC Address.
S802:Second gateway carries the 5th source MAC field in the Ether frame of ARP request message by the above-mentioned 4th The value of value and the 5th Sender MAC Address fields is revised as the mark of the second gateway by the MAC Address of first virtual machine Know, and send the 4th message to information collection server, the mark and the second virtual machine of the second gateway are carried in the 4th message IP address corresponding relation so that information collection server records the mark of the second gateway and the IP of second virtual machine Location corresponding relation;Or second gateway send the 5th message to information collection server, it is virtual that second is carried in the 5th message The corresponding relation of the IP address of the MAC Address of machine and the second virtual machine, and, the mark of the second gateway, so that information gathering takes It is corresponding with the IP address of second virtual machine to record identifying for second gateway according to the mark of second gateway for business device Relation.
Specifically, the second gateway receives the Ether frame for the 4th carrying ARP request message that VM2 is sent, and record VM2 IP The corresponding relation of address and VM2 MAC Address, that is, record 10.0.0.20 and MAC4 corresponding relation;Afterwards, the second gateway will The value and the 5th Sender MAC Address of the 5th source MAC field in the Ether frame of above-mentioned 4th carrying ARP request message The value of field is revised as the MAC Address of the mark, i.e. the second gateway of the second gateway by VM2 MAC Address, i.e., by the 5th source The value of the value of MAC Address field and the 5th Sender MAC Address fields is revised as MAC3 by MAC4, wherein, this is locally identified Can be the MAC Address of gateway oneself, either can be with based on the generation of its whole network unique IP address or other rule generations, As long as having uniqueness in network, as the whole network can uniquely identify;Here IP messages can be that IPv4 messages can also It is IPv6 messages.
Further, the second gateway carries the 5th source MAC field in the Ether frame of ARP request message by the 4th Value and the values of the 5th Sender MAC Address fields second gateway is revised as by the MAC Address of first virtual machine Mark, and send the 4th message to information collection server, the mark of the second gateway and second empty carried in the 4th message The corresponding relation of the corresponding relation of the IP address of plan machine, i.e. MAC3 and 10.0.0.20, information collection server record second net The mark of pass and the IP address corresponding relation of the second virtual machine;Or second gateway send the 5th message give information gathering service Device, the MAC Address of the second virtual machine and the corresponding relation of the IP address of the second virtual machine are carried in the 5th message, and, The mark of two gateways so that information collection server records the mark of the second gateway and second empty according to the mark of the second gateway The IP address corresponding relation of plan machine;Wherein, the 4th message and the 5th message can be carry ARP request message Ether frame or Carry the BGP message of the information.
Further, before S801, the first gateway can send the first request message to information collection server, to obtain VM2 MAC Address is taken, information collection server obtains after the request message is received according to the foregoing method of the present embodiment The corresponding relation of the IP address of the MAC Address of second gateway and the second virtual machine, information collection server can send the first response Message gives the first gateway, the MAC for the second gateway that information collection server prestores is carried in first response message The corresponding relation of the IP address of location and the second virtual machine, i.e. MAC3 and 10.0.0.20 corresponding relation;Afterwards, the first gateway root The response message sent according to information collection server, rebuild the Ether frame of the 4th carrying arp response message and be sent to VM1, the Ether frame of the 4th carrying arp response message carry the mark of the second gateway;VM1 receives the 4th carrying ARP and rung After the Ether frame for answering message, the MAC Address that will be considered that the second virtual machine that IP address is 10.0.0.20 is MAC3, then rear supervention Target MAC (Media Access Control) address to the IP messages of the address can be filled with MAC3, such as:When VM1 send bearing IP packet Ether frame to During the first gateway, the first gateway is received the Ether frame of the bearing IP packet after the Ether frame of the bearing IP packet of VM1 transmissions The value of source MAC field MAC2 is revised as by MAC1, and carry the target MAC (Media Access Control) address field of the Ether frame of the IP messages Value is filled with MAC3, and the value of purpose IP address field is VM2 IP address, i.e. 10.0.0.20, and the first gateway is directly held according to this The Ether frame of the amended bearing IP packet is sent to second by the value for carrying the target MAC (Media Access Control) address field of the Ether frame of IP messages Gateway, and then the second gateway is according to the value of the purpose IP address field of the Ether frame of the amended bearing IP packet and in advance The 10.0.0.20 and MAC4 of storage corresponding relation, the virtual machine for determining the final reception of the Ether frame of the bearing IP packet are VM2, and then the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet is revised as MAC4 by the second gateway, afterwards, by this The Ether frame of bearing IP packet is sent to VM2.
Further, for the first gateway and VM1, the MAC of the second virtual machine learnt by server Location is only the MAC Address of the second gateway, i.e., VM2 MAC Address is realized and can hidden to VM1 and the first gateway, that is to say, that opposite end Any virtual machine is sent to the second gateway and by carrying ARP request message of second gateway forwards to server under DC2 networks The source MAC and Sender MAC Address of Ether frame are MAC3.
In the method that the present embodiment provides, disappeared by the second gateway to information collection server the 4th message of transmission or the 5th Breath, to cause information collection server to record the corresponding relation of the mark of the second gateway and the IP address of the second virtual machine, the After one gateway sends the message of the MAC Address of the virtual machine of acquisition request second to information collection server, information collection server The IP address and the response message of the corresponding relation of the MAC Address of the second gateway for carrying the second virtual machine are sent to the first gateway, To cause the first gateway according to the Ether frame of the carrying arp response message of response message transmission the 4th to the first virtual machine, and make The MAC Address for obtaining the second virtual machine that the first gateway learns is the MAC Address of the second gateway, and is not the second virtual machine The MAC Address of itself, i.e. the first gateway do not have to the MAC Address of all virtual machines under study DC2 networks, only need to learn DC1 networks Under the MAC Address of virtual machine and the MAC Address of the second gateway, so as to reduce the MAC address entries of the study of the first gateway, So as to save DC gateway resources, forward efficiency is improved.
Fig. 9 is a kind of schematic flow sheet of message forwarding method embodiment ten provided by the invention, as shown in figure 9, this reality Apply example and provide the MAC Address that the first virtual machine determines the second virtual machine, and the first virtual machine sends IP to the second virtual machine The overall process of message, this method specifically include:
S10:Above-mentioned first gateway receives the Ether frame for the first carrying ARP request message that above-mentioned first virtual machine is sent, The second source MAC field, the second target MAC (Media Access Control) address field, the are carried in the Ether frame of above-mentioned first carrying ARP request message Two Sender IP address fields, the 2nd Sender MAC Address field, the 2nd Target IP address fields and the 2nd Target MAC Address field, the values of above-mentioned 2nd Sender IP address fields are the IP address of above-mentioned first virtual machine, above-mentioned second source The value of the value of MAC Address field and above-mentioned 2nd Sender MAC Address fields is the MAC Address of above-mentioned first virtual machine, on The value for stating the 2nd Target IP address fields is the IP address of above-mentioned second virtual machine, above-mentioned second target MAC (Media Access Control) address field It is worth for broadcast MAC address, the value of above-mentioned 2nd Target MAC Address fields is unknown MAC Address.
Specifically, if to transmit IP messages between VM1 and VM2, VM1 is except it is to be understood that VM2 IP under correspondent network Outside location, it is also necessary to know the MAC Address of VM2 under correspondent network, therefore, before the Ether frame of bearing IP packet is sent, just Need to send the Ether frame for carrying ARP request message to obtain the MAC Address of VM2 under correspondent network.
Further, VM1 sends the first Ether frame for carrying ARP request message and asked to the first gateway, first carrying ARP The Ether frame of message is asked to be made up of ether frame head, Ether frame load and frame check field three parts, ether frame head is by source MAC The ether frame type field composition of location field, target MAC (Media Access Control) address field and 2 bytes, in ether frame type field When capacitance is hexadecimal 0x0806, illustrate that Ether frame load below is ARP request message, unlike IP messages, ARP request message is with carrying the 2nd Sender IP address fields, the 2nd Sender MAC Address field, the 2nd Target IP Location field and the 2nd Target MAC Address fields, the second source MAC field and the second target MAC (Media Access Control) address field are in ether In the address field of frame head;Wherein, the value of the 2nd Sender IP address fields be VM1 IP address, i.e. 10.0.0.10;First The value of the value of source MAC field and the 2nd Sender MAC Address fields is VM1 MAC Address, i.e. MAC1;Second The value of TargetIP address fields be VM2 IP address, i.e. 10.0.0.20;The value of second target MAC (Media Access Control) address field is broadcast MAC Address, it is herein FF:FF:FF:FF:FF:FF;The value of 2nd Target MAC Address fields is unknown MAC Address, i.e., 00: 00:00:00:00:00。
S11:Above-mentioned first gateway is according to above-mentioned first virtual machine of ether frame recording of the first of reception the carrying ARP messages The corresponding relation of the MAC Address of IP address and above-mentioned first virtual machine.
S12:Above-mentioned first gateway carries the second source MAC word in the Ether frame of ARP request message by above-mentioned first The value of section and the value of the 2nd Sender MAC Address fields are revised as above-mentioned first net by the MAC Address of above-mentioned first virtual machine The mark of pass, obtain the Ether frame of amended second carrying ARP request message.
S13:The Ether frame of second carrying ARP request message is broadcast to above-mentioned second gateway by above-mentioned first gateway, above-mentioned Second gateway is located at second data center's DC networks, and the first gateway and the first virtual machine are located at the first DC networks, and tenant rents the One virtual machine and the virtual machine rented in the 2nd DC networks.Specifically, the first gateway receives the first carrying ARP that VM1 is sent The Ether frame of request message, and record the corresponding relation of VM1 IP address and VM1 MAC Address, that is, record 10.0.0.10 and MAC1 corresponding relation;Afterwards, the first gateway is by the first source MAC in the Ether frame of the above-mentioned first carrying ARP request message The value of the value of location field and the first Sender MAC Address fields is revised as above-mentioned by the MAC Address of above-mentioned first virtual machine The MAC Address of the mark of one gateway, i.e. the first gateway, i.e., by the value of the second source MAC field and the 2nd Sender MAC The value of location field is revised as MAC2 by MAC1, and recalculates Ether frame check field, and other fields are not made an amendment;Wherein, this Individual local mark can be the MAC Address of gateway oneself, either based on the unique IP address generation of its whole network or other rules Generation can be so that as long as having uniqueness in network, i.e. the whole network can uniquely identify;Here IP messages can be IPv4 Message can also be IPv6 messages.
Further, the Ether frame of the second carrying ARP request message is broadcast to the second gateway, the second gateway by the first gateway Positioned at the 2nd DC networks, the first gateway and the first virtual machine are located at the first DC networks, and tenant rents the first virtual machine and rented It is virtual in 2nd DC networks, for the second gateway and VM2, come from being sent by any first virtual machine for the first gateway The values of source MAC field of Ether frame of all carrying ARP request messages be MAC2, i.e., VM1 MAC Address passes through The modification of one gateway realizes MAC Address to the second gateway and VM2 and hidden.
S14:Above-mentioned second gateway receives the Ether frame for the second carrying ARP request message that first gateway is sent, on State and the second source MAC field, the second target MAC (Media Access Control) address field, second are carried in the Ether frame of the second carrying ARP request message Sender IP address fields, the 2nd Sender MAC Address field, the 2nd Target IP address fields and the 2nd Target MAC Address field, the values of above-mentioned 2nd Sender IP address fields are the IP address of above-mentioned first virtual machine, above-mentioned second source The value of the value of MAC Address field and above-mentioned 2nd Sender MAC Address fields is the mark of above-mentioned first gateway, and above-mentioned The value of two Target IP address fields is the IP address of above-mentioned second virtual machine, and the value of above-mentioned second target MAC (Media Access Control) address field is Broadcast MAC address;The value of above-mentioned 2nd Target MAC Address fields is unknown MAC Address.
S15:Above-mentioned second gateway is by the Ether frame of the second carrying ARP request message into second data center's DC networks Virtual machine is broadcasted, and first gateway and first virtual machine are located at the first DC networks, second gateway and described second Virtual machine is located at the 2nd DC networks, and tenant rents first virtual machine and rented virtual in the 2nd DC networks Machine.
Specifically, the second gateway receives the Ether frame for the second carrying ARP request message that the first gateway is sent, this second holds Carry in the Ether frame of ARP request message and carry the second source MAC field, the second target MAC (Media Access Control) address field, the 2nd Sender IP address field, the 2nd Sender MAC Address field, the 2nd Target IP address fields and the 2nd Target MAC Address words Section, the values of the 2nd Sender IP address fields are VM1 IP address, i.e. 10.0.0.10;The value of second source MAC field and The value of 2nd Sender MAC Address fields is the MAC Address of the first gateway, i.e. MAC2;2nd Target IP address fields Value be the second virtual machine IP address, i.e. 10.0.0.20;The value of second target MAC (Media Access Control) address field is broadcast MAC address;The The value of two Target MAC Address fields is unknown MAC Address.
Further, virtual machine of second gateway by the Ether frame of the second carrying ARP request message into the 2nd DC networks Broadcast, the first gateway and the first virtual machine are located at the first DC networks, and second gateway and second virtual machine are located at second DC networks, tenant rent first virtual machine and the virtual machine rented in the 2nd DC networks;Now VM2 receive this After the Ether frame of two carrying ARP request messages, it will be considered that the MAC Address that IP address is VM1 corresponding to 10.0.0.10 is MAC2, I.e. the second gateway and VM2 will be considered that the value of VM1 MAC Address field is MAC2, then subsequently issue the bearing IP packet of the address The target MAC (Media Access Control) address field of Ether frame can also be filled with MAC2, such as:When VM2 sends the Ether frame for carrying IP messages to the During two gateways, after the second gateway receives the Ether frame of the bearing IP packet of VM2 transmissions, by the Ether frame of the bearing IP packet The value of source MAC field is revised as the MAC Address of the second gateway, i.e. MAC3 by MAC4, and carries the Ether frame of the IP messages Target MAC (Media Access Control) address field value is filled with is MAC2, the value of purpose IP fields is VM1 IP address, i.e. 10.0.0.10, Second gateway directly reports the amended carrying IP according to the value of the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet The Ether frame of text is sent to the first gateway, and then the first gateway is according to the purpose IP of the Ether frame of the amended bearing IP packet The value of address field and the 10.0.0.10 and MAC1 corresponding relation prestored, determine the Ether frame of the bearing IP packet The virtual machine of final reception be VM1, and then by the first gateway by the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet MAC1 is revised as, afterwards, the Ether frame of the bearing IP packet is sent to VM1.
S16:Above-mentioned second gateway receives the Ether frame for the 3rd carrying arp response message that above-mentioned second virtual machine is sent, The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the are carried in the Ether frame of above-mentioned 3rd carrying arp response message Three Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address field, the values of above-mentioned 3rd Sender IP address fields are the IP address of above-mentioned second virtual machine, above-mentioned 3rd source The value of the value of MAC Address field and above-mentioned 3rd Sender MAC Address fields is the MAC Address of above-mentioned second virtual machine, on The value for stating the 3rd Target IP address fields is the IP address of above-mentioned first virtual machine, above-mentioned 3rd target MAC (Media Access Control) address field The value of value and above-mentioned 3rd Target MAC Address fields is the mark of above-mentioned first gateway.
Specifically, the Ether frame of the second carrying ARP request message is broadcast to all DC of VM1 tenants by the first gateway After gateway in network, therefore the second gateway also have received the Ether frame of the second carrying ARP request message, and by this The Ether frame of two carrying ARP request messages is broadcast to all virtual machines in DC2 networks, but because second carrying ARP please Ask and the 2nd Target IP address fields are contained in the Ether frame of message, and the value of the 2nd Target IP address fields VM2 IP address, i.e. 10.0.0.20, therefore, only VM2 can send the Ether frame of one the 3rd carrying arp response message to the Two gateways, and carry the 3rd source MAC field, the MAC of the 3rd mesh in the Ether frame of the 3rd carrying arp response message Location field, the 3rd Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and Three Target MAC Address fields, the value of above-mentioned 3rd Sender IP address fields are the second virtual machine VM2 IP address, i.e., 10.0.0.20;The value of the value of above-mentioned 3rd source MAC field and above-mentioned 3rd Sender MAC Address fields is above-mentioned Two virtual machine VM2 MAC Address, i.e. MAC2;The value of above-mentioned 3rd Target IP address fields is above-mentioned first virtual machine VM1 IP address, i.e. 10.0.0.10;The value and above-mentioned 3rd Target MAC Address fields of above-mentioned 3rd target MAC (Media Access Control) address field Value be above-mentioned first gateway MAC Address, i.e. MAC2.
S17:Above-mentioned second gateway carries the 3rd source MAC word in the Ether frame of arp response message by the above-mentioned 3rd The value of section and the value of above-mentioned 3rd Sender MAC Address fields are revised as above-mentioned the by the MAC Address of above-mentioned second virtual machine The mark of two gateways, obtain the Ether frame of the first carrying arp response message.
S18:The Ether frame of above-mentioned first carrying arp response message is sent to above-mentioned first gateway by above-mentioned second gateway.
Specifically, after the second gateway receives the Ether frame of the 3rd carrying arp response message of VM2 transmissions, record second is empty The corresponding relation of plan machine VM2 MAC Address and VM2 IP address, that is, 10.0.0.20 and MAC4 corresponding relation is recorded, and will The value and the 3rd Sender MAC Address field of 3rd source MAC field of the Ether frame of the 3rd carrying arp response message Value is revised as the MAC Address of the second gateway by the second virtual machine VM2 MAC Address, will carry the ether of arp response message The value of the source MAC field of frame and the value of Sender MAC Address fields are revised as MAC3 by MAC4, obtain the first carrying ARP The Ether frame of response message;Afterwards, the Ether frame of the above-mentioned first carrying arp response message is sent to above-mentioned first by the second gateway Gateway.
Further, as it was previously stated, the first gateway can record the IP address of the first virtual machine and first virtual machine The corresponding relation of the corresponding relation of MAC Address, i.e. 10.0.0.10 and MAC1, the first gateway are receiving the transmission of the second gateway After the Ether frame of first carrying arp response message, the value according to the 3rd Target IP address fields in the Ether frame is understood, and, The 10.0.0.10 and MAC1 corresponding relation prestored, finds MAC1, and by the ether of the first carrying arp response message The value of 3rd target MAC (Media Access Control) address field of frame and the value of the 3rd Target MAC Address fields are equal by the MAC Address of the first gateway Be revised as VM1 MAC Address, will this first carrying arp response message Ether frame target MAC (Media Access Control) address field value and The value of Target MAC Address fields is revised as MAC1 by original MAC2, obtains the Ether frame of the second carrying arp response message.
Further, the first gateway, will be above-mentioned according to the IP address of the first virtual machine and the MAC Address of the first virtual machine The Ether frame of second carrying arp response message is sent to the first virtual machine, that is, is sent to VM1;VM1 receives second carrying ARP After the Ether frame of response message, the MAC Address that will be considered that the second virtual machine that IP address is 10.0.0.20 is MAC3, then subsequently MAC3 can be filled with by issuing the target MAC (Media Access Control) address of the IP messages of the address, such as:When VM1 sends the Ether frame of carrying IP messages During to the first gateway, the first gateway is received the bearing IP packet after the Ether frame of the first bearing IP packet of VM1 transmissions The value of first source MAC field of Ether frame is revised as MAC2 by MAC1, obtains the Ether frame of the second bearing IP packet, and should The value of first target MAC (Media Access Control) address field of the Ether frame of the second bearing IP packet is exactly MAC3, the first purpose IP address field It is worth the IP address for VM2, i.e. 10.0.0.20, the Ether frame of second bearing IP packet is sent to the second gateway by the first gateway, And then second gateway deposit according to the values of the first Target IP address fields of the Ether frame of second bearing IP packet and in advance The 10.0.0.20 and MAC4 of storage corresponding relation, determine the virtual machine of the final reception of the Ether frame of second bearing IP packet For VM2, and then the target MAC (Media Access Control) address field of the Ether frame of the bearing IP packet is revised as MAC4 by the second gateway, obtains The Ether frame of three bearing IP packets, afterwards, the Ether frame of the 3rd bearing IP packet is sent to VM2.
Further, for the first gateway and VM1, being sent by any second virtual machine for the second gateway is come from The values of source MAC field of Ether frame of all carrying arp response messages be MAC3.
In the method that the present embodiment provides, the first gateway receives the first carrying ARP request message that the first virtual machine is sent Ether frame, and the value of the value of the second source MAC field of the Ether frame and the 2nd Sender MAC Address fields is repaiied It is changed to the MAC Address of the first gateway so that the MAC Address for the first virtual machine that the second gateway learns is the first gateway MAC Address, and it is not the MAC Address of the first virtual machine in itself;And the second gateway receives the 3rd that the second virtual machine is sent The MAC Address of the second virtual machine and the corresponding relation of IP address are recorded after carrying the Ether frame of arp response message, and by the ether The value of 3rd source MAC field of frame and the value of the 3rd Sender MAC Address fields are with being revised as the MAC of the second gateway Location so that the MAC Address for the second virtual machine that the first gateway learns is the MAC Address of the second gateway, and is not second The MAC Address of virtual machine in itself, i.e., for the second gateway, the second gateway does not have to all virtual machines under study DC1 networks MAC Address, it need to only learn the MAC Address of virtual machine and the MAC Address of the first gateway under DC2 networks, for the first net For pass, the first gateway does not have to the MAC Address of all virtual machines under study DC2 networks, need to only learn the virtual machine under DC1 networks MAC Address and the second gateway MAC Address, so as to greatly reduce the second gateway and the second gateway study MAC table , so as to save DC gateway resources, improve forward efficiency.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey Sequence upon execution, execution the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or Person's CD etc. is various can be with the medium of store program codes.
Figure 10 is a kind of structural representation of message forward gateway embodiment one provided by the invention, as shown in Figure 10, should Gateway includes:First receiving module 101, the first modified module and 102 first sending modules 103, wherein, the first receiving module 101, the Ether frame of the first carrying Internet protocol IP message sent for receiving the first virtual machine, the first carrying IP reports The first source IP address field, the first source MAC address field, the MAC of the first mesh are carried in the Ether frame of text Location field and the first purpose IP address field, wherein, the value of the first source IP address field is the IP of first virtual machine Address, the value of the first source MAC field are the MAC Address of first virtual machine, the first target MAC (Media Access Control) address word The value of section is the mark of the second gateway corresponding to the second virtual machine, and the value of the first purpose IP address field is empty for described second The IP address of plan machine;First modified module 102, for by first source in the Ether frame of first bearing IP packet The value of MAC Address field is revised as the mark of first gateway by the MAC Address of first virtual machine, obtains the second carrying The Ether frame of IP messages;First sending module 103, for the mark according to second gateway, by the second bearing IP packet Ether frame is sent to second gateway.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment one, its realization principle and skill Art effect is similar, and here is omitted.
Figure 11 is a kind of structural representation of message forward gateway embodiment two provided by the invention, as shown in figure 11, On the basis of above-mentioned embodiment illustrated in fig. 10 one, the gateway also includes:First logging modle 201, for receiving described first After the Ether frame for first bearing IP packet that virtual machine is sent, according to the ether of first bearing IP packet of reception The corresponding relation of the MAC Address of the IP address of first virtual machine described in frame recording and first virtual machine.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment two, its realization principle and skill Art effect is similar, and here is omitted.
Figure 12 is a kind of structural representation of message forward gateway embodiment three provided by the invention, as shown in figure 12, On the basis of above-described embodiment, the gateway also includes:Second receiving module 301, in receive that the first virtual machine sends described the Before the Ether frame of one bearing IP packet, the first carrying ARP request that first virtual machine is sent is received The Ether frame of message, it is described first carrying ARP request message Ether frame in carry the second source MAC field, the second purpose MAC Address field, the second sender Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address field and the second target Target MAC Address fields, the values of the 2nd Sender IP address fields are described the The value of the IP address of one virtual machine, the value of the second source MAC field and the 2nd Sender MAC Address fields is equal For the MAC Address of first virtual machine, the value of the second target Target IP address fields is second virtual machine IP address, the value of the second target MAC (Media Access Control) address field is broadcast MAC address, the 2nd Target MAC Address fields It is worth for unknown MAC Address;Second logging modle 302, for the ether frame recording according to the first of reception the carrying ARP request message The corresponding relation of the MAC Address of the IP address of first virtual machine and first virtual machine;Second modified module 303, use In the value and described second that the second source MAC field in the Ether frame of ARP request message is carried described first The value of Sender MAC Address fields is revised as the mark of first gateway by the MAC Address of first virtual machine, is obtained To the Ether frame of the amended second carrying ARP request message;Broadcast module 304, for carrying ARP request report by described second The Ether frame of text is broadcast to the second gateway, and second gateway is located at second data center's DC networks, first gateway and institute State the first virtual machine and be located at the first DC networks, tenant rents first virtual machine and the void rented in the 2nd DC networks Plan machine.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment three and example IV, in fact Existing principle is similar with technique effect, and here is omitted.
Further, on the basis of above-mentioned embodiment illustrated in fig. 12, the gateway also includes:3rd receiving module 401, use In after the Ether frame of the described second carrying ARP request message is broadcast into the second gateway, receives second gateway and send First carrying arp response message Ether frame, it is described first carrying arp response message Ether frame in carry the 3rd source MAC Address field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender IP address fields, the 3rd Sender MAC Address field, Three Target IP address fields and the 3rd Target MAC Address fields, the value of the 3rd Sender IP address fields is institute State the IP address of the second virtual machine, the value of the 3rd source MAC field and the 3rd Sender MAC Address fields Value is the mark of second gateway, the values of the 3rd Target IP address fields for first virtual machine IP Location, the value of the 3rd target MAC (Media Access Control) address field and the value of the 3rd Target MAC Address fields are first net The mark of pass;3rd modified module 402, it is empty with described first for the IP address according to first virtual machine prestored The corresponding relation of the MAC Address of plan machine, by the MAC of the 3rd mesh of the Ether frame of the described first carrying arp response message The value of the value of location field and the 3rd Target MAC Address fields is revised as described by the mark of first gateway The MAC Address of one virtual machine, obtain the Ether frame of the second carrying arp response message;Second sending module 403, for according to institute The IP address of the first virtual machine and the MAC Address of first virtual machine are stated, by the ether of the described second carrying arp response message Frame is sent to first virtual machine.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method example IV, its realization principle and skill Art effect is similar, and here is omitted.
Figure 13 is a kind of structural representation of message forward gateway example IV provided by the invention, as shown in figure 13, On the basis of above-described embodiment, the gateway also includes:4th receiving module 500, for receiving the first virtual machine transmission First bearing IP packet Ether frame before, receive the 3rd carrying address resolution protocol that first virtual machine is sent The Ether frame of ARP request message, the 4th source MAC field, the are carried in the Ether frame of the 3rd carrying ARP request message Four target MAC (Media Access Control) address fields, the 4th Sender IP address fields, the 4th Sender MAC Address field, the 4th Target IP Address field and the 4th Target MAC Address fields, the value of the 4th Sender IP address fields are virtual for described first The IP address of machine, the value of the 4th source MAC field and the value of the 4th Sender MAC Address fields are described The MAC Address of first virtual machine, the values of the 4th target Target IP address fields for second virtual machine IP Location, the value of the 4th target MAC (Media Access Control) address field is broadcast MAC address, and the value of the 4th Target MAC Address sections is not Know MAC Address;3rd sending module 501, the of the MAC Address that obtains second virtual machine is sent to information collection server One request message, the IP address of second virtual machine is carried in first request message;, the 5th receiving module 502, it is used for Described information acquisition server is received according to the mark of second gateway prestored with the IP of second virtual machine The first response message that location corresponding relation returns, the mark of second gateway is carried in first response message;4th hair Module 503 is sent, for sending the Ether frame of the 4th carrying arp response message, the 4th carrying ARP to first virtual machine The mark of second gateway is carried in the Ether frame of response message, so that first virtual machine reports the described first carrying IP The value of the first target MAC (Media Access Control) address field in the Ether frame of text is filled with the mark of second gateway.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment five, its realization principle and skill Art effect is similar, and here is omitted.
Figure 14 is a kind of structural representation of message forward gateway embodiment five provided by the invention, as shown in figure 14, should Gateway includes:First receiving module 601, the ether of the second carrying Internet protocol IP message sent for receiving the first gateway Frame, the first source IP address field, the first source MAC address are carried in the Ether frame of second bearing IP packet Field, the first target MAC (Media Access Control) address field and the first purpose IP address field, the value of the first source IP address field are described the The IP address of one virtual machine, the value of the first source MAC field are the mark of first gateway, first purpose The value of MAC Address field is the mark of second gateway corresponding to the second virtual machine, the first purpose IP address field It is worth for the IP address of second virtual machine;First modified module 602, for according to second virtual machine prestored The corresponding relation of the MAC Address of IP address and second virtual machine, by the in the Ether frame of second bearing IP packet The value of one target MAC (Media Access Control) address field is revised as the MAC Address of second virtual machine by the mark of second gateway, obtains The Ether frame of three bearing IP packets;First sending module 603, for the IP address according to second virtual machine and described second The MAC Address of virtual machine, the Ether frame of the 3rd bearing IP packet is sent to second virtual machine.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment six, its realization principle and skill Art effect is similar, and here is omitted.
Figure 15 is a kind of structural representation of message forward gateway embodiment six provided by the invention, in implementation shown in Figure 14 On the basis of example, the gateway also includes:Second receiving module 701, for receiving second carrying of the first gateway transmission Before the Ether frame of Internet protocol IP message, receive the second carrying ARP that first gateway is sent and ask The Ether frame of message is sought, the second source MAC field, the second mesh are carried in the Ether frame of the second carrying ARP request message MAC Address field, the 2nd Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP Address field and the second target Target MAC Address fields, the value of the 2nd Sender IP address fields is described first The value of the IP address of virtual machine, the value of the second source MAC field and the 2nd Sender MAC Address fields is The mark of first gateway, the value of the second target TargetIP address fields are the IP address of second virtual machine, The value of the second target MAC (Media Access Control) address field is broadcast MAC address;The value of the 2nd Target MAC Address fields is unknown MAC Address;First broadcast module 702, for by the Ether frame of the described second carrying ARP request message to the second data center DC Virtual machine broadcast in network, first gateway and first virtual machine be located at the first DC networks, second gateway with Second virtual machine is located at the 2nd DC networks, and tenant rents first virtual machine and rents the 2nd DC networks In virtual machine.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment seven, its realization principle and skill Art effect is similar, and here is omitted.
Further, on the basis of above-mentioned embodiment illustrated in fig. 15, the gateway can also include:3rd receiving module 801, broadcasted by virtual machine of the Ether frame of the described second carrying ARP request message into the second data center DC networks Afterwards, the Ether frame for the 3rd carrying arp response message that second virtual machine is sent, the 3rd carrying arp response are received The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender IP address words are carried in the Ether frame of message Section, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address fields, it is described The value of 3rd Sender IP address fields be second virtual machine IP address, the value of the 3rd source MAC field and The value of the 3rd Sender MAC Address fields is the MAC Address of second virtual machine, the 3rd Target IP The value of location field be first virtual machine IP address, the value and the described 3rd of the 3rd target MAC (Media Access Control) address field The value of Target MAC Address fields is the mark of first gateway;Second modified module 802, for the described 3rd to be carried The value and the 3rd Sender MAC Address fields of the 3rd source MAC field in the Ether frame of arp response message Value the mark of second gateway is revised as by the MAC Address of second virtual machine, obtain the first carrying arp response report The Ether frame of text;Second sending module 803, for the Ether frame of the described first carrying arp response message to be sent into described the One gateway.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment eight, its realization principle and skill Art effect is similar, and here is omitted.
Figure 16 is a kind of structural representation of message forward gateway embodiment seven provided by the invention, as shown in figure 17, should Gateway includes:4th receiving module 901, the 3rd sending module 902, wherein, the 4th receiving module 901, for described in reception Before the Ether frame for the second carrying Internet protocol IP message that first gateway is sent, receive second virtual machine and send The 4th carrying ARP request message Ether frame, it is described 4th carrying ARP request message Ether frame in carry the 5th source MAC Address field, the 5th target MAC (Media Access Control) address field, the 5th Sender MAC Address field, the 5th Target MAC Address field, Five Sender IP address fields and the 5th Target IP address fields, the value of the 5th source MAC field and described The value of 5th Sender MAC Address fields is the MAC Address of second virtual machine, the value of the target MAC (Media Access Control) address field For broadcast MAC address, the value of the 5th Sender IP address fields is the IP address of second virtual machine, the described 5th The value of Target IP address fields is the IP address of first virtual machine, and the value of the 5th target MAC (Media Access Control) address field is not Know MAC Address;3rd sending module 902, by the 5th source MAC in the Ether frame of the described 4th carrying ARP request message The value of the value of address field and the 5th MAC Address field is revised as described by the MAC Address of second virtual machine The mark of two gateways, and the 4th message is sent to information collection server, carry second gateway in the 4th message The corresponding relation of mark and the IP address of second virtual machine, so that described information acquisition server records second gateway Mark and second virtual machine IP address corresponding relation.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment nine, its realization principle and skill Art effect is similar, and here is omitted.
Further, on the basis of above-mentioned embodiment illustrated in fig. 16, the gateway can also include:4th sending module 903, for before the Ether frame for the second carrying Internet protocol IP message that first gateway is sent is received, sending 5th message carries the MAC Address and described second of second virtual machine to information collection server in the 5th message The mark of the corresponding relation of the IP address of virtual machine and second gateway, so that described information acquisition server records described The mark of two gateways and the IP address corresponding relation of second virtual machine.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment nine, its realization principle and skill Art effect is similar, and here is omitted.
Figure 17 is a kind of structural representation of message forward gateway embodiment eight provided by the invention, as shown in figure 17, is connect Receive device 11, processor 12 and transmitter 13;
Receiver 11, the Ether frame of the first carrying Internet protocol IP message sent for receiving the first virtual machine, institute State carried in the Ether frame of the first bearing IP packet the first source IP address field, the first source MAC address field, First target MAC (Media Access Control) address field and the first purpose IP address field, wherein, the value of the first source IP address field is described the The IP address of one virtual machine, the value of the first source MAC field are the MAC Address of first virtual machine, described first The value of target MAC (Media Access Control) address field is the mark of the second gateway corresponding to the second virtual machine, the first purpose IP address field It is worth for the IP address of second virtual machine;
Processor 12, for by the first source MAC field in the Ether frame of first bearing IP packet Value is revised as the mark of first gateway by the MAC Address of first virtual machine, obtains the ether of the second bearing IP packet Frame;
Transmitter 13, for the mark according to second gateway, the Ether frame of the second bearing IP packet is sent to institute State the second gateway.
Optionally, processor 12 can be also used for:Receiving the first carrying IP reports of the first virtual machine transmission After the Ether frame of text, according to the IP address of the first virtual machine described in the ether frame recording of first bearing IP packet of reception With the corresponding relation of the MAC Address of first virtual machine.
Receiver 11 can be also used for:Receive the first virtual machine send first bearing IP packet Ether frame it Before, the Ether frame for the first carrying ARP request message that first virtual machine is sent is received, described first holds Carry in the Ether frame of ARP request message and carry the second source MAC field, the second target MAC (Media Access Control) address field, the second sender Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address fields and the second target Target MAC Address fields, the value of the 2nd Sender IP address fields is the IP address of first virtual machine, described The value of the value of second source MAC field and the 2nd Sender MAC Address fields is the MAC of first virtual machine Address, the values of the second target Target IP address fields are the IP address of second virtual machine, second purpose The value of MAC Address field is broadcast MAC address, and the value of the 2nd Target MAC Address fields is for unknown Unknow MAC Location;
Processor 12 can be also used for:First according to the ether frame recording of the first of reception the carrying ARP request message The corresponding relation of the MAC Address of the IP address of virtual machine and first virtual machine;
Processor 12 can be also used for:Described second in Ether frame for carrying ARP request message by described first The value of the value of source MAC field and the 2nd Sender MAC Address fields is equal by the MAC Address of first virtual machine The mark of first gateway is revised as, obtains the Ether frame of amended second carrying ARP request message;
Transmitter 13, it can be also used for the Ether frame of the described second carrying ARP request message being broadcast to the second gateway, institute To state the second gateway and be located at second data center's DC networks, first gateway and first virtual machine are located at the first DC networks, Tenant rents first virtual machine and the virtual machine rented in the 2nd DC networks.
Optionally, receiver 13 can be also used for:The Ether frame of described second carrying ARP request message is being broadcast to the After two gateways, the Ether frame for the first carrying arp response message that second gateway is sent, the first carrying ARP are received The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender IP address are carried in the Ether frame of response message Field, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address fields, institute State the 3rd Sender IP address fields value be second virtual machine IP address, the value of the 3rd source MAC field Value with the 3rd Sender MAC Address fields is the mark of second gateway, the 3rd Target IP address The value of field is the IP address of first virtual machine, the value of the 3rd target MAC (Media Access Control) address field and the 3rd Target The value of MAC Address field is the mark of first gateway;
Optionally, processor 12 can be also used for:According to the IP address of first virtual machine prestored with it is described The corresponding relation of the MAC Address of first virtual machine, by the 3rd purpose of the Ether frame of the described first carrying arp response message The value of the value of MAC Address field and the 3rd Target MAC Address fields is revised as institute by the mark of first gateway The MAC Address of the first virtual machine is stated, obtains the Ether frame of the second carrying arp response message;
Transmitter 13 can be also used for:According to the MAC of the IP address of first virtual machine and first virtual machine Location, the Ether frame of the described second carrying arp response message is sent to first virtual machine.
Optionally, receiver 11 can be also used for:Receiving the first carrying IP reports of the first virtual machine transmission Before the Ether frame of text, the ether for the 3rd carrying ARP request message that first virtual machine is sent is received Frame, the described 3rd carries the 4th source MAC field of carrying, the 4th target MAC (Media Access Control) address word in the Ether frame of ARP request message Section, the 4th Sender IP address fields, the 4th Sender MAC Address field, the 4th Target IP address fields and the 4th Target MAC Address fields, the value of the 4th Sender IP address fields is the IP address of first virtual machine, described The value of the value of 4th source MAC field and the 4th Sender MAC Address fields is the MAC of first virtual machine Address, the values of the 4th target Target IP address fields are the IP address of second virtual machine, the 4th purpose The value of MAC Address field is broadcast MAC address, and the value of the 4th Target MAC Address sections is unknown MAC Address;
Optional transmitter 13 can be also used for:The MAC for obtaining second virtual machine is sent to information collection server First request message of address, the IP address of second virtual machine is carried in first request message;
Optionally, receiver 11 can be also used for:Described information acquisition server is received according to described the prestored The first response message that the mark of two gateways and the IP address corresponding relation of second virtual machine return, first response disappear The mark of second gateway is carried in breath;
Optionally, transmitter 13 can be also used for:To first virtual machine send the 4th carrying arp response message with Too frame, the described 4th carries the mark that second gateway is carried in the Ether frame of arp response message, so that described first is virtual The value of the first target MAC (Media Access Control) address field in the Ether frame of first bearing IP packet is filled with second net by machine The mark of pass.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment one and arrive example IV, in fact Existing principle is similar with technique effect, and here is omitted.
Figure 18 is a kind of structural representation of message forward gateway embodiment nine provided by the invention, as shown in figure 18, is connect Receive device 21, processor 22 and transmitter 23;
Receiver 21, the Ether frame of the second carrying Internet protocol IP message sent for receiving the first gateway are described The first source IP address field, the first source MAC address field, are carried in the Ether frame of second bearing IP packet One target MAC (Media Access Control) address field and the first purpose IP address field, the value of the first source IP address field are virtual for described first The IP address of machine, the value of the first source MAC field are the mark of first gateway, first target MAC (Media Access Control) address The value of field is the mark of second gateway corresponding to the second virtual machine, and the value of the first purpose IP address field is described The IP address of second virtual machine;
Processor 22, for the IP address according to second virtual machine prestored and second virtual machine The corresponding relation of MAC Address, by the value of the first target MAC (Media Access Control) address field in the Ether frame of second bearing IP packet by institute The mark for stating the second gateway is revised as the MAC Address of second virtual machine, obtains the Ether frame of the 3rd bearing IP packet;
Transmitter 23, for the IP address according to second virtual machine and the MAC Address of second virtual machine, by institute The Ether frame for stating the 3rd bearing IP packet is sent to second virtual machine.
Optionally, receiver 21, can be also used for:Receiving the second carrying Internet protocol of the first gateway transmission Before the Ether frame of IP messages, receive the second carrying ARP request message that first gateway is sent with Too frame, it is described second carrying ARP request message Ether frame in carry the second source MAC field, the second target MAC (Media Access Control) address word Section, the 2nd Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address fields and Two target Target MAC Address fields, the values of the 2nd Sender IP address fields for first virtual machine IP The value of location, the value of the second source MAC field and the 2nd Sender MAC Address fields is first gateway Mark, the values of the second target Target IP address fields is the IP address of second virtual machine, second purpose The value of MAC Address field is broadcast MAC address;The value of the 2nd Target MAC Address fields is unknown MAC Address;
Transmitter 23, the Ether frame by the described second carrying ARP request message is can be also used for the second data center DC Virtual machine broadcast in network, first gateway and first virtual machine be located at the first DC networks, second gateway with Second virtual machine is located at the 2nd DC networks, and tenant rents first virtual machine and rents the 2nd DC networks In virtual machine.
Optionally, receiver 21, can be also used for by the Ether frame of the described second carrying ARP request message to described the After virtual machine broadcast in two data center's DC networks, the 3rd carrying arp response report that second virtual machine is sent is received The Ether frame of text, the described 3rd carries the 3rd source MAC field of carrying, the MAC of the 3rd mesh in the Ether frame of arp response message Address field, the 3rd Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and 3rd Target MAC Address fields, the value of the 3rd Sender IP address fields are the IP address of second virtual machine, The value of the 3rd source MAC field and the value of the 3rd Sender MAC Address fields are second virtual machine MAC Address, the values of the 3rd Target IP address fields are the IP address of first virtual machine, the MAC of the 3rd mesh The value of the value of address field and the 3rd Target MAC Address fields is the mark of first gateway;
Processor 22, it can be also used for the 3rd source MAC in the Ether frame of the described 3rd carrying arp response message The value of the value of address field and the 3rd Sender MAC Address fields is revised as by the MAC Address of second virtual machine The mark of second gateway, obtain the Ether frame of the first carrying arp response message;
Transmitter 23, it can be also used for the Ether frame of the described first carrying arp response message being sent to first net Close.
Optionally, receiver 21, can be used for receiving the second carrying internet protocol of the first gateway transmission Before the Ether frame for discussing IP messages, the Ether frame for the 4th carrying ARP request message that second virtual machine is sent is received, it is described The 5th source MAC field, the 5th target MAC (Media Access Control) address field, the 5th are carried in the Ether frame of 4th carrying ARP request message Sender MAC Address field, the 5th TargetMAC address fields, the 5th Sender IP address fields and the 5th Target IP address field, the value of the 5th source MAC field and the value of the 5th Sender MAC Address fields are described The MAC Address of second virtual machine, the value of the target MAC (Media Access Control) address field are broadcast MAC address, the 5th Sender IP The value of location field is the IP address of second virtual machine, and the value of the 5th Target IP address fields is empty for described first The IP address of plan machine, the value of the 5th target MAC (Media Access Control) address field is unknown MAC Address;
Optionally, transmitter 21, can be used for the described 5th in the Ether frame of the described 4th carrying ARP request message The value of the value of source MAC field and the 5th Sender MAC Address fields is equal by the MAC Address of second virtual machine It is revised as the mark of second gateway, and sends the 4th message to information collection server, institute is carried in the 4th message The corresponding relation of the mark of the second gateway and the IP address of second virtual machine is stated, so that described information acquisition server records The mark of second gateway and the IP address corresponding relation of second virtual machine.
Optionally, transmitter 23, can be used for receiving the second carrying internet protocol of the first gateway transmission Before the Ether frame for discussing IP messages, the 5th message is sent to information collection server, and it is virtual that second is carried in the 5th message The mark of the corresponding relation of the IP address of second virtual machine described in machine and second gateway, so that described information acquisition server Record the mark of second gateway and the IP address corresponding relation of second virtual machine.
The message forward gateway of the present embodiment can perform above-mentioned message forwarding method embodiment five and arrive embodiment just, in fact Existing principle is similar with technique effect, and here is omitted.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology The scope of scheme.

Claims (20)

  1. A kind of 1. message forwarding method, it is characterised in that including:
    First gateway receives the Ether frame for the first carrying Internet protocol IP message that the first virtual machine is sent, first carrying The first source IP address field, the first source MAC address field, the first purpose are carried in the Ether frame of IP messages MAC Address field and the first purpose IP address field, wherein, the value of the first source IP address field is first virtual machine IP address, the value of the first source MAC field is the MAC Address of first virtual machine, the MAC of first mesh The value of location field is the mark of the second gateway corresponding to the second virtual machine, and the value of the first purpose IP address field is described the The IP address of two virtual machines, first gateway are the gateways of the first data center network, and second gateway is the second data The gateway of central site network;
    First gateway is by the value of the first source MAC field in the Ether frame of first bearing IP packet by institute The MAC Address for stating the first virtual machine is revised as the mark of first gateway, obtains the Ether frame of the second bearing IP packet;
    The Ether frame of second bearing IP packet is sent to described second by first gateway according to the mark of second gateway Gateway.
  2. 2. according to the method for claim 1, it is characterised in that first gateway receives what first virtual machine was sent After the Ether frame of first bearing IP packet, methods described also includes:
    First gateway IP of the first virtual machine according to the ether frame recording of first bearing IP packet of reception The corresponding relation of the MAC Address of location and first virtual machine.
  3. 3. method according to claim 1 or 2, it is characterised in that first gateway receives what the first virtual machine was sent Before the Ether frame of first bearing IP packet, methods described also includes:
    First gateway receives the ether for the first carrying ARP request message that first virtual machine is sent Frame, it is described first carrying ARP request message Ether frame in carry the second source MAC field, the second target MAC (Media Access Control) address word Section, the second sender Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address words Section and the second target Target MAC Address fields, the value of the 2nd Sender IP address fields is first virtual machine IP address, the value of the value of the second source MAC field and the 2nd Sender MAC Address fields is described The MAC Address of one virtual machine, the value of the second target Target IP address fields are the IP address of second virtual machine, The value of the second target MAC (Media Access Control) address field is broadcast MAC address, and the value of the 2nd Target MAC Address fields is unknown Unknow MAC Address;
    The IP of first gateway the first virtual machine according to the ether frame recording of the first of reception the carrying ARP request message The corresponding relation of the MAC Address of location and first virtual machine;
    First gateway carries the second source MAC field in the Ether frame of ARP request message by described first The value of value and the 2nd Sender MAC Address fields is revised as first net by the MAC Address of first virtual machine The mark of pass, obtain the Ether frame of amended second carrying ARP request message;
    The Ether frame of described second carrying ARP request message is broadcast to the second gateway, second gateway by first gateway Positioned at second data center's DC networks, first gateway and first virtual machine are located at the first DC networks, and tenant rents institute State the first virtual machine and the virtual machine rented in the 2nd DC networks.
  4. 4. according to the method for claim 3, it is characterised in that first gateway carries ARP request report by described second The Ether frame of text is broadcast to after the second gateway, and methods described also includes:
    First gateway receives the Ether frame for the first carrying arp response message that second gateway is sent, and described first holds Carry and the 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender are carried in the Ether frame of arp response message IP address field, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address words Section, the values of the 3rd Sender IP address fields are the IP address of second virtual machine, the 3rd source MAC word Section value and the 3rd Sender MAC Address fields value be second gateway mark, the 3rd Target The value of IP address field be first virtual machine IP address, the value and the described 3rd of the 3rd target MAC (Media Access Control) address field The value of Target MAC Address fields is the mark of first gateway;
    First gateway is according to the IP address of first virtual machine prestored and the MAC Address of first virtual machine Corresponding relation, by described first carrying arp response message Ether frame the 3rd target MAC (Media Access Control) address field value and institute The value for stating the 3rd Target MAC Address fields is revised as by the mark of first gateway MAC of first virtual machine Location, obtain the Ether frame of the second carrying arp response message;
    First gateway is according to the IP address of first virtual machine and the MAC Address of first virtual machine, by described The Ether frame of two carrying arp response messages is sent to first virtual machine.
  5. 5. method according to claim 1 or 2, it is characterised in that first gateway receives the first virtual machine hair Before the Ether frame of first bearing IP packet sent, methods described also includes:
    First gateway receives the ether for the 3rd carrying ARP request message that first virtual machine is sent Frame, the described 3rd carries the 4th source MAC field of carrying, the 4th target MAC (Media Access Control) address word in the Ether frame of ARP request message Section, the 4th Sender IP address fields, the 4th Sender MAC Address field, the 4th Target IP address fields and the 4th Target MAC Address fields, the value of the 4th Sender IP address fields is the IP address of first virtual machine, described The value of the value of 4th source MAC field and the 4th Sender MAC Address fields is the MAC of first virtual machine Address, the values of the 4th target Target IP address fields are the IP address of second virtual machine, the 4th purpose The value of MAC Address field is broadcast MAC address, and the value of the 4th Target MAC Address sections is unknown MAC Address;
    The first request that first gateway sends the MAC Address for obtaining second virtual machine to information collection server disappears Cease, the IP address of second virtual machine is carried in first request message;
    First gateway receives described information acquisition server according to the mark of second gateway prestored and described The first response message that the IP address corresponding relation of second virtual machine returns, second net is carried in first response message The mark of pass;
    First gateway sends the Ether frame of the 4th carrying arp response message, the 4th carrying to first virtual machine The mark of second gateway is carried in the Ether frame of arp response message, so that first virtual machine carries described first The value of the first target MAC (Media Access Control) address field in the Ether frame of IP messages is filled with the mark of second gateway.
  6. A kind of 6. message forwarding method, it is characterised in that including:
    Second gateway receives the Ether frame for the second carrying Internet protocol IP message that the first gateway is sent, the second carrying IP The first source IP address field, the first source MAC address field, the MAC of the first mesh are carried in the Ether frame of message Address field and the first purpose IP address field, the value of the first source IP address field are the IP address of the first virtual machine, institute The value for stating the first source MAC field is the mark of first gateway, and the value of the first target MAC (Media Access Control) address field is second The mark of second gateway corresponding to virtual machine, the value of the first purpose IP address field are the IP of second virtual machine Address, first gateway are the gateways of the first data center network, and second gateway is the net of the second data center network Close;
    Second gateway is according to the IP address of second virtual machine prestored and the MAC Address of second virtual machine Corresponding relation, by the value of the first target MAC (Media Access Control) address field in the Ether frame of second bearing IP packet by described second The mark of gateway is revised as the MAC Address of second virtual machine, obtains the Ether frame of the 3rd bearing IP packet;
    Second gateway is according to the IP address of second virtual machine and the MAC Address of second virtual machine, by described The Ether frame of three bearing IP packets is sent to second virtual machine.
  7. 7. according to the method for claim 6, it is characterised in that second gateway receive that the first gateway sends described the Before the Ether frame of two carrying Internet protocol IP messages, methods described also includes:
    Second gateway receives the ether for the second carrying ARP request message that first gateway is sent Frame, it is described second carrying ARP request message Ether frame in carry the second source MAC field, the second target MAC (Media Access Control) address word Section, the 2nd Sender IP address fields, the 2nd Sender MAC Address field, the second target Target IP address fields and Two target Target MAC Address fields, the values of the 2nd Sender IP address fields for first virtual machine IP The value of location, the value of the second source MAC field and the 2nd Sender MAC Address fields is first gateway Mark, the values of the second target Target IP address fields is the IP address of second virtual machine, second purpose The value of MAC Address field is broadcast MAC address;The value of the 2nd Target MAC Address fields is unknown MAC Address;
    Second gateway is virtual into second data center's DC networks by the Ether frame of the described second carrying ARP request message Machine is broadcasted, and first gateway and first virtual machine are located at the first DC networks, second gateway and described second virtual Machine is located at the 2nd DC networks, and tenant rents first virtual machine and the virtual machine rented in the 2nd DC networks.
  8. 8. according to the method for claim 7, it is characterised in that second gateway carries ARP request report by described second After virtual machine broadcast of the Ether frame of text into the second data center DC networks, methods described also includes:
    The Ether frame for the 3rd carrying arp response message that the second gateway reception, second virtual machine is sent, the described 3rd Carry and the 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender are carried in the Ether frame of arp response message IP address field, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address words Section, the values of the 3rd Sender IP address fields are the IP address of second virtual machine, the 3rd source MAC word Section value and the 3rd Sender MAC Address fields value be second virtual machine MAC Address, the described 3rd The value of Target IP address fields is the IP address of first virtual machine, the value of the 3rd target MAC (Media Access Control) address field and institute The value for stating the 3rd Target MAC Address fields is the mark of first gateway;
    Second gateway carries the 3rd source MAC field in the Ether frame of arp response message by the described 3rd The value of value and the 3rd Sender MAC Address fields is revised as second net by the MAC Address of second virtual machine The mark of pass, obtain the Ether frame of the first carrying arp response message;
    The Ether frame of described first carrying arp response message is sent to first gateway by second gateway.
  9. 9. according to the method for claim 6, it is characterised in that second gateway receives the institute that first gateway is sent Before the Ether frame for stating the second carrying Internet protocol IP message, methods described also includes:
    The Ether frame for the 4th carrying ARP request message that the second gateway reception, second virtual machine is sent, the described 4th Carry and the 5th source MAC field, the 5th target MAC (Media Access Control) address field, the 5th Sender are carried in the Ether frame of ARP request message MAC Address field, the 5th Target MAC Address field, the 5th Sender IP address fields and the 5th Target IP address Field, the value of the 5th source MAC field and the value of the 5th Sender MAC Address fields are described second empty The MAC Address of plan machine, the value of the target MAC (Media Access Control) address field are broadcast MAC address, the 5th Sender IP address fields Value be second virtual machine IP address, the values of the 5th Target IP address fields is first virtual machine IP address, the value of the 5th target MAC (Media Access Control) address field is unknown MAC Address;
    Second gateway carries the 5th source MAC field in the Ether frame of ARP request message by the described 4th The value of value and the 5th Sender MAC Address fields is revised as second net by the MAC Address of second virtual machine The mark of pass, and the 4th message is sent to information collection server, the mark of second gateway is carried in the 4th message With the corresponding relation of the IP address of second virtual machine so that described information acquisition server records the mark of second gateway Know the IP address corresponding relation with second virtual machine.
  10. 10. according to the method for claim 6, it is characterised in that second gateway receives what first gateway was sent Before the Ether frame of the second carrying Internet protocol IP message, methods described also includes:
    Second gateway sends the 5th message to information collection server, and second virtual machine is carried in the 5th message MAC Address and second virtual machine IP address corresponding relation, and, the mark of second gateway, so that described Information collection server records the mark of second gateway and the IP address corresponding relation of second virtual machine.
  11. A kind of 11. first gateway, it is characterised in that including:
    First receiving module, the Ether frame of the first carrying Internet protocol IP message sent for receiving the first virtual machine, institute State carried in the Ether frame of the first bearing IP packet the first source IP address field, the first source MAC address field, First target MAC (Media Access Control) address field and the first purpose IP address field, wherein, the value of the first source IP address field is described the The IP address of one virtual machine, the value of the first source MAC field are the MAC Address of first virtual machine, described first The value of target MAC (Media Access Control) address field is the mark of the second gateway corresponding to the second virtual machine, the first purpose IP address field It is the gateway of the first data center network to be worth for the IP address of second virtual machine, first gateway, second gateway It is the gateway of the second data center network;
    First modified module, for by the first source MAC field in the Ether frame of first bearing IP packet Value is revised as the mark of first gateway by the MAC Address of first virtual machine, obtains the ether of the second bearing IP packet Frame;
    First sending module, for the mark according to second gateway, the Ether frame of the second bearing IP packet is sent to institute State the second gateway.
  12. 12. gateway according to claim 11, it is characterised in that the gateway also includes:
    First logging modle, for receive first bearing IP packet that first virtual machine is sent Ether frame it Afterwards, the IP address of the first virtual machine and first void according to the ether frame recording of first bearing IP packet of reception The corresponding relation of the MAC Address of plan machine.
  13. 13. the gateway according to claim 11 or 12, it is characterised in that the gateway also includes:
    Second receiving module, for before the Ether frame for first bearing IP packet that the first virtual machine is sent is received, connecing Receive the Ether frame for the first carrying ARP request message that first virtual machine is sent, the first carrying ARP The second source MAC field, the second target MAC (Media Access Control) address field, the second sender Sender are carried in the Ether frame of request message IP address field, the 2nd Sender MAC Address field, the second target Target IP address fields and the second target Target MAC Address field, the values of the 2nd Sender IP address fields are the IP address of first virtual machine, second source The value of the value of MAC Address field and the 2nd Sender MAC Address fields is the MAC Address of first virtual machine, institute State the second target Target IP address fields value be second virtual machine IP address, the second target MAC (Media Access Control) address word The value of section is broadcast MAC address, and the value of the 2nd Target MAC Address fields is unknown Unknow MAC Address;
    Second logging modle, for the first virtual machine described in the ether frame recording according to the first of reception the carrying ARP request message IP address and first virtual machine MAC Address corresponding relation;
    Second modified module, the second source MAC word in Ether frame for carrying ARP request message by described first The value of section and the value of the 2nd Sender MAC Address fields are revised as described the by the MAC Address of first virtual machine The mark of one gateway, obtain the Ether frame of amended second carrying ARP request message;
    Broadcast module, for the Ether frame of the described second carrying ARP request message to be broadcast into the second gateway, second gateway Positioned at second data center's DC networks, first gateway and first virtual machine are located at the first DC networks, and tenant rents institute State the first virtual machine and the virtual machine rented in the 2nd DC networks.
  14. 14. the gateway according to claim 11 or 12, it is characterised in that the gateway also includes:
    3rd receiving module, for after the Ether frame of the described second carrying ARP request message is broadcast into the second gateway, connecing Receive the Ether frame for the first carrying arp response message that second gateway is sent, the ether of the first carrying arp response message The 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender IP address fields, the 3rd are carried in frame Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address fields, the described 3rd The value of Sender IP address fields is the IP address of second virtual machine, the value of the 3rd source MAC field and described The value of 3rd Sender MAC Address fields is the mark of second gateway, the 3rd Target IP address fields It is worth for the IP address of first virtual machine, the value of the 3rd target MAC (Media Access Control) address field and the 3rd Target MAC The value of location field is the mark of first gateway;
    3rd modified module, for the IP address according to first virtual machine prestored and first virtual machine The corresponding relation of MAC Address, by the 3rd target MAC (Media Access Control) address field of the Ether frame of the described first carrying arp response message Value and the values of the 3rd Target MAC Address fields by the mark of first gateway to be revised as described first virtual The MAC Address of machine, obtain the Ether frame of the second carrying arp response message;
    Second sending module, for the IP address according to first virtual machine and the MAC Address of first virtual machine, by institute The Ether frame for stating the second carrying arp response message is sent to first virtual machine.
  15. 15. the gateway according to claim 11 or 12, it is characterised in that the gateway also includes:
    4th receiving module, for receive first bearing IP packet that first virtual machine is sent Ether frame it Before, the Ether frame for the 3rd carrying ARP request message that first virtual machine is sent is received, the described 3rd holds Carry and the 4th source MAC field, the 4th target MAC (Media Access Control) address field, the 4th Sender are carried in the Ether frame of ARP request message IP address field, the 4th Sender MAC Address field, the 4th Target IP address fields and the 4th Target MAC Address words Section, the values of the 4th Sender IP address fields are the IP address of first virtual machine, the 4th source MAC word Section value and the 4th Sender MAC Address fields value be first virtual machine MAC Address, the 4th mesh The value for marking Target IP address fields is the IP address of second virtual machine, and the value of the 4th target MAC (Media Access Control) address field is Broadcast MAC address, the value of the 4th Target MAC Address sections is unknown MAC Address;
    3rd sending module, please for sending the first of the MAC Address for obtaining second virtual machine to information collection server Message is sought, the IP address of second virtual machine is carried in first request message;
    5th receiving module, for receive described information acquisition server according to the mark of second gateway prestored and The first response message that the IP address corresponding relation of second virtual machine returns, described the is carried in first response message The mark of two gateways;
    4th sending module, for first virtual machine send the 4th carrying arp response message Ether frame, the described 4th Carry and the mark of second gateway is carried in the Ether frame of arp response message, so that first virtual machine is by described first The value of the first target MAC (Media Access Control) address field in the Ether frame of bearing IP packet is filled with the mark of second gateway.
  16. A kind of 16. second gateway, it is characterised in that including:
    First receiving module, the Ether frame of the second carrying Internet protocol IP message sent for receiving the first gateway are described The first source IP address field, the first source MAC address field, are carried in the Ether frame of second bearing IP packet One target MAC (Media Access Control) address field and the first purpose IP address field, the value of the first source IP address field is the first virtual machine IP address, the value of the first source MAC field are the mark of first gateway, the first target MAC (Media Access Control) address field Value be second gateway corresponding to the second virtual machine mark, the value of the first purpose IP address field is described second The IP address of virtual machine, first gateway are the gateways of the first data center network, and second gateway is in the second data The gateway of heart network;
    First modified module, for the IP address according to second virtual machine prestored and second virtual machine The corresponding relation of MAC Address, by the value of the first target MAC (Media Access Control) address field in the Ether frame of second bearing IP packet by institute The mark for stating the second gateway is revised as the MAC Address of second virtual machine, obtains the Ether frame of the 3rd bearing IP packet;
    First sending module, for the IP address according to second virtual machine and the MAC Address of second virtual machine, by institute The Ether frame for stating the 3rd bearing IP packet is sent to second virtual machine.
  17. 17. gateway according to claim 16, it is characterised in that the gateway also includes:
    Second receiving module, for receiving the Ether frame for the second carrying Internet protocol IP message that the first gateway is sent Before, the Ether frame for the second carrying ARP request message that first gateway is sent is received, described second holds Carry in the Ether frame of ARP request message and carry the second source MAC field, the second target MAC (Media Access Control) address field, the 2nd Sender IP address field, the 2nd Sender MAC Address field, the second target Target IP address fields and the second target Target MAC Address field, the values of the 2nd Sender IP address fields are the IP address of first virtual machine, second source The value of the value of MAC Address field and the 2nd Sender MAC Address fields is the mark of first gateway, and described The value of two target Target IP address fields is the IP address of second virtual machine, the second target MAC (Media Access Control) address field It is worth for broadcast MAC address;The value of the 2nd Target MAC Address fields is unknown MAC Address;
    First broadcast module, for carrying the Ether frame of ARP request message by described second into second data center's DC networks Virtual machine broadcast, first gateway and first virtual machine be located at the first DC networks, second gateway and described the Two virtual machines are located at the 2nd DC networks, and tenant rents first virtual machine and the void rented in the 2nd DC networks Plan machine.
  18. 18. gateway according to claim 17, it is characterised in that the gateway also includes:
    3rd receiving module, for by the Ether frame of the described second carrying ARP request message to the second data center DC After virtual machine broadcast in network, the Ether frame for the 3rd carrying arp response message that second virtual machine is sent, institute are received State in the Ether frame of the 3rd carrying arp response message and carry the 3rd source MAC field, the 3rd target MAC (Media Access Control) address field, the 3rd Sender IP address fields, the 3rd Sender MAC Address field, the 3rd Target IP address fields and the 3rd Target MAC Address field, the values of the 3rd Sender IP address fields are the IP address of second virtual machine, the 3rd source The value of the value of MAC Address field and the 3rd Sender MAC Address fields is the MAC Address of second virtual machine, institute The value for stating the 3rd Target IP address fields is the IP address of first virtual machine, the 3rd target MAC (Media Access Control) address field The value of value and the 3rd Target MAC Address fields is the mark of first gateway;
    Second modified module, the 3rd source MAC word in Ether frame for carrying arp response message by the described 3rd The value of section and the value of the 3rd Sender MAC Address fields are revised as described the by the MAC Address of second virtual machine The mark of two gateways, obtain the Ether frame of the first carrying arp response message;
    Second sending module, for the Ether frame of the described first carrying arp response message to be sent into first gateway.
  19. 19. gateway according to claim 16, it is characterised in that the gateway also includes:
    4th receiving module, for receive the second carrying Internet protocol IP message that first gateway sends with Too before frame, the Ether frame for the 4th carrying ARP request message that second virtual machine is sent, the 4th carrying ARP are received The 5th source MAC field, the 5th target MAC (Media Access Control) address field, the 5th Sender MAC are carried in the Ether frame of request message Location field, the 5th Target MAC Address field, the 5th Sender IP address fields and the 5th Target IP address fields, The value of the 5th source MAC field and the value of the 5th Sender MAC Address fields are second virtual machine MAC Address, the value of the target MAC (Media Access Control) address field is broadcast MAC address, and the value of the 5th Sender IP address fields is The IP address of second virtual machine, the value of the 5th Target IP address fields are the IP address of first virtual machine, The value of the 5th target MAC (Media Access Control) address field is unknown MAC Address;
    3rd sending module, the 5th source MAC word in Ether frame for carrying ARP request message by the described 4th The value of section and the value of the 5th Sender MAC Address fields are revised as described the by the MAC Address of second virtual machine The mark of two gateways, and the 4th message is sent to information collection server, carry second gateway in the 4th message The corresponding relation of mark and the IP address of second virtual machine, so that described information acquisition server records second gateway Mark and second virtual machine IP address corresponding relation.
  20. 20. gateway according to claim 16, it is characterised in that the gateway also includes:
    4th sending module, for receive the second carrying Internet protocol IP message that first gateway sends with Too before frame, send the 5th message to information collection server, carried in the 5th message the second virtual machine MAC Address and The corresponding relation of the IP address of second virtual machine, and, the mark of second gateway, so that described information collection service Device records the mark of second gateway and the IP address corresponding relation of second virtual machine.
CN201310074555.6A 2013-03-08 2013-03-08 Message forwarding method and gateway Active CN104038422B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201711000834.2A CN107920020B (en) 2013-03-08 2013-03-08 Message processing method and gateway
CN201310074555.6A CN104038422B (en) 2013-03-08 2013-03-08 Message forwarding method and gateway
PCT/CN2014/072604 WO2014135024A1 (en) 2013-03-08 2014-02-27 Packet forwarding method and gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310074555.6A CN104038422B (en) 2013-03-08 2013-03-08 Message forwarding method and gateway

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201711000834.2A Division CN107920020B (en) 2013-03-08 2013-03-08 Message processing method and gateway

Publications (2)

Publication Number Publication Date
CN104038422A CN104038422A (en) 2014-09-10
CN104038422B true CN104038422B (en) 2017-11-17

Family

ID=51469014

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201310074555.6A Active CN104038422B (en) 2013-03-08 2013-03-08 Message forwarding method and gateway
CN201711000834.2A Active CN107920020B (en) 2013-03-08 2013-03-08 Message processing method and gateway

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201711000834.2A Active CN107920020B (en) 2013-03-08 2013-03-08 Message processing method and gateway

Country Status (2)

Country Link
CN (2) CN104038422B (en)
WO (1) WO2014135024A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102332471B1 (en) 2015-05-08 2021-11-30 삼성전자주식회사 Apparatus and method for synchronization signal detecting
CN108293022B (en) * 2015-12-30 2020-10-09 华为技术有限公司 Method, device and system for transmitting message
CN109495570B (en) * 2018-11-20 2022-04-26 锐捷网络股份有限公司 Method and device for forwarding sampling message and data center
CN110753109B (en) * 2019-10-21 2022-04-29 深信服科技股份有限公司 Gateway interconnection method, gateway device, storage medium and apparatus
CN111385293B (en) * 2020-03-04 2021-06-22 腾讯科技(深圳)有限公司 Network risk detection method and device
CN113922987B (en) * 2021-07-12 2022-12-06 北京北斗弘鹏科技有限公司 Data security transmission method, device, system and storage medium
CN113726658B (en) * 2021-08-09 2022-10-18 中国联合网络通信集团有限公司 Route forwarding method and device
CN116055446B (en) * 2023-01-30 2023-11-17 杭州优云科技有限公司 Cross-network message forwarding method, electronic equipment and machine-readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924707A (en) * 2010-09-27 2010-12-22 杭州华三通信技术有限公司 Method and equipment for processing message of address resolution protocol (ARP)
CN102480420A (en) * 2010-11-29 2012-05-30 北京系统工程研究所 Message sending method as well as message receiving method, device and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7881208B1 (en) * 2001-06-18 2011-02-01 Cisco Technology, Inc. Gateway load balancing protocol
KR100568178B1 (en) * 2003-07-18 2006-04-05 삼성전자주식회사 Gateway unit and control method thereof
US10142218B2 (en) * 2011-01-14 2018-11-27 International Business Machines Corporation Hypervisor routing between networks in a virtual networking environment
EP2482502B1 (en) * 2011-05-24 2017-05-10 Huawei Technologies Co., Ltd. Message handling method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924707A (en) * 2010-09-27 2010-12-22 杭州华三通信技术有限公司 Method and equipment for processing message of address resolution protocol (ARP)
CN102480420A (en) * 2010-11-29 2012-05-30 北京系统工程研究所 Message sending method as well as message receiving method, device and system

Also Published As

Publication number Publication date
WO2014135024A1 (en) 2014-09-12
CN104038422A (en) 2014-09-10
CN107920020B (en) 2021-01-15
CN107920020A (en) 2018-04-17

Similar Documents

Publication Publication Date Title
CN104038422B (en) Message forwarding method and gateway
CN103179228B (en) Internet Protocol address analytic method and fringe node
CN104426681B (en) The distributed multicast of endpoint
US9525563B2 (en) Forwarding packets in an edge device
CN103200209B (en) Access method, cluster server and the member device of member resource
CN104718733B (en) The method and system of packet-based identifier finger URL procotol (ILNP) load balance and Route Selection
CN106464564B (en) Method, system and the computer-readable medium for encapsulating and routing for network packet
CN101488904B (en) Method for GRE tunnel crossing network address translation apparatus and network address translation apparatus
CN103259725B (en) Messaging method and network equipment
TW201737667A (en) Method and device for network load balancing, control, and network interaction
CN105827495B (en) The message forwarding method and equipment of VXLAN gateway
CN108632098A (en) Flow classifier, business route flip-flop, Message processing method and system
CN104243269A (en) Processing method and device of messages in VxLAN (virtual extensible local area network)
US20150089629A1 (en) Network label allocation method, device, and system
CN106612224A (en) Message forwarding method and device applied to VXLAN (Virtual eXtensible LAN)
CN103516542A (en) Network system, and management apparatus and switch thereof
CN101800781A (en) Tunnel transition method and system for passing through NAT
CN107580079A (en) A kind of message transmitting method and device
CN104618243A (en) Routing method, device and system, and gateway scheduling method and device
CN108600074A (en) The retransmission method and device of multicast data message
WO2016186843A1 (en) Automated network peering in a social-network model
CN107547528A (en) IPv6 stateless address distribution method and device
CN109412927A (en) A kind of more VPN data transmission methods, device and the network equipment
CN108199968A (en) Route processing method and device
CN104202398A (en) Remote control method, device and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant