summaryrefslogtreecommitdiff
path: root/docs/vpp/configuration/sflow.md
blob: 042cf8a8044d461cd11265c7563a5a1e517523f4 (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
---
lastproofread: '2025-09-04'
---

(vpp-config-sflow)=

```{include} /_include/need_improvement.txt
```


# VPP sFlow Configuration

VPP Dataplane in VyOS supports sFlow for traffic monitoring and analysis.

The VPP Dataplane integration works hand-in-hand with normal kernel
sFlow agent, which is responsible for collecting and exporting sFlow
samples. VPP itself is responsible for generating the samples.

To enable sFlow in VPP, you first need to configure the service using
the same steps as for normal kernel sFlow agent, as described in
{doc}`/configuration/system/sflow`. Then you can enable sFlow on VPP
interfaces.

Then, you need to enable sFlow on the VPP interfaces you want to
monitor. This is done using the following commands:

```{cfgcmd} set vpp sflow interface \<interface-name\>
```

This will enable sFlow on the specified interface. You can repeat
this command for each interface you want to monitor.

:::{note}
sFlow collects statistics only for traffic *received* on the
interface. If you want to monitor traffic *sent* on the interface,
you need to enable sFlow on the corresponding interface in the
opposite direction.
:::

Optionally, you can specify the number of bytes from each packet
that should be included in the sFlow sample using the following
command:

```{cfgcmd} set vpp sflow header-bytes \<bytes\>
```

This defines the size of the packet header (in bytes) captured for
each sFlow sample.

The sampling rate is configured globally under the `system sflow`
section and automatically applied to VPP sFlow. This ensures
consistent sampling behavior between the system and VPP, and
prevents configuration conflicts.

Finally, you need to enable integration between VPP and the kernel
sFlow agent using the following command:

```{cfgcmd} set system sflow vpp
```

After this, collecting and exporting sFlow samples will be handled
by the kernel sFlow agent, while VPP will generate the samples.