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