module ietf-ospf-sr { namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-sr"; prefix ospf-sr; import ietf-inet-types { prefix "inet"; } import ietf-yang-types { prefix "yang"; } import ietf-routing { prefix "rt"; } import ietf-segment-routing-common { prefix "sr-cmn"; } import ietf-segment-routing { prefix "sr"; } import ietf-ospf { prefix "ospf"; } organization "IETF OSPF - OSPF Working Group"; contact "WG Web: WG List: Editor: Derek Yeung Author: Derek Yeung Author: Yingzhen Qu Author: Acee Lindem Author: Jeffrey Zhang Author: Ing-Wher Chen Author: Greg Hankins "; description "This YANG module defines the generic configuration and operational state for OSPF Segment Routing, which is common across all of the vendor implementations. It is intended that the module will be extended by vendors to define vendor-specific OSPF Segment Routing configuration and operational parameters and policies. Copyright (c) 2017 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; reference "RFC XXXX"; revision 2017-07-02 { description "* Implement NMDA model. * Add local-block-tlvs and srms-preference-tlv. * Remove sid-binding-sub-tlvs."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } revision 2017-03-12 { description "* Add p-flag in adj-sid sub-tlv."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } revision 2016-10-31 { description "* Update authors information. * Add import of ietf-segment-routing-common module."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } revision 2016-07-07 { description "* Change routing-protocol to control-plane-protocol."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } revision 2016-03-20 { description "* Remove routing-instance."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } revision 2015-10-19 { description "* Add per-protocol SRGB support. * Editorial changes."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } revision 2015-09-02 { description "* Author list update. * Editorial changes."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } revision 2015-07-06 { description "Initial revision."; reference "RFC XXXX: A YANG Data Model for OSPF Segment Routing."; } feature ti-lfa { description "Topology-Independent Loop-Free Alternate (TI-LFA) computation using segment routing."; } /* Groupings */ grouping sid-sub-tlv { description "SID/Label sub-TLV grouping."; container sid-sub-tlv { description "Used to advertise the SID/Label associated with a prefix or adjacency."; leaf sid { type uint32; description "Segment Identifier (SID) - A 20 bit label or 32 bit SID."; } } } grouping prefix-sid-sub-tlvs { description "Prefix Segment ID (SID) sub-TLVs."; container perfix-sid-sub-tlvs{ description "Prefix SID sub-TLV."; list prefix-sid-sub-tlv { description "Prefix SID sub-TLV."; leaf flags { type bits { bit NP { position 1; description "No-PHP flag."; } bit M { position 2; description "Mapping server flag."; } bit E { position 3; description "Explicit-NULL flag."; } bit V { position 4; description "Value/Index flag."; } bit L { position 5; description "Local flag."; } } description "Segment Identifier (SID) Flags."; } leaf mt-id { type uint8; description "Multi-topology ID."; } leaf algorithm { type uint8; description "The algorithm associated with the prefix-SID."; } leaf sid { type uint32; description "An index or label."; } } } } grouping extended-prefix-range-tlvs { description "Extended prefix range TLV grouping."; container extended-prefix-range-tlvs { description "The list of range of prefixes."; list extended-prefix-range-tlv { //type=2? description "The range of prefixes."; leaf range-size { type uint16; description "The number of prefixes covered by the advertisement."; } leaf flags { type bits { bit IA { position 0; description "Inter-Area flag."; } } description "Flags."; } leaf prefix { type inet:ip-prefix; description "Address prefix."; } uses prefix-sid-sub-tlvs; uses ospf:unknown-tlvs; } } } grouping sr-algorithm-tlv { description "SR algorithm TLV grouping."; container sr-algorithm-tlv { description "All SR algorithm TLVs."; leaf-list sr-algorithm { type uint8; description "The Segment Routing (SR) algorithms that the router is currently using."; } } } grouping sid-range-tlvs { description "SID Range TLV grouping."; container sid-range-tlvs { description "List of SID range TLVs."; list sid-range-tlv { description "SID range TLV."; leaf range-size { type ospf:uint24; description "The SID range."; } uses sid-sub-tlv; } } } grouping local-block-tlvs { description "The SR local block TLV contains the range of labels reserved for local SIDs."; container local-block-tlvs { description "List of SRLB TLVs."; list local-block-tlv { description "SRLB TLV."; leaf range-size { type ospf:uint24; description "The SID range."; } uses sid-sub-tlv; } } } grouping srms-preference-tlv { description "The SRMS preference TLV is used to advertise a preference associated with the node that acts as an SR Mapping Server."; container srms-preference-tlv { description "SRMS Preference TLV."; leaf preference { type uint8 { range "0 .. 255"; } description "SRMS preference TLV, vlaue from 0 to 255."; } } } /* Configuration */ augment "/rt:routing/rt:control-plane-protocols" + "/rt:control-plane-protocol/ospf:ospf/ospf:instance" { when "../../rt:type = 'ospf:ospfv2' or " + "../../rt:type = 'ospf:ospfv3'" { description "This augments the OSPF routing protocol when used."; } description "This augments the OSPF protocol configuration with segment routing."; uses sr:controlplane-cfg; container protocol-srgb { if-feature sr:protocol-srgb; uses sr-cmn:srgb-cfg; description "Per-protocol SRGB."; } } augment "/rt:routing/rt:control-plane-protocols/" + "rt:control-plane-protocol/ospf:ospf/ospf:instance/" + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface" { when "../../../../../../rt:type = 'ospf:ospfv2' or " + "../../../../../../rt:type = 'ospf:ospfv3'" { description "This augments the OSPF interface configuration when used."; } description "This augments the OSPF protocol interface configuration with segment routing."; uses sr:igp-interface-cfg; } augment "/rt:routing/rt:control-plane-protocols/" + "rt:control-plane-protocol/ospf:ospf/ospf:instance/" + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface/" + "ospf:fast-reroute" { when "../../../../../../../rt:type = 'ospf:ospfv2' or " + "../../../../../../../rt:type = 'ospf:ospfv3'" { description "This augments the OSPF routing protocol when used."; } description "This augments the OSPF protocol IP-FRR with TI-LFA."; container ti-lfa { if-feature ti-lfa; leaf enable { type boolean; description "Enables TI-LFA computation."; } description "Topology Independent Loop Free Alternate (TI-LFA) support."; } } /* Database */ augment "/rt:routing/" + "rt:control-plane-protocols/rt:control-plane-protocol/" + "ospf:ospf/ospf:instance/ospf:areas/ospf:area/" + "ospf:interfaces/ospf:interface/ospf:database/" + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/" + "ospf:link-scope-lsa/ospf:version/ospf:ospfv2/" + "ospf:ospfv2/ospf:body/ospf:opaque/" + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" { when "../../../../../../../../../../../../../../../" + "rt:type = 'ospf:ospfv2'" { description "This augmentation is only valid for OSPFv2."; } description "SR specific TLVs for OSPFv2 extended prefix TLV in type 9 opaque LSA."; uses prefix-sid-sub-tlvs; } augment "/rt:routing/" + "rt:control-plane-protocols/rt:control-plane-protocol/" + "ospf:ospf/ospf:instance/ospf:areas/" + "ospf:area/ospf:database/" + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/" + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/" + "ospf:ospfv2/ospf:body/ospf:opaque/" + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" { when "../../../../../../../../../../../../../" + "rt:type = 'ospf:ospfv2'" { description "This augmentation is only valid for OSPFv2."; } description "SR specific TLVs for OSPFv2 extended prefix TLV in type 10 opaque LSA."; uses prefix-sid-sub-tlvs; } augment "/rt:routing/" + "rt:control-plane-protocols/rt:control-plane-protocol/" + "ospf:ospf/ospf:instance/ospf:database/" + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/" + "ospf:as-scope-lsa/ospf:version/ospf:ospfv2/" + "ospf:ospfv2/ospf:body/ospf:opaque/" + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" { when "../../../../../../../../../../../" + "rt:type = 'ospf:ospfv2'" { description "This augmentation is only valid for OSPFv2."; } description "SR specific TLVs for OSPFv2 extended prefix TLV in type 11 opaque LSA."; uses prefix-sid-sub-tlvs; } augment "/rt:routing/" + "rt:control-plane-protocols/rt:control-plane-protocol/" + "ospf:ospf/ospf:instance/ospf:areas/" + "ospf:area/ospf:database/" + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/" + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/" + "ospf:ospfv2/ospf:body/ospf:opaque/" + "ospf:extended-link-tlvs/ospf:extended-link-tlv" { when "../../../../../../../../../../../../../" + "rt:type = 'ospf:ospfv2'" { description "This augmentation is only valid for OSPFv2."; } description "SR specific TLVs for OSPFv2 extended link TLV in type 10 opaque LSA."; container adj-sid-sub-tlvs { description "Adjacency SID optional sub-TLVs."; list adj-sid-sub-tlv { description "List of Adjacency SID sub-TLVs."; leaf flags { type bits { bit B { position 0; description "Backup flag."; } bit V { position 1; description "Value/Index flag."; } bit L { position 2; description "Local/Global flag."; } bit G { position 3; description "Group flag."; } bit P { position 4; description "Persistent flag."; } } description "Flags."; } leaf mt-id { type uint8; description "Multi-topology ID."; } leaf weight { type uint8; description "Weight used for load-balancing."; } leaf sid { type uint32; description "Segment Identifier (SID) index/label."; } } } container lan-adj-sid-sub-tlvs { description "LAN Adjacency SID optional sub-TLVs."; list lan-adj-sid-sub-tlv { description "List of LAN adjacency SID sub-TLVs."; leaf flags { type bits { bit B { position 0; description "Backup flag."; } bit V { position 1; description "Value/Index flag."; } bit L { position 2; description "Local/Global flag."; } bit G { position 3; description "Group flag."; } bit P { position 4; description "Persistent flag."; } } description "Flags."; } leaf mt-id { type uint8; description "Multi-topology ID."; } leaf weight { type uint8; description "Weight used for load-balancing."; } leaf neighbor-router-id { type yang:dotted-quad; description "Neighbor router ID."; } leaf sid { type uint32; description "Segment Identifier (SID) index/label."; } } } } augment "/rt:routing/" + "rt:control-plane-protocols/rt:control-plane-protocol/" + "ospf:ospf/ospf:instance/ospf:areas/ospf:area/" + "ospf:interfaces/ospf:interface/ospf:database/" + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/" + "ospf:link-scope-lsa/ospf:version/ospf:ospfv2/" + "ospf:ospfv2/ospf:body/ospf:opaque" { when "../../../../../../../../../../../../../" + "rt:type = 'ospf:ospfv2'" { description "This augmentation is only valid for OSPFv2."; } description "SR specific TLVs for OSPFv2 type 9 opaque LSA."; uses extended-prefix-range-tlvs; uses sr-algorithm-tlv; uses sid-range-tlvs; uses local-block-tlvs; uses srms-preference-tlv; } augment "/rt:routing/" + "rt:control-plane-protocols/rt:control-plane-protocol/" + "ospf:ospf/ospf:instance/ospf:areas/" + "ospf:area/ospf:database/" + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/" + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/" + "ospf:ospfv2/ospf:body/ospf:opaque" { when "../../../../../../../../../../../" + "rt:type = 'ospf:ospfv2'" { description "This augmentation is only valid for OSPFv2."; } description "SR specific TLVs for OSPFv2 type 10 opaque LSA."; uses extended-prefix-range-tlvs; uses sr-algorithm-tlv; uses sid-range-tlvs; uses local-block-tlvs; uses srms-preference-tlv; } augment "/rt:routing/" + "rt:control-plane-protocols/rt:control-plane-protocol/" + "ospf:ospf/ospf:instance/ospf:database/" + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/" + "ospf:as-scope-lsa/ospf:version/ospf:ospfv2/" + "ospf:ospfv2/ospf:body/ospf:opaque" { when "../../../../../../../../../" + "rt:type = 'ospf:ospfv2'" { description "This augmentation is only valid for OSPFv2."; } description "SR specific TLVs for OSPFv2 type 11 opaque LSA."; uses extended-prefix-range-tlvs; uses sr-algorithm-tlv; uses sid-range-tlvs; uses local-block-tlvs; uses srms-preference-tlv; } }