summaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-lacp.yang
blob: e49dcb6276eea3ceb5775e05177989e9d51c2d68 (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
module openconfig-lacp {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/lacp";

  prefix "oc-lacp";

  // import some basic types
  import openconfig-interfaces { prefix oc-if; }
  import openconfig-yang-types { prefix oc-yang; }
  import openconfig-extensions { prefix oc-ext; }



  // meta
  organization "OpenConfig working group";

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

  description
    "This module describes configuration and operational state
    data for Link Aggregation Control Protocol (LACP) for
    managing aggregate interfaces.   It works in conjunction with
    the OpenConfig interfaces and aggregate interfaces models.";

  oc-ext:openconfig-version "1.1.0";

  revision "2017-05-05" {
    description
      "Add member local and remote port num";
    reference "1.1.0";
  }

  revision "2016-05-26" {
    description
      "OpenConfig public release";
    reference "1.0.2";
  }


  // typedef statements

  typedef lacp-activity-type {
    type enumeration {
      enum ACTIVE {
        description
          "Interface is an active member, i.e., will detect and
          maintain aggregates";
      }
      enum PASSIVE {
        description
          "Interface is a passive member, i.e., it participates
          with an active partner";
      }
    }
    description
      "Describes the LACP membership type, active or passive, of the
      interface in the aggregate";
    reference "IEEE 802.1AX-2008";
  }

  typedef lacp-timeout-type {
    type enumeration {
      enum LONG {
        description
          "Participant wishes to use long timeouts to detect
          status of the aggregate, i.e., will expect less frequent
          transmissions. Long timeout is 90 seconds.";
      }
      enum SHORT {
        description
          "Participant wishes to use short timeouts, i.e., expects
          frequent transmissions to aggressively detect status
          changes. Short timeout is 3 seconds.";
      }
    }
    description
      "Type of timeout used, short or long, by LACP participants";
    reference "IEEE 802.1AX-2008";
  }

  typedef lacp-synchronization-type {
    type enumeration {
      enum IN_SYNC {
        description
          "Participant is in sync with the system id and key
          transmitted";
      }
      enum OUT_SYNC {
        description
          "Participant is not in sync with the system id and key
          transmitted";
      }
    }
    description
      "Indicates LACP synchronization state of participant";
    reference "IEEE 802.1AX-2008";
  }

  typedef lacp-period-type {
    type enumeration {
      enum FAST {
        description "Send LACP packets every second";
      }
      enum SLOW {
        description "Send LACP packets every 30 seconds";
      }
    }
    description
      "Defines the period options for the time between sending
      LACP messages";
    reference "IEEE 802.3ad";
  }

  // grouping statements


  grouping aggregation-lacp-members-config {
    description
      "Configuration data for lacp member interfaces";

    //currently a placeholder -- the list of member interfaces
    //and their status is considered opstate only
  }

  grouping aggregation-lacp-members-state {
    description
      "Operational status data for the member interfaces";

    leaf interface {
      type oc-if:base-interface-ref;
      description
        "Reference to interface member of the LACP aggregate";
    }

    leaf activity {
      type lacp-activity-type;
      description "Indicates participant is active or passive";
    }

    leaf timeout {
      type lacp-timeout-type;
      description
        "The timeout type (short or long) used by the
        participant";
    }

    leaf synchronization {
      type lacp-synchronization-type;
      description
        "Indicates whether the participant is in-sync or
        out-of-sync";
    }

    leaf aggregatable {
      type boolean;
      description
        "A true value indicates that the participant will allow
        the link to be used as part of the aggregate. A false
        value indicates the link should be used as an individual
        link";
    }

    leaf collecting {
      type boolean;
      description
        "If true, the participant is collecting incoming frames
        on the link, otherwise false";
    }

    leaf distributing {
      type boolean;
      description
        "When true, the participant is distributing outgoing
        frames; when false, distribution is disabled";
    }

    leaf system-id {
      type oc-yang:mac-address;
      description
        "MAC address that defines the local system ID for the
        aggregate interface";
    }

    leaf oper-key {
      type uint16;
      description
        "Current operational value of the key for the aggregate
        interface";
    }

    leaf partner-id {
      type oc-yang:mac-address;
      description
        "MAC address representing the protocol partner's interface
        system ID";
    }

    leaf partner-key {
      type uint16;
      description
        "Operational value of the protocol partner's key";
    }

    leaf port-num {
      type uint16;
      description
        "Port number of the local (actor) aggregation member";
    }

    leaf partner-port-num {
      type uint16;
      description
        "Port number of the partner (remote) port for this member
        port";
    }
  }

grouping aggregation-lacp-members-statistics {
    description
      "LACP packet statistics for the member interfaces";

    container counters {
      description
        "LACP protocol counters";

      leaf lacp-in-pkts {
        type oc-yang:counter64;
        description
          "Number of LACPDUs received";
      }

      leaf lacp-out-pkts {
        type oc-yang:counter64;
        description
          "Number of LACPDUs transmitted";
      }

      leaf lacp-rx-errors {
        type oc-yang:counter64;
        description
          "Number of LACPDU receive packet errors";
      }

      leaf lacp-tx-errors {
        type oc-yang:counter64;
        description
          "Number of LACPDU transmit packet errors";
      }

      leaf lacp-unknown-errors {
        type oc-yang:counter64;
        description
          "Number of LACPDU unknown packet errors";
      }

      leaf lacp-errors {
        type oc-yang:counter64;
        description
          "Number of LACPDU illegal packet errors";
      }
    }
  }

  grouping aggregation-lacp-members-top {
    description
      "Top-level grouping for aggregate members list";

    container members {
      config false;
      description
        "Enclosing container for the list of members interfaces of
        the aggregate. This list is considered operational state
        only so is labeled config false and has no config container";

      list member {
        key "interface";
        description
          "List of member interfaces and their associated status for
          a LACP-controlled aggregate interface.  Member list is not
          configurable here -- each interface indicates items
          its participation in the LAG.";

        leaf interface {
          type leafref {
            path "../state/interface";
          }
          description
            "Reference to aggregate member interface";
        }


        container state {

          config false;

          description
            "Operational state data for aggregate members";

          uses aggregation-lacp-members-state;
          uses aggregation-lacp-members-statistics;
        }
      }
    }
  }

  grouping lacp-interfaces-config {
    description
      "Configuration data for each LACP-enabled interface";

    leaf name {
      type oc-if:base-interface-ref;
      description
        "Reference to the interface on which LACP should be
        configured.   The type of the target interface must be
        ieee8023adLag";
    }

    leaf interval {
      type lacp-period-type;
      default SLOW;
      description
        "Set the period between LACP messages -- uses
        the lacp-period-type enumeration.";
    }

    leaf lacp-mode {
      type lacp-activity-type;
      default ACTIVE;
      description
        "ACTIVE is to initiate the transmission of LACP packets.
         PASSIVE is to wait for peer to initiate the transmission of
         LACP packets.";
        //TODO:some implementations configure the LACP mode on each
        //member interface rather than on the LAG interface.  There
        //may be use cases for this identified at a later time.
    }

    leaf system-id-mac {
      type oc-yang:mac-address;
      description
        "The MAC address portion of the node's System ID. This is
        combined with the system priority to construct the 8-octet
        system-id";
    }

    uses aggregation-lacp-global-config;
  }

  grouping lacp-interfaces-state {
    description
      "Operational state data for each LACP-enabled interface";
  }

  grouping lacp-interfaces-top {
    description
      "Top-level grouping for LACP-enabled interfaces";

    container interfaces {
      description
        "Enclosing container for the list of LACP-enabled
        interfaces";

      list interface {
        key "name";
        description
          "List of aggregate interfaces managed by LACP";

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

        container config {
          description
            "Configuration data for each LACP aggregate interface";

          uses lacp-interfaces-config;
        }

        container state {

          config false;

          description
            "Operational state data for each LACP aggregate
            interface";

          uses lacp-interfaces-config;
          uses lacp-interfaces-state;
        }

        uses aggregation-lacp-members-top;
      }
    }
  }

  grouping aggregation-lacp-global-config {
    description
      "Configuration data for LACP aggregate interfaces";


    leaf system-priority {
      type uint16;
      description
        "Sytem priority used by the node on this LAG interface.
        Lower value is higher priority for determining which node
        is the controlling system.";
    }
  }

  grouping aggregation-lacp-global-state {
    description
      "Operational data for LACP aggregate interfaces";

  }

  grouping aggregation-lacp-top {
    description
      "Top level configuration and state variable containers for
      LACP data";

    container lacp {
      description
        "Configuration and operational state data for LACP protocol
        operation on the aggregate interface";

      container config {
        description
          "Configuration data for LACP";

        uses aggregation-lacp-global-config;
      }

      container state {

        config false;
        description
          "Operational state data for LACP";

        uses aggregation-lacp-global-config;
        uses aggregation-lacp-global-state;
      }
      uses lacp-interfaces-top;
    }
  }

  // data definition statements
  uses aggregation-lacp-top;

  // augment statements


}