netconfcentral logo

example-network-device@2017-03-13



  module example-network-device {

    yang-version 1;

    namespace "urn:example:network-device";

    prefix nd;

    organization
      "IETF RTG YANG Design Team Collaboration
                with OpenConfig";

    contact
      "Routing Area YANG Architecture Design Team -
       <rtg-dt-yang-arch@ietf.org>";

    description
      "This module describes a model structure for YANG
     configuration and operational state data models. Its intent is
     to describe how individual device protocol and feature models
     fit together and interact.";

    revision "2017-03-13" {
      description
        "IETF Routing YANG Design Team Meta-Model";
      reference
        "TBD";

    }


    identity oam-protocol-type {
      base 
      description
        "Base identity for derivation of OAM protocols";
    }

    identity network-service-type {
      base 
      description
        "Base identity for derivation of network services";
    }

    identity system-management-protocol-type {
      base 
      description
        "Base identity for derivation of system management
           protocols";
    }

    identity oam-service-type {
      base 
      description
        "Base identity for derivation of Operations,
           Administration, and Maintenance (OAM) services.";
    }

    identity control-plane-protocol-type {
      base 
      description
        "Base identity for derivation of control-plane protocols";
    }

    identity mpls-lsp-type {
      base 
      description
        "Base identity for derivation of MPLS LSP typs";
    }

    grouping ribs {
      description
        "Routing Information Bases (RIBs) supported by a
       network-instance";
      container ribs {
        description
          "RIBs supported by a network-instance";
        list rib {
          key "name";
          min-elements 1;
          description
            "Each entry represents a RIB identified by the
               'name' key. All routes in a RIB must belong to the
                same address family.

                For each routing instance, an implementation should
                provide one system-controlled default RIB for each
                supported address family.";
          reference
            "draft-ietf-netmod-routing-cfg";

          leaf name {
            type string;
            description
              "The name of the RIB.";
          }

          leaf description {
            type string;
            description
              "Description of the RIB";
          }

          container policy {
            description
              "Policy specific to RIB";
          }  // container policy
        }  // list rib
      }  // container ribs
    }  // grouping ribs

    container ietf-yang-library {
      description
        "YANG Module Library as defined in
       draft-ietf-netconf-yang-library";
    }  // container ietf-yang-library

    container interfaces {
      description
        "Interface list as defined by RFC7223/RFC7224";
    }  // container interfaces

    container hardware {
      description
        "Hardware / vendor-specific data relevant to the platform.
      This container is an anchor point for platform-specific
      configuration and operational state data.  It may be further
      organized into chassis, line cards, ports, etc.  It is
      expected that vendor or platform-specific augmentations
      would be used to populate this part of the device model";
    }  // container hardware

    container qos {
      description
        "QoS features, for example policing, shaping, etc.";
    }  // container qos

    container system-management {
      description
        "System management for physical or virtual device.";
      container system-management-global {
        description
          "System management - with reuse of RFC 7317";
      }  // container system-management-global

      list system-management-protocol {
        key "type";
        description
          "List of system management protocol
                       configured for a logical network
                       element.";
        leaf type {
          type identityref {
            base system-management-protocol-type;
          }
          mandatory true;
          description
            "Syslog, ssh, TACAC+, SNMP, NETCONF, etc.";
        }
      }  // list system-management-protocol
    }  // container system-management

    container network-services {
      description
        "Container for list of configured network
           services.";
      list network-service {
        key "type";
        description
          "List of network services configured for a
               network instance.";
        leaf type {
          type identityref {
            base network-service-type;
          }
          mandatory true;
          description
            "The network service type supported within
                   a network instance, e.g., NTP server, DNS
                   server, DHCP server, etc.";
        }
      }  // list network-service
    }  // container network-services

    container oam-protocols {
      description
        "Container for configured OAM protocols.";
      list oam-protocol {
        key "type";
        description
          "List of configured OAM protocols.";
        leaf type {
          type identityref {
            base oam-protocol-type;
          }
          mandatory true;
          description
            "The Operations, Administration, and
                   Maintenance (OAM) protocol type, e.g., BFD,
                   TWAMP, CFM, etc.";
        }
      }  // list oam-protocol
    }  // container oam-protocols

    container routing {
      description
        "The YANG Data Model for Routing Management revised to be
       Network Instance / VRF independent. ";
      list control-plane-protocol {
        key "type";
        description
          "List of control plane protocols configured for
             a network instance.";
        leaf type {
          type identityref {
            base control-plane-protocol-type;
          }
          mandatory true;
          description
            "The control plane protocol type, e.g., BGP,
                 OSPF IS-IS, etc";
        }

        container policy {
          description
            "Protocol specific policy,
                reusing [RTG-POLICY]";
        }  // container policy
      }  // list control-plane-protocol

      list rib {
        key "name";
        description
          "Each entry represents a RIB identified by the
           'name' key. All routes in a RIB must belong to the
            same address family.

            For each routing instance, an implementation should
            provide one system-controlled default RIB for each
            supported address family.";
        reference
          "draft-ietf-netmod-routing-cfg";

        leaf name {
          type string;
          mandatory true;
          description "The name of the RIB.";
        }

        leaf description {
          type string;
          description
            "Description of the RIB";
        }

        container policy {
          description
            "Policy specific to RIB";
        }  // container policy
      }  // list rib
    }  // container routing

    container mpls {
      description
        "MPLS and TE configuration";
      container global {
        description
          "Global MPLS configuration";
      }  // container global

      list lsps {
        key "type";
        description "List of LSP types.";
        leaf type {
          type identityref {
            base mpls-lsp-type;
          }
          mandatory true;
          description
            "MPLS and Traffic Engineering protocol LSP types,
                   static, LDP/SR (igp-congruent),
                   RSVP TE (constrained-paths) , etc.";
        }
      }  // list lsps
    }  // container mpls

    container ieee-dot1Q {
      description
        "The YANG Data Model for VLAN bridges as defined by the IEEE";
    }  // container ieee-dot1Q

    container ietf-acl {
      description
        "Packet Access Control Lists (ACLs) as specified
                   in draft-ietf-netmod-acl-model";
    }  // container ietf-acl

    container ietf-key-chain {
      description
        "Key chains as specified in
                 draft-ietf-rtgwg-yang-key-chain;";
    }  // container ietf-key-chain

    container logical-network-element {
      description
        "This module is used to support multiple logical network
       elements on a single physical or virtual system.";
    }  // container logical-network-element

    container network-instance {
      description
        "This module is used to support multiple network instances
       within a single physical or virtual device.  Network
       instances are commonly know as VRFs (virtual routing
       and forwarding) and VSIs (virtual switching instances).";
    }  // container network-instance
  }  // module example-network-device