sysrepo / sysrepo

YANG-based configuration and operational state data store for Unix/Linux applications
http://www.sysrepo.org
BSD 3-Clause "New" or "Revised" License
354 stars 234 forks source link

The error in sysrepoctl installation of o-ran-processing-element.yang #3022

Closed vancouversun closed 1 year ago

vancouversun commented 1 year ago

I am installing O-RAN specification Yang module (O-RAN.WG4.MP-YANGs-v05.00). When I'm trying to install o-ran-processing-element.yang, The installation is failed. This is the error msg.

$ sysrepoctl -i o-ran-processing-element.yang -v3

[INF] Connection 74 created.
[ERR] Not found node "diffserv-markings" in path. (Schema location "/o-ran-processing-element:processing-elements/enhanced-uplane-mapping/uplane-mapping/up-markings/ipv4/upv4-dscp-name".)
[ERR] Target of leafref "upv4-dscp-name" cannot be referenced because it is disabled. (Schema location "/o-ran-processing-element:processing-elements/enhanced-uplane-mapping/uplane-mapping/up-markings/ipv4/upv4-dscp-name".)
sysrepoctl error: Failed to install modules (libyang error)
[INF] No datastore changes to apply.

diffserv-markings is defined in o-ran-interfaces.yang that I've already installed.

This is the partial o-ran-interfaces.yang

grouping dscp-marking {
    description
      "Configuration data for CU Plane DSCP marking";
    container diffserv-markings {
      description
        "DSCP Configuration";
      leaf u-plane-marking {
        type inet:dscp;
        default 46;
        description
          "Marking used for default u-plane flows.
          46 represents expedited forwarding";
      }

This is the installed module list

Module Name                        | Revision   | Flags | Owner     | Startup Perms | Submodules | Features
-----------------------------------------------------------------------------------------------------------
example-list                       |            | I     | root:root | 600           |            |
iana-hardware                      | 2018-03-13 | I     | root:root | 600           |            |
iana-if-type                       | 2017-01-19 | I     | root:root | 600           |            |
ietf-crypto-types                  | 2019-04-29 | I     | root:root | 600           |            |
ietf-datastores                    | 2018-02-14 | I     | root:root | 666           |            |
ietf-dhcpv6-types                  | 2018-09-04 | I     | root:root | 600           |            |
ietf-hardware                      | 2018-03-13 | I     | root:root | 600           |            |
ietf-inet-types                    | 2013-07-15 | I     | root:root | 444           |            |
ietf-interfaces                    | 2018-02-20 | I     | root:root | 600           |            |
ietf-ip                            | 2018-02-22 | I     | root:root | 600           |            |
ietf-netconf                       | 2013-09-29 | I     | root:root | 666           |            |
ietf-netconf-acm                   | 2018-02-14 | I     | root:root | 666           |            |
ietf-netconf-monitoring            | 2010-10-04 | I     | root:root | 600           |            |
ietf-netconf-notifications         | 2012-02-06 | I     | root:root | 666           |            |
ietf-netconf-with-defaults         | 2011-06-01 | I     | root:root | 666           |            |
ietf-network-instance              | 2019-01-21 | I     | root:root | 600           |            |
ietf-origin                        | 2018-02-14 | I     | root:root | 666           |            |
ietf-restconf                      | 2017-01-26 | I     | root:root | 600           |            |
ietf-subscribed-notifications      | 2019-09-09 | I     | root:root | 600           |            |
ietf-yang-library                  | 2019-01-04 | I     | root:root | 666           |            |
ietf-yang-metadata                 | 2016-08-05 | i     |           |               |            |
ietf-yang-schema-mount             | 2019-01-14 | I     | root:root | 666           |            |
ietf-yang-structure-ext            | 2020-06-17 | i     |           |               |            |
ietf-yang-types                    | 2013-07-15 | I     | root:root | 444           |            |
o-ran-ald                          | 2019-07-03 | I     | root:root | 600           |            |
o-ran-ald-port                     | 2019-07-03 | I     | root:root | 600           |            |
o-ran-antenna-calibration          | 2020-12-10 | I     | root:root | 600           |            |
o-ran-compression-factors          | 2020-08-10 | I     | root:root | 600           |            |
o-ran-delay-management             | 2020-08-10 | I     | root:root | 600           |            |
o-ran-dhcp                         | 2020-12-10 | I     | root:root | 600           |            |
o-ran-ethernet-forwarding          | 2020-04-17 | I     | root:root | 600           |            |
o-ran-externalio                   | 2019-07-03 | I     | root:root | 600           |            |
o-ran-fan                          | 2019-07-03 | I     | root:root | 600           |            |
o-ran-file-management              | 2019-07-03 | I     | root:root | 600           |            |
o-ran-fm                           | 2019-02-04 | I     | root:root | 600           |            |
o-ran-hardware                     | 2020-12-10 | I     | root:root | 600           |            |
o-ran-interfaces                   | 2020-12-10 | I     | root:root | 600           |            |
o-ran-laa                          | 2019-07-03 | I     | root:root | 600           |            |
o-ran-laa-operations               | 2019-07-03 | I     | root:root | 600           |            |
o-ran-lbm                          | 2019-02-04 | I     | root:root | 600           |            |
o-ran-module-cap                   | 2020-12-10 | I     | root:root | 600           |            |
o-ran-mplane-int                   | 2019-07-03 | I     | root:root | 600           |            |
o-ran-operations                   | 2020-12-10 | I     | root:root | 600           |            |
o-ran-software-management          | 2019-07-03 | I     | root:root | 600           |            |
o-ran-supervision                  | 2020-12-10 | I     | root:root | 600           |            |
o-ran-sync                         | 2020-08-10 | I     | root:root | 600           |            |
o-ran-trace                        | 2019-07-03 | I     | root:root | 600           |            |
o-ran-transceiver                  | 2019-07-03 | I     | root:root | 600           |            |
o-ran-troubleshooting              | 2019-02-04 | I     | root:root | 600           |            |
o-ran-udp-echo                     | 2019-02-04 | I     | root:root | 600           |            |
o-ran-usermgmt                     | 2020-12-10 | I     | root:root | 600           |            |
o-ran-ves-subscribed-notifications | 2020-12-10 | I     | root:root | 600           |            |
o-ran-wg4-features                 | 2020-12-10 | I     | root:root | 600           |            |
sysrepo-monitoring                 | 2022-08-19 | I     | root:root | 666           |            |
sysrepo-plugind                    | 2022-08-26 | I     | root:root | 666           |            |
yang                               | 2022-06-16 | I     | root:root | 666           |            |
michalvasko commented 1 year ago

The error is caused by the module not being compliant with the YANG spec (last paragraph). If you think it is, please provide the YANG module and I will check it.

vancouversun commented 1 year ago

Thanks for the reply.

o-ran-processing-element.yang

module o-ran-processing-element {
  yang-version 1.1;
  namespace "urn:o-ran:processing-element:1.0";
  prefix "o-ran-elements";

  import ietf-yang-types {
    prefix yang;
  }

  import ietf-inet-types {
    prefix "inet";
  }

  import ietf-interfaces {
    prefix "if";
  }

  import ietf-ip {
    prefix "ip";
  }

  import o-ran-interfaces {
    prefix "o-ran-int";
  }

  import o-ran-wg4-features {
    prefix "feat";
  }

  import o-ran-usermgmt {
    prefix "or-user";
  }

  organization "O-RAN Alliance";

  contact
    "www.o-ran.org";

  description
    "This module defines the YANG definitions for mapping of transport flows to
    processing elements. Three options are supported:
    i) virtual MAC based mapping
    ii) MAC address + VLAN-ID based mapping
    iii) UDP/IP based mapping

    Copyright 2020 the O-RAN Alliance.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
    this list of conditions and the above disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the above disclaimer in the documentation
    and/or other materials provided with the distribution.
    * Neither the Members of the O-RAN Alliance nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.";

  revision "2022-08-15" {
    description
      "version 10.0.0

      1) introducing SHARED-ORU-MULTI-OPERATOR feature
      2) fixing constraints";

    reference "ORAN-WG4.M.0-v10.00";
  }

  revision "2021-12-01" {
    description
      "version 8.0.0

      1) typographical corrections in descriptions.
      2) Add support for multiple transport-session-type per O-RU";

    reference "ORAN-WG4.M.0-v08.00";
  }

  revision "2020-04-17" {
    description
      "version 3.0.0

      1) added new enum SHARED-CELL-ETH-INTERFACE in
         transport-session-type and new containers north-eth-flow and
         south-eth-flow to enable Shared cell scenario.";

    reference "ORAN-WG4.M.0-v03.00";
  }

  revision "2019-07-03" {
    description
      "version 1.1.0

      1) added new leaf to enable O-RU to report the maximum number of
      transport flows it can support, e.g., due to restrictions on number
      of VLAN-IDs when Ethernet type transport is used.";

    reference "ORAN-WG4.M.0-v01.00";
  }
  revision "2019-02-04" {
    description
      "version 1.0.0

      1) imported model from xRAN
      2) changed namespace and reference from xran to o-ran";

    reference "ORAN-WG4.M.0-v01.00";
  }

  feature SHARED_CELL {
    description
      "Presence of feature indicates that this O-RU is capable to support
       shared cell.";
  }
