lldpd / lldpd

implementation of IEEE 802.1ab (LLDP)
https://lldpd.github.io
Other
618 stars 181 forks source link

snmp subagent loses all subsequent lldpRemSysName (1.0.8802.1.1.2.1.4.1.1.9) after entry with missing System is added #392

Closed stannous closed 4 years ago

stannous commented 4 years ago

Bug Description

snmp subagent loses all subsequent lldpRemSysName (1.0.8802.1.1.2.1.4.1.1.9) after entry with missing SysName is added.

Using lldpd version around 1.0.4 (patch 990e4e38431 Oct 19, 2019) and snmpd version 5.8.0 (patch 0a6e8c331159 Oct 28, 2019)

All the information from lldpctl is correct.
It's only the entries in the after the entry missing a SysName in lldpRemSysName table that disappear from the snmp subagent.

This is easy to reproduce. Simply inject the packet that is missing a SysName early after lldpd starts up. I'll attach the pcap to this bug. But the pcap just contains the following decode:

root@host6:/home/cumulus# tcpdump -vvveXa -r connectx.pcap 
reading from file connectx.pcap, link-type EN10MB (Ethernet)
14:27:05.243855 50:6b:4b:f6:1e:b1 (oui Unknown) > 01:80:c2:00:00:0e (oui Unknown), ethertype LLDP (0x88cc), length 72: LLDP, length 58
        Chassis ID TLV (1), length 7
          Subtype MAC address (4): 50:6b:4b:f6:1e:b3 (oui Unknown)
          0x0000:  0450 6b4b f61e b3
        Port ID TLV (2), length 7
          Subtype MAC address (3): 50:6b:4b:f6:1e:b1 (oui Unknown)
          0x0000:  0350 6b4b f61e b1
        Time to Live TLV (3), length 2: TTL 48s
          0x0000:  0030
        Port Description TLV (4), length 29: ConnectX-4 Lx, 25G/10G/1G SFP
          0x0000:  436f 6e6e 6563 7458 2d34 204c 782c 2032
          0x0010:  3547 2f31 3047 2f31 4720 5346 50
        End TLV (0), length 0
        0x0000:  0207 0450 6b4b f61e b304 0703 506b 4bf6  ...PkK......PkK.
        0x0010:  1eb1 0602 0030 081d 436f 6e6e 6563 7458  .....0..ConnectX
        0x0020:  2d34 204c 782c 2032 3547 2f31 3047 2f31  -4.Lx,.25G/10G/1
        0x0030:  4720 5346 5000 0000 0000                 G.SFP.....
  1. Start lldpd and inject the packet (tcpreplay -i ethX connectx.pcap) fairly early so that you get other lldp neighbors after it. The point is that entries after this one entry are missing from lldpRemSysName.
  2. Check the two tables by doing some snmp walks. You should see something like this: Notice that the entry in lldpRemSysName table for our injected packet 58000.29.2 is missing because it has no name. But the problem is all the other entries after that are also missing.
    
    root@cel-redxp-01:~# snmpwalk -v2c -cpublic localhost 1.0.8802.1.1.2.1.4.1.1.8; snmpwalk -v2c -cpublic localhost  1.0.8802.1.1.2.1.4.1.1.9
    LLDP-MIB::lldpRemPortDesc.57800.2.1 = STRING: swp25
    LLDP-MIB::lldpRemPortDesc.58000.29.2 = STRING: ConnectX-4 Lx, 25G/10G/1G SFP
    LLDP-MIB::lldpRemPortDesc.59200.4.3 = STRING: swp1
    LLDP-MIB::lldpRemPortDesc.59200.5.6 = STRING: swp1
    LLDP-MIB::lldpRemPortDesc.59200.6.5 = STRING: swp1
    LLDP-MIB::lldpRemPortDesc.59200.7.8 = STRING: swp1
    LLDP-MIB::lldpRemPortDesc.59200.28.9 = STRING: swp1
    LLDP-MIB::lldpRemPortDesc.59200.30.4 = STRING: swp1
    LLDP-MIB::lldpRemPortDesc.59200.31.7 = STRING: swp1

