Directing data traffic between intra-server virtual machines

Systems and methods for improving data communications between intra-server virtual machines are described herein. An example method may commence with receiving, from a first virtual machine, a data packet directed to a second virtual machine, routing the data packet via an external routing environment, and receiving the data packet allowed for delivery to the second virtual machine. Based on the receipt, it may be determined that a data flow associated with the data packet is allowed, and a unique identifier of the first virtual machine may be replaced with a first unique identifier and a unique identifier of the second virtual machine may be replaced with a second unique identifier. The first and second unique identifiers may be associated with corresponding interfaces of the intra-server routing module and used to direct the data flow internally within the server between the first virtual machine and the second virtual machine.

TECHNICAL FIELD

The present disclosure relates generally to data processing and, more specifically, to directing data traffic between intra-server virtual machines.

BACKGROUND

The approaches described in this section could be pursued but are not necessarily approaches that have previously been conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.

Conventionally, a virtual environment may include a hypervisor that is responsible for creating and running virtual machines. A system on which the hypervisor is running the virtual machines may be defined as a host or a virtual host. In the virtual environment, the hypervisor or the host can facilitate communications between multiple networks. Each of these networks may have a plurality of virtual machines. Some of these virtual machines may run on the same hypervisor despite being part of different networks.

A virtual machine of one network may attempt to communicate with a virtual machine of another network. Typically, when the first virtual machine sends data packets to the second virtual machine, the data packets need to be routed according to the traditional routing protocol and may involve sending the data packets via an external routing environment, even if both virtual machines are running on the same host. The external routing environment may be responsible for inspecting the data packets and determining, based on some predetermined policies, whether to allow the data packets to be routed between the first virtual machine and the second virtual machine. If the data packets are allowed, the hypervisor may route the data packet between the first virtual machine and the second virtual machine. Similarly, when the second virtual machine replies to the first virtual machine, a response data packet of the second virtual machine may also need to be routed to the external routing environment to determine whether the response data packet is allowed for routing to the first virtual machine. However, routing data packets between two virtual machines hosted by the same server, via an external routing environment, can result in inefficiencies in data communications between these virtual machines. Thus, intra-server data communication between virtual machines associated with different networks may be resource consuming, result in unnecessary utilization of network routing equipment, and limit the network bandwidth.

SUMMARY

Provided are systems and methods for improving data communications between intra-server virtual machines. In one example embodiment, a system for improving data communications between intra-server virtual machines may include a first virtual machine, a second virtual machine, and an intra-server routing module. The first virtual machine and the second virtual machine may be associated with the same server. The first virtual machine may be operable to establish data communications with a plurality of further virtual machines. Similarly, the second virtual machine may be operable to establish data communications with the plurality of further virtual machines. The intra-server routing module may be operable to receive, from the first virtual machine, a data packet directed to the second virtual machine. The data packet may be routed via an external routing environment.

Furthermore, the intra-server routing module may be operable to receive the data packet allowed for delivery to the second virtual machine via the external routing environment. Responsive to the receipt, it may be determined that a data flow associated with the data packet is allowed to be routed between the first virtual machine and the second virtual machine. Based on the determination, a unique identifier of the first virtual machine, in further data packets associated with the data flow, may be replaced with a first unique identifier and a unique identifier of the second virtual machine may be replaced with a second unique identifier. The first and the second unique identifiers may be associated with corresponding interfaces of the intra-server routing module. Subsequently, the data flow may be routed between the first virtual machine and the second virtual machine internally without having to be routed via the external routing environment.

In another example embodiment, a method for improving data communications between intra-server virtual machines may commence with receiving, by an intra-server routing module, from a first virtual machine, a data packet directed to a second virtual machine. The first virtual machine and the second virtual machine may be associated with the same server. The method may further include routing the data packet via an external routing environment. The method may continue with receiving, via the external routing environment, the data packet allowed for delivery to the second virtual machine. In response to the receipt, it may be determined that a data flow associated with the data packet is allowed to be routed between the first virtual machine and the second virtual machine. Based on the determination, a unique identifier of the first virtual machine may be replaced with a first unique identifier and a unique identifier of the second virtual machine may be replaced with a second unique identifier in further data packets associated with the data flow. The first unique identifier and the second unique identifier may be associated with corresponding interfaces of the intra-server routing module.

