aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-transport-line-protection.yang
blob: 0e21a024938fce2054b0c9612c6b9b54f761ddb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
module openconfig-transport-line-protection {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/optical-transport-line-protection";

  prefix "oc-line-protect";

  import openconfig-extensions { prefix oc-ext; }
  import openconfig-types { prefix oc-types; }
  import openconfig-platform { prefix oc-platform; }

  // meta
  organization "OpenConfig working group";

  contact
    "OpenConfig working group
    www.openconfig.net";

  description
    "This model describes configuration and operational state data
    for optical line protection elements, deployed as part of a
    transport line system. An Automatic Protection Switch (APS)
    is typically installed in the same device as the amplifiers
    and wave-router, however an APS can also be a standalone
    device. In both scenarios, it serves the same purpose of
    providing protection using two dark fiber pairs to ensure the
    amplifiers can still receive a signal if one of the two fiber
    pairs is broken. The APS port details and directionality are
    shown below. The three major attributes, together with their
    modifiers, define the behavior of the APS and can be prioritized
    in the descending order as shown in the following table";

  //
  // Automatic Protection Switch (APS) port details and directionality.
  //                 _________
  //                 |       |
  //                 |       | <=== LINE-PRIMARY-IN
  //                 |       |
  // COMMON-IN  ===> |       | ===> LINE-PRIMARY-OUT
  //                 |       |
  //                 |  APS  |
  // COMMON-OUT <=== |       |
  //                 |       | <=== LINE-SECONDARY-IN
  //                 |       |
  //                 |       | ===> LINE-SECONDARY-OUT
  //                 |_______|
  //
  //
  // The interaction of configuration attributes that control the
  // protection switching behavior
  // +------------------+--------------------+------------------------+
  // | Attribute        | Modifier           | Behavior               |
  // +------------------+--------------------+------------------------+
  // | force-to-port    | n/a                | turns off switching    |
  // |                  |                    | by forcing to primary  |
  // |                  |                    | or secondary           |
  // +------------------+--------------------+------------------------+
  // | relative-switch  | relative-threshold | if set, overrides      |
  // | -threshold       | -offset            | primary and secondary  |
  // |                  |                    | switch thresholds      |
  // +------------------+--------------------+------------------------+
  // | primary-switch   | primary-switch     | sets respective        |
  // | -threshold,      | -hysteresis        | threshold to switch    |
  // | secondary-switch |                    | to opposite port       |
  // | -threshold       |                    |                        |
  // +------------------+--------------------+------------------------+

  oc-ext:openconfig-version "0.4.0";

  revision "2018-07-25" {
    description
      "Added wait-to-restore-time, hold-off-time,
      relative-switch-threshold, relative-switch-threshold-offset,
      forced-to-port, removed secondary-switch-hysteresis, and
      edited the description of primary-switch-threshold,
      secondary-switch-threshold, and primary-switch-hysteresis";
    reference "0.4.0";
  }

  revision "2017-09-08" {
    description
      "Correct bug with OSC interfaces";
    reference "0.3.1";
  }

  revision "2017-07-08" {
    description
      "Support multiple OCMs, add monitor port type
      and refs to hw ports, ";
    reference "0.3.0";
  }

  revision "2017-03-28" {
    description
      "Added min/max/avg stats, status for media channels, OCM, APS";
    reference "0.2.0";
  }

  revision "2016-08-05" {
    description
      "Initial public release";
    reference "0.1.0";
  }

  // extension statements

  // feature statements

  // identity statements

  identity APS_PATHS {
    description
      "Base identity for identifying the line paths on an
      automatic protection switch";
  }

  identity PRIMARY {
    base APS_PATHS;
    description
      "The primary line path connected to an automatic protection
      switch port indicating the primary/preferred path";
  }

  identity SECONDARY {
    base APS_PATHS;
    description
      "The secondary line path connected to an automatic protection
      switch port indicating the secondary path";
  }

  // grouping statements

  grouping aps-input-port-config {
    description
      "Grouping for config related to unidirectional automatic
      protection switch input ports";

    leaf enabled {
      type boolean;
      default "true";
      description
        "This leaf contains the configured, desired state of the
        port. Disabling the port turns off alarm reporting for
        the port";
    }

    leaf target-attenuation {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "Target attenuation of the variable optical attenuator
        associated with the port in increments of 0.01 dB.";
    }
  }

