Summary of the invention
The object of the present invention is to provide a kind of data transmission method and system, to reduce the consumption of MAC Address, save system resource, reduce the MAC address learning load of switching network equipment, for this reason, the present invention adopts following technical scheme:
A kind of data transmission method, be applied to comprise the system of physical server and switching network equipment, described physical server comprises virtual server and virtual switch, described physical server also comprises media interviews control MAC proxy module, described virtual server disposes the internal mac address corresponding with self Internet protocol IP address, and each virtual LAN VLAN is assigned a MAC Address in same the physical server, store the corresponding relation of IP address and the internal mac address of described virtual server in the described MAC proxy module, and the corresponding relation of the VLAN of described VLAN sign ID and MAC Address, described virtual switch stores the logic port of connection virtual server and the corresponding relation of the internal mac address of the virtual server that is connected, and the method comprises:
When described MAC proxy module receives the message of described virtual switch forwarding, described MAC proxy module is according to the VLAN ID of the VLAN ID that carries in the message and self storage and the corresponding relation of MAC Address, and the source MAC in this message is replaced with the MAC Address corresponding with the VLAN ID that carries in the message;
Message repeating after described MAC proxy module is replaced source MAC is processed this message by described switching network equipment to described switching network equipment;
When described MAC proxy module receives the message of described switching network device forwards, described MAC proxy module is according to the IP address of the purpose IP address of carrying in the message and self storage and the corresponding relation of internal mac address, and the target MAC (Media Access Control) address in this message is replaced with the internal mac address corresponding with the purpose IP address of carrying in the message;
Message repeating after described MAC proxy module is replaced target MAC (Media Access Control) address is to described virtual switch, by the corresponding relation of described virtual switch according to the interior MAC Address of self stored logic port and virtual server, the logic port that determine to connect the purpose virtual server, and by this logic port with this message repeating to the purpose virtual server.
Wherein, also storage study is to the mac address information of other equipment in the described virtual switch, and the outbound port of this mac address information is the logic port that virtual switch connects the MAC proxy module;
Described MAC proxy module receives before the message of described virtual switch forwarding, also comprises:
The source virtual server sends described message to described virtual switch, and the source MAC of described message is the internal mac address of described source virtual server;
Determine that according to the target MAC (Media Access Control) address of described message the outbound port of described message is described virtual switch when connecting the logic port of described MAC proxy module when described virtual switch, described virtual switch is given described MAC proxy module with described message repeating.
Wherein, when purpose virtual server and source virtual server are in same physical server, and when belonging to same VLAN, the MAC Address of the described purpose virtual server that described source virtual server is learnt is the internal mac address of described purpose virtual server;
When the purpose virtual server is in different physical servers from the source virtual server, but when belonging to same VLAN, the MAC Address of the described purpose virtual server that described source virtual server is learnt is MAC Address corresponding to VLAN ID of VLAN under the described purpose virtual server;
When the purpose virtual server belonged to different VLAN from the source virtual server, the MAC Address of the described purpose virtual server that described source virtual server is learnt was the virtual interface MAC Address of switching network equipment.
Wherein, when the target MAC (Media Access Control) address of described message is the MAC Address of the virtual interface of described switching network equipment, or during the MAC Address that the VLAN ID of VLAN is corresponding under the purpose virtual server, described virtual switch determines that the outbound port of described message is the logic port that described virtual switch is connected with described MAC proxy module.
Wherein, the method also comprises:
When the target MAC (Media Access Control) address of described message is the internal mac address of purpose virtual server, described virtual switch is according to the corresponding relation of the internal mac address of the logic port of self storing and virtual server, determine the logic interfacing corresponding to target MAC (Media Access Control) address of described message, and this message is transmitted to described purpose virtual server by this logic interfacing.
A kind of data transmission system, comprise physical server and switching network equipment, described physical server comprises virtual server and virtual switch, described physical server also comprises media interviews control MAC proxy module, described virtual server disposes the internal mac address corresponding with self Internet protocol IP address, and the MAC Address that each virtual LAN VLAN is assigned in physical server, store the corresponding relation of IP address and the internal mac address of described virtual server in the described MAC proxy module, and the corresponding relation of the VLAN of described VLAN sign ID and MAC Address, described virtual switch stores the logic port of connection virtual server and the corresponding relation of the internal mac address of the virtual server that is connected;
Described MAC proxy module is used for, when receiving the message of virtual switch forwarding, according to the VLAN ID that carries in the message and the VLAN ID of self storage and the corresponding relation of MAC Address, source MAC in this message is replaced with the MAC Address corresponding with the VLAN ID that carries in the message, and the message repeating after source MAC replaced is to described switching network equipment; When receiving the message of described switching network device forwards, according to the purpose IP address of carrying in the message and the IP address of self storage and the corresponding relation of internal mac address, target MAC (Media Access Control) address in this message is replaced with the internal mac address corresponding with the purpose IP address of carrying in the message, and the message repeating after target MAC (Media Access Control) address replaced is to described virtual switch;
Described switching network equipment is used for, and the message that the described MAC proxy module that receives sends is processed;
Described virtual switch is used for, and according to the corresponding relation of the interior MAC Address of self stored logic port and virtual server, determines to connect the logic port of purpose virtual server, and by this logic port with this message repeating to the purpose virtual server.
Wherein, also storage study is to the mac address information of other equipment in the described virtual switch, and the outbound port of this mac address information is the logic port that virtual switch connects the MAC proxy module;
Described virtual server also is used for, and sends described message to described virtual switch, and the source MAC of described message is the internal mac address of described source virtual server;
Described virtual switch also is used for, and determines that according to the target MAC (Media Access Control) address of described message the outbound port of described message is described virtual switch when connecting the logic port of described MAC proxy module, gives described MAC proxy module with described message repeating.
Wherein, when purpose virtual server and source virtual server are in same physical server, and when belonging to same VLAN, the MAC Address of the described purpose virtual server that described source virtual server is learnt is the internal mac address of described purpose virtual server;
When the purpose virtual server is in different physical servers from the source virtual server, but when belonging to same VLAN, the MAC Address of the described purpose virtual server that described source virtual server is learnt is MAC Address corresponding to VLAN ID of VLAN under the described purpose virtual server;
When the purpose virtual server belonged to different VLAN from the source virtual server, the MAC Address of the described purpose virtual server that described source virtual server is learnt was the virtual interface MAC Address of switching network equipment.
Wherein, described virtual switch specifically is used for, when the target MAC (Media Access Control) address of described message is the MAC Address of the virtual interface of described switching network equipment, or during the MAC Address that the VLAN ID of VLAN is corresponding under the purpose virtual server, the outbound port of determining described message is the logic port that described virtual switch is connected with described MAC proxy module.
Wherein, described virtual switch also is used for, when the target MAC (Media Access Control) address of described message is the internal mac address of purpose virtual server, according to the logic port of self storage and the corresponding relation of the internal mac address of virtual server, determine the logic interfacing corresponding to target MAC (Media Access Control) address of described message, and this message is transmitted to described purpose virtual server by this logic interfacing.
In the above embodiment of the present invention, for the virtual server configuration internal mac address corresponding with self IP address, virtual server is carried out VLAN divide, for each physical server, for each VLAN applies for and distributes a MAC Address; The MAC proxy module is set in physical server, so that the internal mac address of the virtual server in this physical server and the MAC Address of affiliated VLAN are managed, store the corresponding relation of IP address and the internal mac address of the virtual server in this physical server in this MAC proxy module, and the VLAN ID of the affiliated VLAN of the virtual server in this physical server and the corresponding relation of MAC Address; When the MAC proxy module receives the message of virtual switch forwarding, the MAC proxy module replaces with the MAC Address corresponding to VLAN ID of carrying in the message with the source MAC of this message, and the message repeating after source MAC replaced is processed this message by switching network equipment to switching network equipment; When the MAC proxy module receives the message of switching network device forwards, the MAC proxy module replaces with the internal mac address corresponding with the purpose IP address of this message with the target MAC (Media Access Control) address of this message, and the message after this target MAC (Media Access Control) address replaced sends to virtual switch, by virtual switch with this message repeating to the purpose virtual switch, reduced the consumption of MAC Address, save system resource, reduced the MAC address learning load of switching network equipment.
Embodiment
The technical scheme that provides in order to understand better the embodiment of the invention, the below carries out brief description to two layers of forwarding and the three layers of forwarding process in network of virtual server message in the prior art.
Referring to Fig. 1, in existing virtual running environment, the virtual switch on the physical server provides between the virtual server and the ability to communicate between virtual server and the external network.
System creates a Microsoft Loopback Adapter for each virtual server, the Microsoft Loopback Adapter of each virtual server corresponds on the logic port of virtual switch on the physical server, the port that the physical network card of physical server links to each other with switching network equipment corresponding to virtual switch.Store the MAC address entries of record virtual server MAC Address and virtual switch logic port corresponding relation in the virtual switch.
Virtual server message two layers of forwarding and three layers of forwarding process in network can comprise following several step in the prior art:
1), different virtual servers is divided among the different VLAN IP address of configuration different sub-network section according to different functions;
2), can transmit by directly carrying out Layer 2 data on the virtual switch between the virtual server that belongs to same VLAN on the Same Physical server;
3), the network service between the virtual server that belongs to identical VLAN on the different physical server need to be by the first line of a couplet network interface of virtual switch, carry out Layer 2 data by the double layer network switch of outside and transmit;
4), belong between the virtual server of different VLAN (comprise on the Same Physical server with different physical servers on) network service need to by the first line of a couplet network interface of virtual switch, carry out three layers of routing forwarding by external network multilayer switch/router (being generally the core switch of data center).
In the prior art, on the physical server each virtual server all needs application and distributes MAC Address, if the physical server that connects under the switching network equipment is many, and every physical server fictionalizes tens even up to a hundred virtual servers, two layers of switching network equipment need to be learnt a large amount of MAC address entries so, three layers of switching network equipment need to be learnt a large amount of MAC Address and ARP list item, the MAC address learning load of system resources consumption and switching network equipment is excessive, affects the stability of a system.
For the problems referred to above that prior art exists, the embodiment of the invention provides a kind of technical scheme of transfer of data, is applied to comprise the system of physical server and switching network equipment.In this technical scheme, for virtual server disposes the internal mac address corresponding with self IP address, virtual server is carried out VLAN to be divided, for the application of each VLAN in each physical server and distribute a MAC Address, the MAC Address of the different VLAN of Same Physical server and each VLAN of different physical servers is all not identical; The MAC proxy module is set in physical server, so that the internal mac address of the virtual server in this physical server and the MAC Address of affiliated VLAN are managed, store the corresponding relation of IP address and the internal mac address of the virtual server in this physical server in this MAC proxy module, and the VLAN ID of the affiliated VLAN of the virtual server in this physical server and the corresponding relation of MAC Address; When the MAC proxy module receives the message of virtual switch forwarding, the MAC proxy module replaces with the MAC Address corresponding to VLAN ID of carrying in the message with the source MAC of this message, and the message repeating after source MAC replaced is processed this message by switching network equipment to switching network equipment; When the MAC proxy module receives the message of switching network device forwards, the MAC proxy module replaces with the internal mac address corresponding with the purpose IP address of this message with the target MAC (Media Access Control) address of this message, and the message after this target MAC (Media Access Control) address replaced sends to virtual switch, by virtual switch with this message repeating to the purpose virtual switch.Wherein, store the logic port of connection virtual server and the corresponding relation of the internal mac address of the virtual server that is connected in the virtual switch.
In embodiments of the present invention, only need to apply for and distribute an identical MAC Address owing to belong to the virtual server of identical VLAN, and each virtual switch distributes respectively the internal mac address (can be by the service provider self-defined and distribute in the VLAN, be used at virtual server of a physical server unique identification, do not need to apply for), therefore, reduced the consumption of MAC Address; In addition, need the message outwards transmitted by the MAC proxy module source MAC of message to be replaced with the backward switching network device forwards of MAC Address corresponding to VLAN ID, the message that switching network equipment is transmitted to inside replaces with the backward virtual switch in internal mac address by the MAC proxy module with the target MAC (Media Access Control) address of message and transmits, switching network equipment is carrying out MAC address entries or/and ARP list item when study, only need to learn to be VLAN application under the virtual server and the MAC Address of distributing, reduce the MAC address learning load, saved system resource.
Below in conjunction with the accompanying drawing in the embodiments of the invention, the technical scheme in the embodiments of the invention is carried out clear, complete description, obviously, the embodiments described below only are the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not paying the every other embodiment that obtains under the creative work prerequisite, all belong to the scope of embodiments of the invention protection.
As shown in Figure 2, the schematic flow sheet of a kind of data transmission method that provides for the embodiment of the invention can may further comprise the steps:
Step 201, when the MAC proxy module receives the message that virtual switch transmits, the MAC proxy module replaces with the MAC Address corresponding with the VLAN ID that carries in the message with the source MAC of message.
Concrete, when virtual switch received the message of source virtual server transmission, virtual switch can be according to the target MAC (Media Access Control) address of message and the outbound port corresponding to MAC address entries inquiry of self storage.When virtual switch is determined the outbound port of message is virtual switch with the MAC proxy module is connected logic port, virtual switch with this message repeating to the MAC proxy module.
After the MAC proxy module receives the message of virtual switch forwarding, according to the VLAN ID that carries in this message and the VLAN ID of self storage and the corresponding relation of MAC Address, determine the MAC Address corresponding to VLAN ID of carrying in the message, and the source MAC of this message is replaced with determined MAC Address.Wherein, when the source virtual switch sent message, the source MAC of encapsulated message was the internal mac address of distributing.
Message repeating after step 202, MAC proxy module are replaced source MAC is processed this message by switching network equipment to switching network equipment.
Concrete, the MAC proxy module to switching network equipment, is processed by switching network equipment the message repeating after the source MAC replacement after the message that receives is carried out the source MAC replacement to this message.After switching network equipment receives this message, corresponding MAC address entries can be carried out or/and the study of ARP list item, or directly according to target MAC (Media Access Control) address or the IP address of message message is transmitted, the relevant treatment flow process is similar in its concrete handling process and the prior art, does not repeat them here.
Step 203, when the MAC proxy module receives the message of switching network device forwards, the MAC proxy module replaces with the internal mac address corresponding with the IP address of carrying in the message with the target MAC (Media Access Control) address in the message.
Concrete, in embodiments of the present invention, since the MAC proxy module at the message that the source virtual server is sent before the switching network device forwards, all need the source MAC with message is replaced with the MAC Address of the VLAN under the virtual server of source, therefore, the switching network learning equipment to the MAC Address of source virtual server be the MAC Address of the VLAN under the virtual server of source, the switching network device forwards is generally the MAC Address of VLAN under the purpose virtual server to the target MAC (Media Access Control) address of the message of MAC proxy module.
When the MAC proxy module receives the message of switching network device forwards, for make the virtual switch function with this message repeating to the purpose virtual server, the MAC proxy module needs the target MAC (Media Access Control) address of this message is replaced with the internal mac address of purpose virtual server.Therefore, after the MAC proxy module receives the message of switching network device forwards, can be according to the purpose IP address in this message and the IP address of the virtual server of self storing and the corresponding relation of internal mac address, determine internal mac address corresponding to IP address in this message, and the target MAC (Media Access Control) address of this message is replaced with determined internal mac address.
Message repeating after step 204, MAC proxy module are replaced target MAC (Media Access Control) address is to virtual switch, by virtual switch with this message repeating to the purpose virtual server.
Concrete, after the MAC proxy module carried out the replacement of target MAC (Media Access Control) address to the message that receives, the message repeating after the MAC proxy module is replaced this target MAC (Media Access Control) address was to virtual switch.After virtual switch receives the message of MAC proxy module forwarding, can be according to the corresponding relation of logic port and the internal mac address of the virtual server that is connected of the connection virtual server of self storage (in concrete application, usually store with the form of MAC table), the logic port that inquiry is corresponding with target MAC (Media Access Control) address in the message that receives, and by this logic port with this message repeating to the purpose virtual server.
Below in conjunction with concrete application scenarios the technical scheme that the embodiment of the invention provides is carried out clearer, detailed explanation.
Referring to Fig. 3, the structural representation of the concrete application scenarios of a kind of data transmission method that provides for the embodiment of the invention.Wherein:
(virtual server that function is identical belongs to identical VLAN according to the function of virtual server virtual server to be carried out the VLAN division in advance, the virtual server that function is different belongs to different VLAN), and for each VLAN application with distribute a MAC Address, each virtual server in each VLAN distributes respectively an internal mac address, store the IP address of each virtual server on self place physical server and the corresponding relation of internal mac address in the MAC proxy module, and the VLAN ID of VLAN and the corresponding relation of MAC Address under each virtual server, record the corresponding relation of each logic port and corresponding MAC Address in the MAC address entries of virtual switch.Wherein, the internal mac address of the virtual server in the Same Physical server is different, and the internal mac address of the virtual server of different physical servers can be identical.
In embodiments of the present invention, the message repeating between source virtual server and the purpose virtual server can be divided into following several scene:
(1), source virtual server and purpose virtual server are in the Same Physical server, and belong to identical VLAN;
(2), the source virtual server is in different physical servers with the purpose virtual server, but belongs to identical VLAN;
(3), the source virtual server is in different VLAN with the purpose virtual server.
Wherein, for scene (1), the source virtual server can directly be realized mutually intercommunication by virtual switch with the purpose virtual server; For scene (2), the source virtual server sends to the message of purpose virtual server, need to carry out two layers of forwarding by switching network equipment; For scene (3), the source virtual server sends to the message of purpose virtual server, need to carry out three layers of forwarding by switching network equipment.
In addition, because the message that virtual server sends is before being transmitted to switching network equipment, need to carry out source MAC through the MAC proxy module and replace, therefore, carry out in the learning process of MAC Address (carrying out MAC address learning as example to send the ARP request) at virtual server:
For scene (1), the study relation for the IP address of source virtual server and MAC Address of carrying in the ARP request message that the purpose virtual server receives, the study relation for the IP address of purpose virtual server and MAC Address of carrying in the arp reply message that the source virtual server receives, namely in scene (1), the MAC Address of purpose (source) virtual server that source (purpose) virtual server is learnt is the MAC Address of this purpose (source) virtual server;
For scene (2), the source MAC (MAC Address of source virtual server) of the ARP request message that the source virtual server sends is replaced by the MAC Address of the affiliated VLAN of source virtual server when transmitting through the MAC proxy module, the corresponding relation for the MAC Address of VLAN under virtual server IP address, source and the source virtual server that carries in the ARP request message that the purpose virtual server receives, correspondingly, the source MAC (MAC Address of purpose virtual server) of the arp reply message of purpose virtual server response is replaced by the MAC Address of the affiliated VLAN of purpose virtual server when transmitting through the MAC proxy module, the corresponding relation for the MAC Address of VLAN under purpose virtual server IP address and the purpose virtual server that carries in the arp reply message that the source virtual server receives, namely in scene (2), the MAC Address of purpose (source) virtual server that source (purpose) virtual server is learnt is the MAC Address of the VLAN under this purpose (source) virtual server;
For scene (3), the source MAC (MAC Address of source virtual server) of the ARP request message that the source virtual server sends is replaced by the MAC Address of the affiliated VLAN of source virtual server when transmitting through the MAC proxy module, and through switching network equipment the time, be replaced by the virtual interface MAC Address of switching network equipment, what carry in the ARP request message that the purpose virtual server receives is the corresponding relation of the virtual interface MAC Address of virtual server IP address, source and switching network equipment, correspondingly, the source MAC (MAC Address of purpose virtual server) of the ARP request message of purpose virtual server response is replaced by the MAC Address of the affiliated VLAN of purpose virtual server when transmitting through the MAC proxy module, and through switching network equipment the time, be replaced by the virtual interface MAC Address of switching network equipment, what carry in the arp reply message that the source virtual server receives is the corresponding relation of the virtual interface MAC Address of purpose virtual server IP address and switching network equipment, namely in scene (3), the MAC Address of purpose (source) virtual server that source (purpose) virtual server is learnt is the virtual interface MAC Address of switching network equipment.
Wherein, the relevant treatment mode is similar in the concrete processing mode of the MAC Address of source (purpose) the virtual server aim of learning (source) virtual server and the prior art, does not repeat them here.
The below describes the data transmission technology scheme under scene (1), (2) and (3) respectively.
As shown in Figure 4, the schematic flow sheet of a kind of data transmission method under the scene (1) that provides for the embodiment of the invention, in this embodiment, the source virtual server is the virtual server a among the physical server A
1, the purpose virtual server is the virtual server a among the physical server A
2, virtual server a
1With virtual server a
2Belong to same VLAN, the method flow process can may further comprise the steps:
Step 401, virtual server a
1Send message to virtual switch A, the source MAC of this message is virtual server a
1The internal mac address, target MAC (Media Access Control) address is virtual server a
2The internal mac address.
Step 402, virtual switch are inquired about MAC address entries according to the target MAC (Media Access Control) address of the message that receives, and determine that logic port corresponding to this target MAC (Media Access Control) address is and virtual server a
2The logic port that connects.
Concrete, can record the corresponding relation of the logic port that is connected with virtual server and the internal mac address of the virtual server that is connected in the MAC address entries of virtual switch.Receive the message of virtual server transmission when virtual switch after, according to the target MAC (Media Access Control) address inquiry self MAC list item of this message, to determine the outbound port of this message.
In this embodiment, the target MAC (Media Access Control) address of message is and virtual server a
1Be in the Same Physical server, and belong to the virtual server a of identical VLAN
2The internal mac address, its corresponding outbound port is virtual switch and virtual server a
2The logic port that connects.
Step 403, virtual switch by determined logic port with the message repeating that receives to virtual server a
2
As shown in Figure 5, the schematic flow sheet of a kind of data transmission method under the scene (2) that provides for the embodiment of the invention, in this embodiment, the source virtual server is the virtual server a among the physical server A
1, the purpose virtual server is the virtual server b among the physical server B
1, virtual server a
1With virtual server b
1Belong to same VLAN, the method flow process can may further comprise the steps:
Step 501, virtual server a
1Send message to virtual switch A, the source MAC of this message is virtual server a
1The internal mac address, target MAC (Media Access Control) address is virtual server b
1The MAC Address of affiliated VLAN.
Step 502, virtual switch A inquire about MAC address entries according to the target MAC (Media Access Control) address of the message that receives, and determine the logic port of logic port corresponding to this target MAC (Media Access Control) address for being connected with MAC proxy module A.
Concrete, the MAC address entries of virtual switch also records the logic port that is connected with the MAC proxy module and the corresponding relation of corresponding MAC Address, be that target MAC (Media Access Control) address is that the outbound port of the message of this corresponding MAC Address is the logic port that virtual switch is connected with the MAC proxy module, the MAC Address of VLAN under the virtual interface MAC Address that this corresponding MAC Address can be switching network equipment, purpose virtual server.
In this embodiment, the target MAC (Media Access Control) address of message is and virtual server a
1Be in different physical servers, but belong to the virtual server b of identical VLAN
1The MAC Address of affiliated VLAN, its corresponding outbound port is the logic port that virtual switch is connected with the MAC proxy module.
Step 503, virtual switch A by determined logic interfacing with the message repeating that receives to MAC proxy module A.
Step 504, MAC proxy module A replace with virtual server a with the source MAC of the message that receives
1The MAC Address of affiliated VLAN.
Concrete, after the MAC proxy module receives the message that virtual switch transmits, can be according to the VLAN ID that carries in the message, and the VLAN ID of self storage and the corresponding relation of MAC Address, determine corresponding MAC Address, and the source MAC of this message is replaced with determined MAC Address.
Message repeating after step 505, MAC proxy module A replace source MAC is processed by the message that the switching network equipment interconnection is received to switching network equipment.
Wherein, because the target MAC (Media Access Control) address of the message that the MAC proxy module A that switching network equipment receives transmits is not the virtual interface MAC Address of switching network equipment, therefore, this switching network equipment determines that this message is two layers and E-Packets, the outbound port that can determine this message according to target MAC (Media Access Control) address and the VLAN ID of this message, and then message sent to corresponding physical server from determined outbound port.
Step 506, MAC proxy module B receive the message of switching network device forwards, and the target MAC (Media Access Control) address of message is replaced with virtual server b
1The internal mac address.
Concrete, after the MAC proxy module receives the message of switching network device forwards, can be according to the purpose IP address of message, and the IP address of the virtual server of self storing and the corresponding relation of internal mac address, determine corresponding internal mac address, and the target MAC (Media Access Control) address of message is replaced with determined MAC Address.
Message repeating after step 507, MAC proxy module B replace target MAC (Media Access Control) address is to virtual switch B.
After step 508, virtual switch B receive the message of MAC proxy module forwarding, according to the target MAC (Media Access Control) address inquiry MAC address entries of message, determine that logic port corresponding to this target MAC (Media Access Control) address is and virtual server b
1The logic port that connects.
Step 509, virtual switch B by determined logic port with the message repeating that receives to virtual server b
1
As shown in Figure 6, the schematic flow sheet of a kind of data transmission method under the scene (3) that provides for the embodiment of the invention, in this embodiment, the source virtual server is the virtual server a among the physical server A
1, the purpose virtual server is the virtual server b among the physical server B
2, virtual server a
1With virtual server b
2Belong to different VLAN, the method flow process can may further comprise the steps:
Step 601, virtual server a
1Send message to virtual switch A, the source MAC of this message is virtual server a
1The internal mac address, target MAC (Media Access Control) address is the virtual interface MAC Address of switching network equipment.
Step 602, virtual switch A inquire about MAC address entries according to the target MAC (Media Access Control) address of the message that receives, and determine the logic port of logic port corresponding to this target MAC (Media Access Control) address for being connected with MAC proxy module A.
Concrete, in this embodiment, the target MAC (Media Access Control) address of message is the virtual interface MAC Address of switching network equipment, its corresponding outbound port is the logic port that virtual switch is connected with the MAC proxy module.
Step 603, virtual switch A by determined logic interfacing with the message repeating that receives to MAC proxy module A.
Step 604, MAC proxy module A replace with virtual server a with the source MAC of the message that receives
1The MAC Address of affiliated VLAN.
Message repeating after step 605, MAC proxy module A replace source MAC is processed by the message that the switching network equipment interconnection is received to switching network equipment.
Wherein, because the target MAC (Media Access Control) address of the message that the MAC proxy module A that switching network equipment receives transmits is the virtual interface MAC Address of this switching network equipment, therefore, this switching network equipment determines that this message is three layers and E-Packets, can determine according to the purpose IP address of this message the outbound port of this message, and message is sent to corresponding physical server from determined outbound port.
Step 606, MAC proxy module B receive the message of switching network device forwards, and the target MAC (Media Access Control) address of message is replaced with virtual server b
2The internal mac address.
Message repeating after step 607, MAC proxy module B replace target MAC (Media Access Control) address is to virtual switch B.
After step 608, virtual switch B receive the message of MAC proxy module forwarding, according to the target MAC (Media Access Control) address inquiry MAC address entries of message, determine that logic port corresponding to this target MAC (Media Access Control) address is and virtual server b
2The logic port that connects.
Step 609, virtual switch B by determined logic port with the message repeating that receives to virtual server b
2
As shown in Figure 7, the schematic flow sheet of the another kind of data transmission method under the scene (3) that provides for the embodiment of the invention, in this embodiment, the source virtual server is the virtual server a among the physical server A
1, the purpose virtual server is the virtual server a among the physical server A
3, virtual server a
1With virtual server a
3Belong to different VLAN, the method flow process can may further comprise the steps:
Step 701, virtual server a
1Send message to virtual switch A, the source MAC of this message is virtual server a
1The internal mac address, target MAC (Media Access Control) address is the virtual interface MAC Address of switching network equipment.
Step 702, virtual switch A inquire about MAC address entries according to the target MAC (Media Access Control) address of the message that receives, and determine the logic port of logic port corresponding to this target MAC (Media Access Control) address for being connected with MAC proxy module A.
Step 703, virtual switch A by determined logic interfacing with the message repeating that receives to MAC proxy module A.
Step 704, MAC proxy module A replace with virtual server a with the source MAC of the message that receives
1The MAC Address of affiliated VLAN.
Message repeating after step 705, MAC proxy module A replace source MAC is processed by the message that the switching network equipment interconnection is received to switching network equipment.
Wherein, because the target MAC (Media Access Control) address of the message that the MAC proxy module A that switching network equipment receives transmits is the virtual interface MAC Address of this switching network equipment, therefore, this switching network equipment determines that this message is three layers and E-Packets, can determine according to the purpose IP address of this message the outbound port of this message, and message is sent to corresponding physical server from determined outbound port.
Step 706, MAC proxy module A receive the message of switching network device forwards, and the target MAC (Media Access Control) address of message is replaced with virtual server a
3The internal mac address.
Message repeating after step 707, MAC proxy module A replace target MAC (Media Access Control) address is to virtual switch A.
After step 708, virtual switch A receive the message of MAC proxy module forwarding, according to the target MAC (Media Access Control) address inquiry MAC address entries of message, determine that logic port corresponding to this target MAC (Media Access Control) address is and virtual server a
3The logic port that connects.
Step 709, virtual switch A by determined logic port with the message repeating that receives to virtual server a
3
Can find out by above description, in the technical scheme that the embodiment of the invention provides, for virtual server disposes the internal mac address corresponding with self IP address, virtual server is carried out VLAN divide, for each physical server, for each VLAN application and distribute a MAC Address; The MAC proxy module is set in physical server, so that the internal mac address of the virtual server in this physical server and the MAC Address of affiliated VLAN are managed, store the corresponding relation of IP address and the internal mac address of the virtual server in this physical server in this MAC proxy module, and the VLAN ID of the affiliated VLAN of the virtual server in this physical server and the corresponding relation of MAC Address; When the MAC proxy module receives the message of virtual switch forwarding, the MAC proxy module replaces with the MAC Address corresponding to VLAN ID of carrying in the message with the source MAC of this message, and the message repeating after source MAC replaced is processed this message by switching network equipment to switching network equipment; When the MAC proxy module receives the message of switching network device forwards, the MAC proxy module replaces with the internal mac address corresponding with the purpose IP address of this message with the target MAC (Media Access Control) address of this message, and the message after this target MAC (Media Access Control) address replaced sends to virtual switch, by virtual switch with this message repeating to the purpose virtual switch, reduced the consumption of MAC Address, save system resource, reduced the MAC address learning load of switching network equipment (including but not limited to Layer 2 switch or three-tier switch).
Based on the inventive concept of said method embodiment system, the embodiment of the invention also provides a kind of data transmission system.
As shown in Figure 8, the structural representation of a kind of data transmission system that provides for the embodiment of the invention can comprise:
A kind of data transmission system, comprise physical server 81 and switching network equipment 82, described physical server 81 comprises virtual server 811 and virtual switch 812, described physical server also comprises media interviews control MAC proxy module 813, described virtual server 811 disposes the internal mac address corresponding with self Internet protocol IP address, and the MAC Address that each virtual LAN VLAN is assigned in physical server 81, store the corresponding relation of IP address and the internal mac address of described virtual server in the described MAC proxy module 813, and the corresponding relation of the VLAN of described VLAN sign ID and MAC Address, described virtual switch 812 stores the logic port of connection virtual server and the corresponding relation of the internal mac address of the virtual server that is connected;
Described MAC proxy module 813 is used for, when receiving the message of virtual switch 812 forwardings, according to the VLAN ID that carries in the message and the VLAN ID of self storage and the corresponding relation of MAC Address, source MAC in this message is replaced with the MAC Address corresponding with the VLAN ID that carries in the message, and the message repeating after source MAC replaced is to described switching network equipment 82; When receiving the message of described switching network device forwards, according to the purpose IP address of carrying in the message and the IP address of self storage and the corresponding relation of internal mac address, target MAC (Media Access Control) address in this message is replaced with the internal mac address corresponding with the purpose IP address of carrying in the message, and the message repeating after target MAC (Media Access Control) address replaced is to described virtual switch 812;
Described switching network equipment 82 is used for, and the message that the described MAC proxy module 813 that receives sends is processed;
Described virtual switch 812 is used for, and according to the corresponding relation of the interior MAC Address of self stored logic port and virtual server, determines to connect the logic port of purpose virtual server, and by this logic port with this message repeating to the purpose virtual server.
Wherein, also storage study is to the mac address information of other equipment in the described virtual switch 812, and the outbound port of this mac address information is the logic port that virtual switch 812 connects MAC proxy module 813;
Described virtual server 811 also is used for, and sends described message to described virtual switch, and the source MAC of described message is the internal mac address of described source virtual server;
Described virtual switch 812 also is used for, and determines that according to the target MAC (Media Access Control) address of described message the outbound port of described message is described virtual switch when connecting the logic port of described MAC proxy module 813, gives described MAC proxy module 813 with described message repeating.
Wherein, when purpose virtual server and source virtual server are in same physical server, and when belonging to same VLAN, the MAC Address of the described purpose virtual server that described source virtual server is learnt is the internal mac address of described purpose virtual server;
When the purpose virtual server is in different physical servers from the source virtual server, but when belonging to same VLAN, the MAC Address of the described purpose virtual server that described source virtual server is learnt is MAC Address corresponding to VLAN ID of VLAN under the described purpose virtual server;
When the purpose virtual server belonged to different VLAN from the source virtual server, the MAC Address of the described purpose virtual server that described source virtual server is learnt was the virtual interface MAC Address of switching network equipment.
Wherein, described virtual switch 812 specifically is used for, when the target MAC (Media Access Control) address of described message is the MAC Address of the virtual interface of described switching network equipment 82, or during the MAC Address that the VLAN ID of VLAN is corresponding under the purpose virtual server, the outbound port of determining described message is the logic port that described virtual switch is connected with described MAC proxy module 813.
Wherein, described virtual switch 812 also is used for, when the target MAC (Media Access Control) address of described message is the internal mac address of purpose virtual server, according to the logic port of self storage and the corresponding relation of the internal mac address of virtual server, determine the logic interfacing corresponding to target MAC (Media Access Control) address of described message, and this message is transmitted to described purpose virtual server by this logic interfacing.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of above-described embodiment can be merged into a module, also can further split into a plurality of submodules.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, but the former is better execution mode in a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium, comprise that some instructions are with so that a station terminal equipment (can be mobile phone, personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be looked protection scope of the present invention.