In further exemplary embodiments, modules, subsystems, or devices can be adapted to perform the recited steps. Other features and exemplary embodiments are described below.

DETAILED DESCRIPTION

The following detailed description includes references to the accompanying drawings, which form a part of the detailed description. The drawings show illustrations in accordance with exemplary embodiments. These exemplary embodiments, which are also referred to herein as “examples,” are described in enough detail to enable those skilled in the art to practice the present subject matter. The embodiments can be combined, other embodiments can be utilized, or structural, logical, and electrical changes can be made without departing from the scope of what is claimed. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope is defined by the appended claims and their equivalents. In this document, the terms “a” and “an” are used, as is common in patent documents, to include one or more than one. In this document, the term “or” is used to refer to a nonexclusive “or,” such that “A or B” includes “A but not B,” “B but not A,” and “A and B,” unless otherwise indicated.

This disclosure provides methods and systems for improving data communications between intra-server virtual machines. This disclosure uses a virtual environment as an example, but it should be understood that the methods and systems discussed herein are equally applicable to a physical environment. In a virtual environment, virtual machines may be associated with multiple networks while running on the same hypervisor or different hypervisors of the same host/server. When one virtual machine of one network communicates with another virtual machine of another network, an intra-server routing module may route data packets between the virtual machines via an external routing environment even though both virtual machines are running on the same host. The external routing environment may be responsible for taking a decision as to whether data packets are allowed for delivery to destination devices based on some predetermined rules. If the external routing environment allows the data packets to be delivered, the external routing environment sends the data packets back to the intra-server routing module for further routing to the intended virtual machine.

The resources of the external network may be limited; therefore each time the data packets are routed via the external routing environment, the efficiency of the data communications between the virtual machines is reduced. Therefore, to increase efficiency of data communications between co-hosted virtual machines associated with different networks, the intra-server routing module may start routing data packets directly between the first virtual machine and the second virtual machine. However, before such direct routing can be established, it needs to be determined whether such routing can be allowed at all. Since enforcement of routing rules is normally lies in the domain of the external routing environment, in order to determine whether such routing is allowed for a data flow associated, the first data packet of the data flow may be still routed using the external routing environment.

More specifically, successful delivery of the first data packet routed via the external routing environment to the second virtual machine is an indication that the data packet is allowed for routing to the second virtual machine. This, in turn, indicates that the whole data flow (also referred to as a network session) associated with the data packet can be allowed between the first virtual machine and the second virtual machine. Upon determination that the data flow is allowed, further data packets associated with the data flow can be sent directly between the first virtual machine and the second virtual machine without leaving the host machine. To implement such direct routing of the data flow, the intra-server routing module may replace a unique identifier, such as, for example, a Media Access Control (MAC) address, of the first virtual machine with a unique identifier of a first interface of the intra-server routing module and replace a unique identifier of the second virtual machine with a unique identifier of a second interface of the intra-server routing module. Subsequently, the data flow may be routed directly between the virtual machines without having to leave the host.

It should be noted that the first virtual machine and the second virtual machine may be oblivious to the fact that the data packets are no longer routed via the external routing environment.

FIG. 1illustrates an environment100within which systems and methods for improving data communications between intra-server virtual machines can be implemented, in accordance with some embodiments. The environment100may include a hypervisor110, a first virtual machine120, a second virtual machine130, an intra-server routing module140, and an external routing environment150.

The hypervisor110may also serve as a host, or a virtual host, operable to run server or client programs. The host may be associated with a server (not shown), i.e. the host can be installed on the host. The server may be a virtual server as well. In case of the virtual server, virtual switches may be used to facilitate intra-server communications. As used herein, a virtual switch can include an intra-server routing module140. The first virtual machine120and the second virtual machine130may be running on the same hypervisor110. The intra-server routing module140may be operable to receive and forward data communications associated with the first virtual machine120and the second virtual machine130.

