The Link Layer Discovery Protocol (LLDP) is an layer 2 discovery protocol defined in the IEEE 802.1ab. How does it work? The LLDP protocol collects information about local interfaces, sends this information to neighbours, and receives information from the neighbours as well. In short, when the LLDP protocol runs on devices, the NMS can obtain the Layer 2 information about all the devices it connects and the detailed network topology. It does it by searching the layer 2 information in Management Information Base (MIB). NMS uses LLDP management address to identify the device. Trap message is triggered in case when local management address is changed, LLDP is enabled or disabled globally and there are changes on neighbouring devices.
Lets try to configure LLDP based on the following topology:
First of all configure SNMP trap for LLDP:
[Switch]snmp-agent trap enable feature-name lldptrap [Quidway]dis snmp-agent tr feature-name lldptrap all ------------------------------------------------------------------------------ Feature name: LLDPTRAP Trap number : 4 ------------------------------------------------------------------------------ Trap name Default switch status Current switch status lldpRemTablesChange on on hwLldpEnabled on on hwLldpDisabled on on hwLldpLocManIPAddrChange on on
And now turn on traps to be displayed on the screen:
<Switch>terminal monitor Info: Current terminal monitor is on. <Switch>terminal trapping Info: Current Terminal trapping is on.
Enable LLDP globally and look what kind of trap will be displayed:
[Switch]lldp enable Info: Global LLDP is enabled successfully. Nov 27 2012 16:16:37 Quidway LLDP/4/ENABLETRAP:OID: 1.3.6.1.4.1.2011.5.25.134.2.1 Global LLDP is enabled.
Configure LLDP management address:
[Switch]lldp management-address 10.0.0.1 Info: Setting management address successfully. Nov 27 2012 16:18:30 Quidway LLDP/4/ADDCHGTRAP:OID: 1.3.6.1.4.1.2011.5.25.134.2.5 Local management address is changed. (LocManIPAddr=10.0.0.1) [Switch]dis lldp local System information Chassis type :macAddress Chassis ID :286e-d49b-8c72 System name :Switch System description :S3328TP-SI Huawei Versatile Routing Platform Software VRP (R) software,Version 5.70 (S3328 V100R005C00SPC100) Copyright (C) 2003-2010 Huawei Technologies Co., Ltd. System capabilities supported :bridge System capabilities enabled :bridge LLDP Up time :2012/11/27 16:16:37 MED system information Device class :Network Connectivity (MED inventory information of master board) HardwareRev :VER B FirmwareRev :NA SoftwareRev :Version 5.70 V100R005C00SPC100 SerialNum :NA Manufacturer name :HUAWEI TECH CO., LTD Model name :NA Asset tracking identifier :NA System configuration LLDP Status :enabled (default is disabled) LLDP Message Tx Interval :30 (default is 30s) LLDP Message Tx Hold Multiplier :4 (default is 4) LLDP Refresh Delay :2 (default is 2s) LLDP Tx Delay :2 (default is 2s) LLDP Notification Interval :5 (default is 5s) LLDP Notification Enable :enabled (default is disabled) Management Address :IP: 10.0.0.1 Remote Table Statistics: Remote Table Last Change Time :0 days, 0 hours, 50 minutes, 36 seconds Remote Neighbors Added :1 Remote Neighbors Deleted :0 Remote Neighbors Dropped :0 Remote Neighbors Aged :0 Total Neighbors :1 Port information: Interface Ethernet0/0/1: LLDP Enable Status :enabled (default is disabled) Total Neighbors :1 Port ID subtype :interfaceName Port ID :Ethernet0/0/1 Port description :test Port And Protocol VLAN ID(PPVID) don't supported Port VLAN ID(PVID) :1 VLAN name of VLAN 1: VLAN1 Protocol identity :STP RSTP/MSTP LACP EthOAM CFM Auto-negotiation supported :Yes Auto-negotiation enabled :Yes OperMau :speed(100)/duplex(Half) Power port class :'PD PSE power supported :No PSE power enabled :No PSE pairs control ability:No Power pairs :Unknown Port power classification:Unknown Link aggregation supported:Yes Link aggregation enabled :No Aggregation port ID :0 Maximum frame Size :1600 MED port information Media policy type :Unknown Unknown Policy :Yes VLAN tagged :No Media policy VlanID :0 Media policy L2 priority :0 Media policy Dscp :0 Power Type :Unknown PoE PSE power source :Unknown Port PSE Priority :Unknown Port Available power value:0 ... [Switch]dis lldp neighbor Ethernet0/0/1 has 1 neighbors: Neighbor index : 1 Chassis type :macAddress Chassis ID :286e-d49b-8c17 Port ID type :interfaceName Port ID :Ethernet0/0/1 Port description :test System name :labnario System description :S3328TP-SI Huawei Versatile Routing Platform Software VRP (R) software,Version 5.70 (S3328 V100R005C00SPC100) Copyright (C) 2003-2010 Huawei Technologies Co., Ltd. System capabilities supported :bridge System capabilities enabled :bridge Management address type :ipV4 Management address : 172.16.1.1 Expired time :117s Port VLAN ID(PVID) :1 VLAN name of VLAN 1: VLAN1 Protocol identity :STP RSTP/MSTP LACP EthOAM CFM Auto-negotiation supported :Yes Auto-negotiation enabled :No OperMau :speed(100)/duplex(Full) Power port class :'PD PSE power supported :No PSE power enabled :No PSE pairs control ability:No Power pairs :Unknown Port power classification:Unknown Link aggregation supported:Yes Link aggregation enabled :No Aggregation port ID :0 Maximum frame Size :1600 MED Device information Device class :Network Connectivity HardwareRev :VER B FirmwareRev :NA SoftwareRev :Version 5.70 V100R005C00SPC100 SerialNum :NA Manufacturer name :HUAWEI TECH CO., LTD Model name :NA Asset tracking identifier :NA Media policy type :Voice Unknown Policy :'Defined VLAN tagged :Yes Media policy VlanID :0 Media policy L2 priority :6 Media policy Dscp :46 Power Type :Unknown PoE PSE power source :Unknown Port PSE Priority :Unknown Port Available power value:2 Ethernet0/0/2 has 0 neighbors Ethernet0/0/3 has 0 neighbors Ethernet0/0/4 has 0 neighbors Ethernet0/0/5 has 0 neighbors Ethernet0/0/6 has 0 neighbors Ethernet0/0/7 has 0 neighbors Ethernet0/0/8 has 0 neighbors Ethernet0/0/9 has 0 neighbors Ethernet0/0/10 has 0 neighbors Ethernet0/0/11 has 0 neighbors Ethernet0/0/12 has 0 neighbors Ethernet0/0/13 has 0 neighbors Ethernet0/0/14 has 0 neighbors Ethernet0/0/15 has 0 neighbors Ethernet0/0/16 has 0 neighbors Ethernet0/0/17 has 0 neighbors Ethernet0/0/18 has 0 neighbors Ethernet0/0/19 has 0 neighbors Ethernet0/0/20 has 0 neighbors Ethernet0/0/21 has 0 neighbors Ethernet0/0/22 has 0 neighbors Ethernet0/0/23 has 0 neighbors Ethernet0/0/24 has 0 neighbors GigabitEthernet0/0/1 has 0 neighbors GigabitEthernet0/0/2 has 0 neighbors GigabitEthernet0/0/3 has 0 neighbors GigabitEthernet0/0/4 has 0 neighbors
Now change physical parameters of neighbouring interfaces and trap will be send to NMS that LLDP neighbour information is changed:
Nov 27 2012 16:19:26 Quidway SNMP/2/IF_PVCDOWN:OID 1.3.6.1.6.3.1.1.5.3 Interface 4 turned into DOWN state. Nov 27 2012 16:19:26 Quidway SNMP/2/IF_PVCDOWN:OID 1.3.6.1.6.3.1.1.5.3 Interface 32 turned into DOWN state. Nov 27 2012 16:19:26 Quidway LLDP/4/NBRCHGTRAP:OID: 1.0.8802.1.1.2.0.0.1 Neighbor information is changed. (LldpStatsRemTablesInserts=0, LldpStatsRemTablesDeletes=1, LldpStatsRemTablesDrops=0, LldpStatsRemTablesAgeouts=0) Nov 27 2012 16:19:26 Quidway %%01IFNET/4/IF_STATE(l)[6]:Interface Ethernet0/0/1 has turned into DOWN state. Nov 27 2012 16:19:26 Quidway %%01IFNET/4/IF_STATE(l)[7]:Interface Vlanif1 has turned into DOWN state. Nov 27 2012 16:19:26 Quidway %%01IFNET/4/LINKNO_STATE(l)[8]:The line protocol on the interface Vlanif1 has entered the DOWN state. Nov 27 2012 16:19:30 Quidway SNMP/2/IF_PVCUP:OID 1.3.6.1.6.3.1.1.5.4 Interface 4 turned into UP state. Nov 27 2012 16:19:30 Quidway SNMP/2/IF_PVCUP:OID 1.3.6.1.6.3.1.1.5.4 Interface 32 turned into UP state. Nov 27 2012 16:19:30 Quidway SRM/4/PortPhysicalEthHalfDuplexClear:OID 1.3.6.1.4.1.2011.5.25.129.2.5.12 port work at full-duplex state.(EntityPhysicalIndex=4, BaseTrapSeverity=4, BaseTrapProbableCause=1024, BaseTrapEventType=0, EntPhysicalName=Ethernet0/0/1, RelativeResource=interface Ethernet0/0/1) Nov 27 2012 16:19:30 Quidway %%01IFNET/4/IF_STATE(l)[9]:Interface Ethernet0/0/1 has turned into UP state. Nov 27 2012 16:19:30 Quidway %%01IFNET/4/IF_STATE(l)[10]:Interface Vlanif1 has turned into UP state. Nov 27 2012 16:19:30 Quidway %%01IFNET/4/LINKNO_STATE(l)[11]:The line protocol on the interface Vlanif1 has entered the UP state.
We can also display LLDP statistics:
[Switch]dis lldp stat LLDP statistics global Information: Statistics for Ethernet0/0/1: Transmitted Frames Total: 23 Received Frames Total: 19 Frames Discarded Total: 0 Frames Error Total: 0 TLVs Discarded Total: 0 TLVs Unrecognized Total: 0 Neighbors Expired Total: 0
You can also turn on LLDP debugging to follow if LLDP information is exchanged:
<Quidway>debugging lldp all <Quidway>terminal monitor Info: Current terminal monitor is on. <Quidway>terminal debugging Info: Current terminal debugging is on. Nov 27 2012 16:24:25.420.1 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: [LLDP-Evt] [LLDP_SH_CaptureEthPkt] Port 0x00000004 receive a pkt (usTPID: 0x8100, usLenEtype: 0x88cc) Nov 27 2012 16:24:25.420.2 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: [LLDP-Evt] [LLDP_SH_CaptureEthPkt] get vlan(1) cut. Nov 27 2012 16:24:25.420.3 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: [LLDP-Evt] [LLDP_SH_CaptureEthPkt] port 0x00000004 ready to handle lldp pkt. Nov 27 2012 16:24:25.420.4 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: [LLDP-Evt] The port(0x00000004) receive a lldp packet. Nov 27 2012 16:24:25.420.5 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: 01 80 C2 00 00 0E 28 6E D4 9B 8C 17 88 CC 02 07 04 28 6E D4 9B 8C 17 04 0E 05 45 74 68 65 72 6E 65 74 30 2F 30 2F 31 06 02 00 78 08 04 74 65 73 74 0A 08 6C 61 62 6E 61 72 69 6F 0C AB 53 33 33 32 38 54 50 2D 53 49 20 0D 0A 48 75 61 77 65 69 20 56 65 72 73 61 74 69 6C 65 20 52 6F 75 74 69 6E 67 20 50 6C 61 74 66 6F 72 6D 20 53 6F 66 74 77 61 72 65 20 0D 0A 20 56 52 50 20 28 52 29 20 Nov 27 2012 16:24:25.420.6 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: 73 6F 66 74 77 61 72 65 2C 56 65 72 73 69 6F 6E 20 35 2E 37 30 20 28 53 33 33 32 38 20 56 31 30 30 52 30 30 35 43 30 30 53 50 43 31 30 30 29 20 0D 0A 20 43 6F 70 79 72 69 67 68 74 20 28 43 29 20 32 30 30 33 2D 32 30 31 30 20 48 75 61 77 65 69 20 54 65 63 68 6E 6F 6C 6F 67 69 65 73 20 43 6F 2E 2C 20 4C 74 64 2E 0E 04 00 04 00 04 10 1D 05 01 AC 10 01 01 02 00 00 00 22 11 06 0F 2B 06 Nov 27 2012 16:24:25.420.7 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: 01 04 01 8F 5B 05 19 29 01 02 01 01 01 FE 06 00 80 C2 01 00 01 FE 07 00 80 C2 02 00 00 00 FE 0C 00 80 C2 03 00 01 05 56 4C 41 4E 31 FE 10 00 80 C2 04 0B 31 35 30 30 34 32 34 32 33 30 30 FE 10 00 80 C2 04 0B 31 35 30 30 34 32 34 32 33 32 30 FE 0B 00 80 C2 04 06 38 38 30 39 31 31 FE 0A 00 80 C2 04 05 38 38 30 39 33 FE 09 00 80 C2 04 04 38 39 30 32 FE 09 00 12 0F 01 03 A0 3E 00 10 FE Nov 27 2012 16:24:25.420.8 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: 07 00 12 0F 02 00 00 00 FE 09 00 12 0F 03 01 00 00 00 00 FE 06 00 12 0F 04 06 40 FE 07 00 12 BB 01 00 3B 04 FE 08 00 12 BB 02 01 40 01 AE FE 07 00 12 BB 04 80 00 02 FE 0B 00 12 BB 05 56 45 52 20 42 0D 0A FE 05 00 12 BB 06 00 FE 22 00 12 BB 07 56 65 72 73 69 6F 6E 20 35 2E 37 30 20 56 31 30 30 52 30 30 35 43 30 30 53 50 43 31 30 30 FE 05 00 12 BB 08 00 FE 18 00 12 BB 09 48 55 41 57 Nov 27 2012 16:24:25.420.9 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: 45 49 20 54 45 43 48 20 43 4F 2E 2C 20 4C 54 44 FE 05 00 12 BB 0A 00 FE 05 00 12 BB 0B 00 00 00 Nov 27 2012 16:24:25.420.10 Quidway LLDP/7/LLDP Debug:LLDP DEBUG INFO: [LLDP-Evt] This neighour is exist. ifindex[4]
If you want to test it on eNSP, unfortunately I was not able to do it. It looks like LLDP is not supported yet, even the necessary commands are available.