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