// groupings

  grouping non-shared-cell-flow-group {
    description "a grouping for non-shared cell O-RU flows";

    container aliasmac-flow {
      when "../../../transport-session-type = 'ALIASMAC-INTERFACE'";
      if-feature o-ran-int:ALIASMAC-BASED-CU-PLANE;
      description "leafs for virtual mac type data flows";
      leaf ru-aliasmac-address {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:alias-macs";
        }
        mandatory true;
        description
          "O-RU's alias MAC address used for alias MAC based flow";
      }
      leaf vlan-id {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:vlan-id";
        }
        description
          "O-RU's VLAN-ID used for alias MAC based flow";
      }
      leaf o-du-mac-address {
        type yang:mac-address;
        mandatory true;
        description
          "O-DU's MAC address used for alias MAC based flow";
      }
    }
    container eth-flow {
      when "../../../transport-session-type = 'ETH-INTERFACE'";
      description "leafs for mac + vlan-id type data flows";
      leaf ru-mac-address {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:mac-address";
        }
        mandatory true;
        description
          "O-RU's MAC address used for Ethernet based flow";
      }
      leaf vlan-id {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:vlan-id";
        }
        mandatory true;
        description
          "O-RU's VLAN-ID used for Ethernet based flow";
      }
      leaf o-du-mac-address {
        type yang:mac-address;
        mandatory true;
        description
          "O-DU's MAC address used for Ethernet based flow";
      }
    }
    container udpip-flow {
      when "../../../transport-session-type = 'UDPIP-INTERFACE'";
      description "leafs for UDP/IP type data flows";
      choice address {
        leaf ru-ipv4-address {
          type leafref {
            path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/ip:ipv4/ip:address/ip:ip";
          }
          description "O-RU's IPv4 address";
        }
        leaf ru-ipv6-address {
          type leafref {
            path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/ip:ipv6/ip:address/ip:ip";
          }
          description "O-RU's IPv6 address";
        }
        mandatory true;
        description "choice of O-RU IPv4 or IPv6 address";
      }
      leaf o-du-ip-address {
        type inet:ip-address;
        mandatory true;
        description "O-DU's IP address";
      }
      leaf ru-ephemeral-udp-port {
        type inet:port-number;
        mandatory true;
        description
          "ephemeral port used by O-RU";
      }
      leaf o-du-ephemeral-udp-port {
        type inet:port-number;
        mandatory true;
        description
          "ephemeral port used by O-DU";
      }
      leaf ecpri-destination-udp {
        type inet:port-number;
        mandatory true;
        description "the well-known UDP port number used by eCPRI";
        // fixme - add in a default when allocated by IANA
      }
    }
  }

  grouping shared-cell-flow-group {
    description "a grouping for shared cell O-RU flows";

    container north-eth-flow {
      when "../../../transport-session-type = 'SHARED-CELL-ETH-INTERFACE'";
      if-feature "SHARED_CELL";
      description "leafs for mac + vlan-id type data flows";
      leaf ru-mac-address {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:mac-address";
        }
        description
          "O-RU's MAC address used for Ethernet based flow";
      }
      leaf vlan-id {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:vlan-id";
        }
        description
          "O-RU's VLAN-ID used for Ethernet based flow";
      }
      leaf north-node-mac-address {
        type yang:mac-address;
        description
          "North-node's MAC address used for Ethernet based flow";
      }
    }
    container south-eth-flow {
      when "../../../transport-session-type = 'SHARED-CELL-ETH-INTERFACE'";
      if-feature "SHARED_CELL";
      description "leafs for mac + vlan-id type data flows";
      leaf ru-mac-address {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:mac-address";
        }
        description
          "O-RU's MAC address used for Ethernet based flow";
      }
      leaf vlan-id {
        type leafref {
          path "/if:interfaces/if:interface[if:name = current()/../../interface-name]/o-ran-int:vlan-id";
        }
        description
          "O-RU's VLAN-ID used for Ethernet based flow";
      }
      leaf south-node-mac-address {
        type yang:mac-address;
        description
          "south-node's MAC address used for Ethernet based flow";
      }
    }
  }

  grouping session-and-markings-group {
    description "a grouping with transport session type and enhanced uplane markings";

    leaf transport-session-type {
      type enumeration {
        enum ETH-INTERFACE {
          description "VLAN based CUS Transport ";
        }
        enum UDPIP-INTERFACE {
          description "UDP/IP based CUS Transport ";
        }
        enum ALIASMAC-INTERFACE{
          description "Alias MAC address based CUS Transport ";
        }
        enum SHARED-CELL-ETH-INTERFACE {
          if-feature "SHARED_CELL";
          description "VLAN based CUS Transport used for Shared Cell scenario";
        }
      }
      default ETH-INTERFACE;
      description
        "the type of transport session used for identifying different processing
        elements";
    }
    container enhanced-uplane-mapping {
      presence "indicates that enhanced uplane mapping is used";
      description "a mapping table for enhanced user plane marking";
      list uplane-mapping {
        key "up-marking-name";
        description
          "a mapping between up-link name and o-ran-interfaces:up-marking-name";
        leaf up-marking-name {
          type string;
          description "a unique up marking name that is used for enhanced up marking";
        }
        choice up-markings {
          description
            "U-Plane markings";
          case ethernet {
            when "(../../transport-session-type = 'ALIASMAC-INTERFACE') or
            (../../transport-session-type = 'ETH-INTERFACE') or
            (../../transport-session-type = 'SHARED-CELL-ETH-INTERFACE')";
            leaf up-cos-name {
              type leafref {
                path "/if:interfaces/if:interface/o-ran-int:class-of-service/o-ran-int:enhanced-uplane-markings/o-ran-int:up-marking-name";
              }
              description "the Ethernet U-plane transport marking as defined in o-ran-interfaces";
            }
          }
          case ipv4 {
            when "(../../transport-session-type = 'UDPIP-INTERFACE')";
            leaf upv4-dscp-name {
             if-feature o-ran-int:UDPIP-BASED-CU-PLANE;
              type leafref {
                path "/if:interfaces/if:interface/ip:ipv4/o-ran-int:diffserv-markings/o-ran-int:enhanced-uplane-markings/o-ran-int:up-marking-name";
              }
              description "the IPv4 U-plane transport marking as defined in o-ran-interfaces";
            }
          }
          case ipv6 {
            when "(../../transport-session-type = 'UDPIP-INTERFACE')";
            leaf upv6-dscp-name {
             if-feature o-ran-int:UDPIP-BASED-CU-PLANE;
              type leafref {
                path "/if:interfaces/if:interface/ip:ipv6/o-ran-int:diffserv-markings/o-ran-int:enhanced-uplane-markings/o-ran-int:up-marking-name";
              }
              description "the IPv6 U-plane transport marking as defined in o-ran-interfaces";
            }
          }
        }
      }
    }
  }

  grouping pe-group {
    description "a grouping of processing elements";
    leaf maximum-number-of-transport-flows {
      type uint16 {
        range "1..4094";
      }
      default 4094;
      config false;
      description
        "The maximum number of transport flows that can be supported by an O-RU";
    }
    uses session-and-markings-group;

    list ru-elements {
      key "name";
      description
        "the list of transport definitions for each processing element";
      leaf name {
        type string {
          length "1..255";
        }
        description
          "A name that is unique across the O-RU that identifies a processing
          element instance.

          This name may be used in fault management to refer to a fault source
          or affected object";
      }
      leaf sro-id {
        if-feature feat:SHARED-ORU-MULTI-OPERATOR;
        type leafref {
          path "/or-user:users/or-user:user/or-user:sro-id";
        }
        description
          "The identity of a shared resource operator. When present,
          indicates that the list entry corresponds to a processing element
          associated with a shared resource operator where the sro-id identifies
          the specific shared resource operator";
      }
      container transport-flow {
        description
          "container for the transport-flow used for CU plane";
        leaf interface-name {
          type leafref {
            path "/if:interfaces/if:interface/if:name";
          }
          description "the interface name ";
        }
        uses non-shared-cell-flow-group;
        uses shared-cell-flow-group;

      }
    }
    list additional-transport-session-type-elements {
      if-feature "feat:MULTIPLE-TRANSPORT-SESSION-TYPE";
      key transport-session-type;

      description
        "Added to support multiple transport-session-type per O-RU,
         it is always assumed that /processing-elements/ru-elements/ is configured with the first type of transport,
         and /processing-element/additional-transport-session-elements/ru-elements/ is configured with the other types of transport.
         If the O-RU is configured for shared-cell, this list will not be used. An O-RU shall reject any configuration
         with a list entry with transport-session-type set to SHARED-CELL-ETH-INTERFACE";

      uses session-and-markings-group;

      list ru-elements {
        key "name";
        description
          "the list of transport definitions for each processing element";
        leaf name {
          type string {
            length "1..255";
          }
          description
            "A name that is unique across the O-RU that identifies a processing
            element instance.

            This name may be used in fault management to refer to a fault source
            or affected object";
        }
        leaf sro-id {
          if-feature feat:SHARED-ORU-MULTI-OPERATOR;
          type leafref {
            path "/or-user:users/or-user:user/or-user:sro-id";
          }
          description
            "The identity of a shared resource operator. When present,
            indicates that the list entry corresponds to a processing element
            associated with a shared resource operator where the sro-id identifies
            the specific shared resource operator";
        }
        container transport-flow {
          description
            "container for the transport-flow used for CU plane";
          leaf interface-name {
            type leafref {
              path "/if:interfaces/if:interface/if:name";
            }
            description "the interface name ";
          }
          uses non-shared-cell-flow-group;
        }
      }
    }
  }

