-
Notifications
You must be signed in to change notification settings - Fork 701
Expand file tree
/
Copy pathopenconfig-sampling-sflow.yang
More file actions
378 lines (303 loc) · 9.38 KB
/
openconfig-sampling-sflow.yang
File metadata and controls
378 lines (303 loc) · 9.38 KB
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
module openconfig-sampling-sflow {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/sampling/sflow";
prefix "oc-sflow";
// import some basic types
import openconfig-extensions { prefix oc-ext; }
import openconfig-inet-types { prefix oc-inet; }
import openconfig-interfaces { prefix oc-if; }
import openconfig-yang-types { prefix oc-yang; }
import openconfig-network-instance { prefix oc-netinst; }
import openconfig-sampling { prefix oc-sampling; }
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module defines configuration and operational state data
related to data plane traffic sampling based on sFlow.
RFC 3176 - InMon Corporation's sFlow: A Method for
Monitoring Traffic in Switched and Routed Networks";
revision "2025-05-13" {
description
"Add max-datagram-size per RFC 3176 - sFlowRcvrMaximumDatagramSize";
reference "1.1.0";
}
revision "2022-06-21" {
description
"Add agent-id/source-address for IPv4/IPv6; add polling-interval;
add global dscp marking for generated packets; moved sampling-rate
to ingress/egress; moved top-level sampling container to separate
module;";
reference "1.0.0";
}
revision "2020-06-26" {
description
"Initial revision";
reference "0.1.0";
}
oc-ext:openconfig-version "1.1.0";
grouping sflow-interfaces-config {
description
"Configuration data for sFlow data on interfaces.";
leaf name {
type oc-if:base-interface-ref;
description
"Reference to the interface for sFlow configuration and
state.";
}
leaf enabled {
type boolean;
description
"Enables or disables sFlow on the interface. If sFlow is
globally disabled, this leaf is ignored. If sFlow
is globally enabled, this leaf may be used to disable it
for a specific interface.";
}
uses sflow-polling-interval-config;
uses sflow-sampling-rate-config;
}
grouping sflow-interfaces-state {
description
"Operational state data for sFlow data on interfaces";
leaf packets-sampled {
type oc-yang:counter64;
description
"Total number of packets sampled from the interface.";
}
}
grouping sflow-interfaces-top {
description
"Top-level grouping for sFlow data on an interface.";
container interfaces {
description
"Enclosing container for list of sFlow interfaces.";
list interface {
key "name";
description
"List of interfaces with sFlow data.";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to list key.";
}
container config {
description
"Configuration data for sFlow data on interfaces.";
uses sflow-interfaces-config;
}
container state {
config false;
description
"Operational state data for sFlow data on interfaces.";
uses sflow-interfaces-config;
uses sflow-interfaces-state;
}
}
}
}
grouping sflow-collectors-config {
description
"Configuration data for sFlow collectors.";
leaf address {
type oc-inet:ip-address;
description
"IPv4/IPv6 address of the sFlow collector.";
}
leaf port {
type oc-inet:port-number;
default 6343;
description
"UDP port number for the sFlow collector.";
}
leaf source-address {
type oc-inet:ip-address;
description
"Sets the source IPv4/IPv6 address for sFlow datagrams sent
to sFlow collectors.";
}
leaf max-datagram-size {
type uint16;
units bytes;
description
"Sets the maximum size (in bytes) of the sFlow payload itself,
before it's encapsulated in a UDP packet sent to this collector.
This value does not include UDP or IP headers.";
reference
"RFC 3176 - InMon Corporation's sFlow: sFlowRcvrMaximumDatagramSize.";
}
leaf network-instance {
type oc-netinst:network-instance-ref;
description
"Reference to the network instance used to reach the
sFlow collector. If uspecified, the collector destination
is reachable in the default network instance.";
}
}
grouping sflow-collectors-state {
description
"Operational state data for sFlow collectors.";
leaf packets-sent {
type oc-yang:counter64;
description
"The total number of packets sampled and sent to the
collector.";
}
}
grouping sflow-collectors-top {
description
"Top-level grouping for data related to sFlow collectors.";
container collectors {
description
"Enclosing container for list of sFlow collectors.";
list collector {
key "address port";
description
"List of sFlow collectors to send sampling data. Packet
samples are sent to all collectors specified.";
leaf address {
type leafref {
path "../config/address";
}
description
"Reference to address list key.";
}
leaf port {
type leafref {
path "../config/port";
}
description
"Reference to port list key.";
}
container config {
description
"Configuration data for sFlow collectors.";
uses sflow-collectors-config;
}
container state {
config false;
description
"Operational state data for sFlow collectors.";
uses sflow-collectors-config;
uses sflow-collectors-state;
}
}
}
}
grouping sflow-sampling-rate-config {
description
"Configuration data for sFlow sample rates";
leaf ingress-sampling-rate {
type uint32;
description
"Sets the ingress packet sampling rate. The rate is expressed
as an integer N, where the intended sampling rate is 1/N
packets. An implementation may implement the sampling rate as
a statistical average, rather than a strict periodic sampling.
The allowable sampling rate range is generally a property of
the system, e.g., determined by the capability of the
hardware.";
}
leaf egress-sampling-rate {
type uint32;
description
"Sets the egress packet sampling rate. The rate is expressed
as an integer N, where the intended sampling rate is 1/N
packets. An implementation may implement the sampling rate as
a statistical average, rather than a strict periodic sampling.
The allowable sampling rate range is generally a property of
the system, e.g., determined by the capability of the
hardware.";
}
}
grouping sflow-polling-interval-config {
description
"Configuration data for sFlow polling intervals";
leaf polling-interval {
type uint16;
units seconds;
description
"Sets the traffic sampling polling interval.";
}
}
grouping sflow-global-config {
description
"Configuration data for global sflow";
leaf enabled {
type boolean;
default false;
description
"Enables or disables sFlow sampling for the device.";
}
leaf agent-id-ipv4 {
type oc-inet:ipv4-address;
description
"Sets the agent identifier for IPv4 PDUs.";
reference
"RFC 3176 - InMon Corporation's sFlow: A Method for
Monitoring Traffic in Switched and Routed Networks";
}
leaf agent-id-ipv6 {
type oc-inet:ipv6-address;
description
"Sets the agent identifier for IPv6 PDUs.";
reference
"RFC 3176 - InMon Corporation's sFlow: A Method for
Monitoring Traffic in Switched and Routed Networks";
}
leaf dscp {
type oc-inet:dscp;
description
"DSCP marking of packets generated by the sFlow subsystem
on the network device.";
}
leaf sample-size {
type uint16;
units bytes;
default 128;
description
"Sets the maximum number of bytes to be copied from a sampled
packet (content within one specific sample of a packet).";
reference
"RFC 3176 - InMon Corporation's sFlow: A Method for
Monitoring Traffic in Switched and Routed Networks";
}
uses sflow-polling-interval-config;
uses sflow-sampling-rate-config;
}
grouping sflow-global-state {
description
"Operational state data for global sFlow.";
}
grouping sflow-global-top {
description
"Top-level grouping for global sFlow";
container sflow {
description
"Top-level container for sFlow data.";
container config {
description
"Configuration data for global sFlow.";
uses sflow-global-config;
}
container state {
config false;
description
"Operational state data for global sFlow.";
uses sflow-global-config;
uses sflow-global-state;
}
uses sflow-collectors-top;
uses sflow-interfaces-top;
}
}
augment "/oc-sampling:sampling" {
description
"Add sFlow configuration/state to the openconfig-sampling model.";
uses sflow-global-top;
}
}