module ieee802-ethernet-link-oam { /*** NAMESPACE / PREFIX DEFINITION ***/ namespace "urn:ieee:std:802.3:yang:ethernet-link-oam"; prefix "link-oam"; /*** LINKAGE (IMPORTS / INCLUDES) ***/ import ietf-yang-types { prefix "yang"; } import ietf-interfaces { prefix "if"; } import ieee802-ethernet-interface { prefix "eth"; } /*** META INFORMATION ***/ organization "IEEE 802.3 Ethernet Workign Group Web URL: http://www.ieee802.org/3/"; contact "Web URL: http://www.ieee802.org/3/cf/"; description "This module contains a collection of YANG definitions for managing the Ethernet Link OAM feature defined by IEEE 802.3. It provides functionality roughly equivalent to that of the DOT3-OAM-MIB defined in RFC 4878. This YANG module augments the 'ethernet-interface' module."; revision "2017-09-11"{ description "revision for D1.2"; reference "P802.3.2 D1.2."; } revision "2017-08-24"{ description "revised version"; reference "IEEE 802.3 2015"; } revision "2015-10-29" { description "Initial version"; reference "IEEE 802.3 2012"; } /* * Features */ feature uni-directional-link-fault { description "This feature means the device supports Uni Directional Link Fault detection."; reference "[802.3] 57.1.2:a, 30.3.6.1.6 aOAMLocalConfiguration, 30.3.6.1.7 aOAMRemoteConfiguration"; } feature remote-loopback { description "This feature means the device supports remote loopback"; reference "[802.3] 57.1.2:b,30.3.6.1.6 aOAMLocalConfiguration, 30.3.6.1.7 aOAMRemoteConfiguration"; } feature link-monitoring { description "This feature means the device supports Link Monitoring."; reference "[802.3] 57.1.2:c:1,30.3.6.1.6 aOAMLocalConfiguration, 30.3.6.1.7 aOAMRemoteConfiguration"; } feature remote-mib-retrieval { description "This feature means the device supports remote MIB retrieval."; reference "[802.3] 57.1.2:c:2,30.3.6.1.6 aOAMLocalConfiguration, 30.3.6.1.7 aOAMRemoteConfiguration"; } /* * Types / identities */ typedef threshold-event-enum { type enumeration { enum symbol-period-event { value 1; description "Errored symbol period event"; } enum frame-period-event { value 2; description "Errored frame period event"; } enum frame-event { value 3; description "Errored frame event"; } enum frame-seconds-event { value 4; description "Errored frame seconds event"; } } description "Enumeration of the valid threshold event types"; reference "[802.3] 57.5.3"; } identity event-type { description "Base identity for all Link OAM event types."; } identity threshold-event-type { base event-type; description "Event type for a Link Monitoring threshold event."; } identity link-fault-event { /* * Requires Yang 1.1 */ //if-feature uni-directional-link-fault; base event-type; description "Event type for a uni-directional link fault event."; reference "[802.3] 57.2.10.1"; } identity dying-gasp-event { base event-type; description "Event type for a dying gasp event."; reference "[802.3] 57.2.10.1"; } identity critical-event { base event-type; description "Event type for a critical event."; reference "[802.3] 57.2.10.1"; } typedef mode { type enumeration { enum passive { value 0; description "Ethernet Link OAM Passive mode"; } enum active { value 1; description "Ethernet Link OAM Active mode"; } } description "Enumeration of the valid modes in which Link OAM may run"; reference "[802.3] 57.2.9, 30.3.6.1.3."; } typedef event-location { type enumeration { enum event-location-local { value 1; description "A local event"; } enum event-location-remote { value 2; description "A remote event"; } } description "The location of the event that caused a log entry"; } typedef loopback-status{ type enumeration { enum none { value 1; description "Loopback is not being performed"; } enum initiating { value 2; description "Initiating master loopback"; } enum master-loopback { value 3; description "In master loopback mode"; } enum terminating { value 4; description "Terminating master loopback mode"; } enum local-loopback { value 5; description "In slave loopback mode"; } enum unknown { value 6; description "Parser and multiplexer combination unexpected"; } } description "The loopback mode of an OAM interface"; reference "[802.3] 57.2.11"; } typedef operational-state { type enumeration { enum disabled { value 1; description "802.3 OAM is disabled"; } enum link-fault { value 2; description "802.3 OAM has encountered a link fault"; } enum passive-wait { value 3; description "Passive OAM entity waiting to see if peer is OAM capable"; } enum active-send-local { value 4; description "Active OAM entity trying to determine if peer is OAM capable"; } enum send-local-and-remote { value 5; description "OAM discovered peer but still to accept or reject peer config"; } enum send-local-and-remote-ok { value 6; description "OAM peering is allowed by local device"; } enum peering-locally-rejected { value 7; description "OAM peering rejected by local device"; } enum peering-remotely-rejected { value 8; description "OAM peering rejected by remote device"; } enum operational { value 9; description "802.3 OAM is operational"; } enum operational-half-duplex { value 10; description "802.3 OAM is operating in half-duplex mode"; } } description "Operational state of an interface"; reference "[RFC-4878] dot3OamOperStatus, [802.3] 30.3.6.1.4, 30.3.6.1.10, 30.3.6.1.11"; } typedef vendor-oui { type yang:hex-string { length 6; } description "24-bit Organizationally Unique Identifier"; reference "IEEE 802-2001 [802-2001], Clause 9"; } typedef admin-state { type enumeration { enum enabled { value 1; description "802.3 OAM admin is enabled"; } enum disabled { value 2; description "802.3 OAM admin is disabled"; } } description "admin state of the oam function on an interface"; reference "[802.3] 30.3.6.1.2, 30.3.6.2"; } /* * Configuration */ /* * Define per-interface configuration as a grouping so that * augmenting models can reuse it (e.g. for templating support) */ grouping intf-config { description "Per-interface Link OAM configuration nodes"; leaf mode { type mode; default active; description "The mode (active/passive) in which Link OAM should run"; reference "[802.3] 30.3.6.1.3"; } leaf mib-retrieval { if-feature remote-mib-retrieval; type boolean; default false; description "Enable or disable support for responding to MIB retrieval requests from the peer device"; } leaf remote-loopback { if-feature remote-loopback; type boolean; default false; description "Enable or disable support for acting as a remote loopback slave device"; } leaf udlf { if-feature uni-directional-link-fault; type boolean; default false; description "Enable or disable uni-directional link-fault detection"; } container link-monitor { if-feature link-monitoring; description "Configure link monitor parameters"; reference "[802.3] 57.1.2:c"; leaf monitoring { type boolean; default true; description "Enable or disable monitoring"; } list event-type { key threshold-type; description "A list containing at most one entry for each of the threshold event types. If there is no entry for a particular event type, the default values are used for both window size and threshold."; leaf threshold-type { type threshold-event-enum; description "The type of threshold event for which this list entry is specifying the configuration."; reference "[802.3] 57.5.3"; } leaf window { type uint64; description "The size of the window to use when monitoring for this threshold event. The units, default and upper and lower bounds depend on the threshold type as follows: Symbol Period: Units: number of symbols Default: number of symbols in one second for the underlying physical layer Min: number of symbols in one second for the underlying physical layer Max: number of symbols in one minute for the underlying physical layer Frame: Units: deciseconds Default: 1 second Min: 1 second Max: 1 minute Frame Period: Units: number of frames Default: number of minFrameSize frames in one second for the underlying physical layer Min: number of minFrameSize frames in one second for the underlying physical layer Max: number of minFrameSize frames in one minute for the underlying physical layer Frame Seconds: Units: deciseconds Default: 60 seconds Min: 10 seconds Max: 900 seconds "; reference "[802.3] 30.3.6.1.34, 30.3.6.1.36, 30.3.6.1.38, 30.3.6.1.40"; } leaf threshold { type uint64 { range "1..max"; } default 1; description "The threshold value to use when determining whether to generate an event given the number of errors that occurred in a given window. The units depend on the threshold type as follows: Symbol Period: number of errored symbols Frame: number of errored frames Frame Period: number of errored frames Frame Seconds: number of seconds containing at least 1 frame error "; reference "[802.3] 30.3.6.1.34, 30.3.6.1.36, 30.3.6.1.38, 30.3.6.1.40"; } } } } augment "/if:interfaces/if:interface/eth:ethernet" { description "Augments ethernet interface configuration model with nodes specific to Ethernet Link OAM"; container link-oam { leaf admin { type admin-state; default disabled; description "This object is used to provision the default administrative OAM mode for this interface. This object represents the desired state of OAM for this interface. It starts in the disabled state until an explicit management action or configuration information retained by the system causes a transition to the enabled(1) state. When enabled(1), Ethernet OAM will attempt to operate over this interface."; } reference "[802.3], 30.3.6.1.2, 30.3.6.2"; uses intf-config; } } /* * Operational */ grouping event-details { description "Nodes describing an event, used in the event log and in notifications"; reference "[RFC-4878] Dot3OamEventLogEntry"; leaf oui { type vendor-oui; mandatory true; description "Organizationally Unique Identifier for the device that generated the event"; } leaf timestamp { type uint64; units "milliseconds"; mandatory true; description "Timestamp in milliseconds since unix epoch for when the event occurred"; } leaf location { type event-location; mandatory true; description "Where the event occurred (local or remote)"; } leaf event-type { type identityref { base event-type; } mandatory true; description "Type of event that occurred"; reference "[802.3], 30.3.6.1.10,30.3.6.11"; } container threshold { when "../event-type = 'threshold-event-type'" { description "These nodes only apply to threshold event types"; } if-feature link-monitoring; description "Nodes specific to threshold (link monitoring) events"; leaf threshold-event-type { type threshold-event-enum; mandatory true; description "The type of threshold event"; reference "[802.3] 57.5.3"; } leaf window { type uint64; mandatory true; description "Size of the window in which the event was generated. Units are dependent on the threshold event type."; } leaf threshold { type uint64; mandatory true; description "Size of the threshold that was breached during the window. Units are dependent on the threshold event type."; } leaf value { type uint64; mandatory true; description "Breaching value. Units are dependent on the threshold event type, and match that of the threshold."; } } leaf running-total { type uint64; mandatory true; description "The running total number of errors seen since OAM was enabled on the interface. For threshold events, this is the total number of times that particular type of error (e.g. symbol error) has occurred, which may be greater than the number of threshold-crossing event notifications of that type generated during that time (which is conveyed by the event-total leaf)."; } leaf event-total { type uint32; mandatory true; description "Total number of times this event has occurred since OAM was enabled on the interface. For threshold events this is the number of events generated of this type (as opposed to the total number of errors of that type, which may be greater, and is conveyed by the running-total leaf."; } } grouping statistics-common { description "Collection of Link OAM event/packet counters"; reference "[RFC-4878] Dot3OamStatsEntry"; leaf information-tx { type uint32; mandatory true; description "Number of information OAMPDUs transmitted"; reference "[802.3], 30.3.6.1.20"; } leaf information-rx { type uint32; mandatory true; description "Number of information OAMPDUs received"; reference "[802.3], 30.3.6.1.21"; } leaf unique-event-notification-tx { type uint32; mandatory true; description "Number of unique event notification OAMPDUs transmitted"; reference "[802.3], 30.3.6.1.22"; } leaf unique-event-notification-rx { type uint32; mandatory true; description "Number of unique event notification OAMPDUs received"; reference "[802.3], 30.3.6.1.24"; } leaf duplicate-event-notification-tx { type uint32; mandatory true; description "Number of duplicate event notification OAMPDUs transmitted"; reference "[802.3], 30.3.6.1.23"; } leaf duplicate-event-notification-rx { type uint32; mandatory true; description "Number of duplicate event notification OAMPDUs received"; reference "[802.3], 30.3.6.1.25"; } leaf loopback-control-tx { type uint32; mandatory true; description "Number of loopback control OAMPDUs transmitted"; reference "[802.3], 30.3.6.1.26"; } leaf loopback-control-rx { type uint32; mandatory true; description "Number of loopback control OAMPDUs received"; reference "[802.3], 30.3.6.1.27"; } leaf variable-request-tx { type uint32; mandatory true; description "Number of variable request OAMPDUs transmitted"; reference "[802.3], 30.3.6.1.28"; } leaf variable-request-rx { type uint32; mandatory true; description "Number of variable request OAMPDUs received"; reference "[802.3], 30.3.6.1.29"; } leaf variable-response-tx { type uint32; mandatory true; description "Number of variable response OAMPDUs transmitted"; reference "[802.3], 30.3.6.1.30"; } leaf variable-response-rx { type uint32; mandatory true; description "Number of variable response OAMPDUs received"; reference "[802.3], 30.3.6.1.31"; } leaf org-specific-tx { type uint32; mandatory true; description "Number of organization specific OAMPDUs transmitted"; reference "[802.3], 30.3.6.1.32"; } leaf org-specific-rx { type uint32; mandatory true; description "Number of organization specific OAMPDUs received"; reference "[802.3], 30.3.6.1.33"; } leaf unsupported-codes-tx { type uint32; mandatory true; description "Number of OAMPDUs with unsupported codes transmitted"; reference "[802.3], 30.3.6.1.18"; } leaf unsupported-codes-rx { type uint32; mandatory true; description "Number of OAMPDUs with unsupported codes received"; reference "[802.3], 30.3.6.1.19"; } leaf frames-lost-due-to-oam { type uint32; mandatory true; description "A count of the number of frames that were dropped by the OAM multiplexer. Since the OAM multiplexer has multiple inputs and a single output, there may be cases where frames are dropped due to transmit resource contention. This counter is incremented whenever a frame is dropped by the OAM layer."; reference "[802.3], 30.3.6.1.46"; } } grouping discovery-common { description "Nodes describing the state of the discovery process common to both ends of a link (either local or remote)"; leaf mode { type mode; description "Mode (passive/active)"; reference "[802.3], 30.3.6.1.3"; } container functions-supported { description "The Link OAM functions supported by this interface"; reference "[802.3] 30.3.6.1.6, 30.3.6.1.7"; leaf uni-directional-link-fault { type boolean; description "Unidirectional link fault support"; } leaf loopback { type boolean; description "Loopback support"; } leaf link-monitoring { type boolean; description "Link monitoring support"; } leaf mib-retrieval { type boolean; description "MIB variable retrieval support"; } } leaf revision { type uint32; description "Configuration revision"; reference "[802.3], 30.3.6.1.12, 30.3.6.1.13"; } leaf mtu { type uint32; units "bytes"; description "The maximum OAMPDU size"; reference "[802.3], 30.3.6.1.8, 30.3.6.1.9"; } } grouping discovery-info { description "Information relating to the discovery process"; container local { description "Properties of the local device"; leaf operational-status { type operational-state; mandatory true; description "Operational status"; reference "[RFC-4878] dot3OamOperStatus, [802.3] 30.3.6.1.4, 30.3.6.1.10, 30.3.6.1.11"; } leaf loopback-mode { type loopback-status; mandatory true; description "The loopback mode the interface is in"; reference "[802.3], 30.3.6.1.14"; } uses discovery-common; } container remote { description "Properties of the remote (peer) device"; leaf mac-address { type yang:mac-address; description "Remote MAC address"; reference "[802.3], 30.3.6.1.5"; } leaf vendor-oui { type vendor-oui; description "Remote vendor OUI"; reference "[802.3], 30.3.6.1.16"; } leaf vendor-info { type uint32; description "Remote vendor info. The semantics of this value are proprietary and specific to the vendor."; reference "[802.3], 30.3.6.1.17"; } leaf loopback-mode { type loopback-status; mandatory true; description "The loopback mode the interface is in"; reference "[802.3], 30.3.6.1.15"; } uses discovery-common; } } augment "/if:interfaces-state/if:interface/eth:ethernet" { description "Augments ethernet interface operational state model with nodes specific to Ethernet Link OAM"; container link-oam { presence "Implies Link OAM is configured on the interface"; description "Interface operational state for Ethernet Link OAM"; leaf rx-fault { if-feature uni-directional-link-fault; type boolean; mandatory true; description "Has a uni-directional link-fault been detected by the local device?"; } container discovery-info { description "Information relating to the discovery process"; uses discovery-info; } container event-log { description "List of Ethernet Link OAM event log entries on the interface"; list event-log-entry { key "index"; description "Ethernet Link OAM event log entry"; leaf index { type uint32; description "Index of this event in the event log"; } uses event-details; } } container statistics { description "Statistics for an 802.3 OAM interface"; uses statistics-common; leaf local-error-symbol-period-log-entries { type uint32; mandatory true; description "Number of local error symbol period log entries"; } leaf local-error-frame-log-entries { type uint32; mandatory true; description "Number of local error frame log entries"; } leaf local-error-frame-period-log-entries { type uint32; mandatory true; description "Number of local error frame period log entries"; } leaf local-error-frame-second-log-entries { type uint32; mandatory true; description "Number of local error frame second log entries"; } leaf remote-error-symbol-period-log-entries { type uint32; mandatory true; description "Number of remote error symbol period log entries"; } leaf remote-error-frame-log-entries { type uint32; mandatory true; description "Number of remote error frame log entries"; } leaf remote-error-frame-period-log-entries { type uint32; mandatory true; description "Number of remote error frame period log entries"; } leaf remote-error-frame-second-log-entries { type uint32; mandatory true; description "Number of remote error frame second log entries"; } } } } /* * RPCs */ /* rpc reset-stats { description "Reset Ethernet Link OAM statistics on a specific (or all) interface(s)"; input { leaf interface { type if:interface-ref; description "The interface to reset stats for. If not specified, stats are reset for all interfaces in the system."; } } } rpc remote-loopback { if-feature remote-loopback; description "Start/stop remote loopback on the specified interface."; reference "[802.3] 57.1.2:b"; input { leaf interface { type if:interface-ref; mandatory true; description "The interface to start loopback on."; } leaf enable { type boolean; mandatory true; description "Whether to enable or disable remote loopback."; } } output { leaf success { type boolean; mandatory true; description "True if the operation was successful, False otherwise."; } leaf error-message { type string; description "If the operation failed, optionally used to provide extra details."; } } } */ /* * Notifications */ notification threshold-event { if-feature link-monitoring; description "This notification is sent when a local or remote threshold crossing event is detected."; uses event-details { refine event-type { must ". = 'threshold-event-type'" { description "This leaf will always be set to 'threshold-event-type'"; } } } } notification non-threshold-event { description "This notification is sent when a local or remote non-threshold crossing event is detected."; uses event-details { refine event-type { must ". != 'threshold-event-type'" { description "This leaf will never be set to 'threshold-event-type'"; } } } } }