netconfcentral logo

gen-tunnel

HTML

gen-tunnel@2015-06-09



  module gen-tunnel {

    yang-version 1;

    namespace
      "http://example.com/gen-tunnel";

    prefix tunnel;

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

    organization "IETF Netmod Working Group";

    contact "wangzitao@huawei.com";

    description
      "This module defines ietf tunnel yang data model";

    revision "2015-06-09" {
      description
        "Initial revision. - 01 version";
      reference
        "draft-wwz-netmod-yang-tunnel-model-00";

    }


    identity technology-types {
      base 
      description
        "this is the base identity of technology types which are
      IP, GRE, MPLS, etc";
    }

    identity ipv4 {
      base technology-types;
      description "technology of ipv4";
    }

    identity ipv6 {
      base technology-types;
      description "technology of ipv6";
    }

    identity encapsulation-type {
      base 
      description
        "The encapsulation method used by a tunnel
 which are direct, GRE, 6to4, 6over4, IPsec, etc.";
    }

    identity direct {
      base encapsulation-type;
      description "no intermediate header.";
    }

    identity endpoint-type {
      base 
      description
        "this is the base identity of tunnel type which are CE, PE, etc.";
    }

    augment /if:interfaces/if:interface {
      when "if:type = 'ianaift:tunnel'";
      description
        "Parameters for configuring tunnel on interfaces.";
      container tunnel-configuration {
        description
          "tunnel configuration model.";
        leaf base-interface {
          type if:interface-ref;
          must
            "/if:interfaces/if:interface[if:name = current()]" {
            description
              "The base interface.";
          }
          description "The base interface.";
        }

        leaf tunnel-name {
          type string;
          description
            "this name can be used to distinguish different tunnel";
        }

        leaf ip-address {
          type yang:phys-address;
          description
            "ip-address of this tunnel interface";
        }

        leaf technology {
          type identityref {
            base technology-types;
          }
          description
            "this leaf can be used to indicate different technologies
    such as IP, GRE, MPLS, etc";
        }

        leaf encapsulation-method {
          type identityref {
            base encapsulation-type;
          }
          description
            "The encapsulation method used by a tunnel.";
        }

        leaf endpoint-type {
          type identityref {
            base endpoint-type;
          }
          description "The endpoint type.";
        }

        choice signaling-protocol-type {
          description
            "signaling protocol type";
          case signaling-protocol-null {
            description
              "this is a placeholder when no signaling protocol
  is needed";
            leaf signaling-null {
              type empty;
              description
                "there is no signaling protocol define,
   it will be defined in
   technology specific model.";
            }
          }  // case signaling-protocol-null
        }  // choice signaling-protocol-type

        container tunnel-source {
          description
            "parameters of source tunnel";
          choice tunnel-source {
            description "node Addressing.";
            case interface {
              leaf interface-type {
                type leafref {
                  path "/if:interfaces/if:interface/if:type";
                }
                description "interface type";
              }

              leaf interface {
                type if:interface-ref;
                description "Interface";
              }
            }  // case interface

            case ipv4-address {
              description
                "Ip Address based node Addressing.";
              leaf ipv4-address {
                type inet:ipv4-address;
                description "Ipv4 Address";
              }
            }  // case ipv4-address

            case ipv6-address {
              description
                "ipv6 Address based node Addressing.";
              leaf ipv6-address {
                type inet:ipv6-address;
                description "Ipv6 Address";
              }
            }  // case ipv6-address
          }  // choice tunnel-source
        }  // container tunnel-source

        container tunnel-destination {
          description
            "Data nodes for the operational state of tunnel on interfaces";
          choice tunnel-destination {
            description "node Addressing.";
            case interface {
              leaf interface-type {
                type leafref {
                  path "/if:interfaces/if:interface/if:type";
                }
                description "interface type";
              }

              leaf interface {
                type if:interface-ref;
                description "Interface";
              }
            }  // case interface

            case ipv4-address {
              description
                "Ip Address based node Addressing.";
              leaf ipv4-address {
                type inet:ipv4-address;
                description "Ipv4 Address";
              }
            }  // case ipv4-address

            case ipv6-address {
              description
                "ipv6 Address based node Addressing.";
              leaf ipv6-address {
                type inet:ipv6-address;
                description "Ipv6 Address";
              }
            }  // case ipv6-address
          }  // choice tunnel-destination
        }  // container tunnel-destination

        leaf MTU {
          type uint32;
          description
            "Maximum Transmission Unit";
        }

        leaf ttl {
          type uint8;
          default "255";
          description "Time to Live";
        }

        leaf priority {
          type uint8;
          description "priority";
        }

        choice Multiplexing {
          description
            "multiplexing parameters";
          case multiplexing-null {
            description
              "this is a placeholder when no multiplexing is needed";
            leaf multiplexing-null {
              type empty;
              description
                "there is no multiplexing define, it will be defined
        in technology specific model.";
            }
          }  // case multiplexing-null
        }  // choice Multiplexing

        choice QoS {
          description "QoS Parameters";
          case Qos-null {
            description
              "this is a placeholder when no QoS is needed";
            leaf QoS-null {
              type empty;
              description
                "there is no QoS define, it will be defined
        in technology specific model.";
            }
          }  // case Qos-null
        }  // choice QoS

        choice Security {
          description "security parameters";
          case Security-null {
            description
              "this is a placeholder when no Security is needed";
            leaf Security-null {
              type empty;
              description
                "there is no Security define, it will be defined
        in technology specific model.";
            }
          }  // case Security-null
        }  // choice Security

        container resource {
          description
            "this container is used to indicate the resources required
       for a tunnel.";
          leaf bandwidth {
            type uint32;
            description
              "the bandwidth of tunnel";
          }

          leaf MaxRate {
            type uint32;
            description
              "The maximum rate in bits/second.";
          }

          leaf MaxBurstSize {
            type uint32;
            description
              "The maximum burst size in bytes.";
          }

          leaf ExBurstSize {
            type uint32;
            description
              "The Excess burst size in bytes.";
          }

          leaf Frequency {
            type uint32;
            description
              "The granularity of the availability of committed
         rate.";
          }

          leaf weight {
            type uint32;
            description
              "The relative weight for using excess bandwidth above
         its committed rate.";
          }
        }  // container resource
      }  // container tunnel-configuration
    }

    augment /if:interfaces-state {
      when "if:type = 'ianaift:tunnel'";
      description
        "Data nodes for the operational state of tunnel on interfaces";
      container tunnel-state {
        config false;
        description
          "define the state of this tunnel";
        list tunnel {
          key "tunnel-name";
          description
            "The list of tunnel on the interface";
          leaf tunnel-name {
            type leafref {
              path
                "/if:interfaces/if:interface"
                  + "/tunnel:tunnel-configuration/tunnel:tunnel-name";
            }
            description
              "this leaf can be used to distinguish different tunnels";
          }

          leaf admin-status {
            type enumeration {
              enum "up" {
                value 1;
                description
                  "Ready to pass packets.";
              }
              enum "down" {
                value 2;
                description
                  "Not ready to pass packets and not in some test mode.";
              }
              enum "testing" {
                value 3;
                description
                  "In some test mode.";
              }
            }
            description
              "The desired state of the tunnel.";
          }

          leaf oper-status {
            type enumeration {
              enum "up" {
                value 1;
                description
                  "Ready to pass packets.";
              }
              enum "down" {
                value 2;
                description
                  "The tunnel does not pass any packets.";
              }
              enum "testing" {
                value 3;
                description
                  "In some test mode. No operational packets can
           be passed.";
              }
              enum "unknown" {
                value 4;
                description
                  "Status cannot be determined for some reason.";
              }
              enum "dormant" {
                value 5;
                description
                  "Waiting for some external event.";
              }
              enum "not-present" {
                value 6;
                description
                  "Some component (typically hardware) is missing.";
              }
              enum "lower-layer-down" {
                value 7;
                description
                  "Down due to state of lower-layer tunnel(s).";
              }
            }
            description
              "The current operational state of the tunnel.";
          }

          leaf MTU {
            type uint32;
            description
              "Maximum Transmit Uint";
          }

          leaf packets-input {
            type yang:counter64;
            description
              "Number of  packets input.";
          }

          leaf input-errors {
            type yang:counter64;
            description
              "Number of input packets dropped because of errors or for
        other reasons.";
          }

          leaf packets-output {
            type yang:counter64;
            description
              "Number of  packets output.";
          }

          leaf output-errors {
            type yang:counter64;
            description
              "Number of output packets dropped because of errors or for
        other reasons.";
          }

          leaf input-utility-rate {
            type yang:counter64;
            description
              "input utility rate.";
          }

          leaf output-utility-rate {
            type yang:counter64;
            description
              "output utility rate.";
          }

          leaf bytes {
            type yang:counter64;
            description
              "Number of bytes forwarded by the tunnel.";
          }
        }  // list tunnel
      }  // container tunnel-state
    }
  }  // module gen-tunnel

Summary

  
  
Organization IETF Netmod Working Group
  
Module gen-tunnel
Version 2015-06-09
File gen-tunnel@2015-06-09.yang
  
Prefix tunnel
Namespace http://example.com/gen-tunnel
  
Cooked /cookedmodules/gen-tunnel/2015-06-09
YANG /src/gen-tunnel@2015-06-09.yang
XSD /xsd/gen-tunnel@2015-06-09.xsd
  
Abstract This module defines ietf tunnel yang data model
  
Contact
wangzitao@huawei.com

Description

 
This module defines ietf tunnel yang data model