aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-if-ethernet@2018-09-04.yang
blob: cd6b5267f283489632ba37eb505a7bbccf2e6ee1 (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
module openconfig-if-ethernet {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/interfaces/ethernet";

  prefix "oc-eth";

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

  // meta
  organization "OpenConfig working group";

  contact
    "OpenConfig working group
    netopenconfig@googlegroups.com";

  description
    "Model for managing Ethernet interfaces -- augments the OpenConfig
    model for interface configuration and state.";

  oc-ext:openconfig-version "2.6.1";

  revision "2018-09-04" {
    description
      "Remove in-crc-align-errors as it is a duplicate of
      in-crc-errors";
    reference "2.6.1";
  }

  revision "2018-08-28" {
    description
      "Add Ethernet counter in-block-errors";
    reference "2.6.0";
  }

  revision "2018-07-02" {
    description
      "Add new ethernet counters of in-undersize-frames,
      in-crc-align-errors and the distribution container";
    reference "2.5.0";
  }

  revision "2018-04-10" {
    description
      "Add identities for 2.5 and 5 Gbps.";
    reference "2.4.0";
  }

  revision "2018-01-05" {
    description
      "Add logical loopback to interface.";
    reference "2.3.0";
  }

  revision "2017-12-21" {
    description
      "Added IPv6 router advertisement configuration.";
    reference "2.1.0";
  }

  revision "2017-07-14" {
    description
      "Added Ethernet/IP state data; Add dhcp-client;
      migrate to OpenConfig types modules; Removed or
      renamed opstate values";
    reference "2.0.0";
  }

  revision "2016-12-22" {
    description
      "Fixes to Ethernet interfaces model";
    reference "1.1.0";
  }


  // identity statements

  identity ETHERNET_SPEED {
    description "base type to specify available Ethernet link
    speeds";
  }

  identity SPEED_10MB {
    base ETHERNET_SPEED;
    description "10 Mbps Ethernet";
  }

  identity SPEED_100MB {
    base ETHERNET_SPEED;
    description "100 Mbps Ethernet";
  }

  identity SPEED_1GB {
    base ETHERNET_SPEED;
    description "1 Gbps Ethernet";
  }

  identity SPEED_2500MB {
    base ETHERNET_SPEED;
    description "2.5 Gbps Ethernet";
  }

  identity SPEED_5GB {
    base ETHERNET_SPEED;
    description "5 Gbps Ethernet";
  }

  identity SPEED_10GB {
    base ETHERNET_SPEED;
    description "10 Gbps Ethernet";
  }

  identity SPEED_25GB {
    base ETHERNET_SPEED;
    description "25 Gbps Ethernet";
  }

  identity SPEED_40GB {
    base ETHERNET_SPEED;
    description "40 Gbps Ethernet";
  }

  identity SPEED_50GB {
    base ETHERNET_SPEED;
    description "50 Gbps Ethernet";
  }

  identity SPEED_100GB {
    base ETHERNET_SPEED;
    description "100 Gbps Ethernet";
  }

  identity SPEED_UNKNOWN {
    base ETHERNET_SPEED;
    description
      "Interface speed is unknown.  Systems may report
      speed UNKNOWN when an interface is down or unpopuplated (e.g.,
      pluggable not present).";
  }

  // typedef statements


  // grouping statements

  grouping ethernet-interface-config {
    description "Configuration items for Ethernet interfaces";

    leaf mac-address {
      type oc-yang:mac-address;
      description
        "Assigns a MAC address to the Ethernet interface.  If not
        specified, the corresponding operational state leaf is
        expected to show the system-assigned MAC address.";
    }

    leaf auto-negotiate {
      type boolean;
      default true;
      description
        "Set to TRUE to request the interface to auto-negotiate
        transmission parameters with its peer interface.  When
        set to FALSE, the transmission parameters are specified
        manually.";
      reference
        "IEEE 802.3-2012 auto-negotiation transmission parameters";
    }

    leaf duplex-mode {
      type enumeration {
        enum FULL {
          description "Full duplex mode";
        }
        enum HALF {
          description "Half duplex mode";
        }
      }
      description
        "When auto-negotiate is TRUE, this optionally sets the
        duplex mode that will be advertised to the peer.  If
        unspecified, the interface should negotiate the duplex mode
        directly (typically full-duplex).  When auto-negotiate is
        FALSE, this sets the duplex mode on the interface directly.";
    }

    leaf port-speed {
      type identityref {
        base ETHERNET_SPEED;
      }
      description
        "When auto-negotiate is TRUE, this optionally sets the
        port-speed mode that will be advertised to the peer for
        negotiation.  If unspecified, it is expected that the
        interface will select the highest speed available based on
        negotiation.  When auto-negotiate is set to FALSE, sets the
        link speed to a fixed value -- supported values are defined
        by ETHERNET_SPEED identities";
    }

    leaf enable-flow-control {
      type boolean;
      default false;
      description
        "Enable or disable flow control for this interface.
        Ethernet flow control is a mechanism by which a receiver
        may send PAUSE frames to a sender to stop transmission for
        a specified time.

        This setting should override auto-negotiated flow control
        settings.  If left unspecified, and auto-negotiate is TRUE,
        flow control mode is negotiated with the peer interface.";
      reference
        "IEEE 802.3x";
    }
  }

  grouping ethernet-interface-state-counters {
    description
      "Ethernet-specific counters and statistics";

    // ingress counters

    leaf in-mac-control-frames {
      type oc-yang:counter64;
      description
        "MAC layer control frames received on the interface";
    }

    leaf in-mac-pause-frames {
      type oc-yang:counter64;
      description
        "MAC layer PAUSE frames received on the interface";
    }

    leaf in-oversize-frames {
      type oc-yang:counter64;
      description
        "The total number of frames received that were
        longer than 1518 octets (excluding framing bits,
        but including FCS octets) and were otherwise
        well formed.";
    }

    leaf in-undersize-frames {
      type oc-yang:counter64;
      description
        "The total number of frames received that were
        less than 64 octets long (excluding framing bits,
        but including FCS octets) and were otherwise well
        formed.";
      reference
        "RFC 2819: Remote Network Monitoring MIB -
        etherStatsUndersizePkts";
    }

    leaf in-jabber-frames {
      type oc-yang:counter64;
      description
        "Number of jabber frames received on the
        interface.  Jabber frames are typically defined as oversize
        frames which also have a bad CRC.  Implementations may use
        slightly different definitions of what constitutes a jabber
        frame.  Often indicative of a NIC hardware problem.";
    }

    leaf in-fragment-frames {
      type oc-yang:counter64;
      description
        "The total number of frames received that were less than
        64 octets in length (excluding framing bits but including
        FCS octets) and had either a bad Frame Check Sequence
        (FCS) with an integral number of octets (FCS Error) or a
        bad FCS with a non-integral number of octets (Alignment
        Error).";
    }

    leaf in-8021q-frames {
      type oc-yang:counter64;
      description
        "Number of 802.1q tagged frames received on the interface";
    }

    leaf in-crc-errors {
      type oc-yang:counter64;
      description
        "The total number of frames received that
        had a length (excluding framing bits, but
        including FCS octets) of between 64 and 1518
        octets, inclusive, but had either a bad
        Frame Check Sequence (FCS) with an integral
        number of octets (FCS Error) or a bad FCS with
        a non-integral number of octets (Alignment Error)";
      reference
        "RFC 2819: Remote Network Monitoring MIB -
        etherStatsCRCAlignErrors";
    }

    leaf in-block-errors {
      type oc-yang:counter64;
      description
        "The number of received errored blocks. Error detection codes
        are capable of detecting whether one or more errors have
        occurred in a given sequence of bits - the block. It is
        normally not possible to determine the exact number of errored
        bits within the block";
    }

    // egress counters

    leaf out-mac-control-frames {
      type oc-yang:counter64;
      description
        "MAC layer control frames sent on the interface";
    }

    leaf out-mac-pause-frames {
      type oc-yang:counter64;
      description
        "MAC layer PAUSE frames sent on the interface";
    }

    leaf out-8021q-frames {
      type oc-yang:counter64;
      description
        "Number of 802.1q tagged frames sent on the interface";
    }
  }

  grouping ethernet-interface-state {
    description
      "Grouping for defining Ethernet-specific operational state";

    leaf hw-mac-address {
      type oc-yang:mac-address;
      description
        "Represenets the 'burned-in',  or system-assigned, MAC
        address for the Ethernet interface.";
    }

    leaf negotiated-duplex-mode {
      type enumeration {
        enum FULL {
          description "Full duplex mode";
        }
        enum HALF {
          description "Half duplex mode";
        }
      }
      description
        "When auto-negotiate is set to TRUE, and the interface has
        completed auto-negotiation with the remote peer, this value
        shows the duplex mode that has been negotiated.";
    }

    leaf negotiated-port-speed {
      type identityref {
        base ETHERNET_SPEED;
      }
      description
        "When auto-negotiate is set to TRUE, and the interface has
        completed auto-negotiation with the remote peer, this value
        shows the interface speed that has been negotiated.";
    }

    container counters {
      description "Ethernet interface counters";

      uses ethernet-interface-state-counters;

    }

  }

  // data definition statements

  grouping ethernet-top {
    description "top-level Ethernet config and state containers";

    container ethernet {
      description
        "Top-level container for ethernet configuration
        and state";

      container config {
        description "Configuration data for ethernet interfaces";

        uses ethernet-interface-config;

      }

      container state {

        config false;
        description "State variables for Ethernet interfaces";

        uses ethernet-interface-config;
        uses ethernet-interface-state;

      }

    }
  }

  // augment statements

  augment "/oc-if:interfaces/oc-if:interface" {
    description "Adds addtional Ethernet-specific configuration to
    interfaces model";

    uses ethernet-top {
      when "oc-if:state/oc-if:type = 'ift:ethernetCsmacd'" {
      description "Additional interface configuration parameters when
      the interface type is Ethernet";
      }
    }
  }

  // rpc statements

  // notification statements

}