CDP (cdp)
- Layer: L2 (data link)
- Header: variable length
- Notes: L2 control protocols
Reached from
| Lower layer | Selector | Value |
|---|---|---|
snap | pid | 8192 (0x2000) |
Fields
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
version | uint(8) | 2 | CDP protocol version (2). | |
ttl | uint(8) | 180 | Time this advertisement stays valid, in seconds. | |
checksum | uint(16) | Internet checksum over the header and everything after it | Internet checksum over the CDP header and TLVs (Auto). | |
tlvs | tlv — rest of the PDU | CDP TLVs (16-bit type, 16-bit length including the header). |
tlvs
- Type 16 bits, length 16 bits.
- The length counts the type and length fields too.
- Unknown types are kept as raw value octets.
| Type | Name | Value fields | Description |
|---|---|---|---|
| 1 (0x0001) | device_id | ||
| 2 (0x0002) | addresses | ||
| 3 (0x0003) | port_id | ||
| 4 (0x0004) | capabilities | ||
| 5 (0x0005) | software_version | ||
| 6 (0x0006) | platform | ||
| 7 (0x0007) | ip_prefix | ||
| 10 (0x000a) | native_vlan | ||
| 11 (0x000b) | duplex |
Sample templates
- cdp —
templates/protocols/l2/cdp.wpg.yaml