pyang icon indicating copy to clipboard operation
pyang copied to clipboard

SID identitifier for Identities

Open christian-herber opened this issue 4 years ago • 3 comments

When generating SIDs for a module containing identities, those are generated with identifiers that do not have the module prefix.

{
  "assignment-ranges": [
    {
      "entry-point": 1800,
      "size": 400
    }
  ],
  "module-name": "iana-if-type",
  "module-revision": "2017-01-19",
  "items": [
    {
      "namespace": "module",
      "identifier": "iana-if-type",
      "sid": 1800
    },
    {
      "namespace": "identity",
      "identifier": "a12MppSwitch",
      "sid": 1801
    },

E.g. here, and identifier "identifier": "a12MppSwitch" is not guaranteed to be unique in all cases (e.g. multiple identities defined in one module).

Not sure what the right solution is, but pretty sure this one is not ok. What's your opinion @lemikev ?

christian-herber avatar Feb 24 '21 10:02 christian-herber

Hi Christian As specified in "https://tools.ietf.org/html/rfc7950#section-6.2.1", all identity names defined in a module and its submodules must be unique. Considering that a ".sid" file contains the YANG item assignments of a single module, these YANG item identifiers don't need to be prefixed.

lemikev avatar Feb 24 '21 14:02 lemikev

You are right, this should be unique Still, in my opinion, the correct identifier for the given identity here would be /iana-if-type:a12MppSwitch What would be the reason not to include the namespace here?

christian-herber avatar Feb 25 '21 08:02 christian-herber

I’m not sure there is a specific rational for this approach but I can suggest a couple of potential reasons.

  • redundancy, all identity within a .sid file will have the same prefix
  • lack of a common, already established representation y: ethernetCsmacd in RFC 7950 "iana-if-type:ethernetCsmacd" in RFC 7951

lemikev avatar Feb 25 '21 14:02 lemikev