This task enables you to convert TCP dump packet trace files into readable formats (PCAP and text) for analysis and review.
You may need to analyze network packet traces captured in binary format, which are not readable as-is. Converting them to PCAP or text allows you to use analysis tools or view them manually in the CLI.
Follow these steps to convert TCP dump packet traces to PCAP and text formats:
Procedure
|
1. |
Use the tcp dump-file convert all-formats all command to convert the dump packet traces in binary files into PCAP and text formats.
Example:
RP/0/RP0/CPU0:ios# tcp dump-file convert all-formats all
ascii file is saved at : /harddisk:/decoded_dumpfiles/text_tcpdump_peer_all_node0_RP0_CPU0_2024_3_19_10_8_53.462070.txt
pcap file is saved at : /harddisk:/decoded_dumpfiles/pcap_tcpdump_peer_all_node0_RP0_CPU0_2024_3_19_10_8_40.154838.pcap
[OK]
By default, the system stores the converted files in the decoded_dumpfiles folder on the hard disk.
Using the location node-id and file <file path> keywords, you can save the converted TCP dump file to your desired location.
For example, tcp dump-file convert all-formats all location 0/RP0/CPU0 file /harddisk:/demo2 .
RP/0/RP0/CPU0:ios# tcp dump-file convert all-formats all location 0/RP0/CPU0 file /harddisk:/demo2
ascii file is saved at : /harddisk:/demo2.txt
pcap file is saved at : /harddisk:/demo2.pcap
[OK]
|
|
2. |
Use the run cat <text file path> command to view the converted text file in the CLI.
Example:
RP/0/RP0/CPU0:ios# run cat /harddisk:/decoded_dumpfiles/text_tcpdump_peer_all_node0_RP0_CPU0_2024_3_19_10_8_53.462070.txt
Filename: 2024_3_19_10_8_53.462070
==============================================================
Connection state is CLOSED, I/O status: 0, socket status: 103
PCB 0x0000000000f47a80, SO 0xf476d0, TCPCB 0xf6a370, vrfid 0x60000000,
Pak Prio: Medium, TOS: 192, TTL: 255, Hash index: 563
Local host: 14:11:11::1, Local port: 47743 (Local App PID: 19579)
Foreign host: 14:11:11::2, Foreign port: 179
(Local App PID/instance/SPL_APP_ID: 19579/1/0)
Current send queue size in bytes: 0 (max 0)
Current receive queue size in bytes: 0 (max 0) mis-ordered: 0 bytes
Current receive queue size in packets: 0 (max 0)
Timer Starts Wakeups Next(msec)
Retrans 70 2 0
SendWnd 0 0 0
TimeWait 2 0 0
AckHold 66 61 0
KeepAlive 1 0 0
PmtuAger 0 0 0
GiveUp 0 0 0
Throttle 0 0 0
FirstSyn 1 1 0
iss: 3113104891 snduna: 3113106213 sndnxt: 3113106213
sndmax: 3113106213 sndwnd: 31523 sndcwnd: 2832
irs: 4250126727 rcvnxt: 4250128049 rcvwnd: 31448 rcvadv: 4250159497
This sample displays only a portion of the actual output. The full output provides additional details.
|
|
3. |
Use the scp command to copy the converted packet traces from the system to your local computer and view the converted PCAP file. |
The system converts TCP dump packet traces into readable PCAP and text formats. The files are stored at your specified location and are accessible for further analysis from the CLI or on your local machine.