I tend to see a lot of System Administrators never really understanding networking in general.  They are more interested in the configuring of their applications like Microsoft Exchange or Citrix Xenapp, the list can go on.  I’m speaking from experience when I say that.  It’s not really a problem till they decide they want to learn VMware vSphere.  I never really understood networking either until I started learning VMware. 

     I recently found myself explaining Virtual Switching to one of my CO-Workers that was just learning VMware, so I figured I’d write a little article on the concept to help others that are just getting into VMware understand it a little better as well.  One of the first concepts that needs to be understood when it comes to a virtual switching is that a virtual switch in vmware is just like a physical dumb switch except it supports something called VLAN tagging by way of vSwitch Port Groups.  Let me explain what I mean in greater detail.  A VLAN is a way networking engineers can create multiple virtual/logical networks on a physical network (e.g. let’s say I have a 24 port switch, I take 12 ports and assign them to VLAN 7 and the other 12 ports and assign them to VLAN 9.  If I were to plug a computer into one of the first 12 ports and a computer into one of the second 12 ports, they wouldn’t be able to talk to each other unless there was a router to route the traffic to each network, but that’s a discussion for another time).  So, now that you somewhat understand the concept of a VLAN, let’s get back to virtual switching. 

     There are different types of virtual switching but the one that I mainly wanted to cover are the ones used for Guest OS VMs, these are called “Virtual Machine” switches.  In vSphere ESX/ESXi 4.1 Update 1 (current newest version) a standard virtual switch can have up to 4088 switch ports.  That’s obviously quite larger than the 24 port physical switch I used as an example.  So, the next logical question is “Why are there so many ports?!?!”.  Well, I’m glad you asked.  Just like every Server or Desktop PC needs a network switch port to get access to the network so does a Guest VM. 

     Let’s say physically your vSphere server has 4 network interface cards in it that we intend to assign for guest VM network traffic (Stay with me here as we make a mental leap!).  What needs to happen is those 4 physical NICs are assigned as uplink ports to a virtual switch.  So in other words the virtual switch has 4088 virtual ports for your guest VMs, but when any of the guest VMs connected to one of those 4088 ports needs to reach something on your physical network the traffic goes over one of those 4 physical uplinks.  I hope that makes sense.  So, where does VLANs come into play?  Like I said earlier VLAN tagging for vSphere is done by what VMware calls Port Groups.  A Port Group is exactly what its name is.  It’s a logical grouping (collection) of ports on the virtual switch.  In other words, we know that a vSwitch has 4088 ports, If I created a port group, by default it would take 128 ports into its own little group.  So, if I assigned VLAN 5 to this group of 128 ports any Guest VM assigned to this port group would be able to send network traffic to any other Guest VM assigned to the same port group.  The concepts explained in this article are an extremely basic configuration.  There’s much more that can be done with Virtual Switching, I just wanted to help new comers understand the basic concept of how virtual switching is used.  I hope that this was able to help someone out there.  Till next time.