Configuration Guide for Cisco NCS 1014, IOS XR Releases 26.x.x

PDF

Transmission Control Protocol

Want to summarize with AI?

Log in

This section explains how Transmission Control Protocols (TCP) enable reliable, connection-oriented data transfer between computer systems, managing communication and ensuring data integrity.


Transmission Control Protocol (TCP) is a connection-oriented protocol that defines the format of data and acknowledgments exchanged between two computer systems to facilitate data transfer.

  • TCP outlines procedures to ensure that the data being transferred arrives correctly at the intended destination.

  • TCP enables multiple applications on a system to communicate simultaneously. It manages the demultiplexing of incoming traffic among application programs.


TCP dump file converter

The TCP dump file converter is a tool that converts IOS-XR dump files from binary format into user-friendly formats such as PCAP or text.

Key features

The key features of the file converter include:

  • The converter is especially useful when Non-Stop Routing (NSR) is disabled or a session flap occurs on your system. In these cases, the TCP process on the NCS system automatically stores the latest 200 packet traces in binary format in a temporary folder.

  • TCP dump packet traces also include data about the configured routing protocols and overall network traffic on your system. This data provides insights to help you identify and resolve network infrastructure issues, enabling proactive troubleshooting.

Binary files

You can view packet traces binary files in the user-readable format using these methods:

  • Use the show tcp dump-file binary-filename command to view each binary file in text format manually. For more information, refer to View binary files in text format manually

    Note

    This process consumes much time, as you have to view each file manually one after another.

  • Convert all stored packet traces in binary files into PCAP, text, or both using the tcp dump-file convert command.

    For more information, refer to Convert binary files to readable format using TCP dump file converter. This active approach greatly improves the efficiency and ease of packet analysis during network troubleshooting.


Limitations and restrictions for TCP dump file converter

The TCP dump file converter has these limitations and restrictions:

  • The system only stores the most recent 200 message exchanges that occurred right before the session termination, when NSR is disabled, or during a session flap.

  • You can view only one binary file in text format using the show tcp dump-file binary- filename command.

  • TCP dump files are generated by default for BGP, MSDP, MPLS LDP, and SSH.


View binary files in text format manually

Use this task to view each packet trace binary file in text format without using the TCP dump file converter.

Procedure

1.

Run the show tcp dump-file list all command to view the list of packet traces in binary files stored in the tcpdump folder.

Example:

RP/0/RP0/CPU0:ios# show tcp dump-file list all
                        total 1176
                        -rw-r--r-- 1 root root 5927 Nov 22 12:42 31_0_0_126.179.20966.cl.1700656933
                        -rw-r--r-- 1 root root 5892 Nov 22 12:42 31_0_0_127.179.35234.cl.1700656933
                        -rw-r--r-- 1 root root 6148 Nov 22 12:42 31_0_0_149.179.54939.cl.1700656933
                        -rw-r--r-- 1 root root 5894 Nov 22 12:42 31_0_0_155.179.18134.cl.1700656933
                        -rw-r--r-- 1 root root 6063 Nov 22 12:42 31_0_0_156.179.25445.cl.1700656933
                        -rw-r--r-- 1 root root 5860 Nov 22 12:42 31_0_0_161.179.30859.cl.1700656933
                        -rw-r--r-- 1 root root 5832 Nov 22 12:42 31_0_0_173.179.36935.cl.1700656933
                        -rw-r--r-- 1 root root 5906 Nov 22 12:42 31_0_0_190.179.25642.cl.1700656933
2.

Run the show tcp dump-file binary- filename command to view each packet traces binary file in text format.

Example:

RP/0/RP0/CPU0:ios# show tcp dump-file 10_106_0_73.179.34849.cl.1707424077 location 0/RP0/CPU0 
                        Filename: 10_106_0_73.179.34849.cl.1707424077
                        
                        ==============================================================
                        Connection state is CLOSED, I/O status: 0, socket status: 103
                        PCB 0x00007f86bc05e3b8, SO 0x7f86bc05e648, TCPCB 0x7f86bc0c3718, vrfid 0x60000000, 
                        Pak Prio: Medium, TOS: 192, TTL: 1, Hash index: 1593
                        Local host: 10.106.0.72, Local port: 179 (Local App PID: 11354)
                        Foreign host: 10.106.0.73, Foreign port: 34849
                        (Local App PID/instance/SPL_APP_ID: 11354/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        103448          8                0
                        SendWnd             0          0                0
                        TimeWait            1          0                0
                        AckHold        106815     106545                0
                        KeepAlive           1          0                0
                        PmtuAger            0          0                0
                        GiveUp              0          0                0
                        Throttle            0          0                0
                        FirstSyn            0          0                0
                        
                        iss: 161240548   snduna: 163206936   sndnxt: 163206936 
                        sndmax: 163206936   sndwnd: 63104       sndcwnd: 18120     
                        irs: 3691232436  rcvnxt: 3693473072  rcvwnd: 26099   rcvadv: 3693499171
                    

This sample shows only a portion of the full output; the complete output provides additional details.


Convert binary files to readable format using TCP dump file converter

Use this task to convert the dump packet traces in binary files into PCAP and text formats.

Procedure

1.

Run 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".

Use the location node-id and file file path keywords to 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.

Run 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 shows only a portion of the full output; the complete output provides additional details.

3.

Run the scp command to copy the converted packet traces from the system to your local computer and view the converted PCAP file.