The external routing environment150may include a virtual module located in a virtual environment or on a physical device be located in a physical environment. The physical environment may be associated with a network160. The network160may include the Internet or any other network capable of communicating data between devices. Suitable networks may include or interface with any one or more of, for example, a local intranet, a Personal Area Network, a Local Area Network, a Wide Area Network, a Metropolitan Area Network, a virtual private network, a storage area network, a frame relay connection, an Advanced Intelligent Network connection, a synchronous optical network connection, a digital T1, T3, E1 or E3 line, Digital Data Service connection, Digital Subscriber Line connection, an Ethernet connection, an Integrated Services Digital Network line, a dial-up port such as a V.90, V.34 or V.34bis analog modem connection, a cable modem, an Asynchronous Transfer Mode connection, or a Fiber Distributed Data Interface or Copper Distributed Data Interface connection. Furthermore, communications may also include links to any of a variety of wireless networks, including Wireless Application Protocol, General Packet Radio Service, Global System for Mobile Communication, Code Division Multiple Access or Time Division Multiple Access, cellular phone networks, Global Positioning System, cellular digital packet data, Research in Motion, Limited duplex paging network, Bluetooth radio, or an IEEE 802.11-based radio frequency network. The network160can further include or interface with any one or more of an RS-232 serial connection, an IEEE-1394 (FireWire) connection, a Fiber Channel connection, an infrared port, a Small Computer Systems Interface connection, a Universal Serial Bus connection or other wired or wireless, digital or analog interface or connection, mesh or Digi® networking. The network160may include a network of data processing nodes that are interconnected for the purpose of data communication.

To establish a network session with the second virtual machine130, the first virtual machine120may send a data packet170to the intra-server routing module140. The intra-server routing module140may be operable to receive the data packet170and send the data packet170via the external routing environment150. The second virtual machine130may respond to the first virtual machine120by sending a data packet180. The intra-server routing module140may receive the data packet180and all further data packets sent between the first virtual machine120and the second virtual machine130and send the received data packet180or further data packets directly to a destination device, either the first virtual machine120or the second virtual machine130.

FIG. 2is a block diagram200illustrating conventional data communications between the first virtual machine120and the second virtual machine130, according to an example embodiment. The first virtual machine120and the second virtual machine130may be associated with different networks. More specifically, a connection210is a connection of the intra-server routing module140with a first network including the first virtual machine120. A connection220is a connection of the intra-server routing module140with a second network including the second virtual machine130.

When the first virtual machine120attempts to communicate with the second virtual machine130by sending a data packet (not shown), the intra-server routing module140may receive the data packet directed to the second virtual machine130and route the data packet via an external routing environment150. The data packet may be sent to the external routing environment150using a connection260between the intra-server routing module140and the external routing environment150. Similarly, when the second virtual machine130replies to the first virtual machine120by sending a response data packet (not shown), the intra-server routing module140may receive the response data packet directed to the first virtual machine120and route the data packet via the external routing environment150using the connection260. Therefore, a data communication230can be established between the external routing environment150and the first virtual machine120using identifiers of the first virtual machine120and identifiers associated with the external routing environment150. The identifiers of the first virtual machine120may include an IP address, for example, 10.0.0.2/24, and a MAC address, for example, 00:00:00:00:00:03. The identifiers of the external routing environment150may include an IP address, for example, 10.0.0.1/24, and a MAC address, for example, 00:00:00:00:00:01, associated with a first interface240of the external routing environment150.

The data communication230may also include a data communication between the external routing environment150and the second virtual machine130using identifiers of the second virtual machine130and the identifiers of the external routing environment150. The identifiers of the second virtual machine130may include an IP address, for example, 20.0.0.2/24, and a MAC address, for example, 00:00:00:00:00:04. The identifiers of the external routing environment150may further include the IP address, for example, 20.0.0.1/24, and the MAC address, for example, 00:00:00:00:00:02, associated with a second interface250of the external routing environment150.

Thus, the data packets cannot be sent directly to a destination device (namely the second virtual machine130for the data packets sent by the first virtual machine120, and the first virtual machine120for the data packets sent by the second virtual machine130), but need to be routed to the external routing environment150for determining whether the data packets are allowed to be routed to the destination device.

FIG. 3is a block diagram300illustrating data communications between the first virtual machine120and the second virtual machine130, according to an example embodiment. The first virtual machine120and the second virtual machine130may run on the same hypervisor110. However, the first virtual machine120and the second virtual machine130may be associated with different networks. The intra-server routing module140may be connected with the first virtual machine120using the connection210and with the second virtual machine130using the connection220.