// top-level container

  container processing-elements {
    description
      "a model defining the mapping between transport flows and arbitrary
      O-RAN processing elements. A processing element may be then defined for
      handling connectivity or delay procedures, or defined with a corresponding
      eaxcid for CU plane operations";
    uses pe-group;
  }
}

o-ran-interfaces.yang

module o-ran-interfaces {
  yang-version 1.1;
  namespace "urn:o-ran:interfaces:1.0";
  prefix "o-ran-int";

  import ietf-inet-types {
    prefix "inet";
  }

  import iana-if-type {
    prefix "ianaift";
  }

  import ietf-interfaces {
    prefix "if";
  }

  import ietf-ip {
    prefix "ip";
  }

  import ietf-hardware {
    prefix "hw";
  }

  import ietf-yang-types {
    prefix "yang";
  }

  import iana-hardware {
    prefix "ianahw";
  }

  organization "O-RAN Alliance";

  contact
    "www.o-ran.org";

  description
    "This module defines the YANG definitions for managing the O-RAN
     interfaces.

    Copyright 2021 the O-RAN Alliance.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
    this list of conditions and the above disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the above disclaimer in the documentation
    and/or other materials provided with the distribution.
    * Neither the Members of the O-RAN Alliance nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.";

  revision "2021-12-01" {
    description
      "version 5.2.0

      1) typographical corrections in descriptions.";

