In physical networking space, switches are connected to one or more adjacent switch forming a web of switches which can talk to each other. This web of switches is referred as “neighbourhood of switching”.
Virtual switches (standard or vDS) are connected to these physical switches via physical uplinks. These uplinks are terminating at a particular port of the physical switch and that port itself have some characteristics like a VLAN ID etc defined there. These characteristic values are not exposed to virtual switches by default.
What I mean by this is by just looking at virtual switch diagram in vSphere client, we can’t tell which uplink of vSwitch is connected to which port of physical switch, or what is the make and model of backend physical switch.
Switch discovery protocols allow vSphere administrators to determine which physical switch port is connected to a given vSphere standard switch or vSphere distributed switch. Its make us easy to troubleshooting network connectivity issues means we can quickly find the physical switch Port/IP/VLAN etc.
Both protocols use Ethernet Multicast to advertise and receive information. CDP usess the address 01:00:0C:CC:CC:CC and LLDP uses 01:80:C2:00:00:0E.
Below image gives you an overview of what type of information is presented to vSphere administrator when using discovery protocols.
Type of dicovery protocols
VMware supports 2 types of discovery protocol in order to gather details about physical networking stack to which virtual switches are connected:
1: Cisco Discovery Protocol (CDP): The Cisco Discovery Protocol is a Layer-2 protocol used to obtain, learn and share information and data about other Cisco equipment directly connected nearby. CDP allows vSphere administrators to determine which vSwitch is connected to which cisco port. Also administrators can view properties of the Cisco switch such as software version and device ID. CDP also allows Cisco switches to discover information about vSwitches and ESXi hosts. CDP is available for both standard and distributed switches.
2: Link Layer Discovery Protocol (LLDP): LLDP is a vendor nuetral discovery protocol which helps administrators to gain overview of network topology of non-cisco devices to which vSwitch is connected. LLDP is only available with distributed switches v5.0 or greater. LLDP can be configured on vSS via command line by following the steps outlined here
Discovery protocol operating modes
There are 3 operating modes available for both CDP and LLDP:
- Listen : ESXi detects and displays information about the associated physical switch port, but information about the vSphere distributed switch is not available to the switch administrator.
- Advertise : ESXi makes information about the vSphere distributed switch available to the switch administrator, but does not detect and display information about the physical switch.
- Both : ESXi detects and displays information about the associated physical switch and makes information about the vSphere distributed switch available to the switch administrator.
How to configure CDP/LLDP?
To configure CDP or LLDP, loin to vSphere Web Client and switch to networking view. Select the vDS and navigate to Manage Settings > Properties and click on Edit button.
Select Advanced tab and under Discovery protocol select the appropriate protocol depending upon make and model of backend physical switch.
Also change the operation mode as per your requirement and hit OK.
Managing discover protocols using command line
To view the CDP status for a vSwitch you can run:
# esxcfg-vswitch vSwitch0 -b
To change the mode that CDP is running in you can run:
# esxcfg-vswitch vSwitch0 -B both
To disable CDP on vSwitch0
# esxcli network vswitch standard set -c down -v vSwitch0
# esxcli network vswitch standard set -c both -v vSwitch0
I hope you find this post informational. Feel free to share this on social media if it is worth sharing. Be sociable 🙂