LLDP-MIB::lldpRemSysName.57800.2.1 = STRING: pioneerMS7.it.cumulusnetworks.com root@cel-redxp-01:~#


Entries for lldpRemSysName 58000.29.2, .59200.4.3-59200.31.7 are missing.

If we do not inject the packet with missing SysName, we do see the other entries:

root@cel-redxp-01:~# snmpwalk -v2c -cpublic localhost 1.0.8802.1.1.2.1.4.1.1.8; snmpwalk -v2c -cpublic localhost 1.0.8802.1.1.2.1.4.1.1.9 LLDP-MIB::lldpRemPortDesc.57800.2.1 = STRING: swp25 LLDP-MIB::lldpRemPortDesc.59200.4.3 = STRING: swp1 LLDP-MIB::lldpRemPortDesc.59200.5.6 = STRING: swp1 LLDP-MIB::lldpRemPortDesc.59200.6.5 = STRING: swp1 LLDP-MIB::lldpRemPortDesc.59200.7.8 = STRING: swp1 LLDP-MIB::lldpRemPortDesc.59200.28.9 = STRING: swp1 LLDP-MIB::lldpRemPortDesc.59200.30.4 = STRING: swp1 LLDP-MIB::lldpRemPortDesc.59200.31.7 = STRING: swp1 LLDP-MIB::lldpRemSysName.57800.2.1 = STRING: pioneerMS7.it.cumulusnetworks.com LLDP-MIB::lldpRemSysName.59200.4.3 = STRING: host1 LLDP-MIB::lldpRemSysName.59200.5.6 = STRING: host2 LLDP-MIB::lldpRemSysName.59200.6.5 = STRING: host3 LLDP-MIB::lldpRemSysName.59200.7.8 = STRING: host4 LLDP-MIB::lldpRemSysName.59200.28.9 = STRING: host5 LLDP-MIB::lldpRemSysName.59200.30.4 = STRING: host7 LLDP-MIB::lldpRemSysName.59200.31.7 = STRING: host8


The lldpRemSysName table should continue with the other SysNames.
These normally exist if the oddball packet was not injected:

As you can see, lldpctl handles the packets just fine. It is the snmp subagent that
seems to drop all lldpRemSysName entries after the packet with a missing SysName
is injected:   (The entry with the missing SysName is on swp26)

root@cel-redxp-01:~# lldpctl [223/1892]

LLDP neighbors:

Interface: eth0, via: LLDP, RID: 1, Time: 0 day, 00:00:36 Chassis:
ChassisID: mac 6c:64:1a:00:0d:83 SysName: pioneerMS7.it.cumulusnetworks.com SysDescr: Cumulus Linux version 2.5.4 running on cel kennisis MgmtIP: 172.17.1.14 MgmtIface: 2 Capability: Bridge, on Capability: Router, on Port:
PortID: ifname swp25 PortDescr: swp25 TTL: 120