  grouping aps-output-port-config {
    description
      "Grouping for config related to unidirectional automatic
      protection switch output ports";

    leaf target-attenuation {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "Target attenuation of the variable optical attenuator
        associated with the port in increments of 0.01 dB";
    }
  }

  grouping aps-input-port-state {
    description
      "Grouping for state related to unidirectional automatic
      protection switch input ports";

    leaf attenuation {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "The attenuation of the variable optical attenuator
        associated with the port in increments of 0.01 dB.";
    }

    container optical-power {
      description
        "The optical input power of this port in units of
        0.01dBm. Optical input power represents the signal
        traversing from an external destination into the module.
        The power is measured before any attenuation. If avg/min/max
        statistics are not supported, the target is expected to
        just supply the instant value";

      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
    }
  }

  grouping aps-output-port-state {
    description
      "Grouping for state related to unidirectional automatic
      protection switch output ports";

    leaf attenuation {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      description
        "The attenuation of the variable optical attenuator
        associated with the port in increments of 0.01 dB";
    }

    container optical-power {
      description
        "The optical output power of this port in units of
        0.01dBm. Optical output power represents the signal
        traversing from the module to an external destination. The
        power is measured after any attenuation. If avg/min/max
        statistics are not supported, the target is expected to
        just supply the instant value";

      uses oc-types:avg-min-max-instant-stats-precision2-dBm;
    }
  }

  grouping aps-ports {
    description
      "Top level grouping for automatic protection switch ports";

    container line-primary-in {
      description
        "Container for information related to the line primary
        input port";

      container config {
        description
          "Configuration data for the line primary input port";

        uses aps-input-port-config;
      }

      container state {

        config false;

        description
          "State data for the line primary input port";

        uses aps-input-port-config;
        uses aps-input-port-state;
      }

    }

    container line-primary-out {
      description
        "Container for information related to the line primary
        output port";

      container config {
        description
          "Configuration data for the line primary output port";

        uses aps-output-port-config;
      }

      container state {

        config false;

        description
          "State data for the line primary output port";

        uses aps-output-port-config;
        uses aps-output-port-state;
      }
    }

    container line-secondary-in {
      description
        "Container for information related to the line secondary
        input port";

      container config {
        description
          "Configuration data for the line secondary input port";

        uses aps-input-port-config;
      }

      container state {

        config false;

        description
          "State data for the line secondary input port";

        uses aps-input-port-config;
        uses aps-input-port-state;
      }
    }

    container line-secondary-out {
      description
        "Container for information related to the line secondary
        output port";

      container config {
        description
          "Configuration data for the line secondary output port";

        uses aps-output-port-config;
      }

      container state {

        config false;

        description
          "State data for the line secondary output port";

        uses aps-output-port-config;
        uses aps-output-port-state;
      }
    }

    container common-in {
      description
        "Container for information related to the line common
        input port";

      container config {
        description
          "Configuration data for the line common input port";

        uses aps-input-port-config;
      }

      container state {

        config false;

        description
          "State data for the line common input port";

        uses aps-input-port-config;
        uses aps-input-port-state;
      }
    }

    container common-output {
      description
        "Container for information related to the line common
        output port";

      container config {
        description
          "Configuration data for the line common output port";

        uses aps-output-port-config;
      }

      container state {

        config false;

        description
          "State data for the line common output port";

        uses aps-output-port-config;
        uses aps-output-port-state;
      }
    }
  }

