Add a set of openconfig yang models
[transportpce/models.git] / openconfig / openconfig-240119 / src / main / yang / openconfig-platform-transceiver@2021-07-29.yang
1 module openconfig-platform-transceiver {
2   yang-version 1;
3   namespace "http://openconfig.net/yang/platform/transceiver";
4   prefix oc-transceiver;
5
6   import ietf-yang-types {
7     prefix yang;
8   }
9   import openconfig-platform {
10     prefix oc-platform;
11   }
12   import openconfig-platform-types {
13     prefix oc-platform-types;
14   }
15   import openconfig-platform-port {
16     prefix oc-port;
17   }
18   import openconfig-interfaces {
19     prefix oc-if;
20   }
21   import openconfig-transport-types {
22     prefix oc-opt-types;
23   }
24   import openconfig-types {
25     prefix oc-types;
26   }
27   import openconfig-extensions {
28     prefix oc-ext;
29   }
30   import openconfig-yang-types {
31     prefix oc-yang;
32   }
33
34   organization
35     "OpenConfig working group";
36   contact
37     "OpenConfig working group
38      www.openconfig.net";
39   description
40     "This module defines configuration and operational state data
41      for transceivers (i.e., pluggable optics).  The module should be
42      used in conjunction with the platform model where other
43      physical entity data are represented.
44
45      In the platform model, a component of type=TRANSCEIVER is
46      expected to be a subcomponent of a PORT component.  This
47      module defines a concrete schema for the associated data for
48      components with type=TRANSCEIVER.
49
50      A transceiver will always contain physical-channel(s), however
51      when a line side optical-channel is present (i.e. ZR+ optics)
52      the physical-channel will reference its optical-channel.
53      In this case, the optical-channels components must be
54      subcomponents of the transceiver. The relationship between the
55      physical-channel and the optical-channel allows for multiple
56      optical-channels to be associated with a transceiver in addition
57      to ensuring certain leaves (i.e. output-power) are not duplicated
58      in multiple components.
59
60      If a transceiver contains a digital signal processor (DSP), such
61      as with ZR+ optics, the modeling will utilize hierarchical
62      components as follows:
63      PORT --> TRANSCEIVER --> OPTICAL_CHANNEL(s)
64      The signal will then traverse through a series of
65      terminal-device/logical-channels as required. The first
66      logical-channel connected to the OPTICAL_CHANNEL will utilize the
67      assignment/optical-channel leaf to create the relationship. At the
68      conclusion of the series of logical-channels, the logical-channel
69      will be associated to its host / client side based on:
70      * If the TRANSCEIVER is directly within a router or switch, then
71       it will use the logical-channel ingress leaf to specify the
72       interface it is associated with.
73      * If the TRANSCEIVER is within a dedicated terminal (Layer 1)
74       device, then it will use the logical-channel ingress leaf to
75       specify a physical-channel within a TRANSCEIVER component
76       (i.e. gray optic) that it is associated with.";
77
78   revision 2021-07-29 {
79     description
80       "Add several media-lane-based VDM defined by CMIS to physical channel";
81     reference
82       "0.9.0";
83   }
84   revision 2021-02-23 {
85     description
86       "Add leafref to an optical channel from a physical channel.";
87     reference
88       "0.8.0";
89   }
90   revision 2020-05-06 {
91     description
92       "Ensure that when statements in read-write contexts reference
93        only read-write leaves.";
94     reference
95       "0.7.1";
96   }
97   revision 2018-11-25 {
98     description
99       "Add augment for leafref to transceiver component;
100        Correct paths in physical channels leafref.";
101     reference
102       "0.7.0";
103   }
104   revision 2018-11-21 {
105     description
106       "Add OpenConfig module metadata extensions.";
107     reference
108       "0.6.1";
109   }
110   revision 2018-11-16 {
111     description
112       "Added transceiver FEC configuration and state";
113     reference
114       "0.6.0";
115   }
116   revision 2018-05-15 {
117     description
118       "Remove internal-temp state leaf, since we prefer
119        the generic /components/component/state/temperature
120        container for temperature information.";
121     reference
122       "0.5.0";
123   }
124   revision 2018-01-22 {
125     description
126       "Fixed physical-channel path reference";
127     reference
128       "0.4.1";
129   }
130   revision 2017-09-18 {
131     description
132       "Use openconfig-yang-types module";
133     reference
134       "0.4.0";
135   }
136   revision 2017-07-08 {
137     description
138       "Adds clarification on aggregate power measurement data";
139     reference
140       "0.3.0";
141   }
142   revision 2016-12-22 {
143     description
144       "Adds preconfiguration data and clarified units";
145     reference
146       "0.2.0";
147   }
148
149   oc-ext:openconfig-version "0.9.0";
150   oc-ext:regexp-posix;
151   oc-ext:catalog-organization "openconfig";
152   oc-ext:origin "openconfig";
153
154   grouping optical-power-state {
155     description
156       "Reusable leaves related to optical power state -- these
157        are read-only state values. If avg/min/max statistics are
158        not supported, the target is expected to just supply the
159        instant value";
160     container output-power {
161       description
162         "The output optical power of a physical channel in units
163          of 0.01dBm, which may be associated with individual
164          physical channels, or an aggregate of multiple physical
165          channels (i.e., for the overall transceiver). For an
166          aggregate, this may be a measurement from a photodetector
167          or a a calculation performed on the device by summing up
168          all of the related individual physical channels.
169          Values include the instantaneous, average, minimum, and
170          maximum statistics. If avg/min/max statistics are not
171          supported, the target is expected to just supply the
172          instant value";
173       uses oc-types:avg-min-max-instant-stats-precision2-dBm;
174     }
175     container input-power {
176       description
177         "The input optical power of a physical channel in units
178          of 0.01dBm, which may be associated with individual
179          physical channels, or an aggregate of multiple physical
180          channels (i.e., for the overall transceiver). For an
181          aggregate, this may be a measurement from a photodetector
182          or a a calculation performed on the device by summing up
183          all of the related individual physical channels.
184          Values include the instantaneous, average, minimum, and
185          maximum statistics. If avg/min/max statistics are not
186          supported, the target is expected to just supply the
187          instant value";
188       uses oc-types:avg-min-max-instant-stats-precision2-dBm;
189     }
190     container laser-bias-current {
191       description
192         "The current applied by the system to the transmit laser to
193          achieve the output power. The current is expressed in mA
194          with up to two decimal precision. Values include the
195          instantaneous, average, minimum, and maximum statistics.
196          If avg/min/max statistics are not supported, the target is
197          expected to just supply the instant value";
198       uses oc-types:avg-min-max-instant-stats-precision2-mA;
199     }
200   }
201
202   grouping output-optical-frequency {
203     description
204       "Reusable leaves related to optical output power -- this is
205        typically configurable on line side and read-only on the
206        client-side";
207     leaf output-frequency {
208       type oc-opt-types:frequency-type;
209       description
210         "The frequency in MHz of the individual physical channel
211          (e.g. ITU C50 - 195.0THz and would be reported as
212          195,000,000 MHz in this model). This attribute is not
213          configurable on most client ports.";
214     }
215   }
216
217   grouping physical-channel-config {
218     description
219       "Configuration data for physical client channels";
220     leaf index {
221       type uint16 {
222         range "0..max";
223       }
224       description
225         "Index of the physical channnel or lane within a physical
226          client port";
227     }
228     leaf associated-optical-channel {
229       type leafref {
230         path "/oc-platform:components/oc-platform:component/oc-platform:name";
231       }
232       description
233         "A physical channel may reference an optical channel
234          component. If the physical channel does make this optional
235          reference, then a limited set of leaves will apply within
236          the physical channel to avoid duplication within the optical
237          channel.";
238     }
239     leaf description {
240       type string;
241       description
242         "Text description for the client physical channel";
243     }
244     leaf tx-laser {
245       type boolean;
246       description
247         "Enable (true) or disable (false) the transmit label for the
248          channel";
249     }
250     uses physical-channel-config-extended {
251       when "../../../config/module-functional-type = 'oc-opt-types:TYPE_STANDARD_OPTIC'" {
252         description
253           "When the physical channel is of TYPE_STANDARD_OPTIC, the
254            extended config will be used";
255       }
256     }
257   }
258
259   grouping physical-channel-config-extended {
260     description
261       "Extended configuration data for physical client channels
262        for applications where the full physical channel config and
263        state are used. In some cases, such as when the physical
264        channel has a leafref to an optical channel component and the
265        module-functional-type is TYPE_DIGITAL_COHERENT_OPTIC this
266        grouping will NOT be used.";
267     leaf target-output-power {
268       type decimal64 {
269         fraction-digits 2;
270       }
271       units "dBm";
272       description
273         "Target output optical power level of the optical channel,
274          expressed in increments of 0.01 dBm (decibel-milliwats)";
275     }
276   }
277
278   grouping physical-channel-state {
279     description
280       "Operational state data for client channels. In some cases,
281        such as when the physical channel has a leafref to an optical
282        channel component and the module-functional-type is
283        TYPE_DIGITAL_COHERENT_OPTIC this grouping will NOT be used.";
284     leaf laser-age {
285       type oc-types:percentage;
286       description
287         "Laser age (0% at beginning of life, 100% end of life) in integer
288          percentage. This term is defined by Common Management Interface
289          Specification (CMIS).";
290       reference
291         "QSFP-DD CMIS 5.0 Table 8-122";
292     }
293     container laser-temperature {
294       description
295         "Laser temperature for the cooled laser in degrees Celsius with 1
296          decimal precision. This term is defined by Common Management
297          Interface Specification (CMIS). Values include the instantaneous,
298          average, minimum, and maximum statistics. If avg/min/max statistics
299          are not supported, the target is expected to just supply the
300          instant value.";
301       reference
302         "QSFP-DD CMIS 5.0 Table 8-122";
303       uses oc-platform-types:avg-min-max-instant-stats-precision1-celsius;
304     }
305     container target-frequency-deviation {
306       description
307         "The difference in MHz with 1 decimal precision between the target
308          center frequency and the actual current center frequency . This term
309          is defined by Common Management Interface Specification (CMIS) and
310          referred to as laser frequency error or laser ferquency deviation.
311          Values include the instantaneous, average, minimum, and maximum
312          statistics. If avg/min/max statistics are not supported, the target
313          is expected to just supply the instant value.";
314       reference
315         "QSFP-DD CMIS 5.0 Section Table 8-122";
316       uses oc-opt-types:avg-min-max-instant-stats-precision1-mhz;
317     }
318     container tec-current {
319       description
320         "The amount of current flowing to the TC of a cooled laser in percentage
321          with 2 decimal precision. This term is defined by Common Management
322          Interface Specification (CMIS). Values include the instantaneous,
323          average, minimum, and maximum statistics. If avg/min/max statistics
324          are not supported, the target is expected to just supply the instant
325          value.";
326       reference
327         "QSFP-DD CMIS 5.0 Table 8-122";
328       uses oc-opt-types:avg-min-max-instant-stats-precision2-pct;
329     }
330     uses physical-channel-state-extended {
331       when "../../../state/module-functional-type = 'oc-opt-types:TYPE_STANDARD_OPTIC'" {
332         description
333           "When the physical channel is of TYPE_STANDARD_OPTIC, the
334            extended state will be used";
335       }
336     }
337   }
338
339   grouping physical-channel-state-extended {
340     description
341       "Extended operational state data for physical client channels
342        for applications where the full physical channel config and
343        state are used. In some cases, such as when the physical
344        channel has a leafref to an optical channel component and the
345        module-functional-type is TYPE_DIGITAL_COHERENT_OPTIC this
346        grouping will NOT be used.";
347     uses output-optical-frequency;
348     uses optical-power-state;
349   }
350
351   grouping physical-channel-top {
352     description
353       "Top-level grouping for physical client channels";
354     container physical-channels {
355       description
356         "Enclosing container for client channels";
357       list channel {
358         key "index";
359         description
360           "List of client channels, keyed by index within a physical
361            client port.  A physical port with a single channel would
362            have a single zero-indexed element";
363         leaf index {
364           type leafref {
365             path "../config/index";
366           }
367           description
368             "Reference to the index number of the channel";
369         }
370         container config {
371           description
372             "Configuration data for physical channels";
373           uses physical-channel-config;
374         }
375         container state {
376           config false;
377           description
378             "Operational state data for channels";
379           uses physical-channel-config;
380           uses physical-channel-state;
381         }
382       }
383     }
384   }
385
386   grouping port-transceiver-config {
387     description
388       "Configuration data for client port transceivers";
389     leaf enabled {
390       type boolean;
391       description
392         "Turns power on / off to the transceiver -- provides a means
393          to power on/off the transceiver (in the case of SFP, SFP+,
394          QSFP,...) or enable high-power mode (in the case of CFP,
395          CFP2, CFP4) and is optionally supported (device can choose to
396          always enable).  True = power on / high power, False =
397          powered off";
398     }
399     leaf form-factor-preconf {
400       type identityref {
401         base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE;
402       }
403       description
404         "Indicates the type of optical transceiver used on this
405          port.  If the client port is built into the device and not
406          pluggable, then non-pluggable is the corresponding state. If
407          a device port supports multiple form factors (e.g. QSFP28
408          and QSFP+, then the value of the transceiver installed shall
409          be reported. If no transceiver is present, then the value of
410          the highest rate form factor shall be reported
411          (QSFP28, for example).
412
413          The form factor is included in configuration data to allow
414          pre-configuring a device with the expected type of
415          transceiver ahead of deployment.  The corresponding state
416          leaf should reflect the actual transceiver type plugged into
417          the system.";
418     }
419     leaf ethernet-pmd-preconf {
420       type identityref {
421         base oc-opt-types:ETHERNET_PMD_TYPE;
422       }
423       description
424         "The Ethernet PMD is a property of the optical transceiver
425          used on the port, indicating the type of physical connection.
426          It is included in configuration data to allow pre-configuring
427          a port/transceiver with the expected PMD.  The actual PMD is
428          indicated by the ethernet-pmd state leaf.";
429     }
430     leaf fec-mode {
431       type identityref {
432         base oc-platform-types:FEC_MODE_TYPE;
433       }
434       description
435         "The FEC mode indicates the mode of operation for the
436          transceiver's FEC. This defines typical operational modes
437          and does not aim to specify more granular FEC capabilities.";
438     }
439     leaf module-functional-type {
440       type identityref {
441         base oc-opt-types:TRANSCEIVER_MODULE_FUNCTIONAL_TYPE;
442       }
443       description
444         "Indicates the module functional type which represents the
445          functional capability of the transceiver. For example, this
446          would specify the module is a digital coherent optic or a
447          standard grey optic that performs on-off keying.";
448     }
449   }
450
451   grouping port-transceiver-state {
452     description
453       "Operational state data for client port transceivers";
454     leaf present {
455       type enumeration {
456         enum "PRESENT" {
457           description
458             "Transceiver is present on the port";
459         }
460         enum "NOT_PRESENT" {
461           description
462             "Transceiver is not present on the port";
463         }
464       }
465       description
466         "Indicates whether a transceiver is present in
467          the specified client port.";
468     }
469     leaf form-factor {
470       type identityref {
471         base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE;
472       }
473       description
474         "Indicates the type of optical transceiver used on this
475          port.  If the client port is built into the device and not
476          pluggable, then non-pluggable is the corresponding state. If
477          a device port supports multiple form factors (e.g. QSFP28
478          and QSFP+, then the value of the transceiver installed shall
479          be reported. If no transceiver is present, then the value of
480          the highest rate form factor shall be reported
481          (QSFP28, for example).";
482     }
483     leaf connector-type {
484       type identityref {
485         base oc-opt-types:FIBER_CONNECTOR_TYPE;
486       }
487       description
488         "Connector type used on this port";
489     }
490     leaf vendor {
491       type string {
492         length "1..16";
493       }
494       description
495         "Full name of transceiver vendor. 16-octet field that
496          contains ASCII characters, left-aligned and padded on the
497          right with ASCII spaces (20h)";
498     }
499     leaf vendor-part {
500       type string {
501         length "1..16";
502       }
503       description
504         "Transceiver vendor's part number. 16-octet field that
505          contains ASCII characters, left-aligned and padded on the
506          right with ASCII spaces (20h). If part number is undefined,
507          all 16 octets = 0h";
508     }
509     leaf vendor-rev {
510       type string {
511         length "1..2";
512       }
513       description
514         "Transceiver vendor's revision number. 2-octet field that
515          contains ASCII characters, left-aligned and padded on the
516          right with ASCII spaces (20h)";
517     }
518     leaf ethernet-pmd {
519       type identityref {
520         base oc-opt-types:ETHERNET_PMD_TYPE;
521       }
522       description
523         "Ethernet PMD (physical medium dependent sublayer) that the
524          transceiver supports. The SFF/QSFP MSAs have registers for
525          this and CFP MSA has similar.";
526     }
527     leaf sonet-sdh-compliance-code {
528       type identityref {
529         base oc-opt-types:SONET_APPLICATION_CODE;
530       }
531       description
532         "SONET/SDH application code supported by the port";
533     }
534     leaf otn-compliance-code {
535       type identityref {
536         base oc-opt-types:OTN_APPLICATION_CODE;
537       }
538       description
539         "OTN application code supported by the port";
540     }
541     leaf serial-no {
542       type string {
543         length "1..16";
544       }
545       description
546         "Transceiver serial number. 16-octet field that contains
547          ASCII characters, left-aligned and padded on the right with
548          ASCII spaces (20h). If part serial number is undefined, all
549          16 octets = 0h";
550     }
551     leaf date-code {
552       type oc-yang:date-and-time;
553       description
554         "Representation of the transceiver date code, typically
555          stored as YYMMDD.  The time portion of the value is
556          undefined and not intended to be read.";
557     }
558     leaf fault-condition {
559       type boolean;
560       description
561         "Indicates if a fault condition exists in the transceiver";
562     }
563     leaf fec-status {
564       type identityref {
565         base oc-platform-types:FEC_STATUS_TYPE;
566       }
567       description
568         "Operational status of FEC";
569     }
570     leaf fec-uncorrectable-blocks {
571       type yang:counter64;
572       description
573         "The number of blocks that were uncorrectable by the FEC";
574     }
575     leaf fec-uncorrectable-words {
576       type yang:counter64;
577       description
578         "The number of words that were uncorrectable by the FEC";
579     }
580     leaf fec-corrected-bytes {
581       type yang:counter64;
582       description
583         "The number of bytes that were corrected by the FEC";
584     }
585     leaf fec-corrected-bits {
586       type yang:counter64;
587       description
588         "The number of bits that were corrected by the FEC";
589     }
590     container pre-fec-ber {
591       description
592         "Bit error rate before forward error correction -- computed
593          value with 18 decimal precision. Note that decimal64
594          supports values as small as i x 10^-18 where i is an
595          integer. Values smaller than this should be reported as 0
596          to inidicate error free or near error free performance.
597          Values include the instantaneous, average, minimum, and
598          maximum statistics. If avg/min/max statistics are not
599          supported, the target is expected to just supply the
600          instant value";
601       uses oc-opt-types:avg-min-max-instant-stats-precision18-ber;
602     }
603     container post-fec-ber {
604       description
605         "Bit error rate after forward error correction -- computed
606          value with 18 decimal precision. Note that decimal64
607          supports values as small as i x 10^-18 where i is an
608          integer. Values smaller than this should be reported as 0
609          to inidicate error free or near error free performance.
610          Values include the instantaneous, average, minimum, and
611          maximum statistics. If avg/min/max statistics are not
612          supported, the target is expected to just supply the
613          instant value";
614       uses oc-opt-types:avg-min-max-instant-stats-precision18-ber;
615     }
616     container supply-voltage {
617       description
618         "Supply voltage to the transceiver in volts with 2 decimal
619          precision. Values include the instantaneous, average, minimum,
620          and maximum statistics. If avg/min/max statistics are not
621          supported, the target is expected to just supply the instant
622          value.";
623       uses oc-platform-types:avg-min-max-instant-stats-precision2-volts;
624     }
625     uses optical-power-state;
626   }
627
628   grouping port-transceiver-top {
629     description
630       "Top-level grouping for client port transceiver data";
631     container transceiver {
632       description
633         "Top-level container for client port transceiver data";
634       container config {
635         description
636           "Configuration data for client port transceivers";
637         uses port-transceiver-config;
638       }
639       container state {
640         config false;
641         description
642           "Operational state data for client port transceivers";
643         uses port-transceiver-config;
644         uses port-transceiver-state;
645       }
646       uses physical-channel-top;
647     }
648   }
649
650   augment "/oc-platform:components/oc-platform:component" {
651     description
652       "Adding transceiver data to physical inventory. This subtree is
653        only valid when the type of the component is TRANSCEIVER.";
654     uses port-transceiver-top;
655   }
656   augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
657     description
658       "Adds a reference from an interface to the corresponding
659        transceiver component.";
660     leaf transceiver {
661       type leafref {
662         path "/oc-platform:components/oc-platform:component[oc-platform:name=current()/../oc-port:hardware-port]/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:name";
663       }
664       description
665         "Provides a reference to the transceiver subcomponent that
666          corresponds to the physical port component for this interface.
667          The device must only populate this leaf with a reference to
668          a component of type TRANSCEIVER.";
669     }
670   }
671   augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
672     description
673       "Adds a reference from the base interface to its corresponding
674        physical channels.";
675     leaf-list physical-channel {
676       type leafref {
677         path "/oc-platform:components/oc-platform:component[oc-platform:name=current()/../oc-transceiver:transceiver]/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel/oc-transceiver:index";
678       }
679       description
680         "For a channelized interface, list of references to the
681          physical channels (lanes) corresponding to the interface.
682          The physical channels are elements of a transceiver component
683          in the platform model.";
684     }
685   }
686 }