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