Vlan – How vlan and vxlan achieves virtual machine mobility

vlanvxlan

Could you give an example for both of these mechanisms? I understand what vlan/vxlan is but am really confused when mobility kicks in. A vivid example is more than welcome.

Best Answer

To make a VM mobile you want to be able to move it's physical location without changing it's apparent network location.

What that means is that we want to be able to put it on the same virtual Ethernet network regardless of which host machine it is sitting on. As long as a system is generating at least some broadcast traffic the Ethernet switches will quickly figure out it has moved and update their forwarding tables.

In a very small setup we might just put all our VMs on one flat Ethernet network. In such a setup we can migrate the VMs trivially. Downside here is that there is no isolation, every VM can talk directly to every other VM, broadcast traffic flows to all VMs and so-on.

A step up from that is VLANs. we can split our Ethernet network into a number of virtual Ethernet networks. If we can establish a link from any host box into any VLAN then again we can migrate our VM seamlessly. That works ok for moderate scales.

Unfortunately at large scales VLANs start to break down as a solution for decoupling physical and logical topologies. There are less than 4096 usable VLAN tags (not sure offhand how many values are reserved) and Ethernet's Tree structure makes it difficult to build reliable high-bandwidth networks. It is difficult to serve a default gateway IP from multiple locations, so traffic may travel considerable distances in the network before reaching the default gateway (and quite possibly being sent back the way it came)

Which is where VXLAN comes in, VXLAN lets you build virtual Ethernet overlay networks on top of an IP underlay network. It can either be used on it's own in a "learning" mode using IP multicast on the underlay network to carry broadcast unknown and multicast (BUM) traffic for the overlay network or it can be used in conjunction with MP-BGP with vxlan end points advertising MAC addresses and IP addresses for the VXLANs to each other over BGP and simulating a virtual default gateway at each endpoint. Other than needing to support slightly larger frames than normal (sometimes known as "baby jumbos") the underlay network is just a regular IP network.

Furthermore VXLAN is designed to allow scaling of the underlay network using techniques such as link-aggregation and equal cost multipath. To communicate flow information from the underlay network to the overlay network the UDP source port of the outer packet is based on a hash of headers of the inner packet.

VXLAN also allows over 16 million network IDs which should be more than enough even for very large datacenters.