netconfcentral logo

ietf-srv6-static@2017-11-12



  module ietf-srv6-static {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-srv6-static";

    prefix srv6-static;

    import ietf-interfaces {
      prefix if;
    }
    import ietf-inet-types {
      prefix inet;
    }
    import ietf-routing {
      prefix rt;
    }
    import ietf-srv6-types {
      prefix srv6-types;
    }
    import ietf-srv6-base {
      prefix srv6;
    }

    organization "IETF SPRING Working Group";

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

     WG Chair: Bruno Decraene
               <mailto:loa@pi.nu>

     WG Chair: Martin Vigoureux
               <mailto:rcallon@juniper.net>

     Editor:   Kamran Raza
               <mailto:skraza@cisco.com>

     Editor:   Jaganbabu Rajamanickam
               <maito:jrajaman@cisco.com>

     Editor:   Xufeng Liu
               <mailto:Xufeng_Liu@jabil.com>

     Editor:   Iftekhar Hussain
               <mailto:IHussain@infinera.com>

     Editor:   Himanshu Shah
               <mailto:hshah@ciena.com>

     Editor:   Daniel Voyer
               <mailto:daniel.voyerbell.ca>

     Editor:   Hani Elmalky
               <mailto:hani.elmalky@ericsson.com>

     Editor:   Ahmed AbdelSalam
               <mailto:ahmed.abdelsalam@gssi.it>
     ";

    description
      "This YANG module defines the essential elements for the
     management of Static application for Segment-Routing with
     IPv6 dataplane (SRv6).

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

    reference
      "RFC XXXX";


    revision "2017-11-12" {
      description "Initial revision.";
      reference
        "RFC XXXX: YANG Data Model for SRv6";

    }


    grouping path-attrs-v6 {
      description "IPv6 Path properties";
      leaf interface {
        type if:interface-ref;
        description "The outgoing interface";
      }

      leaf next-hop {
        type inet:ipv6-address;
        description
          "The IP address of the next-hop";
      }

      uses srv6:path-attrs-cmn;
    }  // grouping path-attrs-v6

    grouping path-attrs-v4 {
      description "IPv4 Path properties";
      leaf interface {
        type if:interface-ref;
        description "The outgoing interface";
      }

      leaf next-hop {
        type inet:ipv4-address;
        description
          "The IP address of the next-hop";
      }

      uses srv6:path-attrs-cmn;
    }  // grouping path-attrs-v4

    grouping path-attrs-mpls {
      description "MPLS Path properties";
      leaf interface {
        type if:interface-ref;
        description "The outgoing interface";
      }

      leaf next-hop {
        type inet:ip-address;
        description
          "The IP address of the next-hop";
      }

      uses srv6:path-attrs-cmn;
    }  // grouping path-attrs-mpls

    grouping multi-paths-v6 {
      description "Multipath grouping";
      container paths {
        description "List of outgoing paths";
        list path {
          key "path-index";
          description
            "The list of paths associated with the SID";
          leaf path-index {
            type uint8;
            description "Index of the path";
          }

          uses path-attrs-v6;

          container encap {
            description
              "Encapsulation on path";
            uses srv6:path-out-sids;
          }  // container encap
        }  // list path
      }  // container paths
    }  // grouping multi-paths-v6

    grouping multi-paths-v4 {
      description "Multipath grouping";
      container paths {
        description "List of outgoing paths";
        list path {
          key "path-index";
          description
            "The list of paths associated with the SID";
          leaf path-index {
            type uint8;
            description "Index of the path";
          }

          uses path-attrs-v4;

          container encap {
            description
              "Encapsulation on path";
            uses srv6:path-out-sids;
          }  // container encap
        }  // list path
      }  // container paths
    }  // grouping multi-paths-v4

    grouping multi-paths-mpls {
      description "Multipath grouping";
      container paths {
        description "List of outgoing paths";
        list path {
          key "path-index";
          description
            "The list of paths associated with the SID";
          leaf path-index {
            type uint8;
            description "Index of the path";
          }

          uses path-attrs-mpls;

          container encap {
            description
              "Encapsulation on path";
            uses srv6:path-out-labels;
          }  // container encap
        }  // list path
      }  // container paths
    }  // grouping multi-paths-mpls

    grouping srv6-sid-config {
      description
        "Configuration parameters relating to SRv6 sid.";
      leaf opcode {
        type srv6-types:srv6-func-opcode-unreserved;
        description "SRv6 function opcode.";
      }

      leaf end-behavior-type {
        type srv6-types:srv6-end-type;
        mandatory true;
        description
          "Type of SRv6 end behavior.";
      }

      container end {
        when "../end-behavior-type = 'End'" {
          description
            "This container is valid only when the user chooses End
           behavior.";
        }
        description
          "The Endpoint function is the most basic function.
         FIB lookup on updated DA and forward accordingly
         to the matched entry.
         This is the SRv6 instantiation of a Prefix SID.";
        leaf usp {
          type boolean;
          default 'false';
          description
            "Ultimate SRH poping. Default is PSP";
        }
      }  // container end

      container end-t {
        when
          "../end-behavior-type = 'End.T'" {
          description
            "This container is valid only when the user chooses
           End.T behavior.";
        }
        description
          "Endpoint with specific IPv6 table lookup.
         Lookup the next segment in IPv6 table T
         associated with the SID and forward viai
         the matched table entry.
         The End.T is used for multi-table operation
         in the core.";
        leaf usp {
          type boolean;
          default 'false';
          description
            "Ultimate SRH poping. Default is PSP";
        }

        leaf lookup-table-ipv6 {
          type srv6-types:table-id;
          mandatory true;
          description
            "Table Id for lookup on updated DA (next segment)";
        }
      }  // container end-t

      container end-x {
        when
          "../end-behavior-type = 'End.X'" {
          description
            "This container is valid only when the user chooses
           End.X behavior.";
        }
        description
          "Endpoint with cross-connect to an array of
         layer-3 adjacencies.
         Forward to layer-3 adjacency bound to the SID S.
         The End.X function is required to express any
         traffic-engineering policy.";
        leaf usp {
          type boolean;
          default 'false';
          description
            "Ultimate SRH poping. Default is PSP";
        }

        uses multi-paths-v6;
      }  // container end-x

      container end-dx4 {
        when
          "../end-behavior-type = 'End.DX4'" {
          description
            "This container is valid only when the user chooses
           End.DX4 behavior.";
        }
        description
          "Endpoint with decapsulation and cross-connect to
         an array of IPv4 adjacencies.
         Pop the (outer) IPv6 header and its extension
         header and forward to layer-3 adjacency bound
         to the SID S.
         This would be equivalent to the per-CE VPN
         label in MPLS.";
        uses multi-paths-v4;
      }  // container end-dx4

      container end-dx6 {
        when
          "../end-behavior-type = 'End.DX6'" {
          description
            "This container is valid only when the user chooses
           End.DX6 behavior.";
        }
        description
          "Endpoint with decapsulation and cross-connect to
         an array of IPv6 adjacencies. Pop the (outer)
         IPv6 header and its extension headers and forward
         to layer-3 adjacency bound to the SID S.
         The End.DX6 used in the L3VPN use-case.";
        uses multi-paths-v6;
      }  // container end-dx6

      container end-dt4 {
        when
          "../end-behavior-type = 'End.DT4'" {
          description
            "This container is valid only when the user chooses
           End.DT4 behavior.";
        }
        description
          "Endpoint with decapsulation and specific
         IPv4 table lookup.
         Pop the (outer) IPv6 header and its extension
         headers.
         Lookup the exposed inner IPv4 DA in IPv4
         table T and forward via the matched table entry.
         This would be equivalent to the per-VRF VPN label
         in MPLS.";
        leaf lookup-table-ipv4 {
          type srv6-types:table-id;
          mandatory true;
          description "IPv4 table";
        }
      }  // container end-dt4

      container end-dt6 {
        when
          "../end-behavior-type = 'End.DT6'" {
          description
            "This container is valid only when the user chooses
           End.DT6 behavior.";
        }
        description
          "Endpoint with decapsulation and specific IPv6 table
         lookup.
         Pop the (outer) IPv6 header and its extension
         headers.
         Lookup the exposed inner IPv6 DA in IPv6
         table T and forward via the matched table entry.
         End.DT6 function is used in L3VPN use-case.";
        leaf lookup-table-ipv6 {
          type srv6-types:table-id;
          mandatory true;
          description "IPv6 table";
        }
      }  // container end-dt6

      container end-dt46 {
        when
          "../end-behavior-type = 'End.DT46'" {
          description
            "This container is valid only when the user chooses
           End.DT46 behavior.";
        }
        description
          "Endpoint with decapsulation and specific
         IP table lookup.
         Depending on the protocol type (IPv4 or IPv6)
         of the inner ip packet and the specific VRF name
         forward the packet.
         This would be equivalent to the per-VRF VPN
         label in MPLS.";
        leaf lookup-table-ipv4 {
          type srv6-types:table-id;
          mandatory true;
          description "IPv4 table";
        }

        leaf lookup-table-ipv6 {
          type srv6-types:table-id;
          mandatory true;
          description "IPv6 table";
        }
      }  // container end-dt46

      container end-b6 {
        when
          "../end-behavior-type = 'End.B6'" {
          description
            "This container is valid only when the user chooses
           End.B6 behavior.";
        }
        description
          "Endpoint bound to an SRv6 Policy.
         Insert SRH based on the policy and forward the
         packet toward the first hop configured in the policy.
         This is the SRv6 instantiation of a Binding SID.";
        leaf policy-name {
          type string;
          mandatory true;
          description "SRv6 policy name.";
        }

        uses multi-paths-v6;
      }  // container end-b6

      container end-b6-encaps {
        when
          "../end-behavior-type = 'End.B6.Encaps'" {
          description
            "This container is valid only when the user chooses
           End_B6_Encaps behavior.";
        }
        description
          "This is a variation of the End.B6 behavior where
         the SRv6 Policy also includes an IPv6 Source
         Address.
         Insert SRH based on the policy and update the
         source IP and forward the packet toward the
         first hop configured in the policy.
         Instead of simply inserting an SRH with the
         policy (End.B6), this behavior also adds an
         outer IPv6 header.";
        leaf policy-name {
          type string;
          mandatory true;
          description "SRv6 policy name.";
        }

        leaf source-address {
          type inet:ipv6-address;
          mandatory true;
          description
            "IPv6 source address for Encap.";
        }

        uses multi-paths-v6;
      }  // container end-b6-encaps

      container end-bm {
        when
          "../end-behavior-type = 'End.BM'" {
          description
            "This container is valid only when the user chooses
           End.BM behavior.";
        }
        description
          "Endpoint bound to an SR-MPLS Policy.
         push an MPLS label stack <L1, L2, L3> on the
         received packet and forward the according to
         Lable L1.
         This is an SRv6 instantiation of an SR-MPLS Binding SID.";
        leaf policy-name {
          type string;
          mandatory true;
          description "SRv6 policy name";
        }

        uses multi-paths-mpls;
      }  // container end-bm

      container end-dx2 {
        when
          "../end-behavior-type = 'End.DX2'" {
          description
            "This container is valid only when the user chooses
           End.DX2 behavior.";
        }
        description
          "This is an Endpoint with decapsulation and Layer-2
         cross-connect to OIF.
         Pop the (outer) IPv6 header and its extension headers.
         Forward the resulting frame via OIF associated to the SID.
         The End.DX2 function is the L2VPN use-case";
        container paths {
          description
            "List of outgoing paths";
          leaf interface {
            type if:interface-ref;
            mandatory true;
            description
              "Layer-2 cross-connect to Out interface.";
          }
        }  // container paths
      }  // container end-dx2
    }  // grouping srv6-sid-config

    grouping srv6-static-cfg {
      description
        "Grouping configuration and operation for SRv6 sid.";
      list sid {
        key "opcode";
        description "Local SID list";
        uses srv6-sid-config;
      }  // list sid
    }  // grouping srv6-static-cfg

    augment /rt:routing/srv6:srv6/srv6:locators/srv6:locator {
      description
        "This augments locator leaf withing SRv6.";
      container static {
        description "Static SRv6";
        container local-sids {
          description
            "SRv6-static local-SIDs";
          uses srv6-static-cfg;
        }  // container local-sids
      }  // container static
    }
  }  // module ietf-srv6-static