netconfcentral logo

ietf-l3-unicast-topology@2018-02-26



  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:    <https://datatracker.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:xufeng.liu.ietf@gmail.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) 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 8346; see the RFC itself for full legal notices.";

    revision "2018-02-26" {
      description "Initial revision.";
      reference
        "RFC 8346: A YANG Data Model for Layer 3 Topologies";

    }


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

    typedef l3-event-type {
      type enumeration {
        enum "add" {
          value 0;
          description
            "A Layer 3 node, link, prefix, or termination point has
          been added";
        }
        enum "remove" {
          value 1;
          description
            "A Layer 3 node, link, prefix, or termination point has
          been removed";
        }
        enum "update" {
          value 2;
          description
            "A Layer 3 node, link, 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
        "Identifies 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
          "Contains 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
          "Contains 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
          "Contains 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
          "Contains 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
              "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 interface-ref defined
               in RFC 8343. It should be noted that data type
               interface-ref of RFC 8343 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.";
            reference
              "RFC 8343: A YANG Data Model for Interface Management";

          }
        }  // choice termination-point-type
      }  // container l3-termination-point-attributes
    }  // grouping l3-termination-point-attributes

    augment /nw:networks/nw:network/nw:network-types {
      description
        "Introduces 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
        "Augments 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
        "Augments 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
          "Contains 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