    reference "ORAN-WG4.M.0-v05.00";
  }

  revision "2021-03-22" {
    description
      "version 5.1.0

      1) typographical corrections in descriptions.";

    reference "ORAN-WG4.M.0-v05.00";
  }

  revision "2020-12-10" {
    description
      "version 5.0.0

      1) new functionality to describe over subscribed resources";

    reference "ORAN-WG4.M.0-v05.00";
  }

  revision "2020-04-17" {
    description
      "version 1.2.0

      1) updated descriptions to clarify operation when vlan-tagging is false";

    reference "ORAN-WG4.M.0-v03.00";
  }
  revision "2019-07-03" {
    description
      "version 1.1.0

      1) increasing max elements for user plane DSCP markings to 64
      2) re-organizing layout to facilitate cross-WG adoption, whilst ensuring
      nodes are syntactically and semantically equivalent";

    reference "ORAN-WG4.M.0-v01.00";
  }

  revision "2019-02-04" {
    description
      "version 1.0.0

      1) imported model from xRAN
      2) changed namespace and reference from xran to o-ran";

    reference "ORAN-WG4.M.0-v01.00";
  }

  feature UDPIP-BASED-CU-PLANE {
    description
      "This feature indicates that the RU supports the UDP/IP based transport
      for the CU plane.";
  }

  feature ALIASMAC-BASED-CU-PLANE {
    description
      "This feature indicates that the RU supports the alias MAC address
       based transport for the CU plane.";
  }

  typedef pcp {
    type uint8 {
      range "0..7";
    }
    description
      "Priority Code Point. PCP is a 3-bit field that refers to the
      class of service applied to a VLAN tagged frame.  The
      field specifies a priority value between 0 and 7, these values
      can be used by quality of service (QoS) to prioritize
      different classes of traffic.";
    reference
     "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks";
  }

  grouping cos-marking {
    description
      "Configuration data for CU Plane ethernet CoS marking.
      This grouping is only applicable to an interface when vlan-tagging is
      set to TRUE for that interface. In other cases, it may be ignored.";
    container class-of-service {
      description
        "CoS Configuration";
      leaf u-plane-marking {
        type pcp;
        default 7;
        description
          "Marking used for default u-plane flows.
          7 represents highest priority for u-plane marking";
      }
      leaf c-plane-marking {
        type pcp;
        default 7;
        description "7 represents highest priority for c-plane marking";
      }
      leaf m-plane-marking {
        type pcp;
        default 2;
        description "2 represents highest excellent effort for m-plane marking";
      }
      leaf s-plane-marking {
        type pcp;
        default 7;
        description "7 represents highest priority for s-plane marking";
      }
      leaf other-marking {
        type pcp;
        default 1;
        description "1 represents best effort for other marking";
      }
      list enhanced-uplane-markings{
        key "up-marking-name";
        max-elements 4;
        description
          "list of mappings for enhanced (non-default) u-plane markings";
        leaf up-marking-name {
          type string;
          description "The name of the marking";
        }
        leaf enhanced-marking {
          type pcp;
          description "the enhanced u-plane marking";
        }
      }
    }
  }

  grouping dscp-marking {
    description
      "Configuration data for CU Plane DSCP marking";
    container diffserv-markings {
      description
        "DSCP Configuration";
      leaf u-plane-marking {
        type inet:dscp;
        default 46;
        description
          "Marking used for default u-plane flows.
          46 represents expedited forwarding";
      }
      leaf c-plane-marking {
        type inet:dscp;
        default 46;
        description "46 represents expedited forwarding";
      }
      leaf s-plane-marking {
        type inet:dscp;
        default 46;
        description "46 represents expedited forwarding";
      }
      leaf other-marking {
        type inet:dscp;
        default 0;
        description "0 represents best effort forwarding";
      }
      list enhanced-uplane-markings{
        key up-marking-name;
        max-elements 64;
        description
          "list of mappings for enhanced (non-default) u-plane markings";
        leaf up-marking-name {
          type string;
          description "The name of the marking";
        }
        leaf enhanced-marking {
          type inet:dscp;
          description "the enhanced u-plane marking";
        }
      }
    }
  }

  rpc reset-interface-counters {
    description
      "Management plane triggered restart of the interface counters.";
  }

// Cross Working Group Augmentations Follow

// Cross Working Group augmentations for basic Ethernet leafs

  augment "/if:interfaces/if:interface" {
    when "if:type = 'ianaift:ethernetCsmacd'" {
      description "Applies to Ethernet interfaces";
    }
    description
      "Augment the interface model with parameters for
      base Ethernet interface";

    leaf l2-mtu {
      type uint16 {
        range "64 .. 65535";
      }
      units bytes;
      default 1500;
      description
        "The maximum size of layer 2 frames that may be transmitted
        or received on the interface (excluding any FCS overhead).
        For Ethernet interfaces it also excludes the
        4-8 byte overhead of any known (i.e. explicitly matched by
        a child sub-interface) 801.1Q VLAN tags.";
    }
    leaf vlan-tagging {
      type boolean;
      default true;
      description
        "Indicates if VLAN tagging is used.
        Default true is used to enable equipment to autonomously discover that
        it is connected to a trunk port.

        This may be set to false, for example, when the O-RU is directly
        connected to the O-DU. In such cases, native Ethernet frames may be
        used across the O-RAN interface, i.e., any PCP markings defined
        in the cos-markings grouping are NOT used by the O-RU and any default
        value or configured value using those leafs may be ignored by the O-RAN
        equipment.";
    }
    uses cos-marking;

// interface-grouping insert - begin;

    leaf-list interface-groups-id {
      type leafref {
        path "/if:interfaces/o-ran-int:interface-grouping/o-ran-int:interfaces-groups/o-ran-int:interface-group-id";
      }
      config false;
      description
        "an optional leaf used when the sustained rate able to be supported by an interface
        is less than nominal bit rate indicated by o-ran-transceiver.yang

        Identifies interface grouping particular physical hardware MAC address belongs to.";
    }

// interface-grouping insert - end;

  }

// Cross Working Group augmentation for l2vlan interfaces for VLAN definition

  augment "/if:interfaces/if:interface" {
    when "if:type = 'ianaift:l2vlan'";
    description "augments for VLAN definition";
    leaf base-interface {
      type if:interface-ref;
      must "/if:interfaces/if:interface[if:name = current()]"
            + "/o-ran-int:vlan-tagging = 'true'" {
        description
          "The base interface must have VLAN tagging enabled.";
      }
      description
        "The base interface for the VLAN sub-interface.";
    }
    leaf vlan-id {
      type uint16 {
        range "1..4094";
      }
      description
        "The VLAN-ID.";
    }
  }

