Network Stack and Related Techniques
A system for routing network traffic in a virtual network includes: a first virtual machine executed by a first physical server connected to a physical network and a second virtual machine executed by a second physical server connected to the physical network. A network traffic encoder is executed by the first physical server. The network traffic encoder is configured to: receive network traffic generated by the first virtual machine and addressed to the second virtual machine for transmission over the virtual network; identify the second physical server within which the second virtual machine is executing; append a physical network header to the network traffic that includes a network address of the second physical server; and forward the network traffic onto the physical network to be routed to the second physical server.
1 . A system comprising:
a first virtual machine executed by a first physical server connected to a physical network;
a second virtual machine executed by a second physical server connected to the physical network, wherein the first and second virtual machines are connected to a same virtual network;
a network traffic encoder executed by the first physical server, the network traffic encoder configured to:
receive network traffic generated by the first virtual machine and addressed to the second virtual machine for transmission over the virtual network;
identify the second physical server within which the second virtual machine is executing;
append a physical network header to the network traffic that includes a network address of the second physical server; and
forward the network traffic onto the physical network to be routed to the second physical server.
2 . The system of claim 1 further comprising a network traffic decoder, executed by the second physical server, configured to:
receive the network traffic from the physical network;
determine, by reading a virtual network header from the network traffic, whether the network traffic is addressed to the second virtual machine;
if the network traffic is addressed to the second virtual machine, remove the physical network header from the network traffic and forward the network traffic to the second virtual machine.
3 . The system of claim 1 wherein the first physical server and the second physical server are the same physical server.
4 . The system of claim 1 wherein the network traffic encoder is configured to forward the network traffic to the physical network only if the first virtual machine and the second virtual machine reside on different physical servers.
5 . The system of claim 1 further comprising redundant gateways connected to the physical network between the physical servers.
6 . The system of claim 5 wherein the redundant gateways are organized into a cluster of gateways, the cluster being addressable by a virtual gateway address.
7 . The system of claim 5 wherein the gateways are configured to determine, based on a destination address of the network traffic, whether the destination of the network traffic is an address in the virtual network or an address external to the virtual network.
8 . The system of claim 7 wherein the gateways are further configured to determine, if the destination of the network traffic is external to the virtual network, whether the destination of the network traffic is an address in another virtual network within the system or an address external to the system.
9 . The system of claim 5 wherein the gateways include one or more IP match tables containing addresses of the virtual machines, and wherein the gateways are configured to route the network traffic to one or more of the virtual machines based on entries in the IP match tables.
10 . The system of claim 9 wherein the IP match table is populated, at least in part, by one or more of the physical servers.
11 . The system of claim 1 wherein the physical servers are configured to determine whether a communication session is previously established between the first and second virtual servers.
12 . The system of claim 11 wherein the physical servers are further configured to determine which wire to use to communicate between physical servers based on a state of the communication session.
13 . The system of claim 1 wherein the virtual network is an Ethernet network and at least one of the virtual machines includes an Ethernet interface to connect to the virtual network.
14 . The system of claim 13 wherein the physical network is a non-Ethernet network.
15 . The system of claim 1 wherein the virtual machines are configured to send Ethernet packets over the virtual network, the Ethernet packets including one or more types of networking communication protocols.
16 . The system of claim 15 wherein the one or more types of networking communication protocols includes a non-IP protocol.
17 . A method comprising:
executing a first virtual machine by a first physical server connected to a physical network;
executing a second virtual machine by a second physical server connected to the physical network, wherein the first and second virtual machines are connected to a same virtual network;
executing a network traffic encoder by the first physical server, the network traffic encoder configured to:
receive network traffic generated by the first virtual machine and addressed to the second virtual machine for transmission over the virtual network;
identify the second physical server within which the second virtual machine is executing;
append a physical network header to the network traffic that includes a network address of the second physical server; and
forward the network traffic onto the physical network to be routed to the second physical server.
18 . The method of claim 17 further comprising executing a network traffic decoder by the second physical server, the network traffic decoder configured to:
receive the network traffic from the physical network;
determine, by reading a virtual network header from the network traffic, whether the network traffic is addressed to the second virtual machine;
if the network traffic is addressed to the second virtual machine, remove the physical network header from the network traffic and forward the network traffic to the second virtual machine.
19 . The method of claim 17 wherein the first physical server and the second physical server are the same physical server.
20 . The method of claim 17 wherein the network traffic encoder is configured to forward the network traffic to the physical network only if the first virtual machine and the second virtual machine reside on different physical servers.
21 . The method of claim 17 further comprising routing traffic by redundant gateways connected to the physical network between the physical servers.
22 . The method of claim 21 further comprising organizing the redundant gateways into a cluster of gateways, the cluster being addressable by a virtual gateway address.
23 . The method of claim 21 further comprising determining, by the gateways, based on a destination address of the network traffic, whether the destination of the network traffic is an address in the virtual network or an address external to the virtual network.
24 . The method of claim 23 further comprising determining, by the gateways, if the destination of the network traffic is external to the virtual network, whether the destination of the network traffic is an address in another virtual network within the system or an address external to the system.
25 . The method of claim 21 further comprising routing, by the gateways, the network traffic to one or more of the virtual machines based on entries in one or more IP match tables residing in one or more of the gateways.
26 . The method of claim 25 further comprising populating the IP match tables, at least in part, with information by one or more of the physical servers.
27 . The method of claim 17 further comprising determining, by the physical servers, whether a communication session is previously established between the first and second virtual servers.
28 . The method of claim 27 further comprising determining, by the physical servers, which wire to use to communicate between physical servers based on a state of the communication session.