Interface: swp1, via: LLDP, RID: 3, Time: 0 day, 00:00:22 Chassis:
ChassisID: mac 00:01:00:00:01:00 SysName: host1 SysDescr: Cumulus Linux version (hydra-15.mvlab /tmp/stannous/BasicRouterConfig/)4.1.2~1588807579.1d071f8f running on QEMU Standard PC (i440FX + PIIX, 1996) MgmtIP: 192.168.0.15 MgmtIface: 2 MgmtIP: fe80::201:ff:fe00:100 MgmtIface: 2 Capability: Bridge, off Capability: Bridge, off [147/1843] Capability: Router, on Port:
PortID: ifname swp1 PortDescr: swp1 TTL: 120 PMD autoneg: supported: no, enabled: no MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable LLDP-MED:
Device Type: Network Connectivity Device Capability: Capabilities, yes Capability: Policy, yes Capability: Location, yes Capability: MDI/PSE, yes Capability: MDI/PD, yes Capability: Inventory, yes Inventory:
Software Revision: (hydra-15.mvlab /tmp/stannous/Ba Firmware Revision: rel-1.11.0-0-g63451fca13-prebuil Serial Number: Not Specified Manufacturer: QEMU Model: Standard PC (i440FX + PIIX, 1996

Interface: swp2, via: LLDP, RID: 6, Time: 0 day, 00:00:22 Chassis:
ChassisID: mac 00:01:00:00:02:00 SysName: host2 SysDescr: Cumulus Linux version (hydra-15.mvlab /tmp/stannous/BasicRouterConfig/)4.1.2~1588807579.1d071f8f running on QEMU Standard PC (i440FX + PIIX, 1996) MgmtIP: 192.168.0.15 MgmtIface: 2 MgmtIP: fe80::201:ff:fe00:200 MgmtIface: 2 Capability: Bridge, off Capability: Router, on Port:
PortID: ifname swp1 PortDescr: swp1 TTL: 120 PMD autoneg: supported: no, enabled: no MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable LLDP-MED:
Device Type: Network Connectivity Device Capability: Capabilities, yes Capability: Policy, yes Capability: Location, yes Capability: MDI/PSE, yes Capability: MDI/PD, yes Capability: Inventory, yes Inventory:
Software Revision: (hydra-15.mvlab /tmp/stannous/Ba Firmware Revision: rel-1.11.0-0-g63451fca13-prebuil Serial Number: Not Specified Manufacturer: QEMU Model: Standard PC (i440FX + PIIX, 1996

Interface: swp3, via: LLDP, RID: 5, Time: 0 day, 00:00:22 Chassis:
ChassisID: mac 00:01:00:00:03:00 SysName: host3 SysDescr: Cumulus Linux version (hydra-15.mvlab /tmp/stannous/BasicRouterConfig/)4.1.2~1588807579.1d071f8f running on QEMU Standard PC (i440FX + PIIX, 1996) MgmtIP: 192.168.0.15 MgmtIface: 2 MgmtIP: fe80::201:ff:fe00:300 MgmtIface: 2 Capability: Bridge, off Capability: Router, on Port:
PortID: ifname swp1 PortDescr: swp1 TTL: 120 PMD autoneg: supported: no, enabled: no MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable LLDP-MED:
Device Type: Network Connectivity Device Capability: Capabilities, yes Capability: Policy, yes Capability: Location, yes Capability: MDI/PSE, yes [70/1843] Capability: MDI/PD, yes Capability: Inventory, yes Inventory:
Software Revision: (hydra-15.mvlab /tmp/stannous/Ba Firmware Revision: rel-1.11.0-0-g63451fca13-prebuil Serial Number: Not Specified Manufacturer: QEMU Model: Standard PC (i440FX + PIIX, 1996

Interface: swp4, via: LLDP, RID: 8, Time: 0 day, 00:00:22 Chassis:
ChassisID: mac 00:01:00:00:04:00 SysName: host4 SysDescr: Cumulus Linux version (hydra-15.mvlab /tmp/stannous/BasicRouterConfig/)4.1.2~1588807579.1d071f8f running on QEMU Standard PC (i440FX + PIIX, 1996) MgmtIP: 192.168.0.15 MgmtIface: 2 MgmtIP: fe80::201:ff:fe00:400 MgmtIface: 2 Capability: Bridge, off Capability: Router, on Port:
PortID: ifname swp1 PortDescr: swp1 TTL: 120 PMD autoneg: supported: no, enabled: no MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable LLDP-MED:
Device Type: Network Connectivity Device Capability: Capabilities, yes Capability: Policy, yes Capability: Location, yes Capability: MDI/PSE, yes Capability: MDI/PD, yes Capability: Inventory, yes Inventory:
Software Revision: (hydra-15.mvlab /tmp/stannous/Ba Firmware Revision: rel-1.11.0-0-g63451fca13-prebuil Serial Number: Not Specified Manufacturer: QEMU Model: Standard PC (i440FX + PIIX, 1996

Interface: swp25, via: LLDP, RID: 9, Time: 0 day, 00:00:22 Chassis:
ChassisID: mac 00:01:00:00:05:00 SysName: host5 SysDescr: Cumulus Linux version (hydra-15.mvlab /tmp/stannous/BasicRouterConfig/)4.1.2~1588807579.1d071f8f running on QEMU Standard PC (i440FX + PIIX, 1996) MgmtIP: 192.168.0.15 MgmtIface: 2 MgmtIP: fe80::201:ff:fe00:500 MgmtIface: 2 Capability: Bridge, off Capability: Router, on Port:
PortID: ifname swp1 PortDescr: swp1 TTL: 120 PMD autoneg: supported: no, enabled: no MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable LLDP-MED:
Device Type: Network Connectivity Device Capability: Capabilities, yes Capability: Policy, yes Capability: Location, yes Capability: MDI/PSE, yes Capability: MDI/PD, yes Capability: Inventory, yes Inventory:
Software Revision: (hydra-15.mvlab /tmp/stannous/Ba Firmware Revision: rel-1.11.0-0-g63451fca13-prebuil Serial Number: Not Specified Manufacturer: QEMU Model: Standard PC (i440FX + PIIX, 1996

Interface: swp26, via: LLDP, RID: 2, Time: 0 day, 00:00:34 Chassis:
ChassisID: mac 50:6b:4b:f6:1e:b3 Port:
PortID: mac 50:6b:4b:f6:1e:b1 PortDescr: ConnectX-4 Lx, 25G/10G/1G SFP TTL: 48

Interface: swp27, via: LLDP, RID: 4, Time: 0 day, 00:00:22 Chassis:
ChassisID: mac 00:01:00:00:07:00 SysName: host7 SysDescr: Cumulus Linux version (hydra-15.mvlab /tmp/stannous/BasicRouterConfig/)4.1.2~1588807579.1d071f8f running on QEMU Standard PC (i440FX + PIIX, 1996) MgmtIP: 192.168.0.15 MgmtIface: 2 MgmtIP: fe80::201:ff:fe00:700 MgmtIface: 2 Capability: Bridge, off Capability: Router, on Port:
PortID: ifname swp1 PortDescr: swp1 TTL: 120 PMD autoneg: supported: no, enabled: no MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable LLDP-MED:
Device Type: Network Connectivity Device Capability: Capabilities, yes Capability: Policy, yes Capability: Location, yes Capability: MDI/PSE, yes Capability: MDI/PD, yes Capability: Inventory, yes Inventory:
Software Revision: (hydra-15.mvlab /tmp/stannous/Ba Firmware Revision: rel-1.11.0-0-g63451fca13-prebuil Serial Number: Not Specified Manufacturer: QEMU Model: Standard PC (i440FX + PIIX, 1996

Interface: swp28, via: LLDP, RID: 7, Time: 0 day, 00:00:22 Chassis:
ChassisID: mac 00:01:00:00:08:00 SysName: host8 SysDescr: Cumulus Linux version (hydra-15.mvlab /tmp/stannous/BasicRouterConfig/)4.1.2~1588807579.1d071f8f running on QEMU Standard PC (i440FX + PIIX, 1996) MgmtIP: 192.168.0.15 MgmtIface: 2 MgmtIP: fe80::201:ff:fe00:800 MgmtIface: 2 Capability: Bridge, off Capability: Router, on Port:
PortID: ifname swp1 PortDescr: swp1 TTL: 120 PMD autoneg: supported: no, enabled: no MAU oper type: 10GigBaseCX4 - X copper over 8 pair 100-Ohm balanced cable LLDP-MED:
Device Type: Network Connectivity Device Capability: Capabilities, yes Capability: Policy, yes Capability: Location, yes Capability: MDI/PSE, yes Capability: MDI/PD, yes Capability: Inventory, yes Inventory:
Software Revision: (hydra-15.mvlab /tmp/stannous/Ba Firmware Revision: rel-1.11.0-0-g63451fca13-prebuil Serial Number: Not Specified Manufacturer: QEMU Model: Standard PC (i440FX + PIIX, 1996

vincentbernat commented 4 years ago

Thanks, I'll have a look later this week. This should be an easy fix.

stannous commented 4 years ago

connectx.pcap.gz