// Cross Working Group augmentation for both ethernetCsmacd and l2vlan interfaces

  augment "/if:interfaces/if:interface" {
    when "(if:type = 'ianaift:ethernetCsmacd') or
          (if:type = 'ianaift:l2vlan')" {
      description "Applies to ethernetCsmacd and l2vlan interfaces";
    }
    description
      "Augment the interface model with parameters for all
      both ethernetCsmacd and l2vlan interfaces.";
    leaf last-cleared {
      type yang:date-and-time;
      config false;
      description
        "Timestamp of the last time the interface counters were
        cleared.";
    }
  }

// Cross Working Group augmentation to ietf-ip covering DSCP for M-Plane

augment "/if:interfaces/if:interface/ip:ipv4" {
  description "augments for IPv4 based M-Plane transport";
  leaf m-plane-marking {
    type inet:dscp;
    default 18;
    description "18 represents AF21 or 'immediate traffic'";
  }
}
augment "/if:interfaces/if:interface/ip:ipv6" {
  description "augments for IPv6 based M-Plane transport";
  leaf m-plane-marking {
    type inet:dscp;
    default 18;
    description "18 represents AF21 or 'immediate traffic'";
  }
}

// WG4 Specific Augmentations Follow

// WG4 Augmentation for basic Ethernet leafs

  augment "/if:interfaces/if:interface" {
    when "if:type = 'ianaift:ethernetCsmacd'" {
      description
        "Applies to WG4 Ethernet interfaces for alias MAC based CU-Plane";
    }
    if-feature ALIASMAC-BASED-CU-PLANE;
    description
      "Augment the interface model with parameters for
      base Ethernet interface";

    leaf-list alias-macs {
      type yang:mac-address;

      description
        "Augments interfaces with range of alias MAC addresses.";
    }

  }

// WG4 Augmentation for both ethernetCsmacd and l2vlan interfaces

  augment "/if:interfaces/if:interface" {
    when "(if:type = 'ianaift:ethernetCsmacd') or
          (if:type = 'ianaift:l2vlan')" {
      description "Applies to ethernetCsmacd and l2vlan interfaces";
    }
    description
      "Augment the interface model with parameters for all
      both ethernetCsmacd and l2vlan interfaces.";
    leaf mac-address {
      type yang:mac-address;

      description
        "The MAC address of the interface.";
    }

    container port-reference {
      description
        "a port reference used by other O-RAN modules";
      leaf port-name {
        type leafref {
          path '/hw:hardware/hw:component/hw:name';
        }
        must "derived-from-or-self(deref(current())/../hw:class, 'ianahw:port')";
// TAKE NOTE - depending on version of pyang, this may generate various
// warnings, e.g., warning: XPath for "port-name" does not exist
        description
          "O-RAN interfaces use a reference to a physical port component.

          In this case, the component name referenced must be of class type
          port, i.e., when /hw:hardware/hw:component/hw:class is derived from
          ianahw:port";
      }
      leaf port-number {
        type uint8;
        description
          "A number allocated by the server which identifies a port.
          Port number value is 0 to N-1 where N is number of ports
          in the device.

          This value is fixed for the lifetime of the equipment, i.e., cannot be
          changed during equipment reboots.";
      }
    }
  }

// WG4 specific augmentation to ietf-ip covering DSCP for CUS Plane

  augment "/if:interfaces/if:interface/ip:ipv4" {
    if-feature UDPIP-BASED-CU-PLANE;
    description "augments for IPv4 based CUS transport";
    uses dscp-marking;
  }
  augment "/if:interfaces/if:interface/ip:ipv6" {
    if-feature UDPIP-BASED-CU-PLANE;
    description "augments for IPv6 based CUS transport";
    uses dscp-marking;
  }

// Other Working Group Specific Augmentations Follow Here

// interface-grouping insert - begin;

  augment "/if:interfaces" {
    description "augments interfaces for groupings of physical hardware addresses that can be used to group Ethernet ports";

    container interface-grouping {

      presence
        "indicates maximum sustained throughput of an O-RU is less than the combined bandwidth of all physical ports";

      config false;

      description
        "A container used by an O-RU where the maximum sustained throughput
        of an O-RU is less than the combined bandwidth of all physical ports";

      list interfaces-groups {
        key interface-group-id;
        description "List of interface groups.";

        leaf interface-group-id {
          type uint8;
          description "interface group identifier.";
        }

        leaf max-sustainable-ingress-bandwidth {
          type uint32;
          units Mbps;
          description
            "Maximum sustainable ingress bandwidth the interface group can handle. The sustainable bandwidth is calculated
            over one radio frame.

            The peak ingress bandwidth may exceed the sustainable bandwidth for periods shorter than a radio frame period.";
        }

        leaf max-sustainable-egress-bandwidth {
          type uint32;
          units Mbps;
          description
            "Maximum sustainable egress bandwidth the interface group can handle. The sustainable bandwidth is calculated
            over one radio frame.";
        }
      }
    }
  }
// interface-grouping insert - end;

}

ietf-ip.yang

module ietf-ip {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-ip";
  prefix ip;

  import ietf-interfaces {
    prefix if;
  }
  import ietf-inet-types {
    prefix inet;
  }
  import ietf-yang-types {
    prefix yang;
  }

  organization
    "IETF NETMOD (Network Modeling) Working Group";

