UNIT 2.0: Network Access
2.3 Configure and verify Layer 2 discovery protocols (CDP and LLDP)

Cisco Discovery Protocol (CDP)
CDP is a layer 2 media-independent and network-independent protocol. It is used to learn about neighbor directly connected devices. It is enabled by default. This protocol is cisco proprietary so it cannot be used on other noncisco devices.
How does it work?
CDP packet is just a frame that is sent every couple of default 60 sec seconds across the wire to gain the information. Once the nearby devices receive the CDP packet it responds with all of its information. The default hold timer is 180 seconds i.e. information is stored for 180 seconds and if it doesn't hear back from CDP neighbor in 180 seconds then it will discard that neighbor from its CDP neighbor list.
The information contained in the o Discovery Protocol advertisement (message) varies based on the device and installed version of OS.
Some of the information that CDP can learn includes:
- Cisco IOS version running on Cisco devices.
- Hardware Platform of devices
- Ip addresses of interfaces on the device
- Locally connected device advertising cisco discovery protocol
- Interface active on cisco devices including encapsulation type
- Hostname
- Duplex setting
- Vlan trunking protocol (VTP) domain
- Native VLAN
Link Layer Discovery Protocol(LLDP)
It is similar to CDP but it supports non-cisco devices. LLDP is standard while CDP is a Cisco proprietary protocol. Cisco devices support the IEEE 802.1 ab version of LLDP.
LLDP uses attributes that contain a Type, Length, and Value description. These are called TLV’s (Type Length Value). Devices that support LLDP uses TLV’s to send and receive information to their directly connected neighbor.
LLDP advertisements are sent every 30 seconds and the information is held for 120 seconds. The interface reinitialization delay in LLDP is 2 sec. LLDP is not enabled by default.
Examples:
To verify CDP neighbors on the switch

To configure and verify LLDP neighbors on the switch