The first virtual machine120may attempt to communicate with the second virtual machine130by sending a first data packet (not shown) directed the second virtual machine130. The intra-server routing module140may receive the first data packet and route the data packet via an external routing environment150using a connection310between the intra-server routing module140and the external routing environment150. The connection310may be associated with the first interface240of the external routing environment150.

In some embodiments, when the first data packet is a data packet sent by the second virtual machine130to the first virtual machine120, the intra-server routing module140may route the data packet via the external routing environment150using a connection320between the intra-server routing module140and the external routing environment150. The connection320may be associated with the second interface250of the external routing environment150.

If the external routing environment150allows the first data packet to be routed to the second virtual machine130, the intra-server routing module140may send the first data packet to the second virtual machine130. Therefore, the data communication230may be established between the external routing environment150and the first virtual machine120using identifiers of the first virtual machine120and identifiers of the first interface240of the external routing environment150. The data communication230may also include a data communication between the external routing environment150and the second virtual machine130using identifiers of the second virtual machine130and the identifiers of the second interface250of the external routing environment150.

The intra-server routing module140may be operable to analyze data associated with all data communications that pass through the intra-server routing module140and recognize different data flows, for example, by attributing previously established data communications to a data flow. Thus, the intra-server routing module140determines which data flows are allowed by the external routing environment150.

If the data flow between the first virtual machine120and the second virtual machine130is determined to be an allowed data flow, subsequent data packets transmitted between the first virtual machine120and the second virtual machine130may be transmitted directly to a destination device (the second virtual machine130for the data packets sent by the first virtual machine120and the first virtual machine120for the data packets sent by the second virtual machine130) without routing the data packets via the external routing environment150. More specifically, the second virtual machine130may send a further data packet to the first virtual machine120. The further data packet may be received by the intra-server routing module140. The intra-server routing module140may have records showing both the transmission of the first data packet from the first virtual machine120and the receipt of the first data packet by the second virtual machine130. Therefore, the intra-server routing module140may associate the further data packet with the allowed data flow.

Subsequently, instead of forwarding the further data packet to the external routing environment150, the intra-server routing module140may re-write a source MAC address (MAC address of the second virtual machine130) in a packet header, such as, for example, an Ethernet packet header, of the further data packet with the MAC address of the intra-server routing module140. After re-writing the MAC address, intra-server routing module140may pass the further data packet directly to the second virtual machine130without egressing the hypervisor110. Thus, a connection330can be established between the first virtual machine120and the second virtual machine130.

Similarly, when one of further data packets is a data packet sent by the first virtual machine120to the second virtual machine130, the intra-server routing module140may re-write a source MAC address, i.e. a MAC address of the first virtual machine120, in the data header of the data packet with the MAC address of the intra-server routing module140. By establishing the connection330, the network traffic may be offloaded from the interface of the hypervisor110. Additionally, the network traffic may be offloaded from the external routing environment150, thereby preventing network bottlenecks.

In an example embodiment, a network boundary may exist between the first virtual machine120and the second virtual machine130. In this case, network tags associated with the first virtual machine120and the second virtual machine130may also be changed. For example, the first virtual machine120and the second virtual machine130may be associated with different Virtual Local Area Networks (VLANs). Therefore, VLAN tags associated with the first virtual machine120or the second virtual machine130may be re-written. Other examples of network boundaries may include boundaries associated with Virtual Extensible Local Area Networks, Network Virtualization using Generic Routing Encapsulation, and so forth. In further example embodiments, there may be no network boundary between the first virtual machine120and the second virtual machine130.

FIG. 4is a flow chart illustrating a method400for improving data communications between intra-server virtual machines, in accordance with some example embodiments. The method400may commence at operation402with receiving, by an intra-server routing module, from a first virtual machine, a data packet directed to a second virtual machine. The first virtual machine and the second virtual machine may be associated with the same server. In an example embodiment, the first virtual machine and the second virtual machine may be associated with at least one virtual host or at least one hypervisor, which, in turn, may be associated with the server. Furthermore, the first virtual machine may be associated with a first network and the second virtual machine may be associated with a second network.

