open-switch / opx-cps

https://openswitch.net
6 stars 15 forks source link

Incompatible ENUM and boolean representations #69

Open kot-begemot-uk opened 6 years ago

kot-begemot-uk commented 6 years ago

All standardized representations for ENUM and boolean such as RFC 4717, 7951, etc use the textual representation of ENUMs and booleans.

CPS presently can only understand or generate the numerical for ENUMs and uses 0/1 instead of true/false for booleans. This use of yang modeled data is not interoperable and requires the use of yang models to convert it to an interop form on every operation.

rakeshdatta commented 6 years ago

@kot-begemot-uk Hi Anton, can you please help me with the information mentioned in: https://github.com/open-switch/opx-docs/wiki/Report-bugs

kot-begemot-uk commented 6 years ago

RFC8040 and the netconf RFCs specify that ENUMs are represented by their named values and boolean is represnted by true and false. The yang RFCs (both yang 1.0 and 1.1) are also fairly specific that the numeric values for enum are purely "implementer's business" and should not be used for interchange. CPS violates every single one of these.

kot-begemot-uk commented 6 years ago

Example violations: base-if-phy/if/interfaces/interface/npu-id = 0 dell-base-if-cmn/if/interfaces/interface/if-index = 5 dell-if/if/interfaces/interface/phys-address = 90:b1:1c:f4:ef:a0 dell-if/if/interfaces/interface/speed = 8 <<<VIOLATES RFCs if/interfaces/interface/enabled = 0<<<VIOLATES RFCs base-if-phy/if/interfaces/interface/learn-mode = 3<<<VIOLATES RFCs if/interfaces/interface/name = e101-001-0 dell-if/if/interfaces/interface/duplex = 1<<<VIOLATES RFCs dell-if/if/interfaces/interface/auto-negotiation = 0<<<VIOLATES RFCs if/interfaces/interface/type = ianaift:ethernetCsmacd dell-if/if/interfaces/interface/tx-idle-time = 768 dell-if/if/interfaces/interface/oui = 6976381 dell-if/if/interfaces/interface/tx-wake-time = 768 dell-if/if/interfaces/interface/mtu = 1532 dell-if/if/interfaces/interface/mode = 1<<<VIOLATES RFCs base-if-phy/if/interfaces/interface/port-id = 1 dell-base-if-cmn/if/interfaces/interface/vlan-filter = 2<<<VIOLATES RFCs base-if-phy/if/interfaces/interface/phy-media = 1<<<VIOLATES RFCs dell-if/if/interfaces/interface/fec = 2<<<VIOLATES RFCs base-if-phy/if/interfaces/interface/tagging-mode = 3<<<VIOLATES RFCs dell-if/if/interfaces/interface/eee = 0<<<VIOLATES RFCs

Out of reported data 75% are in violation of the RFCs to start off with and unacceptable to any RFC compliant implementation.