Things I'd do if I ever have time

Wish list

Please help a man further his career by donating expensive hardware. Cash works too.



Cisco Discovery Protocol (CDP)

Published: 01/07/2010

Reference trace files:

cisco_default_2950_cdp_version_2.cap
cisco_default_2950_cdp_version_1.cap

Cisco devices uses a device informational messaging protocol operating at layer 2 to let their directly-connected neighbors know who and what they are. Once every 60 seconds by default, a CDP frame is sent out of each Ethernet interface to its physically connected peer. This lets peers know what kind of devices they are, which IOS version it's running, the connected port number , etc..

CDP includes the following information relayed to peers (items in blue represent fields not in version 1 of the protocol):


Cisco Discovery Protocol
    Version: 2
    TTL: 180 seconds
    Checksum: 0x6204 [correct]
        [Good: True]
        [Bad : False]
    Device ID: MySwitch01
        Type: Device ID (0x0001)
        Length: 14
        Device ID: MySwitch01
    Addresses
        Type: Addresses (0x0002)
        Length: 17
        Number of addresses: 1
        IP address: 0.0.0.0
            Protocol type: NLPID
            Protocol length: 1
            Protocol: IP
            Address length: 4
            IP address: 0.0.0.0
    Port ID: FastEthernet0/1
        Type: Port ID (0x0003)
        Length: 19
        Sent through Interface: FastEthernet0/1
    Capabilities
        Type: Capabilities (0x0004)
        Length: 8
        Capabilities: 0x00000028
            .... .... .... .... .... .... .... ...0 = Not a Router
            .... .... .... .... .... .... .... ..0. = Not a Transparent Bridge
            .... .... .... .... .... .... .... .0.. = Not a Source Route Bridge
            .... .... .... .... .... .... .... 1... = Is  a Switch
            .... .... .... .... .... .... ...0 .... = Not a Host
            .... .... .... .... .... .... ..1. .... = Is  IGMP capable
            .... .... .... .... .... .... .0.. .... = Not a Repeater
    Software Version
        Type: Software version (0x0005)
        Length: 277
        Software Version: Cisco Internetwork Operating System Software 
                          IOS (tm) C2950 Software (C2950-I6K2L2Q4-M), 
                          Version 12.1(22)EA13, RELEASE SOFTWARE (fc2)
                          Technical Support: http://www.cisco.com/techsupport
                          Copyright (c) 1986-2009 by cisco Systems, Inc.
                          Compiled Fri 27-Feb-09 22:20 by amvarma
    Platform: cisco WS-C2950T-24
        Type: Platform (0x0006)
        Length: 22
        Platform: cisco WS-C2950T-24
    Protocol Hello: Cluster Management
        Type: Protocol Hello (0x0008)
        Length: 36
        OUI: 0x00000C (Cisco)
        Protocol ID: 0x0112 (Cluster Management)
        Cluster Master IP: 0.0.0.0
        UNKNOWN (IP?): 0xFFFFFFFF (255.255.255.255)
        Version?: 0x01
        Sub Version?: 0x02
        Status?: 0x21
        UNKNOWN: 0xFF
        Cluster Commander MAC: 00:00:00:00:00:00
        Switch's MAC: 00:0e:84:cb:c7:c0
        UNKNOWN: 0xFF
        Management VLAN: 0
    VTP Management Domain: ACME_Lab
        Type: VTP Management Domain (0x0009)
        Length: 12
        VTP Management Domain: ACME_Lab
    Native VLAN: 1
        Type: Native VLAN (0x000a)
        Length: 6
        Native VLAN: 1
    Duplex: Full
        Type: Duplex (0x000b)
        Length: 5
        Duplex: Full
    Trust Bitmap: 0x00
        Type: Trust Bitmap (0x0012)
        Length: 5
        Trust Bitmap: 00
    Untrusted port CoS: 0x00
        Type: Untrusted Port CoS (0x0013)
        Length: 5
        Untrusted port CoS: 00
    Management Addresses
        Type: Management Address (0x0016)
        Length: 17
        Number of addresses: 1
        IP address: 0.0.0.0
            Protocol type: NLPID
            Protocol length: 1
            Protocol: IP
            Address length: 4
            IP address: 0.0.0.0


This shows CDP advertises its configured hostname (MySwitch01), the port it's coming from (FastEthernet0/1), the fact that it's a switch (as opposed to a router), the IOS version (12.1(22)EA13), the hardware model (WS-C2950T-24), the VTP domain (ACME_Lab), etc..

Version 2 of this protocol is currently the default on Cisco 2950 switches, although version 1 can be used instead by using the no cdp advertise-v2 command.


Cisco Discovery Protocol
    Version: 1
    TTL: 180 seconds
    Checksum: 0x891c [correct]
        [Good: True]
        [Bad : False]
    Device ID: MySwitch01
        Type: Device ID (0x0001)
        Length: 14
        Device ID: MySwitch01
    Addresses
        Type: Addresses (0x0002)
        Length: 17
        Number of addresses: 1
        IP address: 0.0.0.0
            Protocol type: NLPID
            Protocol length: 1
            Protocol: IP
            Address length: 4
            IP address: 0.0.0.0
    Port ID: FastEthernet0/1
        Type: Port ID (0x0003)
        Length: 19
        Sent through Interface: FastEthernet0/1
    Capabilities
        Type: Capabilities (0x0004)
        Length: 8
        Capabilities: 0x00000028
            .... .... .... .... .... .... .... ...0 = Not a Router
            .... .... .... .... .... .... .... ..0. = Not a Transparent Bridge
            .... .... .... .... .... .... .... .0.. = Not a Source Route Bridge
            .... .... .... .... .... .... .... 1... = Is  a Switch
            .... .... .... .... .... .... ...0 .... = Not a Host
            .... .... .... .... .... .... ..1. .... = Is  IGMP capable
            .... .... .... .... .... .... .0.. .... = Not a Repeater
    Software Version
        Type: Software version (0x0005)
        Length: 277
        Software Version: Cisco Internetwork Operating System Software 
                          IOS (tm) C2950 Software (C2950-I6K2L2Q4-M), 
                          Version 12.1(22)EA13, RELEASE SOFTWARE (fc2)
                          Technical Support: http://www.cisco.com/techsupport
                          Copyright (c) 1986-2009 by cisco Systems, Inc.
                          Compiled Fri 27-Feb-09 22:20 by amvarma
    Platform: cisco WS-C2950T-24
        Type: Platform (0x0006)
        Length: 22
        Platform: cisco WS-C2950T-24


CDP neighbors remember these values for a length of time based on the TTL (180 seconds by default). Some common commands to keep track of CDP status are:

show cdp neighbors detail

show cdp entry *

show cdp traffic

show cdp interface <interface>


There may be cases where having CDP enabled on a switch or a particular interface may not be a wise idea. For example, if an interface is directly connected to the outside world (such as your ISP upstream connection), you may want to disable it. To disable it globally on the switch, use no cdp run. For a specific interface, use the no cdp enable command.



Go back to the main articles list.