  contact
    "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>
     Editor:   Martin Bjorklund
               <mailto:mbj@tail-f.com>";
  description
    "This module contains a collection of YANG definitions for
     managing IP implementations.
     Copyright (c) 2018 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.
     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).
     This version of this YANG module is part of RFC 8344; see
     the RFC itself for full legal notices.";

  revision 2018-02-22 {
    description
      "Updated to support NMDA.";
    reference
      "RFC 8344: A YANG Data Model for IP Management";
  }

  revision 2014-06-16 {
    description
      "Initial revision.";
    reference
      "RFC 7277: A YANG Data Model for IP Management";
  }

  /*
   * Features
   */

  feature ipv4-non-contiguous-netmasks {
    description
      "Indicates support for configuring non-contiguous
       subnet masks.";
  }

  feature ipv6-privacy-autoconf {
    description
      "Indicates support for privacy extensions for stateless address
       autoconfiguration in IPv6.";
    reference
      "RFC 4941: Privacy Extensions for Stateless Address
                 Autoconfiguration in IPv6";
  }

  /*
   * Typedefs
   */

  typedef ip-address-origin {
    type enumeration {
      enum other {
        description
          "None of the following.";
      }

      enum static {
        description
          "Indicates that the address has been statically
           configured -- for example, using the Network Configuration
           Protocol (NETCONF) or a command line interface.";
      }
      enum dhcp {
        description
          "Indicates an address that has been assigned to this
           system by a DHCP server.";
      }
      enum link-layer {
        description
          "Indicates an address created by IPv6 stateless
           autoconfiguration that embeds a link-layer address in its
           interface identifier.";
      }
      enum random {
        description
          "Indicates an address chosen by the system at
           random, e.g., an IPv4 address within 169.254/16, a
           temporary address as described in RFC 4941, or a
           semantically opaque address as described in RFC 7217.";
        reference
          "RFC 4941: Privacy Extensions for Stateless Address
                     Autoconfiguration in IPv6
           RFC 7217: A Method for Generating Semantically Opaque
                     Interface Identifiers with IPv6 Stateless
                     Address Autoconfiguration (SLAAC)";
      }
    }
    description
      "The origin of an address.";
  }

  typedef neighbor-origin {
    type enumeration {
      enum other {
        description
          "None of the following.";
      }
      enum static {
        description
          "Indicates that the mapping has been statically
           configured -- for example, using NETCONF or a command line
           interface.";
      }

      enum dynamic {
        description
          "Indicates that the mapping has been dynamically resolved
           using, for example, IPv4 ARP or the IPv6 Neighbor
           Discovery protocol.";
      }
    }
    description
      "The origin of a neighbor entry.";
  }

  /*
   * Data nodes
   */

  augment "/if:interfaces/if:interface" {
    description
      "IP parameters on interfaces.
       If an interface is not capable of running IP, the server
       must not allow the client to configure these parameters.";

    container ipv4 {
      presence
        "Enables IPv4 unless the 'enabled' leaf
         (which defaults to 'true') is set to 'false'";
      description
        "Parameters for the IPv4 address family.";

      leaf enabled {
        type boolean;
        default true;
        description
          "Controls whether IPv4 is enabled or disabled on this
           interface.  When IPv4 is enabled, this interface is
           connected to an IPv4 stack, and the interface can send
           and receive IPv4 packets.";
      }
      leaf forwarding {
        type boolean;
        default false;
        description
          "Controls IPv4 packet forwarding of datagrams received by,
           but not addressed to, this interface.  IPv4 routers
           forward datagrams.  IPv4 hosts do not (except those
           source-routed via the host).";
      }

      leaf mtu {
        type uint16 {
          range "68..max";
        }
        units "octets";
        description
          "The size, in octets, of the largest IPv4 packet that the
           interface will send and receive.
           The server may restrict the allowed values for this leaf,
           depending on the interface's type.
           If this leaf is not configured, the operationally used MTU
           depends on the interface's type.";
        reference
          "RFC 791: Internet Protocol";
      }
      list address {
        key "ip";
        description
          "The list of IPv4 addresses on the interface.";

        leaf ip {
          type inet:ipv4-address-no-zone;
          description
            "The IPv4 address on the interface.";
        }
        choice subnet {
          mandatory true;
          description
            "The subnet can be specified as a prefix length or,
             if the server supports non-contiguous netmasks, as
             a netmask.";
          leaf prefix-length {
            type uint8 {
              range "0..32";
            }
            description
              "The length of the subnet prefix.";
          }
          leaf netmask {
            if-feature ipv4-non-contiguous-netmasks;
            type yang:dotted-quad;
            description
              "The subnet specified as a netmask.";
          }
        }

        leaf origin {
          type ip-address-origin;
          config false;
          description
            "The origin of this address.";
        }
      }
      list neighbor {
        key "ip";
        description
          "A list of mappings from IPv4 addresses to
           link-layer addresses.
           Entries in this list in the intended configuration are
           used as static entries in the ARP Cache.
           In the operational state, this list represents the ARP
           Cache.";
        reference
          "RFC 826: An Ethernet Address Resolution Protocol";

        leaf ip {
          type inet:ipv4-address-no-zone;
          description
            "The IPv4 address of the neighbor node.";
        }
        leaf link-layer-address {
          type yang:phys-address;
          mandatory true;
          description
            "The link-layer address of the neighbor node.";
        }
        leaf origin {
          type neighbor-origin;
          config false;
          description
            "The origin of this neighbor entry.";
        }
      }
    }

    container ipv6 {
      presence
        "Enables IPv6 unless the 'enabled' leaf
         (which defaults to 'true') is set to 'false'";
      description
        "Parameters for the IPv6 address family.";

      leaf enabled {
        type boolean;
        default true;
        description
          "Controls whether IPv6 is enabled or disabled on this
           interface.  When IPv6 is enabled, this interface is
           connected to an IPv6 stack, and the interface can send
           and receive IPv6 packets.";
      }
      leaf forwarding {
        type boolean;
        default false;
        description
          "Controls IPv6 packet forwarding of datagrams received by,
           but not addressed to, this interface.  IPv6 routers
           forward datagrams.  IPv6 hosts do not (except those
           source-routed via the host).";
        reference
          "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                     Section 6.2.1, IsRouter";
      }
      leaf mtu {
        type uint32 {
          range "1280..max";
        }
        units "octets";
        description
          "The size, in octets, of the largest IPv6 packet that the
           interface will send and receive.
           The server may restrict the allowed values for this leaf,
           depending on the interface's type.
           If this leaf is not configured, the operationally used MTU
           depends on the interface's type.";
        reference
          "RFC 8200: Internet Protocol, Version 6 (IPv6)
                     Specification
                     Section 5";
      }

      list address {
        key "ip";
        description
          "The list of IPv6 addresses on the interface.";

        leaf ip {
          type inet:ipv6-address-no-zone;
          description
            "The IPv6 address on the interface.";
        }
        leaf prefix-length {
          type uint8 {
            range "0..128";
          }
          mandatory true;
          description
            "The length of the subnet prefix.";
        }
        leaf origin {
          type ip-address-origin;
          config false;
          description
            "The origin of this address.";
        }
        leaf status {
          type enumeration {
            enum preferred {
              description
                "This is a valid address that can appear as the
                 destination or source address of a packet.";
            }
            enum deprecated {
              description
                "This is a valid but deprecated address that should
                 no longer be used as a source address in new
                 communications, but packets addressed to such an
                 address are processed as expected.";
            }
            enum invalid {
              description
                "This isn't a valid address, and it shouldn't appear
                 as the destination or source address of a packet.";
            }

            enum inaccessible {
              description
                "The address is not accessible because the interface
                 to which this address is assigned is not
                 operational.";
            }
            enum unknown {
              description
                "The status cannot be determined for some reason.";
            }
            enum tentative {
              description
                "The uniqueness of the address on the link is being
                 verified.  Addresses in this state should not be
                 used for general communication and should only be
                 used to determine the uniqueness of the address.";
            }
            enum duplicate {
              description
                "The address has been determined to be non-unique on
                 the link and so must not be used.";
            }
            enum optimistic {
              description
                "The address is available for use, subject to
                 restrictions, while its uniqueness on a link is
                 being verified.";
            }
          }
          config false;
          description
            "The status of an address.  Most of the states correspond
             to states from the IPv6 Stateless Address
             Autoconfiguration protocol.";
          reference
            "RFC 4293: Management Information Base for the
                       Internet Protocol (IP)
                       - IpAddressStatusTC
             RFC 4862: IPv6 Stateless Address Autoconfiguration";
        }
      }

      list neighbor {
        key "ip";
        description
          "A list of mappings from IPv6 addresses to
           link-layer addresses.
           Entries in this list in the intended configuration are
           used as static entries in the Neighbor Cache.
           In the operational state, this list represents the
           Neighbor Cache.";
        reference
          "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";

        leaf ip {
          type inet:ipv6-address-no-zone;
          description
            "The IPv6 address of the neighbor node.";
        }
        leaf link-layer-address {
          type yang:phys-address;
          mandatory true;
          description
            "The link-layer address of the neighbor node.
             In the operational state, if the neighbor's 'state' leaf
             is 'incomplete', this leaf is not instantiated.";
        }
        leaf origin {
          type neighbor-origin;
          config false;
          description
            "The origin of this neighbor entry.";
        }
        leaf is-router {
          type empty;
          config false;
          description
            "Indicates that the neighbor node acts as a router.";
        }

        leaf state {
          type enumeration {
            enum incomplete {
              description
                "Address resolution is in progress, and the
                 link-layer address of the neighbor has not yet been
                 determined.";
            }
            enum reachable {
              description
                "Roughly speaking, the neighbor is known to have been
                 reachable recently (within tens of seconds ago).";
            }
            enum stale {
              description
                "The neighbor is no longer known to be reachable, but
                 until traffic is sent to the neighbor no attempt
                 should be made to verify its reachability.";
            }
            enum delay {
              description
                "The neighbor is no longer known to be reachable, and
                 traffic has recently been sent to the neighbor.
                 Rather than probe the neighbor immediately, however,
                 delay sending probes for a short while in order to
                 give upper-layer protocols a chance to provide
                 reachability confirmation.";
            }
            enum probe {
              description
                "The neighbor is no longer known to be reachable, and
                 unicast Neighbor Solicitation probes are being sent
                 to verify reachability.";
            }
          }
          config false;
          description
            "The Neighbor Unreachability Detection state of this
             entry.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                       Section 7.3.2";
        }
      }

      leaf dup-addr-detect-transmits {
        type uint32;
        default 1;
        description
          "The number of consecutive Neighbor Solicitation messages
           sent while performing Duplicate Address Detection on a
           tentative address.  A value of zero indicates that
           Duplicate Address Detection is not performed on
           tentative addresses.  A value of one indicates a single
           transmission with no follow-up retransmissions.";
        reference
          "RFC 4862: IPv6 Stateless Address Autoconfiguration";
      }
      container autoconf {
        description
          "Parameters to control the autoconfiguration of IPv6
           addresses, as described in RFC 4862.";
        reference
          "RFC 4862: IPv6 Stateless Address Autoconfiguration";

        leaf create-global-addresses {
          type boolean;
          default true;
          description
            "If enabled, the host creates global addresses as
             described in RFC 4862.";
          reference
            "RFC 4862: IPv6 Stateless Address Autoconfiguration
                       Section 5.5";
        }
        leaf create-temporary-addresses {
          if-feature ipv6-privacy-autoconf;
          type boolean;
          default false;
          description
            "If enabled, the host creates temporary addresses as
             described in RFC 4941.";
          reference
            "RFC 4941: Privacy Extensions for Stateless Address
                       Autoconfiguration in IPv6";
        }

        leaf temporary-valid-lifetime {
          if-feature ipv6-privacy-autoconf;
          type uint32;
          units "seconds";
          default 604800;
          description
            "The time period during which the temporary address
             is valid.";
          reference
            "RFC 4941: Privacy Extensions for Stateless Address
                       Autoconfiguration in IPv6
                       - TEMP_VALID_LIFETIME";
        }
        leaf temporary-preferred-lifetime {
          if-feature ipv6-privacy-autoconf;
          type uint32;
          units "seconds";
          default 86400;
          description
            "The time period during which the temporary address is
             preferred.";
          reference
            "RFC 4941: Privacy Extensions for Stateless Address
                       Autoconfiguration in IPv6
                       - TEMP_PREFERRED_LIFETIME";
        }
      }
    }
  }

  /*
   * Legacy operational state data nodes
   */

  augment "/if:interfaces-state/if:interface" {
    status deprecated;
    description
      "Data nodes for the operational state of IP on interfaces.";

    container ipv4 {
      presence
        "Present if IPv4 is enabled on this interface";
      config false;
      status deprecated;
      description
        "Interface-specific parameters for the IPv4 address family.";

      leaf forwarding {
        type boolean;
        status deprecated;
        description
          "Indicates whether IPv4 packet forwarding is enabled or
           disabled on this interface.";
      }
      leaf mtu {
        type uint16 {
          range "68..max";
        }
        units "octets";
        status deprecated;
        description
          "The size, in octets, of the largest IPv4 packet that the
           interface will send and receive.";
        reference
          "RFC 791: Internet Protocol";
      }
      list address {
        key "ip";
        status deprecated;
        description
          "The list of IPv4 addresses on the interface.";

        leaf ip {
          type inet:ipv4-address-no-zone;
          status deprecated;
          description
            "The IPv4 address on the interface.";
        }
        choice subnet {
          status deprecated;
          description
            "The subnet can be specified as a prefix length or,
             if the server supports non-contiguous netmasks, as
             a netmask.";
          leaf prefix-length {
            type uint8 {
              range "0..32";
            }
            status deprecated;
            description
              "The length of the subnet prefix.";
          }
          leaf netmask {
            if-feature ipv4-non-contiguous-netmasks;
            type yang:dotted-quad;
            status deprecated;
            description
              "The subnet specified as a netmask.";
          }
        }
        leaf origin {
          type ip-address-origin;
          status deprecated;
          description
            "The origin of this address.";
        }
      }
      list neighbor {
        key "ip";
        status deprecated;
        description
          "A list of mappings from IPv4 addresses to
           link-layer addresses.
           This list represents the ARP Cache.";
        reference
          "RFC 826: An Ethernet Address Resolution Protocol";

        leaf ip {
          type inet:ipv4-address-no-zone;
          status deprecated;
          description
            "The IPv4 address of the neighbor node.";
        }

        leaf link-layer-address {
          type yang:phys-address;
          status deprecated;
          description
            "The link-layer address of the neighbor node.";
        }
        leaf origin {
          type neighbor-origin;
          status deprecated;
          description
            "The origin of this neighbor entry.";
        }
      }
    }

    container ipv6 {
      presence
        "Present if IPv6 is enabled on this interface";
      config false;
      status deprecated;
      description
        "Parameters for the IPv6 address family.";

      leaf forwarding {
        type boolean;
        default false;
        status deprecated;
        description
          "Indicates whether IPv6 packet forwarding is enabled or
           disabled on this interface.";
        reference
          "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                     Section 6.2.1, IsRouter";
      }
      leaf mtu {
        type uint32 {
          range "1280..max";
        }
        units "octets";
        status deprecated;
        description
          "The size, in octets, of the largest IPv6 packet that the
           interface will send and receive.";
        reference
          "RFC 8200: Internet Protocol, Version 6 (IPv6)
                     Specification
                     Section 5";
      }
      list address {
        key "ip";
        status deprecated;
        description
          "The list of IPv6 addresses on the interface.";

        leaf ip {
          type inet:ipv6-address-no-zone;
          status deprecated;
          description
            "The IPv6 address on the interface.";
        }
        leaf prefix-length {
          type uint8 {
            range "0..128";
          }
          mandatory true;
          status deprecated;
          description
            "The length of the subnet prefix.";
        }
        leaf origin {
          type ip-address-origin;
          status deprecated;
          description
            "The origin of this address.";
        }
        leaf status {
          type enumeration {
            enum preferred {
              description
                "This is a valid address that can appear as the
                 destination or source address of a packet.";
            }
            enum deprecated {
              description
                "This is a valid but deprecated address that should
                 no longer be used as a source address in new
                 communications, but packets addressed to such an
                 address are processed as expected.";
            }
            enum invalid {
              description
                "This isn't a valid address, and it shouldn't appear
                 as the destination or source address of a packet.";
            }

            enum inaccessible {
              description
                "The address is not accessible because the interface
                 to which this address is assigned is not
                 operational.";
            }
            enum unknown {
              description
                "The status cannot be determined for some reason.";
            }
            enum tentative {
              description
                "The uniqueness of the address on the link is being
                 verified.  Addresses in this state should not be
                 used for general communication and should only be
                 used to determine the uniqueness of the address.";
            }
            enum duplicate {
              description
                "The address has been determined to be non-unique on
                 the link and so must not be used.";
            }
            enum optimistic {
              description
                "The address is available for use, subject to
                 restrictions, while its uniqueness on a link is
                 being verified.";
            }
          }
          status deprecated;
          description
            "The status of an address.  Most of the states correspond
             to states from the IPv6 Stateless Address
             Autoconfiguration protocol.";
          reference
            "RFC 4293: Management Information Base for the
                       Internet Protocol (IP)
                       - IpAddressStatusTC
             RFC 4862: IPv6 Stateless Address Autoconfiguration";
        }
      }

      list neighbor {
        key "ip";
        status deprecated;
        description
          "A list of mappings from IPv6 addresses to
           link-layer addresses.
           This list represents the Neighbor Cache.";
        reference
          "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";

        leaf ip {
          type inet:ipv6-address-no-zone;
          status deprecated;
          description
            "The IPv6 address of the neighbor node.";
        }
        leaf link-layer-address {
          type yang:phys-address;
          status deprecated;
          description
            "The link-layer address of the neighbor node.";
        }
        leaf origin {
          type neighbor-origin;
          status deprecated;
          description
            "The origin of this neighbor entry.";
        }
        leaf is-router {
          type empty;
          status deprecated;
          description
            "Indicates that the neighbor node acts as a router.";
        }
        leaf state {
          type enumeration {
            enum incomplete {
              description
                "Address resolution is in progress, and the
                 link-layer address of the neighbor has not yet been
                 determined.";
            }
            enum reachable {
              description
                "Roughly speaking, the neighbor is known to have been
                 reachable recently (within tens of seconds ago).";
            }
            enum stale {
              description
                "The neighbor is no longer known to be reachable, but
                 until traffic is sent to the neighbor no attempt
                 should be made to verify its reachability.";
            }
            enum delay {
              description
                "The neighbor is no longer known to be reachable, and
                 traffic has recently been sent to the neighbor.
                 Rather than probe the neighbor immediately, however,
                 delay sending probes for a short while in order to
                 give upper-layer protocols a chance to provide
                 reachability confirmation.";
            }
            enum probe {
              description
                "The neighbor is no longer known to be reachable, and
                 unicast Neighbor Solicitation probes are being sent
                 to verify reachability.";
            }
          }
          status deprecated;
          description
            "The Neighbor Unreachability Detection state of this
             entry.";
          reference
            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                       Section 7.3.2";
        }
      }
    }
  }
}
michalvasko commented 1 year ago

