Load balancing over tunnel endpoint groups
Some embodiments provide a method of forwarding data messages between source and destination host computers that execute source and destination machines. At a source computer on which a source machine for a data message flow executes, the method in some embodiments identifies a source tunnel endpoint group (TEPG) associated with the source machine. For the flow, the method selects one TEP of the TEPG as the source TEP. The method then uses the selected source TEP to forward the flow to the destination computer on which the destination machine executes.
1 . A method of forwarding data messages between a source computer and a destination computer, the source computer executing a source machine, the destination computer executing a destination machine, the method comprising:
at the source computer:
identifying, by a first virtual switch of a hypervisor executing in the source computer, a destination tunnel endpoint group (TEPG) associated with the destination machine, the destination TEPG comprising a plurality of tunnel endpoints (TEPs);
identifying, by the first virtual switch, a teaming policy for the destination TEPG, the teaming policy specifying at least one of a source Internet Protocol (IP) address, a destination IP address, a source port, a destination port, or a protocol;
identifying, by the first virtual switch for a flow of the data messages having a source being the source machine and a destination being the destination machine, one tunnel endpoint (TEP) of the plurality of TEPs as a destination TEP from the destination TEPG based on a hash of parameters in the flow as specified by the teaming policy;
forwarding, by the first virtual switch, the flow from an uplink port of the virtual switch;
encapsulating, by a callback to the hypervisor from the uplink port of the first virtual switch, the data messages of the flow with encapsulating headers that store a first identifier identifying the destination TEP and a second identifier for the destination TEPG;
forwarding the data messages as encapsulated to the destination TEP; and
at the destination computer:
receiving the data messages at a selected uplink port of a second virtual switch executing in the destination computer that is selected based on the destination TEP and the destination TEPG as identified in the encapsulating headers.
2 . The method of claim 1 , wherein the flow is a first flow, and identifying the destination TEPG and the destination TEP comprises retrieving identifiers for the destination TEPG and destination TEP from a connection tracking record created by the source computer for a second flow sent from the destination machine to the source machine, the first flow being responsive to the second flow.
3 . The method of claim 1 further comprising
identifying a source TEPG associated with the source machine; and
identifying, for the flow, a TEP of the source TEPG as the source TEP;
wherein the encapsulating headers include additional identifiers for the source TEPG and the source TEP.
4 . The method of claim 3 , wherein the source and destination TEPGs and TEPs are for the destination computer to use to identify the source and destination TEPGs and TEPs of the data messages of the flow.
5 . The method of claim 3 , wherein the identifiers include network addresses associated with the source and destination TEPs.
6 . The method of claim 3 , wherein the identifiers are not L2, L3 and L4 addresses associated with the source and destination TEPs.
7 . The method of claim 1 , wherein the source computer has a plurality of physical network interface controllers (PNICs) associated with a plurality of TEPs of a source TEPG of the source computer, the method further comprising:
identifying the source TEPG that is associated with the source machine and the source computer;
identifying, for the flow, a TEP of the source TEPG as the source TEP,
wherein forwarding the encapsulated data messages comprises forwarding the encapsulated data messages through a PNIC associated with the selected source TEP.
8 . A method of forwarding data messages between source and destination devices, the method comprising:
at the source device:
identifying, by a first virtual switch of a hypervisor executing in the source device, a source tunnel endpoint group (TEPG) and a destination TEPG associated with the flow, each of the source TEPG and the destination TEPG comprising a plurality of tunnel endpoints (TEPs);
identifying, by the first virtual switch, a first teaming policy for the destination TEPG, the first teaming policy specifying at least one of a source Internet Protocol (IP) address, a destination IP address, a source port, a destination port, or a protocol;
selecting, by the first virtual switch for a flow of the data messages having a source being the source device and a destination being the destination device, a tunnel endpoint (TEP) from the source TEPG as a source TEP;
selecting, by the first virtual switch for the flow, a TEP from the destination TEPG as a destination TEP based on a hash of parameters in the flow as specified by the first teaming policy;
forwarding, by the first virtual switch, the flow from an uplink port of the virtual switch;
encapsulating, by a callback to the hypervisor from the uplink port of the first virtual switch, the data messages of the flow with encapsulating headers that store first and second identifiers identifying source and destination TEPs;
forwarding the data messages as encapsulated to the destination TEP; and
at the destination device:
receiving the data messages at a selected uplink port of a second virtual switch executing in the destination device that is selected based on the destination TEP.
9 . The method of claim 8 , wherein the source device has a plurality of physical network interface controllers (PNICs) associated with the plurality of TEPs of the source TEPG, and wherein forwarding the data messages comprises forwarding the data messages through a PNIC of the plurality of PNICs associated with the source TEP.
10 . The method of claim 8 , wherein the identifiers include network addresses associated with the source and destination TEPs.
11 . The method of claim 8 , wherein the identifiers are not L2, L3 and L4 addresses associated with the source and destination TEPs.