At operation404, the intra-server routing module may route the data packet via an external routing environment. In example embodiments, the external routing environment may include a virtual routing environment or a physical routing environment. In further example embodiments, the external routing environment may include one or more of the following: a Firewall, an intrusion prevention system, an intrusion detection system, a monitoring device, and so forth.

The intra-server routing module may receive, via the external routing environment, the data packet allowed for delivery to the second virtual machine at operation406. In example embodiments, the data packet may be allowed by the external routing environment for delivery based on a predetermined policy. The predetermined policy may include a routing policy, a security policy, an access policy, and the like.

The method400may continue with operation408at which it may be determined that a data flow associated with the data packet is allowed between the first virtual machine and the second virtual machine. The determination may be made in response to the receipt of the data packet allowed by the external routing environment for delivery to the second virtual machine.

At operation410, based on the determination that the data flow is allowed, a unique identifier of the first virtual machine may be replaced with a first unique identifier and a unique identifier of the second virtual machine may be replaced with a second unique identifier in further data packets associated with the data flow. The first unique identifier and the second unique identifier may be associated with corresponding network interfaces of the intra-server routing module. The unique identifier of the first virtual machine and the unique identifier of the second virtual machine may be replaced in one or more routing tables associated with the intra-server routing module.

In an example embodiment, the unique identifier associated with the first virtual machine may include a MAC address of the first virtual machine. The unique identifier associated with the second virtual machine may include a MAC address of the second virtual machine. The first unique identifier and the second unique identifier may include MAC addresses of interfaces associated with the intra-server routing module.

The method400may continue with directing the data flow between the first virtual machine and the second virtual machine using the first unique identifier and the second unique identifier at operation412. The data flow may be directed internally within the server. In further example embodiments, the routing of the data packet via the external routing environment includes forwarding the data packet to an inline device by the intra-server routing module. The inline device may receive the data packet from the intra-server routing module and forward the data packet to the external routing environment.

The method400may further include inspecting the data communications within the server by a tap sensor. Based on the inspection, the tap sensor may determine that the further data packets are associated with the data packet that is allowed for routing. Based on such determination, the tap sensor may instruct the intra-server routing module to replace the unique identifier of the first virtual machine with the first unique identifier. Furthermore, the tap sensor may instruct the intra-server routing module to replace the unique identifier of the second virtual machine with the second unique identifier. In an example embodiment, the first virtual machine and the second virtual machine may be associated with at least one container described below with reference toFIG. 9. The at least one container may be associated with the server.

FIG. 5is a block diagram showing various modules of a system500for improving data communications between intra-server virtual machines, in accordance with certain embodiments. The system500may comprise a first virtual machine510, a second virtual machine520, an intra-server routing module530, optionally, a tap sensor540, and an inline device550. The first virtual machine510may be operable to establish data communications with a plurality of further virtual machines. The second virtual machine520may be operable to establish the data communications with the plurality of further virtual machines. The first virtual machine510and the second virtual machine520may be associated with a server. Furthermore, the first virtual machine510may be associated with a first network and the second virtual machine520may be associated with a second network.

The intra-server routing module530may be operable to receive, from the first virtual machine510, a data packet directed to the second virtual machine520. Upon receipt of the data packet, the intra-server routing module530may be operable to route the data packet via an external routing environment. The intra-server routing module530may be further operable to receive, via the external routing environment, the data packet for delivery to the second virtual machine520. In response to the receipt of the data packet from the external routing environment, the intra-server routing module530may determine that a data flow associated with the data packet is allowed for routing between the first virtual machine510and the second virtual machine520. In some embodiments, the data packet may be allowed by the external routing environment for delivery based on a predetermined policy. The external routing environment may include a virtual routing environment or a physical routing environment. The external routing environment may include one or more of the following: a Firewall, an intrusion prevention system, an intrusion detection system, and so forth.

Based on the determination that the data flow is allowed, the intra-server routing module530may replace, in further data packets associated with the data flow, a unique identifier of the first virtual machine510with a first unique identifier. Furthermore, the intra-server routing module530may replace a unique identifier of the second virtual machine520with a second unique identifier. The first unique identifier and the second unique identifier may be associated with corresponding network interfaces of the intra-server routing module.

