napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.26k stars 554 forks source link

Normalization of certain LLDP data #816

Closed ktbyers closed 5 years ago

ktbyers commented 6 years ago

Mainly focusing on remote_system_capab and remote_system_enabled_capab

Adding @jobec I am open to more discussion on this.

I think the main requirements would be:

  1. Has to cover all five of the core platforms.
  2. Has to be covered in the unit tests
  3. We have to have a reasonably wide set of expected values we can get from the 5 different platforms (which might not be that hard since three of the five platforms are Cisco).

The normalization helper should probably go into base/helpers.py.

We would also have to agree on what values should be returned (i.e. what values we are going to standardize on).

jobec commented 6 years ago

Proposal on normalized values:

Bit Value Cisco string Juniper string Capability according to IEEE
0x001 other O* Other Other
0x002 repeater P* Repeater Repeater
0x004 bridge B* Bridge* MAC Bridge component
0x008 wlan-access-point W* WLAN Access Point* 802.11 Access Point (AP)
0x010 router R* Router* Router
0x020 telephone T* Telephone* Telephone
0x040 docsis-cable-device C* DOCSIS Cable Device DOCSIS cable device
0x080 station S* Station Only* Station Only
0x100 C-VLAN component
0x200 S-VLAN component
0x400 Two-port MAC Relay component

* confirmed from sample output

sources:

ktbyers commented 6 years ago

Yes, that looks good.

I assume we would use the "Value" column above as the normalized data.

We can look at our current unit test data (I glanced at it yesterday and IIRC it only had "B" and "R").

One item I noticed is Arista had "bridge" and "router" in all lower case (once again from memory so definitely double check).

Cisco "B" and "R" and abbreviated codes looked consistent across IOS, NX-OS, and IOS-XR platforms at least on our small sample size of data.

ktbyers commented 6 years ago

@jobec FYI, I am assuming you are writing the PR for this?