summaryrefslogtreecommitdiffstats
path: root/srv6/srv6-api
diff options
context:
space:
mode:
authorMichal Cmarada <michal.cmarada@pantheon.tech>2018-06-15 13:09:56 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-06-19 18:54:51 +0000
commit3edc384ac6cbeb68d36dbb4a51aa027c3bd3257d (patch)
tree78e4ae88f89e08756ae469d068c45e2e7a059c2f /srv6/srv6-api
parentb44b5a2a1ee8ba193265708272be97fd6f11d010 (diff)
HC2VPP-288 - add SRv6 module (writers only)
Changes: - add new module for SRv6 - add models for SRv6 configuration: from https://datatracker.ietf.org/doc/draft-raza-spring-srv6-yang/ - hc2vpp-ietf-srv6-base@2018-03-01.yang - hc2vpp-ietf-srv6-static@2018-03-01.yang - ietf-srv6-types@2018-03-01.yang - implements Configuration of local sids and their end functions. - implements support for FIB table management (HC2VPP-345) Models hc2vpp-ietf-srv6-base and hc2vpp-ietf-srv6-static are changed (HC2VPP-332): - imports for routing models (HC2VPP-298) - presence in end function containers was added to fix mandatory child verification if parent container is not present Change-Id: Ib74e48023b671383f076b84773e26ce7c5ae282a Signed-off-by: Michal Cmarada <michal.cmarada@pantheon.tech> Signed-off-by: Jan Srnicek <jan.srnicek@pantheon.tech>
Diffstat (limited to 'srv6/srv6-api')
-rw-r--r--srv6/srv6-api/asciidoc/Readme.adoc15
-rw-r--r--srv6/srv6-api/pom.xml62
-rw-r--r--srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-base@2018-03-01.yang666
-rw-r--r--srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-static@2018-03-01.yang832
-rw-r--r--srv6/srv6-api/src/main/yang/ietf-srv6-types@2018-03-01.yang589
-rw-r--r--srv6/srv6-api/src/main/yang/vpp-ietf-srv6-base@2018-06-13.yang73
6 files changed, 2237 insertions, 0 deletions
diff --git a/srv6/srv6-api/asciidoc/Readme.adoc b/srv6/srv6-api/asciidoc/Readme.adoc
new file mode 100644
index 000000000..3c378954d
--- /dev/null
+++ b/srv6/srv6-api/asciidoc/Readme.adoc
@@ -0,0 +1,15 @@
+= srv6-api
+
+SRv6 API consists of models obtained
+from https://datatracker.ietf.org/doc/draft-raza-spring-srv6-yang/[draft-raza-spring-srv6-yang]:
+
+- `hc2vpp-ietf-srv6-base@2018-03-01.yang`
+- `hc2vpp-ietf-srv6-static@2018-03-01.yang`
+- `ietf-srv6-types@2018-03-01.yang`
+
+Models *hc2vpp-ietf-srv6-base* and *hc2vpp-ietf-srv6-static*
+are changed (https://jira.fd.io/browse/HC2VPP-332[HC2VPP-332]):
+
+ - imports for routing models (https://jira.fd.io/browse/HC2VPP-298[HC2VPP-298])
+ - presence in end function containers was added to fix
+ mandatory child verification if parent container is not present
diff --git a/srv6/srv6-api/pom.xml b/srv6/srv6-api/pom.xml
new file mode 100644
index 000000000..c20c43234
--- /dev/null
+++ b/srv6/srv6-api/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2018 Bell Canada, Pantheon Technologies and/or its affiliates.
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>io.fd.hc2vpp.common</groupId>
+ <artifactId>api-parent</artifactId>
+ <version>1.18.07-SNAPSHOT</version>
+ <relativePath>../../common/api-parent</relativePath>
+ </parent>
+
+ <groupId>io.fd.hc2vpp.srv6</groupId>
+ <artifactId>srv6-api</artifactId>
+ <name>${project.artifactId}</name>
+ <version>1.18.07-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.fd.hc2vpp.routing</groupId>
+ <artifactId>routing-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.fd.hc2vpp.fib.management</groupId>
+ <artifactId>fib-management-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-interfaces</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-base@2018-03-01.yang b/srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-base@2018-03-01.yang
new file mode 100644
index 000000000..4d41b4566
--- /dev/null
+++ b/srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-base@2018-03-01.yang
@@ -0,0 +1,666 @@
+module hc2vpp-ietf-srv6-base {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-srv6-base";
+ prefix srv6;
+
+ import ietf-interfaces {
+ prefix "if";
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ // TODO: hc2vpp-298 - Renamed imports, because hc2vpp uses modified versions of these models.
+ import hc2vpp-ietf-routing-types {
+ prefix "rt-types";
+ }
+
+
+ // TODO: hc2vpp-298 - Renamed imports, because hc2vpp uses modified versions of these models.
+ import hc2vpp-ietf-routing {
+ prefix "rt";
+ }
+
+ import ietf-srv6-types {
+ prefix srv6-types;
+ }
+
+ organization
+ "IETF SPRING Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/spring/>
+ WG List: <mailto:spring@ietf.org>
+
+ Editor: Kamran Raza
+ <mailto:skraza@cisco.com>
+
+ Editor: Jaganbabu Rajamanickam
+ <maito:jrajaman@cisco.com>
+
+ Editor: Xufeng Liu
+ <mailto:Xufeng_Liu@jabil.com>
+
+ Editor: Zhibo Hu
+ <mailto:huzhibo@huawei.com>
+
+ Editor: Iftekhar Hussain
+ <mailto:IHussain@infinera.com>
+
+ Editor: Himanshu Shah
+ <mailto:hshah@ciena.com>
+
+ Editor: Daniel Voyer
+ <mailto:daniel.voyer@bell.ca>
+
+ Editor: Hani Elmalky
+ <mailto:hani.elmalky@ericsson.com>
+
+ Editor: Satoru Matsushima
+ <mailto:satoru.matsushima@gmail.com>
+
+ Editor: Katsuhiro Horiba
+ <mailto:katsuhiro.horiba@g.softbank.co.jp>
+
+ Editor: Ahmed AbdelSalam
+ <mailto:ahmed.abdelsalam@gssi.it>
+
+ ";
+
+ description
+ "This YANG module defines the essential elements for the
+ management of 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 2018-03-01 {
+ description
+ "Updated to align with SRv6 network programming draft rev 04";
+ reference
+ "RFC XXXX: YANG Data Model for SRv6";
+ }
+
+ revision 2017-11-12 {
+ description
+ "Initial revision.";
+ reference
+ "RFC XXXX: YANG Data Model for SRv6";
+ }
+
+/*
+ * Common
+ */
+
+ grouping path-attrs-cmn {
+ description
+ "Path properties -common for v4/v6";
+
+ leaf weight {
+ type uint32;
+ description
+ "This value is used to compute a loadshare to perform un-equal
+ load balancing when multiple outgoing path(s) are specified. A
+ share is computed as a ratio of this number to the total under
+ all configured path(s).";
+ }
+
+ leaf role {
+
+ type enumeration {
+ enum PRIMARY { description "Path as primary traffic carrying"; }
+ enum BACKUP { description "Path acts as a backup"; }
+ enum PRIMARY_AND_BACKUP { description
+ "Path acts as primary and backup simultaneously"; }
+ }
+ description "The path role";
+ }
+
+ leaf backup-path-index {
+ type uint8;
+ description "Index of the protecting (backup) path";
+ }
+ }
+
+ grouping path-out-sids {
+ description "Grouping for path's SID stack";
+
+ list out-sid {
+ key "sid";
+ description "Out SID";
+
+ leaf sid {
+ type srv6-types:srv6-sid;
+ description "SID value";
+ }
+ }
+
+ }
+
+ grouping path-out-labels {
+ description "Grouping for path's label stack";
+
+ list out-label {
+ key "label";
+ description "Out label";
+
+ leaf label {
+ type rt-types:mpls-label;
+ description "Label value";
+ }
+ }
+
+ }
+
+ /*
+ * Config and State
+ */
+
+ grouping srv6-encap {
+ description "Grouping for encap param config.";
+
+ container encapsulation {
+ description "Configure encapsulation related parameters";
+ leaf source-address {
+ type inet:ipv6-address;
+ description "Specify a source address (for T.Encap). The address must locally exists
+ and be routable";
+ }
+ leaf ip-ttl-propagation {
+ type boolean;
+ default false;
+ description "IP TTL propagation from encapsulated packet to encapsulating outer
+ IPv6 header. When configured on decapsulation side, this refers to
+ propagating IP TTL from outer IPv6 header to inner header after decap";
+ }
+
+ }
+ }
+
+ grouping srv6-locator-state {
+ description "SRv6 grouping Locastateor ";
+
+ leaf operational-status {
+ type srv6-types:srv6-status-type;
+ config false;
+ description "Indicates whether locator state is UP";
+ }
+
+ leaf is-in-address-conflict {
+ type boolean;
+ config false;
+ description "Indicates whether locator address conflicts with
+ some other IPv6 address on the box";
+ }
+ }
+
+ grouping srv6-locators {
+ description "SRv6 locator grouping";
+
+ container locators {
+ description "SRv6 locators";
+
+ list locator {
+ key "name";
+ description "Configure a SRv6 locator";
+
+
+ leaf name {
+ type string;
+ description "Locator name";
+ }
+
+ leaf enable {
+ type boolean;
+ default false;
+ description "Enable a SRv6 locator";
+ }
+ leaf is-default {
+ type boolean;
+ mandatory true;
+ description "Indicates if the locator is a default locator";
+ }
+
+ container prefix {
+ description "Specify locator prefix value";
+ leaf address {
+ type inet:ipv6-address;
+ mandatory true;
+ description "IPv6 address";
+ }
+ leaf length {
+ type srv6-types:srv6-locator-len;
+ mandatory true;
+ description "Locator (prefix) length";
+ }
+ }
+ uses srv6-locator-state;
+ }
+ }
+ }
+
+ grouping srv6-stats-in {
+ description "Grouping for inbound stats";
+
+ leaf in-pkts {
+ type yang:counter64;
+ description
+ "A cumulative counter of the total number of packets received";
+ }
+
+ leaf in-octets {
+ type yang:counter64;
+ description
+ "A cumulative counter of the total bytes received.";
+ }
+
+ }
+
+ grouping srv6-stats-out {
+ description "Grouping for inbound stats";
+
+ leaf out-pkts {
+ type yang:counter64;
+ description
+ "A cumulative counter of the total number of packets transmitted";
+ }
+
+ leaf out-octets {
+ type yang:counter64;
+ description
+ "A cumulative counter of the total bytes transmitted.";
+ }
+ }
+
+ grouping path-out-sids-choice {
+ description "Grouping for Out-SID choices";
+ choice encap-type {
+ description "Out-SID encap-based choice";
+ case srv6 {
+ uses path-out-sids;
+ }
+ case mpls {
+ uses path-out-labels;
+ }
+ }
+ }
+
+ grouping local-sid-fwd-state {
+ description "SRv6 local-SID forwarding state grouping";
+
+ container forwarding {
+ description "SRv6 local-SID forwarding state";
+
+ leaf is-installed {
+ type boolean;
+ description "Indicates whether SID is installed in forwarding";
+ }
+
+ leaf next-hop-type {
+ type srv6-types:srv6-nexthop-type;
+ description "Forwarding next-hop types";
+ }
+
+ container paths {
+
+ when "../is-installed = 'true'" {
+ description "This container is valid only when the local-SID is installed
+ in forwarding";
+ }
+
+ list path {
+ key path-index;
+ description "The list of paths associated with the SID";
+
+ leaf path-index {
+ type uint8;
+ description "Index of the path";
+ }
+
+ container l2 {
+ when "../../../next-hop-type = 'l2'" {
+ description "This container is valid only for L2 type of NHs";
+ }
+
+ leaf interface {
+ type if:interface-ref;
+ description "The outgoing Layer2 interface";
+ }
+
+ description "L2 information";
+ }
+
+ container l3 {
+ when "../../../next-hop-type != 'l2'" {
+ description "This container is valid only for L3 type of NHs";
+ }
+
+ leaf interface {
+ type if:interface-ref;
+ description "The outgoing Layer3 interface";
+ }
+
+ leaf next-hop {
+ type inet:ip-address;
+ description "The IP address of the next-hop";
+ }
+
+ uses path-attrs-cmn;
+
+ description "L3 information";
+ }
+ uses path-out-sids-choice;
+ }
+
+ description "Forwarding paths";
+ }
+ }
+ }
+
+ grouping srv6-state-sid {
+ description "SRv6 SID state grouping";
+
+ container local-sids {
+ config false;
+ description "Local-SID state";
+
+ container counters {
+ description "SRv6 counters";
+
+ container cnt3 {
+ description "Counts SRv6 traffic received/dropped on local prefix not instantiated as local-SID";
+ uses srv6-stats-in;
+ }
+ }
+
+ list local-sid {
+ key "sid";
+ description "Per-localSID Counters";
+
+ leaf sid {
+ type srv6-types:srv6-sid;
+ description "Local SID value";
+ }
+
+ uses srv6-locator-ref;
+
+ leaf is-reserved {
+ type boolean;
+ description "Set to true if SID comes from reserved pool";
+ }
+
+ leaf end-behavior-type {
+ type identityref {
+ base srv6-types:srv6-endpoint-type;
+ }
+ description "Type of SRv6 end behavior.";
+ }
+
+ leaf alloc-type {
+ type srv6-types:sid-alloc-type;
+ description
+ "Type of sid allocation.";
+
+ }
+
+ list owner {
+ key "type instance";
+ description "SID Owner clients";
+ leaf type {
+ type identityref {
+ base srv6-types:srv6-sid-owner-type;
+ }
+ description "SID owner/client type";
+ }
+ leaf instance {
+ type string;
+ description "Client instance";
+ }
+ leaf is-winner {
+ type boolean;
+ description "Is this client/owner the winning in terms of forwarding";
+ }
+ }
+
+ uses local-sid-fwd-state;
+
+ container counters {
+ description "SRv6 per local-SID counters";
+
+ container cnt1 {
+ description "Counts SRv6 traffic received on local-SID prefix and processed successfully";
+ uses srv6-stats-in;
+ }
+ }
+ }
+ }
+ }
+
+ grouping srv6-support-ends {
+ description "SRv6 End behavior support grouping";
+
+ list end-behavior {
+ key "type";
+ description "End behavior support";
+
+ leaf type {
+ type identityref {
+ base srv6-types:srv6-endpoint-type;
+ }
+ description "End behavior (End*) type";
+ }
+
+ leaf supported {
+ type boolean;
+ mandatory true;
+ description "True if supported";
+ }
+ }
+ }
+
+ grouping srv6-support-transits {
+ description "SRv6 Transit behavior support grouping";
+
+ list transit-behavior {
+ key "type";
+ description "Transit behavior support";
+
+ leaf type {
+ type srv6-types:srv6-transit-type;
+ description "Transit behavior (T*) type";
+ }
+ leaf supported {
+ type boolean;
+ mandatory true;
+ description "True if supported";
+ }
+ }
+ }
+
+ grouping srv6-support-signaled {
+ description "SRv6 signaled parameter support grouping";
+
+ container signaled-parameters {
+ description "SRv6 signaled parameter support";
+
+ leaf max-sl {
+ type uint8;
+ //mandatory true;
+ description "Maximum value of the SL field in the SRH of
+ a received packet before applying the function
+ associated with a SID";
+ }
+ leaf max-end-pop-srh {
+ type uint8;
+ //mandatory true;
+ description "Maximum number of SIDs in the top SRH in an
+ SRH stack to which the router can apply
+ PSP or USP flavors";
+ }
+ leaf max-t_insert {
+
+ type uint8;
+ //mandatory true;
+ description "Maximum number of SIDs that can be inserted as
+ part of the T.insert behavior";
+ }
+ leaf max-t_encap {
+ type uint8;
+ //mandatory true;
+ description "Maximum number of SIDs that can be inserted as
+ part of the T.Encap behavior";
+ }
+ leaf max-end_d {
+ type uint8;
+ //mandatory true;
+ description "Maximum number of SIDs in an SRH when applying
+ End.DX6 and End.DT6 functions";
+ }
+ }
+ }
+
+ grouping srv6-support-security-rules {
+ description "SRv6 Security rules grouping";
+
+ list security-rule {
+ key "type";
+ description "Security rule support";
+
+ leaf type {
+ type srv6-types:srv6-security-rule-type;
+ description "Security rule type";
+ }
+ leaf supported {
+ type boolean;
+ mandatory true;
+ description "True if supported";
+ }
+ }
+ }
+
+ grouping srv6-support-counters {
+ description "SRv6 Counters grouping";
+
+ list counters {
+ key "type";
+ description "SRv6 counter support";
+
+ leaf type {
+ type srv6-types:srv6-counter-type;
+
+ description "Counter type";
+ }
+ leaf supported {
+ type boolean;
+ mandatory true;
+ description "True if supported";
+ }
+ }
+ }
+
+ grouping srv6-state-capabilities {
+ description "SRv6 node capabilities grouping";
+ container node-capabilities {
+ config false;
+ description "Node's SRv6 capabilities";
+
+ uses srv6-support-ends;
+ uses srv6-support-transits;
+ uses srv6-support-signaled;
+ uses srv6-support-security-rules;
+ uses srv6-support-counters;
+ }
+ }
+
+ augment "/rt:routing" {
+ description
+ "This augments routing-instance configuration with segment-routing SRv6.";
+
+ container srv6 {
+ description "Segment Routing with IPv6 dataplane";
+
+ /* config */
+ leaf enable {
+ type boolean;
+ default false;
+ description "Enable SRv6";
+ }
+
+ uses srv6-encap;
+ uses srv6-locators;
+ uses srv6-state-capabilities;
+ uses srv6-state-sid;
+ }
+ }
+
+ /* Notifications */
+
+ grouping srv6-locator-ref {
+
+ description
+ "An absolute reference to an SRv6 locator";
+ leaf locator-ref {
+ type leafref {
+ path "/rt:routing/srv6:srv6/srv6:locators/srv6:locator/srv6:name";
+ }
+ description
+ "Reference to a SRv6 locator.";
+ }
+ }
+
+ notification srv6-locator-status-event {
+ description
+ "Notification event for a change of SRv6 locator operational status.";
+ leaf operational-status {
+ type srv6-types:srv6-status-type;
+ description "Operational status";
+ }
+ uses srv6-locator-ref;
+ }
+
+ notification srv6-sid-collision-event {
+ description
+ "Notification event for an SRv6 SID collision - i.e., attempt to bind an already
+ bound SID to a new context";
+ leaf sid {
+ type srv6-types:srv6-sid;
+ description "SRv6 SID";
+ }
+ container existing {
+ description "Current assignment / bind";
+ leaf end-behavior-type {
+ type identityref {
+ base srv6-types:srv6-endpoint-type;
+ }
+ description "End type";
+ }
+ // TODO: More
+ }
+ container requested {
+ description "Requested assignment / bind";
+
+ leaf end-behavior-type {
+ type identityref {
+ base srv6-types:srv6-endpoint-type;
+ }
+ description "End type";
+ }
+
+ }
+
+ }
+
+} // module
diff --git a/srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-static@2018-03-01.yang b/srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-static@2018-03-01.yang
new file mode 100644
index 000000000..3ba936688
--- /dev/null
+++ b/srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-static@2018-03-01.yang
@@ -0,0 +1,832 @@
+module hc2vpp-ietf-srv6-static {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-srv6-static";
+ prefix srv6-static;
+
+ import ietf-interfaces {
+ prefix "if";
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ // TODO: hc2vpp-298 - Renamed imports, because hc2vpp uses modified versions of these models.
+ import hc2vpp-ietf-routing {
+ prefix "rt";
+ }
+
+ import ietf-srv6-types {
+ prefix srv6-types;
+ }
+
+ // TODO: hc2vpp-332 - Renamed imports, because hc2vpp uses modified versions of these models.
+ import hc2vpp-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>
+
+
+ Editor: Kamran Raza
+ <mailto:skraza@cisco.com>
+
+ Editor: Jaganbabu Rajamanickam
+ <maito:jrajaman@cisco.com>
+
+ Editor: Xufeng Liu
+ <mailto:Xufeng_Liu@jabil.com>
+
+ Editor: Zhibo Hu
+ <mailto:huzhibo@huawei.com>
+
+ Editor: Iftekhar Hussain
+ <mailto:IHussain@infinera.com>
+
+ Editor: Himanshu Shah
+ <mailto:hshah@ciena.com>
+
+ Editor: Daniel Voyer
+ <mailto:daniel.voyer@bell.ca>
+
+ Editor: Hani Elmalky
+ <mailto:hani.elmalky@ericsson.com>
+
+ Editor: Satoru Matsushima
+ <mailto:satoru.matsushima@gmail.com>
+
+ Editor: Katsuhiro Horiba
+ <mailto:katsuhiro.horiba@g.softbank.co.jp>
+
+ 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 2018-03-01 {
+ description
+ "Updated to align with SRv6 network programming draft rev 04";
+ reference
+ "RFC XXXX: YANG Data Model for SRv6";
+ }
+
+ revision 2017-11-12 {
+ description
+ "Initial revision.";
+ reference
+ "RFC XXXX: YANG Data Model for SRv6";
+ }
+
+ /*
+ * Config and State
+ */
+
+
+ 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-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-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 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;
+ }
+ }
+ }
+ }
+
+
+ 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;
+ }
+ }
+ }
+ }
+
+ 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;
+ }
+ }
+ }
+ }
+
+ 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 identityref {
+ base srv6-types:srv6-endpoint-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 (variant: no PSP, no USP).";
+ }
+ 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
+ (variant: no PSP, no USP)";
+
+ }
+
+ container end_psp {
+ when "../end-behavior-type = 'End_PSP'" {
+ description
+ "This container is valid only when the user chooses End
+ behavior (variant: PSP only).";
+ }
+ 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
+ (variant: PSP only)";
+
+ }
+
+ container end_usp {
+ when "../end-behavior-type = 'End_USP'" {
+
+ description
+ "This container is valid only when the user chooses End
+ behavior (variant: USP only).";
+ }
+ 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
+ (variant: USP only)";
+
+ }
+
+ container end_psp_usp {
+ when "../end-behavior-type = 'End_PSP_USP'" {
+ description
+ "This container is valid only when the user chooses End
+ behavior (variant: PSP/USP).";
+ }
+ 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
+ (variant: PSP/USP)";
+
+ }
+
+ container end-t {
+ when "../end-behavior-type = 'End.T'" {
+ description
+ "This container is valid only when the user chooses
+ End.T behavior (variant: no PSP, no USP).";
+ }
+ description
+ "Endpoint with specific IPv6 table lookup (variant: no PSP, no USP).
+ Lookup the next segment in IPv6 table T
+ associated with the SID and forward via
+ the matched table entry.
+ The End.T is used for multi-table operation
+ in the core.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+ leaf lookup-table-ipv6 {
+ type srv6-types:table-id;
+ mandatory true;
+ description
+ "Table Id for lookup on updated DA (next segment)";
+
+ }
+ }
+
+ container end-t_psp {
+ when "../end-behavior-type = 'End.T_PSP'" {
+ description
+ "This container is valid only when the user chooses
+ End.T behavior (variant: PSP only).";
+ }
+ description
+ "Endpoint with specific IPv6 table lookup (variant: PSP only).
+ Lookup the next segment in IPv6 table T
+ associated with the SID and forward via
+ the matched table entry.
+ The End.T is used for multi-table operation
+ in the core.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ leaf lookup-table-ipv6 {
+ type srv6-types:table-id;
+ mandatory true;
+ description
+ "Table Id for lookup on updated DA (next segment)";
+ }
+ }
+
+
+ container end-t_usp {
+ when "../end-behavior-type = 'End.T_USP'" {
+ description
+ "This container is valid only when the user chooses
+ End.T behavior (variant: USP only).";
+ }
+ description
+ "Endpoint with specific IPv6 table lookup (variant: USP only).
+ Lookup the next segment in IPv6 table T
+ associated with the SID and forward via
+ the matched table entry.
+ The End.T is used for multi-table operation
+ in the core.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ leaf lookup-table-ipv6 {
+ type srv6-types:table-id;
+ mandatory true;
+ description
+
+ "Table Id for lookup on updated DA (next segment)";
+ }
+ }
+
+ container end-t_psp_usp {
+ when "../end-behavior-type = 'End.T_PSP_USP'" {
+ description
+ "This container is valid only when the user chooses
+ End.T behavior (variant: USP/PSP).";
+ }
+ description
+ "Endpoint with specific IPv6 table lookup (variant: USP/PSP).
+ Lookup the next segment in IPv6 table T
+ associated with the SID and forward via
+ the matched table entry.
+ The End.T is used for multi-table operation
+ in the core.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ leaf lookup-table-ipv6 {
+ type srv6-types:table-id;
+ mandatory true;
+ description
+ "Table Id for lookup on updated DA (next segment)";
+ }
+ }
+
+ container end-x {
+ when "../end-behavior-type = 'End.X'" {
+ description
+ "This container is valid only when the user chooses
+ End.X behavior (variant: no USP/PSP)";
+ }
+ description
+ "Endpoint with cross-connect to an array of
+ layer-3 adjacencies (variant: no USP/PSP).
+ Forward to layer-3 adjacency bound to the SID S.
+ The End.X function is required to express any
+ traffic-engineering policy.";
+
+ leaf protected {
+ type boolean;
+ default false;
+ description "Is Adj-SID protected?";
+ }
+
+ uses multi-paths-v6;
+
+ }
+
+ container end-x_psp {
+ when "../end-behavior-type = 'End.X_PSP'" {
+ description
+ "This container is valid only when the user chooses
+ End.X behavior (variant: PSP only)";
+ }
+ description
+ "Endpoint with cross-connect to an array of
+ layer-3 adjacencies (variant: PSP only).
+ Forward to layer-3 adjacency bound to the SID S.
+ The End.X function is required to express any
+ traffic-engineering policy.";
+
+ leaf protected {
+ type boolean;
+ default false;
+ description "Is Adj-SID protected?";
+ }
+
+ uses multi-paths-v6;
+ }
+
+ container end-x_usp {
+ when "../end-behavior-type = 'End.X_USP'" {
+ description
+ "This container is valid only when the user chooses
+ End.X behavior (variant: USP only)";
+ }
+ description
+ "Endpoint with cross-connect to an array of
+ layer-3 adjacencies (variant: USP only).
+ Forward to layer-3 adjacency bound to the SID S.
+ The End.X function is required to express any
+ traffic-engineering policy.";
+
+ leaf protected {
+ type boolean;
+ default false;
+ description "Is Adj-SID protected?";
+ }
+
+ uses multi-paths-v6;
+ }
+
+ container end-x_psp_usp {
+ when "../end-behavior-type = 'End.X_PSP_USP'" {
+
+ description
+ "This container is valid only when the user chooses
+ End.X behavior (variant: PSP/USP)";
+ }
+ description
+ "Endpoint with cross-connect to an array of
+ layer-3 adjacencies (variant: PSP/USP).
+ Forward to layer-3 adjacency bound to the SID S.
+ The End.X function is required to express any
+ traffic-engineering policy.";
+
+ leaf protected {
+ type boolean;
+ default false;
+ description "Is Adj-SID protected?";
+ }
+
+ uses multi-paths-v6;
+ }
+
+
+ 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.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ leaf policy-name {
+ type string;
+ mandatory true;
+ description "SRv6 policy name.";
+ }
+
+ uses multi-paths-v6;
+ }
+
+ 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.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ 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-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.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ leaf policy-name {
+ type string;
+ mandatory true;
+
+ description "SRv6 policy name";
+ }
+ uses multi-paths-mpls;
+ }
+
+ 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-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-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.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ leaf lookup-table-ipv6 {
+ type srv6-types:table-id;
+ mandatory true;
+ description "IPv6 table";
+ }
+ }
+ 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.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ leaf lookup-table-ipv4 {
+ type srv6-types:table-id;
+ mandatory true;
+ description "IPv4 table";
+ }
+ }
+ 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.";
+ // TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ 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-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";
+ // TODO: HC2VPP-332 - Added presence in container so mandatory child is enforced
+ // only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
+ presence "Mandatory child only if container is present";
+
+ container paths {
+ description "List of outgoing paths";
+
+ leaf interface {
+ type if:interface-ref;
+ mandatory true;
+ description "Layer-2 cross-connect to Out interface.";
+ }
+ }
+ }
+ /* TODO
+ container end-dx2v {
+ when "../end-behavior-type = 'End.DX2V'" {
+ description
+ "This container is valid only when the user chooses
+ End.DX2V behavior.";
+ }
+ description
+
+ "Endpoint with decapsulation and specific VLAN
+ L2 table lookup.
+ Pop the (outer) IPv6 header
+ and its extension headers lookup the exposed
+ inner VLANs in L2 table T forward via the
+ matched table entry.
+ The End.DX2V is used for EVPN Flexible cross-connect
+ use-cases";
+ leaf end-dx2v {
+ type empty;
+ description
+ "End_DX2V behavior";
+ }
+ }
+ container end-dt2u {
+ when "../end-behavior-type = 'End.DT2U'" {
+ description
+ "This container is valid only when the user chooses
+ End.DT2U behavior.";
+ }
+ description
+ "Endpoint with decapsulation and specific
+ unicast MAC L2 table lookup.
+ Pop the (outer) IPv6 header and its extension headers.
+ Learn the exposed inner MAC SA in L2 table T.
+ Lookup the exposed inner MAC DA in L2 table T.
+ Forward via the matched T entry else to all L2OIF in T.
+ The End.DT2U is used for EVPN Bridging unicast use cases";
+ leaf end-dt2u {
+ type empty;
+ description
+ "End_DT2U behavior";
+ }
+ }
+ container end-dt2m {
+ when "../end-behavior-type = 'End.DT2M'" {
+ description
+ "This container is valid only when the user chooses
+ End.DT2M behavior.";
+ }
+ description
+ "Endpoint with decapsulation and specific L2 table flooding.
+ Pop the (outer) IPv6 header and its extension headers.
+ Learn the exposed inner MAC SA in L2 table T.
+ Forward on all L2OIF excluding the one specified in Arg.FE2.
+ The End.DT2M is used for EVPN Bridging BUM use case with
+ ESI filtering capability.";
+ leaf end-dt2m {
+
+ type empty;
+ description
+ "End_DT2M behavior";
+ }
+ }
+*/
+
+ container end-otp {
+ when "../end-behavior-type = 'End.OTP'" {
+ description
+ "This container is valid only when the user chooses
+ End.OTP behavior.";
+ }
+ description
+ "Endpoint for OAM with timestamp and punt behavior";
+ }
+ }
+
+ grouping srv6-static-cfg {
+ description
+ "Grouping configuration and operation for SRv6 sid.";
+
+ list sid {
+ key "opcode";
+ description "Local SID list";
+
+ uses srv6-sid-config;
+ }
+ }
+
+ augment "/rt:routing/srv6:srv6/srv6:locators/srv6:locator" {
+ description
+ "This augments locator leaf withing SRv6.";
+
+ container static {
+ description "Static SRv6";
+
+ /* Local SIDs */
+ container local-sids {
+ description
+ "SRv6-static local-SIDs";
+
+ uses srv6-static-cfg;
+ /* no state for now; SID state accessible through base model */
+ }
+
+ }
+ }
+
+} // module
diff --git a/srv6/srv6-api/src/main/yang/ietf-srv6-types@2018-03-01.yang b/srv6/srv6-api/src/main/yang/ietf-srv6-types@2018-03-01.yang
new file mode 100644
index 000000000..e87a92f14
--- /dev/null
+++ b/srv6/srv6-api/src/main/yang/ietf-srv6-types@2018-03-01.yang
@@ -0,0 +1,589 @@
+module ietf-srv6-types {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-srv6-types";
+ prefix srv6-types;
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ organization
+ "IETF SPRING Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/spring/>
+ WG List: <mailto:spring@ietf.org>
+
+ Editor: Kamran Raza
+ <mailto:skraza@cisco.com>
+
+ Editor: Jaganbabu Rajamanickam
+ <maito:jrajaman@cisco.com>
+
+ Editor: Xufeng Liu
+ <mailto:Xufeng_Liu@jabil.com>
+
+ Editor: Zhibo Hu
+ <mailto:huzhibo@huawei.com>
+
+ Editor: Iftekhar Hussain
+ <mailto:IHussain@infinera.com>
+
+ Editor: Himanshu Shah
+ <mailto:hshah@ciena.com>
+
+ Editor: Daniel Voyer
+ <mailto:daniel.voyer@bell.ca>
+
+ Editor: Hani Elmalky
+ <mailto:hani.elmalky@ericsson.com>
+
+ Editor: Satoru Matsushima
+ <mailto:satoru.matsushima@gmail.com>
+
+ Editor: Katsuhiro Horiba
+
+ <mailto:katsuhiro.horiba@g.softbank.co.jp>
+
+ Editor: Ahmed AbdelSalam
+ <mailto:ahmed.abdelsalam@gssi.it>
+
+ ";
+
+ description
+ "This YANG module defines the essential types for the
+ management of Segment-Routing with IPv6 dataplane (SRv6).
+
+ 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
+ (http://trustee.ietf.org/license-info).";
+
+ reference "RFC XXXX";
+
+ revision 2018-03-01 {
+ description
+ "Updated to align with SRv6 network programming draft rev 04";
+ reference
+ "RFC XXXX: YANG Data Model for SRv6";
+ }
+
+ revision 2017-11-12 {
+ description
+ "Initial revision";
+ reference
+ "RFC XXXX: YANG Data Model for SRv6";
+ }
+
+ identity srv6-endpoint-type {
+ description
+ "Base identity from which specific SRv6 Endpoint types are derived.";
+ }
+
+ /* Endpoints defined under draft-filsfils-spring-srv6-network-programming */
+
+ identity End {
+ base srv6-endpoint-type;
+ description
+ "End function (variant: no PSP, no USP).";
+
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End_PSP {
+ base srv6-endpoint-type;
+ description
+ "End function (variant: PSP only).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End_USP {
+ base srv6-endpoint-type;
+ description
+ "End function (variant: USP only).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End_PSP_USP {
+ base srv6-endpoint-type;
+ description
+ "End function (variant: PSP and USP).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.X {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with cross-connect to an array
+ of layer-3 adjacencies (variant: no PSP, no USP).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.X_PSP {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with cross-connect to an array
+ of layer-3 adjacencies (variant: PSP only).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.X_USP {
+ base srv6-endpoint-type;
+
+ description
+ "Endpoint with cross-connect to an array
+ of layer-3 adjacencies (variant: USP only).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.X_PSP_USP {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with cross-connect to an array
+ of layer-3 adjacencies (variant: PSP and USP).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.T {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with specific IPv6 table lookup
+ (variant: no PSP, no USP).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.T_PSP {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with specific IPv6 table lookup
+ (variant: PSP only).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.T_USP {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with specific IPv6 table lookup
+ (variant: USP only).";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.T_PSP_USP {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with specific IPv6 table lookup
+ (variant: PSP and USP).";
+
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.B6 {
+ base srv6-endpoint-type;
+ description
+ "Endpoint bound to an SRv6 Policy";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.B6.Encaps {
+ base srv6-endpoint-type;
+ description
+ "This is a variation of the End.B6 behavior
+ where the SRv6 Policy also includes an
+ IPv6 Source Address A.";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.BM {
+ base srv6-endpoint-type;
+ description
+ "Endpoint bound to an SR-MPLS Policy";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DX6 {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and cross-connect
+ to an array of IPv6 adjacencies";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DX4 {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and cross-connect
+ to an array of IPv4 adjacencies";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+
+ identity End.DT6 {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and specific
+ IPv6 table lookup";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DT4 {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and specific
+ IPv4 table lookup";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DT46 {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and specific IP
+ (IPv4 or IPv6) table lookup";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DX2 {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and Layer-2
+ cross-connect to an L2 interface";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DX2V {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and specific
+ VLAN L2 table lookup";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DT2U {
+ base srv6-endpoint-type;
+ description
+
+ "Endpoint with decapsulation and specific
+ unicast MAC L2 table lookup";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.DT2M {
+ base srv6-endpoint-type;
+ description
+ "Endpoint with decapsulation and specific L2 table
+ flooding";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.OTP {
+ base srv6-endpoint-type;
+ description
+ "Endpoint for OAM operation of timestamp and punt";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ identity End.S {
+ base srv6-endpoint-type;
+ description
+ "Endpoint in search of a target in table TE";
+ reference
+ "draft-filsfils-spring-srv6-network-programming-04";
+ }
+
+ /* Endpoints defined under draft-xuclad-spring-sr-service-chaining */
+
+ identity End.AS {
+ base srv6-endpoint-type;
+ description
+ "Service-Chaining Static proxy for inner type (Ethernet,
+ IPv4 or IPv6)";
+ reference
+ "draft-xuclad-spring-sr-service-chaining-01";
+ }
+
+ identity End.AD {
+ base srv6-endpoint-type;
+ description
+ "Service-Chaining Dynamic proxy for inner type (Ethernet,
+ IPv4 or IPv6)";
+ reference
+
+ "draft-xuclad-spring-sr-service-chaining-01";
+ }
+
+ identity End.ASM {
+ base srv6-endpoint-type;
+ description
+ "Service-Chaining Shared memory SR proxy for inner type
+ (Ethernet, IPv4 or IPv6)";
+ reference
+ "draft-xuclad-spring-sr-service-chaining-01";
+ }
+
+ identity End.AM {
+ base srv6-endpoint-type;
+ description
+ "Service-Chaining Masquerading SR proxy";
+ reference
+ "draft-xuclad-spring-sr-service-chaining-01";
+ }
+
+ /* Endpoints defined under draft-ietf-dmm-srv6-mobile-uplane */
+
+ identity End.MAP {
+ base srv6-endpoint-type;
+ description
+ "DMM End.MAP";
+ reference
+ "draft-ietf-dmm-srv6-mobile-uplane-01";
+ }
+
+ identity End.M.GTP6.UP {
+ base srv6-endpoint-type;
+ description
+ "DMM End.M.GTP6.UP";
+ reference
+ "draft-ietf-dmm-srv6-mobile-uplane-01";
+ }
+
+ identity End.M.GTP6.DN {
+ base srv6-endpoint-type;
+
+ description
+ "DMM End.M.GTP6.DN";
+ reference
+ "draft-ietf-dmm-srv6-mobile-uplane-01";
+ }
+
+ identity End.M.GTP4.DN {
+ base srv6-endpoint-type;
+ description
+ "DMM End.M.GTP4.DN";
+ reference
+ "draft-ietf-dmm-srv6-mobile-uplane-01";
+ }
+
+ identity End.Limit {
+ base srv6-endpoint-type;
+ description
+ "DMM End.Limit";
+ reference
+ "draft-ietf-dmm-srv6-mobile-uplane-01";
+ }
+
+ typedef srv6-transit-type {
+
+ type enumeration {
+ /* draft-filsfils-spring-srv6-network-programming-04 */
+ enum T { value 1; description "Transit behavior"; }
+ enum T.Insert {
+ description "Transit behavior with insertion of an SRv6 policy";
+ }
+ enum T.Insert.Red {
+ description "Transit behavior with reduced insertion of an SRv6 policy";
+ }
+ enum T.Encaps {
+ description "Transit behavior with encap of an SRv6 policy";
+ }
+ enum T.Encaps.Red {
+ description "Transit behavior with reduced encap of an SRv6 policy";
+ }
+ enum T.Encaps.L2 {
+ description "T.Encaps behavior on the received L2 frame";
+ }
+ enum T.Encaps.L2.Red {
+ description "T.Encaps.Red behavior on the received L2 frame";
+ }
+ }
+
+ description "SRv6 Transit behavior types";
+
+ }
+
+ typedef srv6-security-rule-type {
+ type enumeration {
+ /* draft-filsfils-spring-srv6-network-programming-04 */
+ enum SEC1 { value 1; description "Security rule SEC1"; }
+ enum SEC2 { description "Security rule SEC2"; }
+ enum SEC3 { description "Security rule SEC3"; }
+ enum SEC4 { description "Security rule SEC4"; }
+ }
+
+ description "SRv6 Security rule types";
+ }
+
+ typedef srv6-counter-type {
+ type enumeration {
+ /* draft-filsfils-spring-srv6-network-programming-04 */
+ enum CNT1 { value 1; description "CNT1"; }
+ enum CNT2 { description "CNT2"; }
+ enum CNT3 { description "CNT3"; }
+ }
+
+ description "SRv6 counter types";
+ }
+
+ typedef srv6-sid {
+ type inet:ipv6-prefix;
+ description
+ "This type defines a SID value in SRv6";
+ }
+
+ typedef srv6-func-opcode {
+ type uint32;
+ description
+ "This is a typedef for SID FUNC's opcode type";
+ }
+
+ typedef srv6-func-opcode-reserved {
+ type uint32 {
+ range "1 .. 63";
+ }
+
+ description
+ "This is a typedef for SID FUNC's reserved opcode type";
+ }
+
+ typedef srv6-func-opcode-unreserved {
+ type uint32 {
+
+ range "64 .. max";
+ }
+
+ description
+ "This is a typedef for SID FUNC's allocatable (unreserved) opcode type";
+ }
+
+ typedef srv6-func-opcode-reserved-type {
+ type enumeration {
+ enum invalid { value 0; description "Invalid opcode"; }
+ }
+
+ description "SRv6 SID FUNC Reserved Opcodes";
+ }
+
+ typedef srv6-locator-len {
+ type uint8 {
+ range "32 .. 96";
+ }
+ description
+ "This type defines an SRv6 locator len with range constraints";
+ }
+
+ typedef srv6-sid-pfxlen {
+ type uint8 {
+ range "33 .. 128";
+ }
+ default 128;
+ description
+ "This type defines a SID prefixlen with range constraints";
+ }
+
+ typedef sid-alloc-type {
+ type enumeration {
+ enum Dynamic {
+ description
+ "SID allocated dynamically.";
+ }
+ enum Explicit {
+ description
+ "SID allocated with explicit (static) value";
+ }
+ }
+ description
+ "Types of sid allocation used.";
+ }
+
+ identity srv6-sid-owner-type {
+
+ description
+ "Base identity from which SID owner types are derived.";
+ }
+
+ identity isis {
+ base srv6-sid-owner-type;
+ description "ISIS";
+ }
+
+ identity ospfv3 {
+ base srv6-sid-owner-type;
+ description "OSPFv3";
+ }
+
+ identity bgp {
+ base srv6-sid-owner-type;
+ description "BGP";
+ }
+
+ identity evpn {
+ base srv6-sid-owner-type;
+ description "EVPN";
+ }
+
+ identity sr-policy {
+ base srv6-sid-owner-type;
+ description "SR Policy";
+ }
+
+ identity service-function {
+ base srv6-sid-owner-type;
+ description "SF";
+ }
+
+ // TODO: Rtg module ?
+ typedef table-id {
+ type uint32;
+ description
+ "Routing Table Id";
+ }
+
+ typedef srv6-status-type {
+ type enumeration {
+ enum up { value 1; description "State is Up"; }
+ enum down { description "State is Down"; }
+ }
+ description
+ "Status type";
+
+ }
+
+ typedef srv6-nexthop-type {
+ type enumeration {
+ enum ipv4 { value 1; description "IPv4 next-hop"; }
+ enum ipv6 { description "IPv6 next-hop"; }
+ enum mpls { description "MPLS next-hop"; }
+ enum l2 { description "L2 next-hop"; }
+ }
+ description
+ "Forwarding Next-hop type";
+ }
+
+} // module
diff --git a/srv6/srv6-api/src/main/yang/vpp-ietf-srv6-base@2018-06-13.yang b/srv6/srv6-api/src/main/yang/vpp-ietf-srv6-base@2018-06-13.yang
new file mode 100644
index 000000000..16aad11c8
--- /dev/null
+++ b/srv6/srv6-api/src/main/yang/vpp-ietf-srv6-base@2018-06-13.yang
@@ -0,0 +1,73 @@
+module vpp-ietf-srv6-base {
+
+ namespace "urn:hc2vpp:params:xml:ns:yang:vpp-ietf-srv6-base";
+ prefix vpp-ietf-srv6-base;
+
+ import hc2vpp-ietf-srv6-base {
+ prefix "ietf-srv6-base";
+ revision-date 2018-03-01;
+ }
+
+ import vpp-fib-table-management {
+ prefix fib-management;
+ revision-date 2018-05-21;
+ }
+
+ import hc2vpp-ietf-routing {
+ prefix "rt";
+ }
+
+ import yang-ext { prefix "ext"; }
+
+ organization
+ "FD.io - The Fast Data Project";
+
+ contact
+ "Hc2vpp Wiki <https://wiki.fd.io/view/Hc2vpp>
+ Mailing List <hc2vpp@lists.fd.io>";
+
+ description
+ "This module provides VPP specific configuration of FIB table management
+ for SRv6 base configuration.
+ It augments locator beacause, locator is the routable element in SRv6 and
+ because this is IPv6 specific configuration the address family for FIB has
+ to be always Ipv6.
+
+ Copyright (c) 2018 Bell Canada, Pantheon Technologies and/or its affiliates.
+
+ Licensed under the Apache License, Version 2.0 (the 'License');
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an 'AS IS' BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.";
+
+ revision 2018-06-13 {
+ description "initial revision";
+ }
+
+ grouping vpp-srv6-fib {
+ container fib-table {
+ leaf table-id {
+ type fib-management:fib-table-list-ref;
+ description "VRF index reference.";
+ }
+ leaf address-family {
+ type fib-management:address-family-type;
+ description "Address family reference. For SRv6 has to be always Ipv6.";
+ }
+ }
+ }
+
+ augment "/rt:routing/ietf-srv6-base:srv6/ietf-srv6-base:locators/ietf-srv6-base:locator" {
+ description "This augments locator leaf withing SRv6 with VPP specific configuration.";
+ ext:augment-identifier "vpp-srv6-fib-locator-augment";
+
+ uses vpp-srv6-fib;
+ }
+}