Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only ethernetCsmacd interfaces are shown in the room viewer #2280

Closed
alexanderfefelov opened this issue Apr 26, 2021 · 2 comments · Fixed by #2314
Closed

Only ethernetCsmacd interfaces are shown in the room viewer #2280

alexanderfefelov opened this issue Apr 26, 2021 · 2 comments · Fixed by #2314
Assignees
Labels
Milestone

Comments

@alexanderfefelov
Copy link

# Filter interfaces on iftype and add fast last_cam lookup
for netbox in netboxes:
netbox.interfaces = netbox.interface_set.filter(
iftype=6).order_by("ifindex").extra(select=cam_query)

NAV 5.1.3

snmpwalk -c foobar -v 2c [D-Link DGS-3627G] IF-MIB::ifTable:

...
IF-MIB::ifType.1 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.2 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.3 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.4 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.5 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.6 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.7 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.8 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.9 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.10 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.11 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.12 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.13 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.14 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.15 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.16 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.17 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.18 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.19 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.20 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.21 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.22 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.23 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.24 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.25 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.26 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.27 = INTEGER: ethernetCsmacd(6)
...

snmpwalk -c foobar -v 2c [D-Link DGS-3200-10] IF-MIB::ifTable:

...
IF-MIB::ifType.1 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.2 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.3 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.4 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.5 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.6 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.7 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.8 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.9 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.10 = INTEGER: gigabitEthernet(117)
...
alexanderfefelov added a commit to alexanderfefelov/nav-add-ons that referenced this issue Apr 29, 2021
@lunkwill42 lunkwill42 added the bug label May 7, 2021
@lunkwill42
Copy link
Member

Thanks for the bug report!

This filter has been there since the code was introduced to NAV, but I cannot find the reasoning behind it. I can only assume it was a misguided attempt to get a list of only physical ethernet ports, or only switch ports, but using iftype to try to discern that makes no sense.

The point of the device/interface list tab in the room view is mostly to figure which access ports are currently in use, or have recently been used. However, history is based on CAM records and would only work for switch ports. Switch ports aren't necessarily physical interfaces, at least not on Juniper, so...

Would you agree that listing switch ports makes the most sense, regardless of whether they are physical or not?

@lunkwill42
Copy link
Member

@alexanderfefelov Upon closer inspection, this is the definition of ifType in section 3.2.4 of RFC 3635:

There are three other interface types defined in the IANAifType-MIB for Ethernet. They are fastEther(62), fastEtherFX(69), and gigabitEthernet(117). These interface types were registered by individual vendors, not by any IETF working group. A requirement for compliance with this document is that all ethernet-like interfaces MUST return ethernetCsmacd(6) for ifType, and MUST NOT return fastEther(62), fastEtherFX(69), or gigabitEthernet(117). However, as there are fielded implementations that do return these obsolete ifType values, management applications SHOULD be prepared to receive them from older implementations.

It seems D-Link is one of the mentioned "fielded implementations" that return an obsolete ifType. In the interest of supporting stuff that is out there, I suggest instead to update the interface selection code to include ifType values of 6, 62, 69 and 117.

lunkwill42 added a commit to lunkwill42/nav that referenced this issue May 10, 2021
Because:

- Although RFC 3635 specifies that implementations MUST use
  ifType=ethernetCsmacd(6) for all ethernet-like interface types, many
  fielded implementations have incorrectly used other values that were
  never reserved by the IETF.
- D-Link is one such vendor, where interfaces would not be listed in the
  room interface list because of this.

Fixes Uninett#2280
@lunkwill42 lunkwill42 self-assigned this May 10, 2021
lunkwill42 added a commit to lunkwill42/nav that referenced this issue Oct 19, 2021
Because:

- Although RFC 3635 specifies that implementations MUST use
  ifType=ethernetCsmacd(6) for all ethernet-like interface types, many
  fielded implementations have incorrectly used other values that were
  never reserved by the IETF.
- D-Link is one such vendor, where interfaces would not be listed in the
  room interface list because of this.

Fixes Uninett#2280
lunkwill42 added a commit to lunkwill42/nav that referenced this issue Feb 22, 2022
Because:

- Although RFC 3635 specifies that implementations MUST use
  ifType=ethernetCsmacd(6) for all ethernet-like interface types, many
  fielded implementations have incorrectly used other values that were
  never reserved by the IETF.
- D-Link is one such vendor, where interfaces would not be listed in the
  room interface list because of this.

Fixes Uninett#2280
@lunkwill42 lunkwill42 added this to the 5.3.0 milestone Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants