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: WG List: Editor: Kamran Raza Editor: Jaganbabu Rajamanickam Editor: Xufeng Liu Editor: Zhibo Hu Editor: Iftekhar Hussain Editor: Himanshu Shah Editor: Daniel Voyer Editor: Hani Elmalky Editor: Satoru Matsushima Editor: Katsuhiro Horiba Editor: Ahmed AbdelSalam "; 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