blob: 849b534d2545cb835f6f6661ea1572c0d0326eb1 [file] [log] [blame]
Thomas Vachuska8ca75a22017-08-24 16:12:59 -07001module openconfig-platform-transceiver {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/platform/transceiver";
7
8 prefix "oc-transceiver";
9
10 // import some basic types
11 import openconfig-platform { prefix oc-platform; }
12 import openconfig-interfaces { prefix oc-if; }
13 import openconfig-transport-types { prefix oc-opt-types; }
14 import openconfig-types { prefix oc-types; }
15 import openconfig-extensions { prefix oc-ext; }
16 import ietf-yang-types { prefix yang; }
17
18
19 // meta
20 organization "OpenConfig working group";
21
22 contact
23 "OpenConfig working group
24 www.openconfig.net";
25
26 description
27 "This module defines configuration and operational state data
28 for transceivers (i.e., pluggable optics). The module should be
29 used in conjunction with the platform model where other
30 physical entity data are represented.
31
32 In the platform model, a component of type=TRANSCEIVER is
33 expected to be a subcomponent of a PORT component. This
34 module defines a concrete schema for the associated data for
35 components with type=TRANSCEIVER.";
36
37 oc-ext:openconfig-version "0.3.0";
38
39 revision "2017-07-08" {
40 description
41 "Adds clarification on aggregate power measurement data";
42 reference "0.3.0";
43 }
44
45 revision "2016-12-22" {
46 description
47 "Adds preconfiguration data and clarified units";
48 reference "0.2.0";
49 }
50
51 // identity statements
52
53 // typedef statements
54
55 // grouping statements
56
57 grouping optical-power-state {
58 description
59 "Reusable leaves related to optical power state -- these
60 are read-only state values. If avg/min/max statistics are
61 not supported, the target is expected to just supply the
62 instant value";
63
64 container output-power {
65 description
66 "The output optical power of a physical channel in units
67 of 0.01dBm, which may be associated with individual
68 physical channels, or an aggregate of multiple physical
69 channels (i.e., for the overall transceiver). For an
70 aggregate, this may be a measurement from a photodetector
71 or a a calculation performed on the device by summing up
72 all of the related individual physical channels.
73 Values include the instantaneous, average, minimum, and
74 maximum statistics. If avg/min/max statistics are not
75 supported, the target is expected to just supply the
76 instant value";
77
78 uses oc-types:avg-min-max-instant-stats-precision2-dBm;
79 }
80
81 container input-power {
82 description
83 "The input optical power of a physical channel in units
84 of 0.01dBm, which may be associated with individual
85 physical channels, or an aggregate of multiple physical
86 channels (i.e., for the overall transceiver). For an
87 aggregate, this may be a measurement from a photodetector
88 or a a calculation performed on the device by summing up
89 all of the related individual physical channels.
90 Values include the instantaneous, average, minimum, and
91 maximum statistics. If avg/min/max statistics are not
92 supported, the target is expected to just supply the
93 instant value";
94
95 uses oc-types:avg-min-max-instant-stats-precision2-dBm;
96 }
97
98 container laser-bias-current {
99 description
100 "The current applied by the system to the transmit laser to
101 achieve the output power. The current is expressed in mA
102 with up to two decimal precision. Values include the
103 instantaneous, average, minimum, and maximum statistics.
104 If avg/min/max statistics are not supported, the target is
105 expected to just supply the instant value";
106
107 uses oc-types:avg-min-max-instant-stats-precision2-mA;
108 }
109 }
110
111 grouping output-optical-frequency {
112 description
113 "Reusable leaves related to optical output power -- this is
114 typically configurable on line side and read-only on the
115 client-side";
116
117 leaf output-frequency {
118 type oc-opt-types:frequency-type;
119 description
120 "The frequency in MHz of the individual physical channel
121 (e.g. ITU C50 - 195.0THz and would be reported as
122 195,000,000 MHz in this model). This attribute is not
123 configurable on most client ports.";
124 }
125 }
126
127
128 grouping physical-channel-config {
129 description
130 "Configuration data for physical client channels";
131
132 leaf index {
133 type uint16 {
134 range 0..max;
135 }
136 description
137 "Index of the physical channnel or lane within a physical
138 client port";
139 }
140
141 leaf description {
142 type string;
143 description
144 "Text description for the client physical channel";
145 }
146
147 leaf tx-laser {
148 type boolean;
149 description
150 "Enable (true) or disable (false) the transmit label for the
151 channel";
152 }
153
154 leaf target-output-power {
155 type decimal64 {
156 fraction-digits 2;
157 }
158 units dBm;
159 description
160 "Target output optical power level of the optical channel,
161 expressed in increments of 0.01 dBm (decibel-milliwats)";
162 }
163 }
164
165 grouping physical-channel-state {
166 description
167 "Operational state data for client channels.";
168
169 uses output-optical-frequency;
170 uses optical-power-state;
171 }
172
173 grouping physical-channel-top {
174 description
175 "Top-level grouping for physical client channels";
176
177 container physical-channels {
178 description
179 "Enclosing container for client channels";
180
181 list channel {
182 key "index";
183 description
184 "List of client channels, keyed by index within a physical
185 client port. A physical port with a single channel would
186 have a single zero-indexed element";
187
188 leaf index {
189 type leafref {
190 path "../config/index";
191 }
192 description
193 "Reference to the index number of the channel";
194 }
195
196 container config {
197 description
198 "Configuration data for physical channels";
199
200 uses physical-channel-config;
201 }
202
203 container state {
204
205 config false;
206
207 description
208 "Operational state data for channels";
209
210 uses physical-channel-config;
211 uses physical-channel-state;
212 }
213 }
214 }
215 }
216
217
218 grouping port-transceiver-config {
219 description
220 "Configuration data for client port transceivers";
221
222 leaf enabled {
223 type boolean;
224 description
225 "Turns power on / off to the transceiver -- provides a means
226 to power on/off the transceiver (in the case of SFP, SFP+,
227 QSFP,...) or enable high-power mode (in the case of CFP,
228 CFP2, CFP4) and is optionally supported (device can choose to
229 always enable). True = power on / high power, False =
230 powered off";
231 }
232
233 leaf form-factor-preconf {
234 type identityref {
235 base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE;
236 }
237 description
238 "Indicates the type of optical transceiver used on this
239 port. If the client port is built into the device and not
240 pluggable, then non-pluggable is the corresponding state. If
241 a device port supports multiple form factors (e.g. QSFP28
242 and QSFP+, then the value of the transceiver installed shall
243 be reported. If no transceiver is present, then the value of
244 the highest rate form factor shall be reported
245 (QSFP28, for example).
246
247 The form factor is included in configuration data to allow
248 pre-configuring a device with the expected type of
249 transceiver ahead of deployment. The corresponding state
250 leaf should reflect the actual transceiver type plugged into
251 the system.";
252 }
253
254 leaf ethernet-pmd-preconf {
255 type identityref {
256 base oc-opt-types:ETHERNET_PMD_TYPE;
257 }
258 description
259 "The Ethernet PMD is a property of the optical transceiver
260 used on the port, indicating the type of physical connection.
261 It is included in configuration data to allow pre-configuring
262 a port/transceiver with the expected PMD. The actual PMD is
263 indicated by the ethernet-pmd state leaf.";
264 }
265 }
266
267 grouping port-transceiver-state {
268 description
269 "Operational state data for client port transceivers";
270
271 leaf present {
272 type enumeration {
273 enum PRESENT {
274 description
275 "Transceiver is present on the port";
276 }
277 enum NOT_PRESENT {
278 description
279 "Transceiver is not present on the port";
280 }
281 }
282 description
283 "Indicates whether a transceiver is present in
284 the specified client port.";
285 }
286
287 leaf form-factor {
288 type identityref {
289 base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE;
290 }
291 description
292 "Indicates the type of optical transceiver used on this
293 port. If the client port is built into the device and not
294 pluggable, then non-pluggable is the corresponding state. If
295 a device port supports multiple form factors (e.g. QSFP28
296 and QSFP+, then the value of the transceiver installed shall
297 be reported. If no transceiver is present, then the value of
298 the highest rate form factor shall be reported
299 (QSFP28, for example).";
300 }
301
302 leaf connector-type {
303 type identityref {
304 base oc-opt-types:FIBER_CONNECTOR_TYPE;
305 }
306 description
307 "Connector type used on this port";
308 }
309
310 leaf internal-temp {
311 // TODO: this should probably be removed if we add temperature
312 // as a top-level component property, i.e., transceiver temp
313 // should be reported there.
314 type int16 {
315 range -40..125;
316 }
317 description
318 "Internally measured temperature in degrees Celsius. MSA
319 valid range is between -40 and +125C. Accuracy shall be
320 better than +/- 3 degC over the whole temperature range.";
321 }
322
323 leaf vendor {
324 type string {
325 length 1..16;
326 }
327 description
328 "Full name of transceiver vendor. 16-octet field that
329 contains ASCII characters, left-aligned and padded on the
330 right with ASCII spaces (20h)";
331 }
332
333 leaf vendor-part {
334 type string {
335 length 1..16;
336 }
337 description
338 "Transceiver vendor's part number. 16-octet field that
339 contains ASCII characters, left-aligned and padded on the
340 right with ASCII spaces (20h). If part number is undefined,
341 all 16 octets = 0h";
342 }
343
344 leaf vendor-rev {
345 type string {
346 length 1..2;
347 }
348 description
349 "Transceiver vendor's revision number. 2-octet field that
350 contains ASCII characters, left-aligned and padded on the
351 right with ASCII spaces (20h)";
352 }
353
354 //TODO: these compliance code leaves should be active based on
355 //the type of port
356 leaf ethernet-pmd {
357 type identityref {
358 base oc-opt-types:ETHERNET_PMD_TYPE;
359 }
360 description
361 "Ethernet PMD (physical medium dependent sublayer) that the
362 transceiver supports. The SFF/QSFP MSAs have registers for
363 this and CFP MSA has similar.";
364 }
365
366 leaf sonet-sdh-compliance-code {
367 type identityref {
368 base oc-opt-types:SONET_APPLICATION_CODE;
369 }
370 description
371 "SONET/SDH application code supported by the port";
372 }
373
374 leaf otn-compliance-code {
375 type identityref {
376 base oc-opt-types:OTN_APPLICATION_CODE;
377 }
378 description
379 "OTN application code supported by the port";
380 }
381
382 leaf serial-no {
383 type string {
384 length 1..16;
385 }
386 description
387 "Transceiver serial number. 16-octet field that contains
388 ASCII characters, left-aligned and padded on the right with
389 ASCII spaces (20h). If part serial number is undefined, all
390 16 octets = 0h";
391 }
392
393 leaf date-code {
394 type yang:date-and-time;
395 description
396 "Representation of the transceiver date code, typically
397 stored as YYMMDD. The time portion of the value is
398 undefined and not intended to be read.";
399 }
400
401 leaf fault-condition {
402 type boolean;
403 description
404 "Indicates if a fault condition exists in the transceiver";
405 }
406
407 uses optical-power-state;
408
409 }
410
411 grouping port-transceiver-top {
412 description
413 "Top-level grouping for client port transceiver data";
414
415 container transceiver {
416 description
417 "Top-level container for client port transceiver data";
418
419 container config {
420 description
421 "Configuration data for client port transceivers";
422
423 uses port-transceiver-config;
424 }
425
426 container state {
427
428 config false;
429
430 description
431 "Operational state data for client port transceivers";
432
433 uses port-transceiver-config;
434 uses port-transceiver-state;
435 }
436 // physical channels are associated with a transceiver
437 // component
438 uses physical-channel-top;
439 }
440 }
441
442 // data definition statements
443
444 // augment statements
445
446 augment "/oc-platform:components/oc-platform:component" {
447 description
448 "Adding transceiver data to physical inventory";
449
450 uses port-transceiver-top {
451 when "current()/oc-platform:state/" +
452 "oc-platform:type = 'TRANSCEIVER'" {
453 description
454 "Augment is active when component is of type TRANSCEIVER";
455 }
456 }
457 }
458
459 augment "/oc-if:interfaces/oc-if:interface/oc-if:state" {
460 //TODO: add 'when' or other condition to make sure this
461 //leafref points to a component of type TRANSCEIVER.
462 description
463 "Adds a reference from the base interface to its corresponding
464 physical channels.";
465
466 leaf-list physical-channel {
467 type leafref {
468 path "/oc-platform:components/" +
469 "oc-platform:component[oc-platform:name=current()/../oc-platform:hardware-port]/" +
470 "oc-transceiver:transceiver/" +
471 "oc-transceiver:physical-channels/oc-transceiver:channel/" +
472 "oc-transceiver:index";
473 }
474 description
475 "For a channelized interface, list of references to the
476 physical channels (lanes) corresponding to the interface.";
477 }
478 }
479
480 // rpc statements
481
482 // notification statements
483
484}