Overview
This section explains the SPAN to file feature, which mirrors network traffic to files in PCAP format for offline analysis. It covers configuration options for buffer sizes and types, and provides a comprehensive history of feature support across various software releases and hardware platforms.
SPAN to file is a traffic monitoring feature that
-
captures traffic from a SPAN session and writes it directly to a file for later analysis
-
extends the existing SPAN feature by mirroring network packets to a file instead of an interface
-
helps in the analysis of the packets at a later stage, and
-
saves the file in the PCAP file format, which is compatible with tools like tcpdump and Wireshark.
The monitor-session <name> [ethernet|ipv4|ipv6|mpls-ipv4|mpls-ipv6] command creates a monitor-session with the specified name and traffic class, serving as a chain point from the SPAN feature.
The destination file [size <kbytes>] [buffer-type linear] command adds a file destination option to the session configuration.
destination file has these configuration options:
-
Buffer size: Sets the maximum file size for captured packets.
-
Buffer types:
-
Circular: This is the default buffer type. Once the buffer is full, it overwrites from the beginning.
-
Linear: Once the buffer is full, no further packets are logged. Only the linear buffer type must be explicitly configured.
-
Altering any parameters, such as buffer size or type, recreates the session and clears any packet buffers.
All configuration options available for other SPAN types should also be supported by SPAN to file. These include options such as applying ACLs and capturing only the first X bytes of each packet.
Starting with Cisco IOS XR Release 7.5.3, truncation is supported per global session rather than per interface. These options are implemented by the router when punting the packet.
| Feature name |
Release information |
Feature description |
|---|---|---|
| SPAN-to-File with unique capture | Release 25.2.1 | Introduced in this release on: Fixed Systems (8200 [ASIC: Q200, P100], 8700 [ASIC: P100, K100], 8010 [ASIC: A100]); Centralized Systems (8600 [ASIC: Q200]); Modular Systems (8800 [LC ASIC: Q100, Q200, P100]) This feature enhances the SPAN-to-File functionality by allowing you to capture only a single, unique packet for each punt reason or interface. This prevents interesting packets from being overshadowed by repeated packets in the analysed flow, ensuring that diverse and relevant packets are retained for analysis. The feature introduces these changes: CLI: The unique-punt and unique-port keywords are introduced in the drops command. |
| Always-On SPAN-to-File with periodic write |
Release 24.4.1 | Introduced in this release on: Fixed Systems(8200, 8700); Centralized Systems (8600); Modular Systems (8800 [LC ASIC: Q100, Q200, P100]). The routers can now provide reliable, always-available packet capture for post-event analysis, eliminating the need for prior configuration or user interaction. The enhanced SPAN-to-File feature provides continuous packet capture and debugging capability with always-on functionality that starts automatically upon destination configuration. It prevents data loss during node reloads by periodically writing packet buffer contents to disk, without stopping the capture. A default SPAN-to-File session for forwarding and buffer drops is always active and can be disabled if not needed. The feature also supports packet truncation and sampling in software for software-mirrored packets, independent of NPU capabilities. The feature introduces these changes: CLI:
YANG data models:
(see GitHub, YANG Data Models Navigator) |
| SPAN-to-file in Tx direction |
Release 25.1.1 | Introduced in this release on: Fixed Systems (8700 [ASIC: K100], 8010 [ASIC: A100]) This feature is now supported on:
|
| SPAN-to-file in Tx direction | Release 24.4.1 | Introduced in this release on: Fixed Systems(8200, 8700)(select variants only*); Modular Systems (8800 [LC ASIC: P100])(select variants only*). This feature now allows to capture packets in the Tx direction on the following hardware. *This feature is now supported on:
|
| SPAN-to-file support in Tx and Rx direction |
Release 7.5.3 | With this feature, the ability to capture the packet in Tx direction along with the ability to store the capture on the file is supported. You can now capture the packet in the Tx direction and store the capture on the file. Earlier, you could only capture or mirror the traffic in the Rx direction. You now have the flexibility to choose Tx, Rx, or both directions. You can now capture and analyze the outgoing (Tx) packets. |
| Partial packet capture ability for SPAN-to-file (Rx) |
Release 25.1.1 | Introduced in this release on: Fixed Systems ( 8010 [ASIC: A100]) This feature is now supported on:
|
| Partial packet capture ability for SPAN-to-file (Rx) | Release 24.4.1 | Introduced in this release on: Fixed Systems(8200, 8700)(select variants only*); Modular Systems (8800 [LC ASIC: P100])(select variants only*). This feature now allows you to perform partial packet capture in the Rx direction on the following hardware. *This feature is now supported on:
|
| Partial packet capture ability for SPAN-to-file (Rx) |
Release 7.5.3 | With this feature, you can perform partial packet capture in the Rx direction. Earlier, the ability for entire packet capture was available in the Tx direction only, now you can choose entire or partial packet capture in the Rx direction also. Here, partial packet capture is also known as truncation. |
| SPAN-to-file PCAPng file format | Release 24.4.1 | Introduced in this release on: Fixed Systems(8200, 8700)(select variants only*); Modular Systems (8800 [LC ASIC: P100])(select variants only*). This PCAPng File Format feature that contains different blocks used to rebuild the captured packets into recognizable data is now supported on the following hardware. *This feature is now supported on:
|
| SPAN-to-file PCAPng file format |
Release 7.3.1 |
PCAPng is the next generation of packet capture format that contains a dump of data packets captured over a network and stored in a standard format. The PCAPng file contains different types of information blocks, such as the section header, interface description, enhanced packet, simple packet, name resolution, and interface statistics. These blocks can be used to rebuild the captured packets into recognizable data. The PCAPng file format:
|
This table details the support for packet capture for various releases:
| Before Release 7.5.3 |
After Release 7.5.3 |
|---|---|
| There was no functionality that you could enable to capture the payload of packets coming from your customers for security reasons. |
The capture of all the outgoing packets from the router is supported. |