netconfcentral logo

ietf-l3-unicast-topology@2017-12-16



  module ietf-l3-unicast-topology {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology";

    prefix l3t;

    import ietf-network {
      prefix nw;
    }
    import ietf-network-topology {
      prefix nt;
    }
    import ietf-inet-types {
      prefix inet;
    }
    import ietf-routing-types {
      prefix rt-types;
    }

    organization
      "IETF I2RS (Interface to the Routing System) Working Group";

    contact
      "WG Web:    <http://tools.ietf.org/wg/i2rs/>
     WG List:   <mailto:i2rs@ietf.org>
     Editor:    Alexander Clemm
                <mailto:ludwig@clemm.org>
     Editor:    Jan Medved
                <mailto:jmedved@cisco.com>
     Editor:    Robert Varga
                <mailto:robert.varga@pantheon.tech>
     Editor:    Xufeng Liu
                <mailto:xliu@kuatrotech.com>
     Editor:    Nitin Bahadur
                <mailto:nitin_bahadur@yahoo.com>
     Editor:    Hariharan Ananthakrishnan
                <mailto:hari@packetdesign.com>";

    description
      "This module defines a model for Layer 3 Unicast
     topologies.
     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
     draft-ietf-i2rs-yang-l3-topology-16;
     see the RFC itself for full legal notices.
     NOTE TO RFC EDITOR: Please replace above reference to
     draft-ietf-i2rs-yang-l3-topology-16 with RFC
     number when published (i.e. RFC xxxx).";

    revision "2017-12-16" {
      description
        "Initial revision.
       NOTE TO RFC EDITOR: Please replace the following reference
       to draft-ietf-i2rs-yang-l3-topology-16 with
       RFC number when published (i.e. RFC xxxx).";
      reference
        "draft-ietf-i2rs-yang-l3-topology-16";

    }


    identity flag-identity {
      base 
      description "Base type for flags";
    }

    typedef l3-event-type {
      type enumeration {
        enum "add" {
          value 0;
          description
            "An Layer 3 node or link or prefix or termination-point has
          been added";
        }
        enum "remove" {
          value 1;
          description
            "An Layer 3 node or link or prefix or termination-point has
          been removed";
        }
        enum "update" {
          value 2;
          description
            "An Layer 3 node or link or prefix or termination-point has
          been updated";
        }
      }
      description
        "Layer 3 Event type for notifications";
    }

    typedef prefix-flag-type {
      type identityref {
        base flag-identity;
      }
      description "Prefix flag attributes";
    }

    typedef node-flag-type {
      type identityref {
        base flag-identity;
      }
      description "Node flag attributes";
    }

    typedef link-flag-type {
      type identityref {
        base flag-identity;
      }
      description "Link flag attributes";
    }

    typedef l3-flag-type {
      type identityref {
        base flag-identity;
      }
      description "L3 flag attributes";
    }

    grouping l3-prefix-attributes {
      description "L3 prefix attributes";
      leaf prefix {
        type inet:ip-prefix;
        description "IP prefix value";
      }

      leaf metric {
        type uint32;
        description "Prefix metric";
      }

      leaf-list flag {
        type prefix-flag-type;
        description "Prefix flags";
      }
    }  // grouping l3-prefix-attributes

    grouping l3-unicast-topology-type {
      description
        "Identify the topology type to be L3 unicast.";
      container l3-unicast-topology {
        presence
          "indicates L3 Unicast Topology";
        description
          "The presence of the container node indicates L3 Unicast
        Topology";
      }  // container l3-unicast-topology
    }  // grouping l3-unicast-topology-type

    grouping l3-topology-attributes {
      description
        "Topology scope attributes";
      container l3-topology-attributes {
        description
          "Containing topology attributes";
        leaf name {
          type string;
          description "Name of the topology";
        }

        leaf-list flag {
          type l3-flag-type;
          description "Topology flags";
        }
      }  // container l3-topology-attributes
    }  // grouping l3-topology-attributes

    grouping l3-node-attributes {
      description "L3 node scope attributes";
      container l3-node-attributes {
        description
          "Containing node attributes";
        leaf name {
          type inet:domain-name;
          description "Node name";
        }

        leaf-list flag {
          type node-flag-type;
          description "Node flags";
        }

        leaf-list router-id {
          type rt-types:router-id;
          description
            "Router-id for the node";
        }

        list prefix {
          key "prefix";
          description
            "A list of prefixes along with their attributes";
          uses l3-prefix-attributes;
        }  // list prefix
      }  // container l3-node-attributes
    }  // grouping l3-node-attributes

    grouping l3-link-attributes {
      description "L3 link scope attributes";
      container l3-link-attributes {
        description
          "Containing link attributes";
        leaf name {
          type string;
          description "Link Name";
        }

        leaf-list flag {
          type link-flag-type;
          description "Link flags";
        }

        leaf metric1 {
          type uint64;
          description "Link Metric 1";
        }

        leaf metric2 {
          type uint64;
          description "Link Metric 2";
        }
      }  // container l3-link-attributes
    }  // grouping l3-link-attributes

    grouping l3-termination-point-attributes {
      description
        "L3 termination point scope attributes";
      container l3-termination-point-attributes {
        description
          "Containing termination point attributes";
        choice termination-point-type {
          description
            "Indicates the termination point type";
          leaf-list ip-address {
            type inet:ip-address;
            description
              "IPv4 or IPv6 address.";
          }
          leaf unnumbered-id {
            type uint32;
            description
              "Unnumbered interface identifier.
               The identifier will correspond to the ifIndex value
               of the interface, i.e. the ifIndex value of the
               ifEntry that represents the interface in
               implementations where the Interfaces Group MIB
               (RFC 2863) is supported.";
            reference
              "RFC 2863: The Interfaces Group MIB";

          }
          leaf interface-name {
            type string;
            description
              "A name of the interface.  The name can (but does not
               have to) correspond to an interface reference of a
               containing node's interface, i.e. the path name of a
               corresponding interface data node on the containing
               node reminiscent of data type if-ref defined in
               RFC 7223. It should be noted that data type if-ref of
               RFC 7223 cannot be used directly, as this data type
               is used to reference an interface in a datastore of
               a single node in the network, not to uniquely
               reference interfaces across a network.";
          }
        }  // choice termination-point-type
      }  // container l3-termination-point-attributes
    }  // grouping l3-termination-point-attributes

    augment /nw:networks/nw:network/nw:network-types {
      description
        "Introduce new network type for L3 unicast topology";
      uses l3-unicast-topology-type;
    }

    augment /nw:networks/nw:network {
      when
        "nw:network-types/l3t:l3-unicast-topology" {
        description
          "Augmentation parameters apply only for networks with
        L3 unicast topology";
      }
      description
        "L3 unicast for the network as a whole";
      uses l3-topology-attributes;
    }

    augment /nw:networks/nw:network/nw:node {
      when
        "../nw:network-types/l3t:l3-unicast-topology" {
        description
          "Augmentation parameters apply only for networks with
        L3 unicast topology";
      }
      description
        "L3 unicast node level attributes ";
      uses l3-node-attributes;
    }

    augment /nw:networks/nw:network/nt:link {
      when
        "../nw:network-types/l3t:l3-unicast-topology" {
        description
          "Augmentation parameters apply only for networks with
        L3 unicast topology";
      }
      description
        "Augment topology link attributes";
      uses l3-link-attributes;
    }

    augment /nw:networks/nw:network/nw:node/nt:termination-point {
      when
        "../../nw:network-types/l3t:l3-unicast-topology" {
        description
          "Augmentation parameters apply only for networks with
        L3 unicast topology";
      }
      description
        "Augment topology termination point configuration";
      uses l3-termination-point-attributes;
    }

    notification l3-node-event {
      description
        "Notification event for L3 node";
      leaf l3-event-type {
        type l3-event-type;
        description "Event type";
      }

      uses nw:node-ref;

      uses l3-unicast-topology-type;

      uses l3-node-attributes;
    }  // notification l3-node-event

    notification l3-link-event {
      description
        "Notification event for L3 link";
      leaf l3-event-type {
        type l3-event-type;
        description "Event type";
      }

      uses nt:link-ref;

      uses l3-unicast-topology-type;

      uses l3-link-attributes;
    }  // notification l3-link-event

    notification l3-prefix-event {
      description
        "Notification event for L3 prefix";
      leaf l3-event-type {
        type l3-event-type;
        description "Event type";
      }

      uses nw:node-ref;

      uses l3-unicast-topology-type;

      container prefix {
        description
          "Containing L3 prefix attributes";
        uses l3-prefix-attributes;
      }  // container prefix
    }  // notification l3-prefix-event

    notification termination-point-event {
      description
        "Notification event for L3 termination point";
      leaf l3-event-type {
        type l3-event-type;
        description "Event type";
      }

      uses nt:tp-ref;

      uses l3-unicast-topology-type;

      uses l3-termination-point-attributes;
    }  // notification termination-point-event
  }  // module ietf-l3-unicast-topology