openconfig / public

Repository for publishing OpenConfig models, documentation, and other material for the community.
Apache License 2.0
873 stars 643 forks source link

Correction to loopback-mode-type FACILITY and TERMINAL #1135

Open liulk opened 2 weeks ago

liulk commented 2 weeks ago

https://openconfig.net/projects/models/schemadocs/yangdoc/openconfig-terminal-device.html

Currently:

Cisco reported that FACILITY and TERMINAL loopbacks should be reversed. @ahsaanyousaf confirmed it.

Proposed:

Background:

@aashaikh first added the definition here: https://github.com/openconfig/public/commit/4e0d236b04326c37275ea9d5c621ea51e7d8eeb8

@aashaikh first use of loopback-mode-type for terminal device loopback-mode leaf here: https://github.com/openconfig/public/commit/b05e0076a8716f4a21dd5029e22fc47d54b7d059

@sulrich changed the interface loopback-mode leaf from boolean to loopback-mode-type here: https://github.com/openconfig/public/pull/731

@sallylsy and @dplore added PHY and MAC specific enums: https://github.com/openconfig/public/pull/1034

liulk commented 2 weeks ago

cc: @aaronmillisor

ahsaanyousaf commented 2 weeks ago

cc: @ejbrever

liulk commented 2 weeks ago

Judging from the fact that https://github.com/openconfig/public/commit/4e0d236b04326c37275ea9d5c621ea51e7d8eeb8 and https://github.com/openconfig/public/commit/b05e0076a8716f4a21dd5029e22fc47d54b7d059 used terminology specific to optical transceivers, my guess is that it was originally only intended for PHY loopback, not MAC.

After #731 and #1034, it added cases where it is possible to mix the configuration of L1 loopback on L2 interfaces or L2 loopback on L1 channels.

Do these actually make sense?

How do we feel about deprecating all enums of loopback-mode-type and just add LOCAL and REMOTE as the recommended values? The PHY / MAC will depend on which interface type the mode is configured on.

Updated proposal:

LimeHat commented 2 weeks ago

An ASIC can implement loopback functionality in the MAC layer or the (internal) PHY layer. There's also an external PHY layer which corresponds to a transceiver.

One of the points in #1034 was that in some use cases, the actual loopback functionality is not necessarily required and the FACILITY is used to emulate the oper-up state of an interface (when the operator doesn't care about the data plane behavior of the interface)

ejbrever commented 2 weeks ago

I agree the definitions of FACILITY and TERMINAL are reversed.

Maybe FACILITY|TERMINAL are not applicable to pluggable optics on a router the same way. In that case, perhaps dedicated enums for those would be better. But I would strongly suggest we do not deprecate FACILITY|TERMINAL as for optical networking they are industry standard names and we have a lot of OpenConfig implementations using those that we shouldn't break (at least ten across four vendors).