No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

How to correlate LLDP port information with other port information using SNMP OIDs ?

Publication Date:  2019-02-28 Views:  121 Downloads:  0

Issue Description

Customer had a few S5720-52X-PWR-LI-AC stacks composed of two S5720-52X-PWR-LI-AC switches and he wanted to read some information over SNMP.
He needed to read and display LLDP information from switch using SNMP. But they cannot correlate LLDP port information with other port information from current displays.

In his case the switch showed following LLDP neighbor information on command line:
--------------------------------------------------
<switch>display lldp neighbor brief 
Local Intf    Neighbor Dev             Neighbor Intf             Exptime(s)
GE0/0/3       -                        94c6-911f-5394            2688   
GE0/0/39      ap-ap2-og2-sa-01         GE0/0/0                   105    
GE0/0/40      ap-ap2-og2-sa-02         GE0/0/0                   111    
GE0/0/41      ap-ap2-og1-sa-06         GE0/0/0                   90     
GE0/0/42      ap-ap2-og1-sa-05         GE0/0/0                   119    
XGE0/0/1      sw-ap1-ug2-vr01-01       XGE2/0/24                 114    
GE1/0/1       -                        a0d3-c121-e158            3401   
GE1/0/39      ap-ap2-og1-sa-03         GE0/0/0                   98     
GE1/0/40      ap-ap2-og1-sa-02         GE0/0/0                   101    
--------------------------------------------------

SNMP output of IF-MIB::ifDescr displays following table:
--------------------------------------------------
IF-MIB::ifDescr.1 InLoopBack0
IF-MIB::ifDescr.2 NULL0
IF-MIB::ifDescr.3 Console9/0/0
IF-MIB::ifDescr.4 Vlanif1
IF-MIB::ifDescr.5 GigabitEthernet0/0/1
IF-MIB::ifDescr.6 GigabitEthernet0/0/2
...
IF-MIB::ifDescr.51 GigabitEthernet0/0/47
IF-MIB::ifDescr.52 GigabitEthernet0/0/48
IF-MIB::ifDescr.53 XGigabitEthernet0/0/1
IF-MIB::ifDescr.54 XGigabitEthernet0/0/2
IF-MIB::ifDescr.55 XGigabitEthernet0/0/3
IF-MIB::ifDescr.56 XGigabitEthernet0/0/4
IF-MIB::ifDescr.57 Vlanif99
IF-MIB::ifDescr.58 Eth-Trunk1
IF-MIB::ifDescr.59 GigabitEthernet1/0/1
IF-MIB::ifDescr.60 GigabitEthernet1/0/2
...
IF-MIB::ifDescr.105 GigabitEthernet1/0/47
IF-MIB::ifDescr.106 GigabitEthernet1/0/48
IF-MIB::ifDescr.107 XGigabitEthernet1/0/1
IF-MIB::ifDescr.108 XGigabitEthernet1/0/2
IF-MIB::ifDescr.109 XGigabitEthernet1/0/3
IF-MIB::ifDescr.110 XGigabitEthernet1/0/4
--------------------------------------------------

He read the HUAWEI-L2IF-MIB::hwL2IfPortIfIndex OID from SNMP too:
--------------------------------------------------
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.1 58
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.2 5
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.3 6
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.4 7
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.5 8
...
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.101 106
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.102 107
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.103 108
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.104 109
HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.105 110
--------------------------------------------------

If he read LLDP-MIB::lldpRemSysName, then he got some good and some strage data:
--------------------------------------------------
LLDP-MIB::lldpRemSysName.0.3.1 
LLDP-MIB::lldpRemSysName.0.39.1 ap-ap2-og2-sa-01
LLDP-MIB::lldpRemSysName.0.40.1 ap-ap2-og2-sa-02
LLDP-MIB::lldpRemSysName.0.41.1 ap-ap2-og1-sa-06
LLDP-MIB::lldpRemSysName.0.42.1 ap-ap2-og1-sa-05
LLDP-MIB::lldpRemSysName.0.49.1 sw-ap1-ug2-vr01-01
LLDP-MIB::lldpRemSysName.0.101.1 
LLDP-MIB::lldpRemSysName.0.102.1 
LLDP-MIB::lldpRemSysName.0.103.1 
LLDP-MIB::lldpRemSysName.0.139.1 ap-ap2-og1-sa-03
LLDP-MIB::lldpRemSysName.0.140.1 ap-ap2-og1-sa-02
--------------------------------------------------

Here is an example: 

--------------------------------------------------
LLDP-MIB::lldpRemSysName.0.39.1 ap-ap2-og2-sa-01

Device ap-ap2-og2-sa-01 is on port GE0/0/39, which is in IF-MIB::ifDescr on index 43. So the index "39" from lldpRemSysName is not the index from IF-MIB. So he checked the hwL2IfPortIfIndex. The OID hwL2IfPortIfIndex.39 contains number 42:

HUAWEI-L2IF-MIB::hwL2IfPortIfIndex.39 42

Number 42+1 is exactly 43 - the index in IF-MIB.
--------------------------------------------------

Next example:
--------------------------------------------------
LLDP-MIB::lldpRemSysName.0.49.1 sw-ap1-ug2-vr01-01

Index 49 in the hwL2IfPortIfIndex gets 52, 52+1 is 53:

IF-MIB::ifDescr.53 XGigabitEthernet0/0/1

This is correct too, the device sw-ap1-ug2-vr01-01 is on the port XGE0/0/1.

XGE0/0/1      sw-ap1-ug2-vr01-01       XGE2/0/24                 114    
--------------------------------------------------

But now some port from Stack unit 1:
--------------------------------------------------
LLDP-MIB::lldpRemSysName.0.139.1 ap-ap2-og1-sa-03

The index 193 is neither in IF-MIB nor in hwL2IfPortIfIndex. So he cannot convert the LLDP index 193 to IF-MIB index.

The device ap-ap2-og1-sa-03 is on port GE1/0/39 (as seen on console output).

1 0 39 look like 139, just remove the "0" and conctenate "1" and "39".

Then same for LLDP-MIB::lldpRemSysName.0.140.1 ap-ap2-og1-sa-02.

Solution

I've made some tests also in our lab environment and I think I've found the explanation for those index values.
For example wireless_oneair is connected locally on GE2/1/19: 


In the lldpRemSysName the value of local port is 222 :


The index of this interface is 27, so definitely this is not used above:

 

Since the index of that table should indicate the local port number, I’ve used the lldpLocPortTable and query the lldpLocPortId(1.0.8802.1.1.2.1.3.7.1.3) :

Here, you can see the attribute associated to 2/119 it’s 222 so the values correlate.


 


END