I am not able to load the module without its imports o-ran-usermgmt and o-ran-wg4-features, some revisions of these modules I found online seem to be too old and differ from the ones you are using. Please provide them but I think, based on the extensive usage of if-features that the error is correct and the YANG modules are not.

vancouversun commented 1 year ago

Please use this URL to download whole o-ran yang models that I am using. https://orandownloadsweb.azurewebsites.net/download?id=46

michalvasko commented 1 year ago

Thanks, so the leafref /o-ran-processing-element:processing-elements/enhanced-uplane-mapping/uplane-mapping/up-markings/ipv4/upv4-dscp-name target /if:interfaces/if:interface/ip:ipv4/o-ran-int:diffserv-markings is conditional based on the feature UDPIP-BASED-CU-PLANE, the leafref itself has no if-features. That is in direct conflict with the paragraph I referenced before making the YANG o-ran-processing-element invalid.

vancouversun commented 1 year ago

Thanks for the reply. Is there a way to fix it to install o-ran-processing-element.yang?

michalvasko commented 1 year ago

Well, yes, just get rid of the problem I have mentioned but you will have to use a modified YANG module.

Agao404 commented 1 year ago

I encountered the same error today while installing o-ran-processing-element.yang, and the current environment is the latest version deployed. Error message:

sysrepoctl -i /yangfile/o-ran-processing-element.yang -s /yangfile -o root -g root -v3

[INF] Connection 82 created. [ERR] Not found node "diffserv-markings" in path. (Schema location "/o-ran-processing-element:processing-elements/enhanced-uplane-mapping/uplane-mapping/up-markings/ipv4/upv4-dscp-name".) [ERR] Target of leafref "upv4-dscp-name" cannot be referenced because it is disabled. (Schema location "/o-ran-processing-element:processing-elements/enhanced-uplane-mapping/uplane-mapping/up-markings/ipv4/upv4-dscp-name".) sysrepoctl error: Failed to install modules (libyang error)

sysrepoctl -c o-ran-interfaces -e UDPIP-BASED-CU-PLANE -e ALIASMAC-BASED-CU-PLANE

After I enabled the UDPIP-BASED-CU-PLANE and ALIASMAC-BASED-CU-PLANE features of o-ran-interfaces, the installation was successful....