  grouping aps-config {
    description
      "Configuration data for automatic protection switch modules";

    leaf name {
      type leafref {
        path "/oc-platform:components/oc-platform:component/" +
          "oc-platform:name";
      }
      description
        "Reference to the component name (in the platform model)
        corresponding to this automatic protection switch module
        in the device";
    }

    leaf revertive {
      type boolean;
      description
        "Revertive behavior of the module. If True, then
        automatically revert after protection switch once the
        fault is restored. This leaf is not valid when the
        relative-switch-threshold is in effect";
    }

    leaf wait-to-restore-time {
      type uint32;
      units milliseconds;
      description
         "The time that must elapse before an APS path
         that has recovered from an signal failure (SF) or signal
         degradation (SD) condition can be used again to transport
         the normal traffic signal. During this time period, an SF or
         SD condition shall override the wait-to-restore time period.
         This leaf can only take effect when the revertive leaf
         equals true";
    }

    leaf hold-off-time {
      type uint32;
      units milliseconds;
      description
        "The time delay between the declaration of an SF or SD
        condition and the initiation of the protection switching
        algorithm";
    }

    leaf primary-switch-threshold {
      type decimal64 {
        fraction-digits 2;
      }
      units dBm;
      description
        "The threshold at which the primary line port will switch to
        the opposite line port in increments of 0.01 dBm. If the
        hardware supports only one switch threshold for primary and
        and secondary ports then it is recommended to set both
        primary-switch-threshold and secondary-switch-threshold to
        the same value to be explicit. When the relative switch
        threshold is enabled, i.e. set to a non-zero value, the
        primary switch threshold will be overridden";
    }

    leaf primary-switch-hysteresis {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      default 0;
      description
        "The delta in dB between the primary-switch-threshold
        and the signal received on the primary APS_PATH before
        initiating a switch from the secondary APS_PATH to the
        primary APS_PATH, in order to prevent toggling between ports
        when an input signal is very close to the threshold. A zero
        value means the switch hysteresis is disabled.";
    }

    leaf secondary-switch-threshold {
      type decimal64 {
        fraction-digits 2;
      }
      units dBm;
      description
        "The threshold at which the secondary line port will switch to
        the opposite line port in increments of 0.01 dBm. If the
        hardware supports only one switch threshold for primary and
        and secondary ports then it is recommended to set both
        primary-switch-threshold and secondary-switch-threshold to
        the same value to be explicit. When the relative switch
        threshold is enabled, i.e. set to a non-zero value, the
        secondary switch threshold will be overridden";
    }

    leaf relative-switch-threshold {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      default 0;
      description
        "The delta threshold in dB at which the current line port
        will switch to the opposite line port. It can be set to
        the value of 0dB. When set to 0dB, the threshold is ignored
        and the system automatically applies the primary and
        secondary switch thresholds. When set to a non-zero value,
        it overrides the primary and secondary switch thresholds";
    }

    leaf relative-switch-threshold-offset {
      type decimal64 {
        fraction-digits 2;
      }
      units dB;
      default 0;
      description
        "The offset of the relative switch threshold that compensates
        the normal difference of receiving power between the primary
        and secondary line ports. A negative offset corresponds to
        the situation where the secondary line port receives a higher
        power than the primary line port in normal condition, and a
        positive offset means the opposite. The offset will only work
        when the relative switch threshold is set to a non-zero
        value";
    }

    leaf force-to-port {
      type enumeration {
        enum NONE {
          description
            "Do not force the switch to stay on any line port";
        }
        enum PRIMARY {
          description
            "Force the switch to stay on the primary line port";
        }
        enum SECONDARY {
          description
            "Force the switch to stay on the secondary line port";
        }
      }
      default NONE;
      description
        "Explicitly set the switch to stay on a port regardless of
        its operational condition";
    }
  }

  grouping aps-state {
    description
      "State data for automatic protection switch modules";

    leaf active-path {
      type identityref {
        base APS_PATHS;
      }
      description
        "Indicates which line path on the protection switch is
         currently the active path connected to the common port";
    }
  }

  grouping automatic-protection-switch-top {
    description
      "Top level grouping for automatic protection switch data";

    container aps-modules {
      description
        "Enclosing container for list of automatic protection
	       switch modules";

      list aps-module {
        key "name";
        description
          "List of automatic protection switch modules present
          in the device";

        leaf name {
          type leafref {
            path "../config/name";
          }
          description
            "Reference to the config name list key";
        }

        container config {
          description
            "Configuration data for an automatic protection
            switch module";

          uses aps-config;
        }

        container state {

          config false;

          description
            "Operational state data for an automatic protection
            switch module";

          uses aps-config;
          uses aps-state;
        }

        container ports {
          description
            "Top level grouping for automatic protection switch ports";

          uses aps-ports;
        }
      }
    }
  }

  grouping transport-line-protection-top {
    description
      "Top level grouping for transport line protection data";

    container aps {
      description
        "Top level grouping for automatic protection switch data";

      uses automatic-protection-switch-top;
    }
  }

  // data definition statements

  uses transport-line-protection-top;

}