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