netconfcentral logo

ietf-network-instance@2017-12-04



  module ietf-network-instance {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-network-instance";

    prefix ni;

    import ietf-interfaces {
      prefix if;
      reference
        "RFC 7223: A YANG Data Model for Interface
        Management";


    }
    import ietf-ip {
      prefix ip;
      reference
        "RFC 7277: A YANG Data Model for IP Management";


    }
    import ietf-yang-schema-mount {
      prefix yangmnt;
      reference
        "draft-ietf-netmod-schema-mount: YANG Schema Mount";


    }

    organization
      "IETF Routing Area (rtgwg) Working Group";

    contact
      "WG Web:   <http://tools.ietf.org/wg/rtgwg/>
     WG List:  <mailto:rtgwg@ietf.org>
     Author:   Lou Berger
               <mailto:lberger@labn.net>
     Author:   Christan Hopps
               <mailto:chopps@chopps.org>
     Author:   Acee Lindem
               <mailto:acee@cisco.com>
     Author:   Dean Bogdanovic
               <mailto:ivandean@gmail.com>";

    description
      "This module is used to support multiple network instances
     within a single physical or virtual device.  Network
     instances are commonly known as VRFs (virtual routing
     and forwarding) and VSIs (virtual switching instances).

     Copyright (c) 2017 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
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX; see
     the RFC itself for full legal notices.";

    revision "2017-12-04" {
      description "Initial revision.";
      reference
        "RFC TBD";

    }


    container network-instances {
      description
        "Network instances each of which consists of a
       VRFs (virtual routing and forwarding) and/or
       VSIs (virtual switching instances).";
      reference
        "RFC 8022 - A YANG Data Model for Routing
        Management";

      list network-instance {
        key "name";
        description
          "List of network-instances.";
        leaf name {
          type string;
          mandatory true;
          description
            "device scoped identifier for the network
           instance.";
        }

        leaf enabled {
          type boolean;
          default "true";
          description
            "Flag indicating whether or not the network
           instance is enabled.";
        }

        leaf description {
          type string;
          description
            "Description of the network instance
           and its intended purpose.";
        }

        choice ni-type {
          description
            "This node serves as an anchor point for different types
           of network instances.  Each 'case' is expected to
           differ in terms of the information needed in the
           parent/core to support the NI, and may differ in their
           mounted schema definition. When the mounted schema is
           not expected to be the same for a specific type of NI
           a mount point should be defined.";
        }  // choice ni-type

        choice root-type {
          mandatory true;
          description
            "Well known mount points.";
          container vrf-root {
            yangmnt:mount-point "vrf-root" {
              description "Root for L3VPN type models. This will typically
not be an inline type mount point.";
            }
            description
              "Container for mount point.";
          }  // container vrf-root
          container vsi-root {
            yangmnt:mount-point "vsi-root" {
              description "Root for L2VPN type models. This will typically
not be an inline type mount point.";
            }
            description
              "Container for mount point.";
          }  // container vsi-root
          container vv-root {
            yangmnt:mount-point "vv-root" {
              description "Root models that support both L2VPN type bridging
and L3VPN type routing. This will typically
not be an inline type mount point.";
            }
            description
              "Container for mount point.";
          }  // container vv-root
        }  // choice root-type
      }  // list network-instance
    }  // container network-instances

    augment /if:interfaces/if:interface {
      description
        "Add a node for the identification of the network
       instance associated with the information configured
       on a interface.

       Note that a standard error will be returned if the
       identified leafref isn't present.  If an interfaces cannot
       be assigned for any other reason, the operation SHALL fail
       with an error-tag of 'operation-failed' and an
       error-app-tag of 'ni-assignment-failed'.  A meaningful
       error-info that indicates the source of the assignment
       failure SHOULD also be provided.";
      leaf bind-ni-name {
        type leafref {
          path "/network-instances/network-instance/name";
        }
        description
          "Network Instance to which an interface is bound.";
      }
    }

    augment /if:interfaces/if:interface/ip:ipv4 {
      description
        "Add a node for the identification of the network
       instance associated with the information configured
       on an IPv4 interface.
       Note that a standard error will be returned if the
       identified leafref isn't present.  If an interfaces cannot
       be assigned for any other reason, the operation SHALL fail
       with an error-tag of 'operation-failed' and an
       error-app-tag of 'ni-assignment-failed'.  A meaningful
       error-info that indicates the source of the assignment
       failure SHOULD also be provided.";
      leaf bind-ni-name {
        type leafref {
          path "/network-instances/network-instance/name";
        }
        description
          "Network Instance to which IPv4 interface is bound.";
      }
    }

    augment /if:interfaces/if:interface/ip:ipv6 {
      description
        "Add a node for the identification of the network
       instance associated with the information configured
       on an IPv6 interface.

       Note that a standard error will be returned if the
       identified leafref isn't present.  If an interfaces cannot
       be assigned for any other reason, the operation SHALL fail
       with an error-tag of 'operation-failed' and an
       error-app-tag of 'ni-assignment-failed'.  A meaningful
       error-info that indicates the source of the assignment
       failure SHOULD also be provided.";
      leaf bind-ni-name {
        type leafref {
          path "/network-instances/network-instance/name";
        }
        description
          "Network Instance to which IPv6 interface is bound.";
      }
    }

    notification bind-ni-name-failed {
      description
        "Indicates an error in the association of an interface to an
       NI. Only generated after success is initially returned when
       bind-ni-name is set.

       Note: some errors may need to be reported for multiple
       associations, e.g., a single error may need to be reported
       for an IPv4 and an IPv6 bind-ni-name.
       At least one container with a bind-ni-name leaf MUST be
       included in this notification.";
      leaf name {
        type leafref {
          path "/if:interfaces/if:interface/if:name";
        }
        mandatory true;
        description
          "Contains the interface name associated with the
        failure.";
      }

      container interface {
        description
          "Generic interface type.";
        leaf bind-ni-name {
          type leafref {
            path "/if:interfaces/if:interface/ni:bind-ni-name";
          }
          description
            "Contains the bind-ni-name associated with the
           failure.";
        }
      }  // container interface

      container ipv4 {
        description "IPv4 interface type.";
        leaf bind-ni-name {
          type leafref {
            path "/if:interfaces/if:interface/ip:ipv4/ni:bind-ni-name";
          }
          description
            "Contains the bind-ni-name associated with the
           failure.";
        }
      }  // container ipv4

      container ipv6 {
        description "IPv6 interface type.";
        leaf bind-ni-name {
          type leafref {
            path "/if:interfaces/if:interface/ip:ipv6/ni:bind-ni-name";
          }
          description
            "Contains the bind-ni-name associated with the
           failure.";
        }
      }  // container ipv6

      leaf error-info {
        type string;
        description
          "Optionally, indicates the source of the assignment
         failure.";
      }
    }  // notification bind-ni-name-failed
  }  // module ietf-network-instance