In some example embodiments, the unique identifier of the first virtual machine and the unique identifier of the second virtual machine may be replaced in one or more routing tables associated with the intra-server routing module. In an example embodiment, the unique identifier associated with the first virtual machine510may include a MAC address of the first virtual machine510. The unique identifier associated with the second virtual machine520may include a MAC address of the second virtual machine520. The first unique identifier and the second unique identifier may include MAC addresses associated with the intra-server routing module530.

The intra-server routing module530may be further operable to direct the data flow between the first virtual machine510and the second virtual machine520via the first unique identifier and the second unique identifier associated with corresponding interfaces of the intra-server routing module530. The data flow may be directed internally within the server.

The inline device550of the system500may be operable to receive the data packet from the intra-server routing module and forward the data packet via the external routing environment. The tap sensor540of the system500may be built into the inline device, and the tap sensor540may be operable to inspect the data communications within the server. The tap sensor540may inspect the data packet on its way to its destination. Based on the inspection, the tap sensor540may determine that the further data packets are associated with the data packet are allowed to be routed to their destination. The tap sensor540may be operable to instruct the intra-server routing module to replace the unique identifier associated with the first virtual machine510with the first unique identifier and replace the unique identifier associated with the second virtual machine520with the second unique identifier.

FIG. 6is a block diagram600illustrating data communications between the first virtual machine120and the second virtual machine130using an inline device610connected to an intra-server routing module140, according to an example embodiment. As shown inFIG. 6, an inline device610may be in communication with the intra-server routing module140. In some example embodiments, the inline device610may be placed after the intra-server routing module140, as shown inFIG. 6, or before the intra-server routing module140(not shown). The inline device610may be responsible for receiving a data packet of the first virtual machine120from the intra-server routing module140using a connection620between the inline device610and the intra-server routing module140. The inline device610may forward the data packet to an external routing environment150via a connection630between the inline device610and the external routing environment150. In other embodiments, when the data packet is sent by the second virtual machine130, the inline device610may forward the data packet to the external routing environment150via a connection640between the inline device610and the external routing environment150.

Upon receipt of the data packet from the external routing environment150for further forwarding to a second virtual machine130, the inline device610may determine that a data flow between the first virtual machine120and the second virtual machine130is an allowed data flow. Consequently, the inline device610may replace identifiers in a process similar the one described above with reference to the replacement performed by the intra-server routing module140. More specifically, the inline device610may replace, in further data packets associated with the data flow, a unique identifier of the first virtual machine120with a third unique identifier and replace a unique identifier of the second virtual machine130with a fourth unique identifier. The third unique identifier and the fourth unique identifier may be associated with corresponding interfaces of the inline device610. Therefore, a connection650may be established for forwarding data packets between the first virtual machine120and the second virtual machine130using the inline device610and without ever leaving the hypervisor110.

FIG. 7is a block diagram700illustrating data communications between the first virtual machine and the second virtual machine, according to an example embodiment. The intra-server routing module140may have a tap sensor710. The tap sensor710may be a sensor operable in a tap mode for inspecting data traffic. While in the tap mode, the tap sensor710can receive and monitor a copy of every data packet passing through the intra-server routing module140. The tap sensor710can inform the intra-server routing module140whether an allowed data packet is detected. More specifically, upon detection of the allowed data packet, the tap sensor710may instruct the intra-server routing module140to replace a unique identifier associated with the first virtual machine120with the first unique identifier of the intra-server routing module140. Furthermore, the tap sensor710may instruct the intra-server routing module140to replace a unique identifier associated with the second virtual machine130with the second unique identifier of the intra-server routing module140.

FIG. 8is a block diagram800illustrating data communications between virtual machines associated with different hypervisors, according to an example embodiment. As shown onFIG. 8, the first virtual machine120may run on a first hypervisor shown as a hypervisor805. The second virtual machine130may run on a second hypervisor shown as a hypervisor810. The first virtual machine120and the second virtual machine130may be associated with different networks. The hypervisor805may communicate with an intra-server routing module815via a connection825. The hypervisor810may communicate with an intra-server routing module820via a connection830. The intra-server routing module815and the intra-server routing module820may communicate with a switched environment835via a connection840and a connection845, respectively. More specifically, the intra-server routing module815and the intra-server routing module820may send data packets received from the first virtual machine120or the second virtual machine130to the switched environment835. The switched environment835may route the data packets via an external routing environment150using a connection850if the data packet is received from the first virtual machine120or a connection855is the data packet is received from the second virtual machine130. Thus, a connection860may be established for routing the data packets between the first virtual machine120and the second virtual machine130via the external routing environment150.

