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

Updating infix-ip to clarify non-support deviations of ietf-ip #137

Closed
wants to merge 3 commits into from

Conversation

jovatn
Copy link
Contributor

@jovatn jovatn commented Sep 15, 2023

Setting deviations of non-supported parts of ietf-ip

Idea is that "pyang -f tree ietf-ip.yang infix-ip.yang" should show what we really support (and should make tests for).

General

Do we want use infix-ip.yang (overwrite)?
Or store as separate infix-ip-DATE.yang

For configuration

  • Compare YANG with CLI
    • YANG: /if:interfaces/if:interface: for ipv4 and ipv6
    • CLI: Available CLI settings on target
  • Put deviations for missing in yang
  • Compare pyang output until it matches (see "After" below)

Note1: This does not say the remaining config settings works, but
it reduces the list of what we need to set.

Note2: Unsure what it what the "ro" parameters within the
config part really means. E.g., what does "ro origin?"
for ipv4 addresses mean here?

For Status

  • Compare YANG with "sysrepocfg operational" output
    • YANG: /if:interfaces-state/if:interface:
    • sysrepocfg: "sysrepocfg -X -f json -d operational -x /interfaces"
      on target
  • Put deviations for missing in yang
  • Compare pyang output until it matches (see "After" below)

Note1: I wished to set full ipv6 branch as not-supported, as sysrepocfg
gave no result.

Note2: Is there some other/better way than comparing with sysrepocfg?
The CLI show commands are not really relevant here as that does not
match the yang states.

Note3: Ongoing work on status output has not been considered.
Risk that there is mismatch here.

sysrepocfg output

Example with some IPv6 address set (does not show up in operational)

root@infix-00-00-00:~$ ipb a
lo               UP             127.0.0.1/8 ::1/128 
e0               UP             3ffe:200::1/64 fe80::ff:fe00:0/64 
root@infix-00-00-00:~$ sysrepocfg -X -f json -d operational -x /interfaces
{
  "ietf-interfaces:interfaces": {
    "interface": [
      {
        "name": "lo",
        "type": "infix-if-type:loopback",
        "oper-status": "up",
        "if-index": 1,
        "phys-address": "00:00:00:00:00:00",
        "statistics": {
          "in-octets": "2947",
          "out-octets": "2947"
        },
        "ietf-ip:ipv4": {
          "address": [
            {
              "ip": "127.0.0.1",
              "prefix-length": 8
            }
          ]
        }
      },
      {
        "name": "e0",
        "type": "infix-if-type:ethernet",
        "oper-status": "up",
        "if-index": 2,
        "phys-address": "02:00:00:00:00:00",
        "statistics": {
          "in-octets": "220",
          "out-octets": "5695"
        },
        "ietf-ip:ipv4": {
          "mtu": 1500
        }
      }
    ]
  }
}
root@infix-00-00-00:~$ 

Compare pyang output

As can be seen below, the output after is much more compact.

After

$ pyang -f tree ietf-ip@2018-02-22.yang infix-ip@2023-09-14.yang 

module: ietf-ip

  augment /if:interfaces/if:interface:
    +--rw ipv4!
    |  +--rw enabled?             boolean
    |  +--rw forwarding?          boolean
    |  +--rw mtu?                 uint16
    |  +--rw address* [ip]
    |  |  +--rw ip                     inet:ipv4-address-no-zone
    |  |  +--rw (subnet)
    |  |     +--:(prefix-length)
    |  |        +--rw prefix-length?   uint8
    |  +--rw neighbor* [ip]
    |  |  +--rw ip                    inet:ipv4-address-no-zone
    |  |  +--rw link-layer-address    yang:phys-address
    |  +--rw infix-ip:autoconf
    |     +--rw infix-ip:enabled?   boolean
    +--rw ipv6!
       +--rw enabled?                     boolean
       +--rw forwarding?                  boolean
       +--rw mtu?                         uint32
       +--rw address* [ip]
       |  +--rw ip               inet:ipv6-address-no-zone
       |  +--rw prefix-length    uint8
       +--rw neighbor* [ip]
       |  +--rw ip                    inet:ipv6-address-no-zone
       |  +--rw link-layer-address    yang:phys-address
       +--rw dup-addr-detect-transmits?   uint32
       +--rw autoconf
          +--rw create-global-addresses?   boolean
  augment /if:interfaces-state/if:interface:
    x--ro ipv4!
    |  x--ro mtu?       uint16
    |  x--ro address* [ip]
    |     x--ro ip                     inet:ipv4-address-no-zone
    |     x--ro (subnet)?
    |        x--:(prefix-length)
    |           x--ro prefix-length?   uint8
    x--ro ipv6!

$

Before

