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

[Question] Why do Openconfig Yang models mix config and state leaves in the same yang tree? #1141

Closed
pedroaston opened this issue Jun 26, 2024 · 2 comments

Comments

@pedroaston
Copy link

Question

Why do Openconfig yang models mix configuration containers with state ones in the same yang tree?

Example of the current IS-IS OC model (path >> /network-instances/network-instance/protocols/protocol/isis/):

"openconfig-network-instance:global": {
    "afi-safi": {
      "af": [
        {
          "afi-name": "openconfig-isis-types:IPV4",
          "config": {
            "afi-name": "openconfig-isis-types:IPV4",
            "enabled": true,
            "max-ecmp-paths": 0,
            "safi-name": "openconfig-isis-types:UNICAST"
          },
          "safi-name": "openconfig-isis-types:UNICAST",
          "state": {
            "afi-name": "openconfig-isis-types:IPV4",
            "enabled": true,
            "max-ecmp-paths": 0,
            "safi-name": "openconfig-isis-types:UNICAST"
          }
        },
        {
          "afi-name": "openconfig-isis-types:IPV6",
          "config": {
            "afi-name": "openconfig-isis-types:IPV6",
            "enabled": false,
            "max-ecmp-paths": 0,
            "safi-name": "openconfig-isis-types:UNICAST"
          },
          "multi-topology": {
            "config": {
              "enabled": false
            },
            "state": {
              "enabled": false
            }
          },
          "safi-name": "openconfig-isis-types:UNICAST",
          "state": {
            "afi-name": "openconfig-isis-types:IPV6",
            "enabled": false,
            "max-ecmp-paths": 0,
            "safi-name": "openconfig-isis-types:UNICAST"
          }
        }
      ]
    },
    "config": {
      "instance": "1",
      "level-capability": "LEVEL_2",
      "net": [
        "01.0100.0000.0000.00"
      ]
    },
...
}

Example of segregated yang for config and state:

(config yang example)
{
  "openconfig-network-instance:global:config": {
    "afi-safi": {
      "af": [
        {
          "afi-name": "openconfig-isis-types:IPV4",
          "enabled": true,
          "max-ecmp-paths": 0,
          "safi-name": "openconfig-isis-types:UNICAST"
        },
        {
          "afi-name": "openconfig-isis-types:IPV6",
          "enabled": false,
          "max-ecmp-paths": 0,
          "safi-name": "openconfig-isis-types:UNICAST"
         },
        "multi-topology": { 
          "enabled": false
         }, 
        }
      ]
    },
    "instance": "1",
    "level-capability": "LEVEL_2",
    "net": [
      "01.0100.0000.0000.00"
     ]
  },
...
}
(state yang example)
{
  "openconfig-network-instance:global:state": {
    ...
    "circuit-counters": {
      "adj-changes": 0,
      "adj-number": 0,
      "auth-fails": 0,
      "auth-type-fails": 0,
      "id-field-len-mismatches": 0,
      "lan-dis-changes": 0,
      "max-area-address-mismatches": 0,
      "rejected-adj": 0
     },
...
}

From the point of view of a telemetry collector and of a configuration agent, the segregated approach seems to be the best one from a pragmatic point of view. Also some router vendors who have their own yang models seem to be choosing this path.
What was the rational to choose the current approach by Openconfig?

Thanks

@dplore
Copy link
Member

dplore commented Jul 4, 2024

See https://openconfig.net/docs/guides/style_guide/#naming

The motivation for this style is to emphasize the correlation of monitoring and configuration for authors and readers of the model.

See openconfig/gnmi#169 for a proposed update to gNMI to subscribe to config and state separately.

@dplore dplore closed this as completed Jul 4, 2024
@pedroaston
Copy link
Author

Hello @dplore,

thanks for the feedback 😃 The gNMI pull request you linked is relevant to some of the issues I have faced when working with gNMI and OC models from a NMS POV. I will try to contribute there on the related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants