diff options
Diffstat (limited to 'srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-static@2018-03-01.yang')
-rw-r--r-- | srv6/srv6-api/src/main/yang/hc2vpp-ietf-srv6-static@2018-03-01.yang | 832 |
1 files changed, 832 insertions, 0 deletions
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 |