blob: 78d8fc015cbc39a7edcd158d648f2a16f193c146 [file] [log] [blame]
hiroki096259b2018-12-07 09:33:24 -08001module openconfig-if-ethernet {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/interfaces/ethernet";
7
8 prefix "oc-eth";
9
10 // import some basic types
11 import openconfig-interfaces { prefix oc-if; }
12 import iana-if-type { prefix ift; }
13 import openconfig-yang-types { prefix oc-yang; }
14 import openconfig-extensions { prefix oc-ext; }
15
16 // meta
17 organization "OpenConfig working group";
18
19 contact
20 "OpenConfig working group
21 netopenconfig@googlegroups.com";
22
23 description
24 "Model for managing Ethernet interfaces -- augments the OpenConfig
25 model for interface configuration and state.";
26
27 oc-ext:openconfig-version "2.4.0";
28
29 revision "2018-04-10" {
30 description
31 "Add identites for 2.5 and 5 Gbps.";
32 reference "2.4.0";
33 }
34
35 revision "2018-01-05" {
36 description
37 "Add logical loopback to interface.";
38 reference "2.3.0";
39 }
40
41 revision "2017-12-21" {
42 description
43 "Added IPv6 router advertisement configuration.";
44 reference "2.1.0";
45 }
46
47 revision "2017-07-14" {
48 description
49 "Added Ethernet/IP state data; Add dhcp-client;
50 migrate to OpenConfig types modules; Removed or
51 renamed opstate values";
52 reference "2.0.0";
53 }
54
55 revision "2016-12-22" {
56 description
57 "Fixes to Ethernet interfaces model";
58 reference "1.1.0";
59 }
60
61
62 // identity statements
63
64 identity ETHERNET_SPEED {
65 description "base type to specify available Ethernet link
66 speeds";
67 }
68
69 identity SPEED_10MB {
70 base ETHERNET_SPEED;
71 description "10 Mbps Ethernet";
72 }
73
74 identity SPEED_100MB {
75 base ETHERNET_SPEED;
76 description "100 Mbps Ethernet";
77 }
78
79 identity SPEED_1GB {
80 base ETHERNET_SPEED;
81 description "1 Gbps Ethernet";
82 }
83
84 identity SPEED_2500MB {
85 base ETHERNET_SPEED;
86 description "2.5 Gbps Ethernet";
87 }
88
89 identity SPEED_5GB {
90 base ETHERNET_SPEED;
91 description "5 Gbps Ethernet";
92 }
93
94 identity SPEED_10GB {
95 base ETHERNET_SPEED;
96 description "10 Gbps Ethernet";
97 }
98
99 identity SPEED_25GB {
100 base ETHERNET_SPEED;
101 description "25 Gbps Ethernet";
102 }
103
104 identity SPEED_40GB {
105 base ETHERNET_SPEED;
106 description "40 Gbps Ethernet";
107 }
108
109 identity SPEED_50GB {
110 base ETHERNET_SPEED;
111 description "50 Gbps Ethernet";
112 }
113
114 identity SPEED_100GB {
115 base ETHERNET_SPEED;
116 description "100 Gbps Ethernet";
117 }
118
119 identity SPEED_UNKNOWN {
120 base ETHERNET_SPEED;
121 description
122 "Interface speed is unknown. Systems may report
123 speed UNKNOWN when an interface is down or unpopuplated (e.g.,
124 pluggable not present).";
125 }
126
127 // typedef statements
128
129
130 // grouping statements
131
132 grouping ethernet-interface-config {
133 description "Configuration items for Ethernet interfaces";
134
135 leaf mac-address {
136 type oc-yang:mac-address;
137 description
138 "Assigns a MAC address to the Ethernet interface. If not
139 specified, the corresponding operational state leaf is
140 expected to show the system-assigned MAC address.";
141 }
142
143 leaf auto-negotiate {
144 type boolean;
145 default true;
146 description
147 "Set to TRUE to request the interface to auto-negotiate
148 transmission parameters with its peer interface. When
149 set to FALSE, the transmission parameters are specified
150 manually.";
151 reference
152 "IEEE 802.3-2012 auto-negotiation transmission parameters";
153 }
154
155 leaf duplex-mode {
156 type enumeration {
157 enum FULL {
158 description "Full duplex mode";
159 }
160 enum HALF {
161 description "Half duplex mode";
162 }
163 }
164 description
165 "When auto-negotiate is TRUE, this optionally sets the
166 duplex mode that will be advertised to the peer. If
167 unspecified, the interface should negotiate the duplex mode
168 directly (typically full-duplex). When auto-negotiate is
169 FALSE, this sets the duplex mode on the interface directly.";
170 }
171
172 leaf port-speed {
173 type identityref {
174 base ETHERNET_SPEED;
175 }
176 description
177 "When auto-negotiate is TRUE, this optionally sets the
178 port-speed mode that will be advertised to the peer for
179 negotiation. If unspecified, it is expected that the
180 interface will select the highest speed available based on
181 negotiation. When auto-negotiate is set to FALSE, sets the
182 link speed to a fixed value -- supported values are defined
183 by ETHERNET_SPEED identities";
184 }
185
186 leaf enable-flow-control {
187 type boolean;
188 default false;
189 description
190 "Enable or disable flow control for this interface.
191 Ethernet flow control is a mechanism by which a receiver
192 may send PAUSE frames to a sender to stop transmission for
193 a specified time.
194
195 This setting should override auto-negotiated flow control
196 settings. If left unspecified, and auto-negotiate is TRUE,
197 flow control mode is negotiated with the peer interface.";
198 reference
199 "IEEE 802.3x";
200 }
201 }
202
203 grouping ethernet-interface-state-counters {
204 description
205 "Ethernet-specific counters and statistics";
206
207 // ingress counters
208
209 leaf in-mac-control-frames {
210 type oc-yang:counter64;
211 description
212 "MAC layer control frames received on the interface";
213 }
214
215 leaf in-mac-pause-frames {
216 type oc-yang:counter64;
217 description
218 "MAC layer PAUSE frames received on the interface";
219 }
220
221 leaf in-oversize-frames {
222 type oc-yang:counter64;
223 description
224 "Number of oversize frames received on the interface";
225 }
226
227 leaf in-jabber-frames {
228 type oc-yang:counter64;
229 description
230 "Number of jabber frames received on the
231 interface. Jabber frames are typically defined as oversize
232 frames which also have a bad CRC. Implementations may use
233 slightly different definitions of what constitutes a jabber
234 frame. Often indicative of a NIC hardware problem.";
235 }
236
237 leaf in-fragment-frames {
238 type oc-yang:counter64;
239 description
240 "Number of fragment frames received on the interface.";
241 }
242
243 leaf in-8021q-frames {
244 type oc-yang:counter64;
245 description
246 "Number of 802.1q tagged frames received on the interface";
247 }
248
249 leaf in-crc-errors {
250 type oc-yang:counter64;
251 description
252 "Number of receive error events due to FCS/CRC check
253 failure";
254 }
255
256 // egress counters
257
258 leaf out-mac-control-frames {
259 type oc-yang:counter64;
260 description
261 "MAC layer control frames sent on the interface";
262 }
263
264 leaf out-mac-pause-frames {
265 type oc-yang:counter64;
266 description
267 "MAC layer PAUSE frames sent on the interface";
268 }
269
270 leaf out-8021q-frames {
271 type oc-yang:counter64;
272 description
273 "Number of 802.1q tagged frames sent on the interface";
274 }
275 }
276
277 grouping ethernet-interface-state {
278 description
279 "Grouping for defining Ethernet-specific operational state";
280
281 leaf hw-mac-address {
282 type oc-yang:mac-address;
283 description
284 "Represenets the 'burned-in', or system-assigned, MAC
285 address for the Ethernet interface.";
286 }
287
288 leaf negotiated-duplex-mode {
289 type enumeration {
290 enum FULL {
291 description "Full duplex mode";
292 }
293 enum HALF {
294 description "Half duplex mode";
295 }
296 }
297 description
298 "When auto-negotiate is set to TRUE, and the interface has
299 completed auto-negotiation with the remote peer, this value
300 shows the duplex mode that has been negotiated.";
301 }
302
303 leaf negotiated-port-speed {
304 type identityref {
305 base ETHERNET_SPEED;
306 }
307 description
308 "When auto-negotiate is set to TRUE, and the interface has
309 completed auto-negotiation with the remote peer, this value
310 shows the interface speed that has been negotiated.";
311 }
312
313 container counters {
314 description "Ethernet interface counters";
315
316 uses ethernet-interface-state-counters;
317
318 }
319
320 }
321
322 // data definition statements
323
324 grouping ethernet-top {
325 description "top-level Ethernet config and state containers";
326
327 container ethernet {
328 description
329 "Top-level container for ethernet configuration
330 and state";
331
332 container config {
333 description "Configuration data for ethernet interfaces";
334
335 uses ethernet-interface-config;
336
337 }
338
339 container state {
340
341 config false;
342 description "State variables for Ethernet interfaces";
343
344 uses ethernet-interface-config;
345 uses ethernet-interface-state;
346
347 }
348
349 }
350 }
351
352 // augment statements
353
354 augment "/oc-if:interfaces/oc-if:interface" {
355 description "Adds addtional Ethernet-specific configuration to
356 interfaces model";
357
358 uses ethernet-top {
359 when "oc-if:state/oc-if:type = 'ift:ethernetCsmacd'" {
360 description "Additional interface configuration parameters when
361 the interface type is Ethernet";
362 }
363 }
364 }
365
366 // rpc statements
367
368 // notification statements
369
370}