netconfcentral logo

ietf-segment-routing-ipv6@2017-10-23



  module ietf-segment-routing-ipv6 {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-segment-routing-ipv6";

    prefix sr;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-routing {
      prefix rt;
    }

    organization "IETF SPRING Working Group";

    contact
      "WG Web:   <http://tools.ietf.org/wg/spring/>
     WG List:  <mailto:spring@ietf.org>

     Editor:    Zhibo hu
               <mailto:huzhibo@huawei.com>

     Author:    Zhenbin li
               <lizhenbin@huawei.com>

     Author:    S. Matsushima
               <satoru.matsushima@g.softbank.co.jp>

    ";

    description
      "The YANG module defines a generic configuration model for
     Segment routing IPv6 data plane.

     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.";

    reference
      "RFC XXXX";


    revision "2017-10-23" {
      description
        "
       * Implement NMDA model
       *Conform to RFC6087BIS Appendix C
      ";
      reference
        "RFC XXXX: YANG Data Model for Segment Routing IPv6.";

    }


    typedef erHopMode {
      type enumeration {
        enum "IPV6_ADDRESS" {
          value 0;
          description "IPv6 address.";
        }
        enum "SRv6 Sid" {
          value 1;
          description "SRv6 SID.";
        }
      }
      description "TE Hop Address Type";
    }

    typedef erSidIpv6Type {
      type enumeration {
        enum "none" {
          value 0;
          description "None.";
        }
        enum "adjacency" {
          value 1;
          description "Adjacency SID.";
        }
        enum "prefix" {
          value 2;
          description "Prefix SID.";
        }
      }
      description "TE Hop Address Type";
    }

    augment /rt:routing {
      description
        "This augments routing-instance
       configuration with segment-routing-ipv6.";
      container segment-routing-ipv6 {
        description
          "segment routing IPV6 global config.";
        leaf srv6-enable {
          type boolean;
          default "false";
          description
            "Enables segment-routing
           IPV6 dataplane.";
        }

        leaf traffic-engineering-enable {
          type boolean;
          default "false";
          description
            "Enables segment-routing
           IPV6 traffic-engineering.";
        }

        container SRV6-node-capabilities {
          description
            "Containing SRv6 node capabilities.";
          leaf encap-capability {
            type boolean;
            default 'true';
            description
              "The SRv6 T.Encap capability of Node.";
          }

          leaf maximum-sl {
            type uint8;
            description
              "Node maximum-sl is the maximum value of the 'SL' field
             in the SRH supported by the node.";
          }

          leaf maximum-end-pop-srh {
            type uint8;
            description
              "Node maximum-end-pop-srh is the maximum number of SIDs
             in the top SRH in an SRH stack to which the node can
             apply 'PSP' or 'USP' flavors.";
          }

          leaf maximum-insert-srh {
            type uint8;
            description
              "Node maximum-insert-srh is the maximum number of SIDs
             that can be inserted as part of the 'T.insert'
             behavior supported by the node.";
          }

          leaf maximum-encap-srh {
            type uint8;
            description
              "Node maximum-encap-srh is the maximum number of SIDs
             that can be included as part of the 'T.Encap'
             behavior supported by the node.";
          }

          leaf maximum-end-d-srh {
            type uint8;
            description
              "Node maximum-end-d-srh is the maximum number of SIDs
             in an SRH when applying 'End.DX6' and 'End.DT6'
             functions supported by the node.";
          }
        }  // container SRV6-node-capabilities

        container myLocalSidTable {
          description
            "My local SID table contains all the local SRv6 segments
       explicitly instantiated at the node.";
          container srv6EndSidTables {
            config false;
            description
              "Segment Routing IPv6 End Local-Sid table.";
            list srhEndSidForwTable {
              key "endSidValue";
              config false;
              description
                "Segment Routing IPv6 End Local-Sid table.";
              leaf endSidValue {
                type inet:ipv6-address-no-zone;
                config false;
                description "End SID value.";
              }

              leaf endSidFlavor {
                type string {
                  length "0..64";
                }
                config false;
                description
                  "End SID flavor value.";
              }
            }  // list srhEndSidForwTable
          }  // container srv6EndSidTables

          container srv6EndXSidTables {
            config false;
            description
              "Segment Routing IPv6 End.X Local-Sid table.";
            list srhEndXSidForwTable {
              key "endXSidValue";
              config false;
              description
                "Segment Routing IPv6 End.X Local-Sid table.";
              leaf endXSidValue {
                type inet:ipv6-address-no-zone;
                config false;
                description
                  "End.X SID value.";
              }

              leaf endXSidFlavor {
                type string {
                  length "0..64";
                }
                config false;
                description
                  "End.X SID flavor value.";
              }

              container endXSidNhpInfos {
                config false;
                description
                  "Next hop information.";
                list endXSidNhpInfo {
                  key "interface nextHop";
                  config false;
                  description
                    "Next hop information.";
                  leaf interface {
                    type string {
                      length "0..64";
                    }
                    config false;
                    description
                      "Exit interface.";
                  }

                  leaf nextHop {
                    type inet:ipv6-address-no-zone;
                    config false;
                    description
                      "Next hop IPV6 address.";
                  }
                }  // list endXSidNhpInfo
              }  // container endXSidNhpInfos
            }  // list srhEndXSidForwTable
          }  // container srv6EndXSidTables
        }  // container myLocalSidTable

        container explicitPaths {
          description "Explicit path list.";
          list explicitPath {
            key "explicitPathName";
            description
              "Explicit path. When a TE LSP is to be established,
           specify route hop constraints for the LSP.";
            leaf explicitPathName {
              type string {
                length "1..63";
                pattern '[^ \?]*';
              }
              description
                "Explicit path name.";
            }

            container explicitPathHops {
              description "Route hop list.";
              list explicitPathHop {
                key "tunnelHopIndex";
                max-elements 96;
                description "Route hop.";
                leaf tunnelHopIndex {
                  type uint32 {
                    range "1..65535";
                  }
                  description
                    "Route hop index.";
                }

                leaf tunnelHopMode {
                  type erHopMode;
                  default "IPV6_ADDRESS";
                  description
                    "Route hop mode, specifies the
                 IPv6 address or the SRv6 SID.";
                }

                leaf tunnelHopSidIPv6 {
                  when
                    "../tunnelHopMode='SID_IPV6'";
                  type inet:ipv6-address-no-zone;
                  mandatory true;
                  description
                    "SRv6 SID of the explicit route hop.";
                }

                leaf tunnelHopSidIpv6Type {
                  when
                    "../tunnelHopMode='SID_IPV6'";
                  type erSidIpv6Type;
                  default "none";
                  description
                    "SRv6 SID type of the explicit route hop.";
                }
              }  // list explicitPathHop
            }  // container explicitPathHops
          }  // list explicitPath
        }  // container explicitPaths
      }  // container segment-routing-ipv6
    }
  }  // module ietf-segment-routing-ipv6