Upon receipt of the data packet from the external routing environment150, the switched environment835may determine that the data packet is allowed and, therefore, a data flow between the first virtual machine120and the second virtual machine130is allowed. The switched environment835may further perform an identifier replacement procedure by replacing the identifiers of the first virtual machine120and the second virtual machine130with identifiers of the switched environment835. Thus, a connection870may be established for forwarding the data packets between the first virtual machine120and the second virtual machine130via the switched environment835without sending the data packets via the external routing environment150.

FIG. 9is a block diagram900illustrating data communications between containers associated with an operating system, according to an example embodiment. The block diagram900shows an embodiment for operating system level virtualization in which a kernel of an operating system runs on a hardware node with multiple isolated virtual machines. Such virtual machines of the operating system can be referred to as containers. As shown onFIG. 9, a first container910and a second container915may run on an operating system905. Furthermore, the first container910and the second container915may be associated with different networks. The routing module920may be connected to the first container910using a connection925and to the second container915using a connection930.

The first container910may attempt to communicate with the second container915by sending a data packet directed to the second container915. The routing module920may receive the data packet and route the data packet via an external routing environment150. If the external routing environment150allows the data packet to be sent to the second container915, the routing module920may send the data packet to the second container915. Thus, a data communication935may be established between the external routing environment150and the first container910using identifiers of the first container910and identifiers of the first interface240of the external routing environment150. The data communication935may also include a data communication between the external routing environment150and the second container915using identifiers of the second container915and the identifiers of the second interface250of the external routing environment150.

Once the data flow between the first container910and the second container915is determined as allowed, subsequent data packets of the data flow may be transmitted between the first container910and the second container915using the routing module920without routing the further data packets via the external routing environment150. More specifically, the second container915may send a further data packet to the first container910. The further data packet may be received by the routing module920. The routing module920may associate the further data packet with the allowed data flow between the first container910and the second container915. Instead of forwarding the further data packet to the external routing environment150, the routing module920may re-write a source MAC address (MAC address of the second container915) in a data header of the further data packet with the MAC address of the routing module920. After re-writing the MAC address, the routing module920may pass the further data packet directly to the first container910without leaving the operating system905. Thus, a data communication940may be established between the first container910and the second container915.

Similarly, when one of further data packets is a data packet sent by the first container910to the second container915, the routing module920may re-write a source MAC address, i.e. a MAC address of the first container910, in the header of the data packet with the MAC address of the routing module920.

The computer system1000includes a processor or multiple processors1002, a hard disk drive1004, a main memory1006, and a static memory1008, which communicate with each other via a bus1010. The computer system1000may also include a network interface device1012. The hard disk drive1004may include a computer-readable medium1020, which stores one or more sets of instructions1022embodying or utilized by any one or more of the methodologies or functions described herein. The instructions1022can also reside, completely or at least partially, within the main memory1006and/or within the processors1002during execution thereof by the computer system1000. The main memory1006and the processors1002also constitute machine-readable media.

The exemplary embodiments described herein can be implemented in an operating environment comprising computer-executable instructions (e.g., software) installed on a computer, in hardware, or in a combination of software and hardware. The computer-executable instructions can be written in a computer programming language or can be embodied in firmware logic. If written in a programming language conforming to a recognized standard, such instructions can be executed on a variety of hardware platforms and for interfaces to a variety of operating systems. Although not limited thereto, computer software programs for implementing the present method can be written in any number of suitable programming languages such as, for example, C, Python, JavaScript, Go, or other compilers, assemblers, interpreters or other computer languages or platforms.

Thus, systems and methods for improving data communications between intra-server virtual machines are described. Although embodiments have been described with reference to specific exemplary embodiments, it will be evident that various modifications and changes can be made to these exemplary embodiments without departing from the broader spirit and scope of the present application. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.