$ pyang -f tree ietf-ip@2018-02-22.yang infix-ip@2023-04-24.yang 
module: ietf-ip

  augment /if:interfaces/if:interface:
    +--rw ipv4!
    |  +--rw enabled?             boolean
    |  +--rw forwarding?          boolean
    |  +--rw mtu?                 uint16
    |  +--rw address* [ip]
    |  |  +--rw ip                     inet:ipv4-address-no-zone
    |  |  +--rw (subnet)
    |  |  |  +--:(prefix-length)
    |  |  |  |  +--rw prefix-length?   uint8
    |  |  |  +--:(netmask)
    |  |  |     +--rw netmask?         yang:dotted-quad {ipv4-non-contiguous-netmasks}?
    |  |  +--ro origin?                ip-address-origin
    |  +--rw neighbor* [ip]
    |  |  +--rw ip                    inet:ipv4-address-no-zone
    |  |  +--rw link-layer-address    yang:phys-address
    |  |  +--ro origin?               neighbor-origin
    |  +--rw infix-ip:autoconf
    |     +--rw infix-ip:enabled?   boolean
    +--rw ipv6!
       +--rw enabled?                     boolean
       +--rw forwarding?                  boolean
       +--rw mtu?                         uint32
       +--rw address* [ip]
       |  +--rw ip               inet:ipv6-address-no-zone
       |  +--rw prefix-length    uint8
       |  +--ro origin?          ip-address-origin
       |  +--ro status?          enumeration
       +--rw neighbor* [ip]
       |  +--rw ip                    inet:ipv6-address-no-zone
       |  +--rw link-layer-address    yang:phys-address
       |  +--ro origin?               neighbor-origin
       |  +--ro is-router?            empty
       |  +--ro state?                enumeration
       +--rw dup-addr-detect-transmits?   uint32
       +--rw autoconf
          +--rw create-global-addresses?        boolean
          +--rw create-temporary-addresses?     boolean {ipv6-privacy-autoconf}?
          +--rw temporary-valid-lifetime?       uint32 {ipv6-privacy-autoconf}?
          +--rw temporary-preferred-lifetime?   uint32 {ipv6-privacy-autoconf}?
  augment /if:interfaces-state/if:interface:
    x--ro ipv4!
    |  x--ro forwarding?   boolean
    |  x--ro mtu?          uint16
    |  x--ro address* [ip]
    |  |  x--ro ip                     inet:ipv4-address-no-zone
    |  |  x--ro (subnet)?
    |  |  |  x--:(prefix-length)
    |  |  |  |  x--ro prefix-length?   uint8
    |  |  |  x--:(netmask)
    |  |  |     x--ro netmask?         yang:dotted-quad {ipv4-non-contiguous-netmasks}?
    |  |  x--ro origin?                ip-address-origin
    |  x--ro neighbor* [ip]
    |     x--ro ip                    inet:ipv4-address-no-zone
    |     x--ro link-layer-address?   yang:phys-address
    |     x--ro origin?               neighbor-origin
    x--ro ipv6!
       x--ro forwarding?   boolean
       x--ro mtu?          uint32
       x--ro address* [ip]
       |  x--ro ip               inet:ipv6-address-no-zone
       |  x--ro prefix-length    uint8
       |  x--ro origin?          ip-address-origin
       |  x--ro status?          enumeration
       x--ro neighbor* [ip]
          x--ro ip                    inet:ipv6-address-no-zone
          x--ro link-layer-address?   yang:phys-address
          x--ro origin?               neighbor-origin
          x--ro is-router?            empty
          x--ro state?                enumeration

$ 

Setting deviations of non-supported parts of ietf-ip

Idea is that "pyang -f tree ietf-ip.yang infix-ip.yang" should
show what we really support (and should make tests for).
Adding it in a dedicted directory for the user guide.
Can be changed, of course.
Copy link
Contributor

@troglobit troglobit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, only a few questions:

I think we should disable the entire /if:interfaces-state//. xpath. What do you think? (ping @wkz and @jovatn)

Should we fold in PR #122 in this? The general Interface "LEGO" would be nice to introduce the concepts, I think.

@troglobit troglobit added this to the Infix v23.09 milestone Sep 21, 2023
@jovatn
Copy link
Contributor Author

jovatn commented Sep 21, 2023

I think we should disable the entire /if:interfaces-state//. xpath. What do you think? (ping @wkz and @jovatn)

You are right. As you have pointed out, it is deprecated.

Feel free to fold this into PR #122. And to change whatever you think should be changed.

troglobit added a commit that referenced this pull request Sep 22, 2023
Manually merge PR #137, with minor updates to the YANG deviations, and
complete relocation of the new user-guide.  The idea is to keep all the
documentation generic and use the docgen package later to include all
relevant parts into a PDF user guide.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
Copy link
Contributor

Manually merged in 2431089.

@troglobit troglobit closed this Sep 22, 2023
@jovatn jovatn deleted the jonva/user-guide branch September 22, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants