module ietf-connection-oriented-oam { namespace "urn:ietf:params:xml:ns:yang:ietf-connection-oriented-oam"; prefix co-oam; import ietf-yang-types { prefix yang; } import ietf-inet-types { prefix inet; } import ietf-interfaces { prefix if; } organization "IETF LIME Working Group"; contact "WG Web: http://tools.ietf.org/wg/lime WG List: mailto:lime@ietf.org WG Chair: Carlos Pignataro cpignata@cisco.com WG Chair: Ron Bonica rbonica@juniper.net Editor: Deepak Kumar dekumar@cisco.com Editor: Qin Wu bill.wu@huawei.com Editor: Zitao Wang wangzitao@huawei.com"; description "This YANG module defines the generic configuration, statistics and rpc for connection oriented OAM to be used within IETF in a protocol indpendent manner. Functional level abstraction is indendent with YANG modeling. It is assumed that each protocol maps corresponding abstracts to its native format. Each protocol may extend the YANG model defined here to include protocol specific extensions"; revision 2017-06-01 { description "Initial revision. - 09 version"; reference "draft-ietf-lime-yang-oam-model"; } /* features */ feature connectivity-verification { description "This feature indicates that the server supports executing connectivity verification OAM command and returning a response. Servers that do not advertise this feature will not support executing connectivity verification command or rpc model for connectivity verification command."; } feature continuity-check{ description "This feature indicates that the server supports executing continuity check OAM command and returning a response. Servers that do not advertise this feature will not support executing continuity check command or rpc model for continuity check command."; } feature traceroute{ description "This feature indicates that the server supports executing traceroute OAM command and returning a response. Servers that do not advertise this feature will not support executing traceroute command or rpc model for traceroute command."; } feature mip { description "This feature indicates that the Maintenance Intermediate Point(MIP) needs to be explicit configured"; } /* Identities */ identity technology-types { description "This is the base identy of technology types which are TRILL,MPLS-TP,vpls etc"; } identity command-sub-type { description "Defines different rpc command subtypes, e.g rfc6905 trill OAM, this is optional for most cases"; } identity on-demand { base command-sub-type; description "On demand activation - indicates that the tool is activated manually to detect a specific anomaly. On-demand OAM method requires only transient configuration."; } identity proactive { base command-sub-type; description "Proactive activation - indicates that the tool is activated on a continual basis, where messages are sent periodically, and errors are detected when a certain number of expected messages are not received. Proactive OAM method requires persistent configuration."; } identity name-format { description "This defines the name format, IEEE 8021ag CFM defines varying styles of names. It is expected name format as an identity ref to be extended with new types."; } identity name-format-null { base name-format; description "Defines name format as null"; } identity identifier-format { description "Identifier-format identity can be augmented to define other format identifiers used in MEP-ID etc"; } identity identifier-format-integer { base identifier-format; description "Defines identifier-format to be integer"; } identity defect-types { description "Defines different defect types, e.g. Remote Defect Indication (rdi), loss of continuity"; } identity rdi { base defect-types; description "Indicates the aggregate health of the remote Maintenance End Points (MEPs). "; } identity remote-mep-defect{ base defect-types; description "Indicates that one or more of the remote Maintenance End Points(MEPs)is reporting a failure "; } identity loss-of-continuity{ base defect-types; description "If no proactive Continuity Check (CC) OAM packets from the source Maintenance End Point (MEP) (and in the case of Connectivity Verification , this includes the requirement to have the expected unique, technology dependent source MEP identifier) are received within the interval."; } identity cv-defect { base defect-types; description "This function should support monitoring between the Maintenance End Points (MEPs) and, in addition, between a MEP and Maintenance Intermediate Point (MIP). [RFC6371] highlights,when performing Connectivity Verification, the need for the Continuity Check and Connectivity Verification (CC-V) messages to include unique identification of the MEG that is being monitored and the MEP that originated the message."; } identity invalid-oam-defect{ base defect-types; description "Indicates that one or more invalid OAM messages has been received and that 3.5 times that OAM message transmission interval has not yet expired."; } identity cross-connect-defect{ base defect-types; description "Indicates that one or more cross-connect defect (for example, a service ID does not match the VLAN.) messages has been received and that 3.5 times that OAM message transmission interval has not yet expired."; } /* typedefs */ typedef mep-name { type string; description "Generic administrative name for a Maintenance End Point (MEP)."; } typedef interval{ type decimal64{ fraction-digits 2; } units "milliseconds"; description "Interval between packets in milliseconds. 0 means no packets are sent."; } typedef md-name-string { type string; description "Generic administrative name for Maintenance Domain (MD)."; } typedef ma-name-string { type string; description "Generic administrative name for an Maintenance Association (MA)."; } typedef oam-counter32 { type yang:zero-based-counter32; description "Define 32 bit counter for OAM."; } typedef md-level { type uint32 { range "0..255"; } description "Maintenance Domain level. The level may be restricted in certain protocols (e.g., protocol in layer 0 to layer 7)."; } /* groupings */ grouping maintenance-domain-reference { description "This grouping uniquely identifies a maintenance domain."; leaf maintenance-domain { type leafref { path "/co-oam:domains/co-oam:domain/co-oam:md-name-string"; } description "A reference to a specific Maintenance Domain."; } } grouping maintenance-association-reference { description "This grouping uniquely identifies a maintenance association. It consists of a maintence-domain-reference and a maintenance-association leafref"; uses maintenance-domain-reference; leaf maintenance-association { type leafref { path "/co-oam:domains/co-oam:domain" +"[co-oam:md-name-string = current()/" +"../maintenance-domain]/co-oam:mas" +"/co-oam:ma/co-oam:ma-name-string"; } description "A reference to a specific Maintenance Association."; } } grouping maintenance-association-end-point-reference { description "This grouping uniquely identifies a maintenance association. It consists of a maintence-association-reference and a maintenance-association-end-point leafref"; uses maintenance-association-reference; leaf maintenance-association-end-point { type leafref { path "/co-oam:domains/co-oam:domain" +"[co-oam:md-name-string = current()/" +"../maintenance-domain]/co-oam:mas" +"/co-oam:ma[co-oam:ma-name-string = " +"current()/../maintenance-association]" +"/co-oam:mep/co-oam:mep-name"; } description "A reference to a specific Maintenance association End Point."; } } grouping time-to-live { leaf ttl{ type uint8; description "Time to Live."; } description "Time to Live grouping."; } grouping defect-message { choice defect { case defect-null { description "This is a placeholder when no defect status is needed"; leaf defect-null { type empty; description "There is no defect to be defined, it will be defined in technology specific model."; } } case defect-code { description "This is a placeholder to display defect code."; leaf defect-code { type int32; description "Defect code is integer value specific to a technology."; } } description "Defect Message choices."; } description "Defect Message."; } grouping mep-address { choice mep-address { case mac-address { leaf mac-address { type yang:mac-address; description "MAC Address"; } description "MAC Address based Maintenance End Point (MEP) Addressing."; } case ipv4-address { leaf ipv4-address { type inet:ipv4-address; description "IPv4 Address"; } description "IP Address based Maintenance End Point(MEP) Addressing."; } case ipv6-address { leaf ipv6-address { type inet:ipv6-address; description "IPv6 Address"; } description "IPv6 Address based Maintenance End Point(MEP) Addressing."; } description "Maintenance End Point (MEP) Addressing."; } description "Maintenance End Point(MEP) Address"; } grouping mip-address { choice mip-address { case mac-address { leaf mac-address { type yang:mac-address; description "MAC Address"; } description "MAC Address based Maintenance Intermediate Point (MIP) Addressing."; } case ipv4-address { leaf ipv4-address { type inet:ipv4-address; description "IPv4 Address."; } description "IP Address based Maintenance Intermediate Point (MIP) Addressing."; } case ipv6-address { leaf ipv6-address { type inet:ipv6-address; description "IPv6 Address."; } description "IPv6 Address based Maintenance Intermediate Point (MIP) Addressing."; } description "Maintenance Intermediate Point (MIP) Addressing."; } description "Maintenance Intermediate Point (MIP) Address."; } grouping maintenance-domain-id { description "Grouping containing leaves sufficient to identify a Maintenance Domain."; leaf technology { type identityref { base technology-types; } mandatory true; description "Defines the technology."; } leaf md-name-string { type md-name-string; mandatory true; description "Defines the generic administrative maintenance domain name."; } } grouping md-name { leaf md-name-format { type identityref { base name-format; } description "Name format."; } choice md-name { case md-name-null { leaf md-name-null { when "'../../../md-name-format' = 'name-format-null'" { description "Maintenance Domain (MD) name format is equal to null format."; } type empty; description "Maintenance Domain (MD) name Null."; } } description "Maintenance Domain (MD) name."; } description "Maintenance Domain (MD) name."; } grouping ma-identifier { description "Grouping containing leaves sufficient to identify an Maintenance Association (MA)."; leaf ma-name-string { type ma-name-string; description "Maintenance Association (MA) name string."; } } grouping ma-name { description "Maintenance Association (MA) name."; leaf ma-name-format { type identityref { base name-format; } description "Maintenance Association (MA) name format."; } choice ma-name { case ma-name-null { leaf ma-name-null { when "'../../../ma-name-format' = 'name-format-null'" { description "Maintenance Association (MA)."; } type empty; description "Empty"; } } description "Maintenance Association) name(MA)."; } } grouping mep-id { choice mep-id { default "mep-id-int"; case mep-id-int { leaf mep-id-int { type int32; description "Maintenance End Point (MEP) ID in integer format."; } } description "Maintenance End Point (MEP) ID."; } leaf mep-id-format { type identityref { base identifier-format; } description "Maintenance End Point (MEP) ID format."; } description "Maintenance End Point (MEP) ID."; } grouping mep { description "Defines elements within the Maintenance End Point (MEP)."; leaf mep-name { type mep-name; mandatory true; description "Generic administrative name of the Maintenance End Point (MEP)."; } uses mep-id; uses mep-address; } grouping monitor-stats { description "grouping for monitoring statistics, this will be augmented by others who use this component"; choice monitor-stats { default "monitor-null"; case monitor-null { description "This is a place holder when no monitoring statistics is needed"; leaf monitor-null { type empty; description "There is no monitoring statistics to be defined."; } } description "Define the monitor stats."; } } grouping connectivity-context { description "Grouping defining the connectivity context for an Maintenance Association (MA), for example, a VRF for VPLS, or an LSP for MPLS-TP. This will be augmented by each protocol who use this component."; choice connectivity-context { default "context-null"; case context-null { description "This is a place holder when no context is needed."; leaf context-null { type empty; description "There is no context to be defined."; } } description "Connectivity context."; } } grouping cos { description "Priority used in transmitted packets; for example, in the EXP field in MPLS-TP."; leaf cos-id { type uint8; description "Class of service."; } } grouping mip-grouping { uses mip-address; description "Grouping for Maintenance Intermediate Point(MIP) configuration."; } container domains { description "Contains configuration related data. Within the container is list of fault domains. Within each domian has List of Maintenance Association (MA)."; list domain { key "technology md-name-string"; description "Define the list of fault Domains within the ietf-connection-oriented-oam module."; uses maintenance-domain-id; uses md-name; leaf md-level { type md-level; description "Define the MD-Level."; } container mas { description "This container defines Maintenance Association (MA), within that have multiple MA and within MA have Maintenance End Point (MEP)."; list ma { key "ma-name-string"; uses ma-identifier; uses ma-name; uses connectivity-context; uses cos { description "Default class of service for this Maintenance Association (MA), which may be overridden for particular Maintenance End Points (MEPs), sessions or operations."; } leaf cc-enable{ type boolean; description "Indicate whether the Continuity Check (CC) is enabled."; } list mep { key "mep-name"; description "Contain a list of Maintenance End Points (MEPs)"; uses mep; uses cos; leaf cc-enable{ type boolean; description "Indicate whether the Continuity Check (CC)is enabled."; } list session { key "session-cookie"; ordered-by user; description "Monitoring session to/from a particular remote Maintenance End Point (MEP). Depending on the protocol, this could represent Continuity Check (CC) messages received from a single remote MEP (if the protocol uses multicast CCs) or a target to which unicast echo request CCs are sent and from which responses are received (if the protocol uses a unicast request/response mechanism)."; leaf session-cookie { type uint32; description "Cookie to identify different sessions, when there are multiple remote Maintenance End Point(MEP) or multiple sessions tothe same remote MEP."; } container destination-mep { uses mep-id; description "Destination Maintenance End Point(MEP)."; } container destination-mep-address { uses mep-address; description "Destination Maintenance End Point (MEP) Address."; } uses cos; } } list mip { if-feature mip; key "interface"; leaf interface { type if:interface-ref; description "Interface"; } uses mip-grouping; description "List for Maintenance Intermediate Point (MIP)."; } description "Maintenance Association list."; } } } } notification defect-condition-notification { description "Upon the defect condition is met, this notification is sent"; leaf technology { type identityref { base technology-types; } description "The technology"; } leaf md-name-string { type leafref{ path "/domains/domain/md-name-string"; } mandatory true; description "Indicate which Maintenance Domain(MD) does the defect belong to."; } leaf ma-name-string{ type leafref{ path "/domains/domain/mas/ma/ma-name-string"; } mandatory true; description "Indicate which Maintenance Association (MA) is the defect associated with."; } leaf mep-name { type leafref{ path "/domains/domain/mas/ma/mep/mep-name"; } description "Indicate which Maintenance End Point(MEP) is seeing the defect."; } leaf defect-type { type identityref { base defect-types; } description "The currently active defects on the specific Maintenance End Point (MEP)."; } container generating-mepid { uses mep-id; description "Indicate who is generating the defect (if known). If unknown set it as 0."; } uses defect-message { description "The defect message to indicate more details."; } } notification defect-cleared-notification { description "Upon defect cleared is met, this notification is sent"; leaf technology { type identityref { base technology-types; } description "The technology."; } leaf md-name-string { type leafref{ path "/domains/domain/md-name-string"; } mandatory true; description "Indicate which Maintenance Domain (MD) does the defect belong to"; } leaf ma-name-string{ type leafref{ path "/domains/domain/mas/ma/ma-name-string"; } mandatory true; description "Indicate which Maintenance Association (MA) is the defect associated with."; } leaf mep-name { type leafref{ path "/domains/domain/mas/ma/mep/mep-name"; } description "Indicate which Maintenance End Point (MEP) is seeing the defect."; } leaf defect-type { type identityref { base defect-types; } description "The currently active defects on the specific Maintenance End Point (MEP)."; } container generating-mepid { uses mep-id; description "Indicate who is generating the defect (if known). if unknown set it as 0."; } uses defect-message { description "Defect message to indicate more details."; } } rpc continuity-check { if-feature "continuity-check"; description "Generates continuity-check as per RFC7276 Table 4."; input { leaf technology { type identityref { base technology-types; } description "The technology"; } leaf md-name-string { type leafref{ path "/domains/domain/md-name-string"; } mandatory true; description "Indicate which Maintenance Domain (MD) does the defect belong to."; } leaf md-level { type leafref { path "/domains/domain/md-level"; } description "The maintenance domain level."; } leaf ma-name-string{ type leafref{ path "/domains/domain/mas/ma/ma-name-string"; } mandatory true; description "Indicate which MA is the defect associated with"; } uses cos; uses time-to-live; leaf sub-type { type identityref { base command-sub-type; } description "Defines different command types."; } leaf source-mep { type leafref{ path "/domains/domain/mas/ma/mep/mep-name"; } description "Source Maintenance End Point (MEP)."; } container destination-mep { uses mep-address; uses mep-id { description "Only applicable if the destination is a Maintenance End Point (MEP)."; } description "Destination Maintenance End Point (MEP)."; } leaf count { type uint32; default "3"; description "Number of continuity-check message to be sent."; } leaf cc-transmit-interval { type interval; description "Interval between echo requests."; } leaf packet-size { type uint32 { range "0..10000"; } default "64"; description "Size of continuity-check packets, in octets."; } } output { uses monitor-stats { description "Stats of continuity check."; } } } rpc continuity-verification { if-feature connectivity-verification; description "Generates continuity-verification as per RFC7276 Table 4."; input { leaf md-name-string { type leafref{ path "/domains/domain/md-name-string"; } mandatory true; description "Indicate which MD (Maintenance Domain) does the defect belong to."; } leaf md-level { type leafref { path "/domains/domain/md-level"; } description "The maintenance domain level."; } leaf ma-name-string{ type leafref{ path "/domains/domain/mas/ma/ma-name-string"; } mandatory true; description "Indicate which Maintenance Association (MA) is the defect associated with."; } uses cos; uses time-to-live; leaf sub-type { type identityref { base command-sub-type; } description "Defines different command types."; } leaf source-mep { type leafref{ path "/domains/domain/mas/ma/mep/mep-name"; } description "Source Maintenance End Point(MEP)."; } container destination-mep { uses mep-address; uses mep-id { description "Only applicable if the destination is a Maintenance End Point (MEP)."; } description "Destination Maintenance End Point(MEP)."; } leaf count { type uint32; default "3"; description "Number of continuity-verification message to be sent."; } leaf interval { type interval; description "Interval between echo requests."; } leaf packet-size { type uint32 { range "64..10000"; } default "64"; description "Size of continuity-verification packets, in octets"; } } output { uses monitor-stats { description "Stats of continuity check."; } } } rpc traceroute { if-feature traceroute; description "Generates Traceroute or Path Trace and return response. Referencing RFC7276 for common Toolset name, for MPLS-TP OAM it's Route Tracing, and for TRILL OAM It's Path Tracing tool. Starts with TTL of one and increment by one at each hop. Untill destination reached or TTL reach max value."; input { leaf md-name-string { type leafref{ path "/domains/domain/md-name-string"; } mandatory true; description "Indicate which Maintenance Domain (MD) does the defect belong to."; } leaf md-level { type leafref { path "/domains/domain/md-level"; } description "The maintenance domain level."; } leaf ma-name-string{ type leafref{ path "/domains/domain/mas/ma/ma-name-string"; } mandatory true; description "Indicate which Maintenance Association (MA) is the defect associated with."; } uses cos; uses time-to-live; leaf command-sub-type { type identityref { base command-sub-type; } description "Defines different command types."; } leaf source-mep { type leafref{ path "/domains/domain/mas/ma/mep/mep-name"; } description "Source Maintenance End Point (MEP)."; } container destination-mep { uses mep-address; uses mep-id { description "Only applicable if the destination is a Maintenance End Point (MEP)."; } description "Destination Maintenance End Point (MEP)."; } leaf count { type uint32; default "1"; description "Number of traceroute probes to send. In protocols where a separate message is sent at each TTL, this is the number of packets to be sent at each TTL."; } leaf interval { type interval; description "Interval between echo requests."; } } output { list response { key "response-index"; leaf response-index { type uint8; description "Arbitrary index for the response. In protocols that guarantee there is only a single response at each TTL, the TTL can be used as the response index."; } uses time-to-live; container destination-mep { description "Maintenance End Point (MEP) from which the response has been received"; uses mep-address; uses mep-id { description "Only applicable if the destination is a Maintenance End Point (MEP)."; } } container mip { if-feature mip; leaf interface { type if:interface-ref; description "Maintenance Intermediate Point (MIP) interface."; } uses mip-address; description "Maintenance Intermediate Point (MIP) responding with traceroute"; } uses monitor-stats { description "Stats of traceroute."; } description "List of response."; } } } }