blob: f529fb36eb4bbdd401b54a437cbd51c7be3a4933 [file] [log] [blame]
Nathan Skrzypczakd4a70642021-10-08 14:01:27 +02001.. _span_doc:
2
3Switched Port Analyzer
4======================
5
6This is a memo intended to contain documentation of the VPP SPAN
7implementation. Everything that is not directly obvious should come
8here.
9
10Port mirroring is used on a network switch to send a copy of network
11packets seen on one switch port to a network monitoring connection on
12another switch port. Can be used by network engineers or administrators
13to measure performance, analyze and debug data or diagnose errors on a
14network.
15
16RX traffic node
17~~~~~~~~~~~~~~~
18
19There is one static node to mirror incoming packets. \* span-input:
20Creates a copy of incoming buffer due to incoming buffers can be reused
21internally.
22
23Chaining: dpdk-input -> span-input -> \* original buffer is sent to
24ethernet-input for processing \* buffer copy is sent to interface-output
25
26Configuration
27~~~~~~~~~~~~~
28
29SPAN supports the following CLI configuration commands:
30
31Enable/Disable SPAN (CLI)
32^^^^^^^^^^^^^^^^^^^^^^^^^
33
34::
35
36 set interface span <if-name> [disable | destination <if-name>]
37
38: mirrored interface name destination : monitoring interface name
39disable: delete mirroring
40
41Enable/Disable SPAN (API)
42^^^^^^^^^^^^^^^^^^^^^^^^^
43
44SPAN supports the following API configuration command:
45sw_interface_span_enable_disable src GigabitEthernet0/8/0 dst
46GigabitEthernet0/9/0 sw_interface_span_enable_disable src_sw_if_index 1
47dst_sw_if_index 2
48
49src/src_sw_if_index: mirrored interface name dst/dst_sw_if_index:
50monitoring interface name
51
52Remove SPAN entry (API)
53^^^^^^^^^^^^^^^^^^^^^^^
54
55SPAN supports the following API configuration command:
56sw_interface_span_enable_disable src_sw_if_index 1 dst_sw_if_index 2
57disable
58
59src_sw_if_index: mirrored interface name dst_sw_if_index: monitoring
60interface name
61
62Configuration example
63~~~~~~~~~~~~~~~~~~~~~
64
65Mirror all packets on interface GigabitEthernet0/10/0 to interface
66GigabitEthernet0/11/0.
67
68Configure IPv4 addresses on mirrored interface: set interface ip address
69GigabitEthernet0/10/0 192.168.1.13/24 set interface state
70GigabitEthernet0/10/0 up
71
72Configure IPv4 addresses on monitoring interface: set interface ip
73address GigabitEthernet0/11/0 192.168.2.13/24 set interface state
74GigabitEthernet0/11/0 up
75
76Configure SPAN set span src GigabitEthernet0/10/0 dst
77GigabitEthernet0/11/0
78
79Operational data
80~~~~~~~~~~~~~~~~
81
82Active SPAN mirroring CLI show command: show interfaces span
83
84Active SPAN mirroring API dump command: sw_interface_span_dump