A virtual switch (vSwitch) is a software program that emulates a layer-2 switch. It has the same functionality as a physical layer-2 switch, with some exceptions. A vSwitch does not learn MAC Addresses from the external network. A vSwitch will not participate in Spanning Tree Protocol (we will cover soon) and a vSwitch cannot create a network loop. We use a vSwitch to provide connectivity between VMs. A vSwitch also will connect to a physical network.
There are two types of vSwitches:
standard: This switch exists on a single type-1 hypervisor
distributed: This switch is spread across 2+ type-1 hypervisors.
We will not focus on distributed vSwitches as this is a complex configuration and I am wanting you to just gain an understanding of what a vSwitch is.
A vSwitch will be made made of many virtual ports that VMs can connect to. A port group provides the ability for us to break up the ports that are available on our vSwitch. A port group provides us the ability to assign VLANs to our traffic. A port group also provides us the ability to apply security rules and traffic shaping policies.
In the demo I create a vSwitch, assign it to a physical interface and then attach a VM to the vSwitch.