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