show tcp
To display the status of Transmission Control Protocol (TCP) connections when Cisco IOS or Cisco IOS Software Modularity images are running, use the show tcp command in user EXEC or privileged EXEC mode.
show tcp [line-number] [tcb address]
Syntax Description
line-number |
(Optional) Absolute line number of the line for which you want to display Telnet connection status. |
tcb |
(Optional) Specifies the transmission control block (TCB) of the ECN-enabled connection that you want to display. |
address |
(Optional) TCB hexadecimal address. The valid range is from 0x0 to 0xFFFFFFFF. |
Command Modes
User EXEC (>) Privileged EXEC (#)
Command History
Release |
Modification |
---|---|
10.0 |
This command was introduced. |
12.3(7)T |
The tcb keyword and address argument were added. |
12.4(2)T |
The output is enhanced to display status and option flags. |
12.2(28)SB |
This command was integrated into Cisco IOS Release 12.2(28)SB. The display output was modified to include the SSO capability flag and to indicate the reason that the SSO property failed on a TCP connection. |
12.2(18)SXF4 |
This command was integrated into Cisco IOS Release 12.2(18)SXF4 to support Software Modularity images. |
12.2(33)SRA |
This command was integrated into Cisco IOS Release 12.2(33)SRA. |
12.2(31)SB2 |
This command was integrated into Cisco IOS Release 12.2(31)SB2. |
Cisco IOS XE Release 2.1 |
This command was integrated into Cisco IOS XE Release 2.1. |
15.0(1)S |
This command was integrated into Cisco IOS Release 15.0(1)S. |
Examples
Note |
Example output varies between Cisco IOS software images and Cisco IOS Software Modularity software images. |
Examples
The following is sample output that displays the status and option flags:
Router# show tcp
.
.
.
Status Flags: passive open, active open, retransmission timeout, app closed
Option Flags: vrf id set
IP Precedence value: 6
.
.
.
SRTT: 273 ms, RTTO: 490 ms, RTV: 217 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 300 ms, ACK hold: 200 ms
Status Flags: active open, retransmission timeout
Option Flags: vrf id set
IP Precedence value: 6
The table below contains the types of flags, all possible command output enhancements, and descriptions.
Type of Flag |
Output Enhancement |
Description |
---|---|---|
Status |
||
Passive open |
Set if passive open was done. |
|
Active open |
Set if active open was done. |
|
Retransmission timeout |
Set if retransmission timeout aborts. |
|
Net output pending |
Output to network is pending. |
|
Wait for FIN |
Wait for FIN to be acknowledged. |
|
App closed |
Application has closed the TCB. |
|
Sync listen |
Listen and establish a handshake. |
|
Gen tcbs |
TCBs are generated as passive listener. |
|
Path mtu discovery |
Path maximum transmission unit (MTU) discovery is enabled. |
|
Half closed |
TCB is half closed. |
|
Timestamp echo present |
Echo segment is present. |
|
Stopped reading |
Read half is shut down. |
|
Option |
||
VRF id set |
Set if connection has a VRF table identifier. |
|
Idle user |
Set if the connection is idle. |
|
Sending urgent data |
Set if urgent data is being sent. |
|
Keepalive running |
Set if keepalive timer is running, or if an Explicit Congestion Notification (ECN)-enabled connection, or a TCB address bind is in effect. |
|
Nagle |
Set if performing the Nagle algorithm. |
|
Always push |
All packets and full-sized segments (internal use) are pushed. |
|
Path mtu capable |
Path MTU discovery is configured. |
|
MD5 |
Message digest 5 (MD) messages are generated. |
|
Urgent data removed |
Urgent data is removed. |
|
SACK option permitted |
Peer permits a selective acknowledgment (SACK) option. |
|
Timestamp option used |
Time-stamp option is in use. |
|
Reuse local address |
Local address can be reused. |
|
Non-blocking reads |
Nonblocking TCP is read. |
|
Non-blocking writes |
Nonblocking TCP is written. |
|
No delayed ACK |
No TCP delayed acknowledgment is sent. |
|
Win-scale |
Peer permits window scaling. |
|
Linger option set |
The linger-on close option is set. |
The following is sample output from the show tcp command:
Router# show tcp
tty0, connection 1 to host cider
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 172.31.232.17, Local port: 11184
Foreign host: 172.31.1.137, Foreign port: 23
Enqueued packets for retransmit: 0, input: 0, saved: 0
Event Timers (current time is 67341276):
Timer: Retrans TimeWait AckHold SendWnd KeepAlive
Starts: 30 0 32 0 0
Wakeups: 1 0 14 0 0
Next: 0 0 0 0 0
iss: 67317172 snduna: 67317228 sndnxt: 67317228 sndwnd: 4096
irs: 1064896000 rcvnxt: 1064897597 rcvwnd: 2144 delrcvwnd: 0
SRTT: 317 ms, RTTO: 900 ms, RTV: 133 ms, KRTT: 0 ms
minRTT: 4 ms, maxRTT: 300 ms, ACK hold: 300 ms
Flags: higher precedence, idle user, retransmission timeout
Datagrams (max data segment is 536 bytes):
Rcvd: 41 (out of order: 0), with data: 34, total data bytes: 1596
Sent: 57 (retransmit: 1), with data: 35, total data bytes: 55
The table below describes the first five lines of output shown in the above display.
Field |
Description |
---|---|
tty |
Identifying number of the line. |
connection |
Identifying number of the TCP connection. |
to host |
Name of the remote host to which the connection has been made. |
Connection state is |
A connection progresses through a series of states during its lifetime. The states that follow are shown in the order in which a connection progresses through them.
|
I/O status |
Number that describes the current internal status of the connection. |
unread input bytes |
Number of bytes that the lower-level TCP processes have read but that the higher-level TCP processes have not yet processed. |
Local host |
IP address of the network server. |
Local port |
Local port number, as derived from the following equation: line-number + (512 * random-number ). (The line number uses the lower nine bits; the other bits are random.) |
Foreign host |
IP address of the remote host to which the TCP connection has been made. |
Foreign port |
Destination port for the remote host. |
Enqueued packets for retransmit |
Number of packets that are waiting on the retransmit queue. These are packets on this TCP connection that have been sent but that have not yet been acknowledged by the remote TCP host. |
input |
Number of packets that are waiting on the input queue to be read by the user. |
saved |
Number of received out-of-order packets that are waiting for all packets in the datagram to be received before they enter the input queue. For example, if packets 1, 2, 4, 5, and 6 have been received, packets 1 and 2 would enter the input queue, and packets 4, 5, and 6 would enter the saved queue. |
Note |
Use the show tcp brief command to display information about the ECN-enabled connections. |
The following line of output shows the current elapsed time according to the system clock of the local host. The time shown is the number of milliseconds since the system started.
Event Timers (current time is 67341276):
The following lines of output display the number of times that various local TCP timeout values were reached during this connection. In this example, the local host re-sent data 30 times because it received no response from the remote host, and it sent an acknowledgment many more times because there was no data.
Timer: Retrans TimeWait AckHold SendWnd Keepalive GiveUp PmtuAger
Starts: 30 0 32 0 0 0 0
Wakeups: 1 0 14 0 0 0 0
Next: 0 0 0 0 0 0 0
The table below describes the fields in the above lines of output.
Field |
Description |
---|---|
Timer |
Names of the timer types in the output. |
Starts |
Number of times that the timer has been triggered during this connection. |
Wakeups |
Number of keepalives sent without receiving any response. (This field is reset to zero when a response is received.) |
Next |
System clock setting that triggers a timer for the next time an event (for example, TimeWait, AckHold, SendWnd, etc.) occurs. |
Retrans |
Retransmission timer is used to time TCP packets that have not been acknowledged and that are waiting for retransmission. |
TimeWait |
A time-wait timer ensures that the remote system receives a request to disconnect a session. |
AckHold |
An acknowledgment timer delays the sending of acknowledgments to the remote TCP in an attempt to reduce network use. |
SendWnd |
A send-window timer ensures that there is no closed window due to a lost TCP acknowledgment. |
KeepAlive |
A keepalive timer controls the transmission of test messages to the remote device to ensure that the link has not been broken without the knowledge of the local device. |
GiveUp |
A give-up timer determines the amount of time a local host will wait for an acknowledgment (or other appropriate reply) of a transmitted message after the the maximum number of retransmissions has been reached. If the timer expires, the local host gives up retransmission attempts and declares the connection dead. |
PmtuAger |
A path MTU (PMTU) age timer is an interval that displays how often TCP estimates the PMTU with a larger maximum segment size (MSS). When the age timer is used, TCP path MTU becomes a dynamic process. If the MSS is smaller than what the peer connection can manage, a larger MSS is tried every time the age timer expires. The discovery process stops when the send MSS is as large as the peer negotiated or the timer has been manually disabled by being set to infinite. |
The following lines of output display the sequence numbers that TCP uses to ensure sequenced, reliable transport of data. The local host and remote host each use these sequence numbers for flow control and to acknowledge receipt of datagrams.
iss: 67317172 snduna: 67317228 sndnxt: 67317228 sndwnd: 4096
irs: 1064896000 rcvnxt: 1064897597 rcvwnd: 2144 delrcvwnd: 0
The table below describes the fields shown in the display above.
Field |
Description |
---|---|
iss |
Initial send sequence number. |
snduna |
Last send sequence number that the local host sent but for which it has not received an acknowledgment. |
sndnxt |
Sequence number that the local host will send next. |
sndwnd |
TCP window size of the remote host. |
irs |
Initial receive sequence number. |
rcvnxt |
Last receive sequence number that the local host has acknowledged. |
rcvwnd |
TCP window size of the local host. |
delrcvwnd |
Delayed receive window--data that the local host has read from the connection but has not yet subtracted from the receive window that the host has advertised to the remote host. The value in this field gradually increases until it is larger than a full-sized packet, at which point it is applied to the rcvwnd field. |
The following lines of output display values that the local host uses to keep track of transmission times so that TCP can adjust to the network that it is using.
SRTT: 317 ms, RTTO: 900 ms, RTV: 133 ms, KRTT: 0 ms
minRTT: 4 ms, maxRTT: 300 ms, ACK hold: 300 ms
Flags: higher precedence, idle user, retransmission timeout
The table below describes the significant fields shown in the output above.
Field |
Description |
---|---|
SRTT |
A calculated smoothed round-trip timeout. |
RTTO |
Round-trip timeout. |
RTV |
Variance of the round-trip time. |
KRTT |
New round-trip timeout (using the Karn algorithm). This field separately tracks the round-trip time of packets that have been re-sent. |
minRTT |
Smallest recorded round-trip timeout (hard-wire value used for calculation). |
maxRTT |
Largest recorded round-trip timeout. |
ACK hold |
Time for which the local host will delay an acknowledgment in order to add data to it. |
Flags |
Properties of the connection. |
Note |
For more information on the above fields, see Round Trip Time Estimation , P. Karn and C. Partridge, ACM SIGCOMM-87, August 1987. |
The following lines of output display the number of datagrams that are transported with data.
Datagrams (max data segment is 536 bytes):
Rcvd: 41 (out of order: 0), with data: 34, total data bytes: 1596
Sent: 57 (retransmit: 1), with data: 35, total data bytes: 55
The table below describes the significant fields shown in the last lines of the show tcp command output.
Field |
Description |
---|---|
Rcvd |
Number of datagrams that the local host has received during this connection (and the number of these datagrams that were out of order). |
with data |
Number of these datagrams that contained data. |
total data bytes |
Total number of bytes of data in these datagrams. |
Sent |
Number of datagrams that the local host sent during this connection (and the number of these datagrams that needed to be re-sent). |
with data |
Number of these datagrams that contained data. |
total data bytes |
Total number of bytes of data in these datagrams. |
The following is sample output from the show tcp tcb command that displays detailed information by hexadecimal address about an ECN-enabled connection:
Router# show tcp tcb 0x62CD2BB8
Connection state is LISTEN, I/O status: 1, unread input bytes: 0
Connection is ECN enabled
Local host: 10.10.10.1, Local port: 179
Foreign host: 10.10.10.2, Foreign port: 12000
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
Event Timers (current time is 0x4F31940):
Timer Starts Wakeups Next
Retrans 0 0 0x0
TimeWait 0 0 0x0
AckHold 0 0 0x0
SendWnd 0 0 0x0
KeepAlive 0 0 0x0
GiveUp 0 0 0x0
PmtuAger 0 0 0x0
DeadWait 0 0 0x0
iss: 0 snduna: 0 sndnxt: 0 sndwnd: 0
irs: 0 rcvnxt: 0 rcvwnd: 4128 delrcvwnd: 0
SRTT: 0 ms, RTTO: 2000 ms, RTV: 2000 ms, KRTT: 0 ms
minRTT: 60000 ms, maxRTT: 0 ms, ACK hold: 200 ms
Flags: passive open, higher precedence, retransmission timeout
TCB is waiting for TCP Process (67)
Datagrams (max data segment is 516 bytes):
Rcvd: 6 (out of order: 0), with data: 0, total data bytes: 0
Sent: 0 (retransmit: 0, fastretransmit: 0), with data: 0, total data
bytes: 0
Examples
The following is sample output from the show tcp tcb command from a Software Modularity image:
Router# show tcp tcb 0x1059C10
Connection state is ESTAB, I/O status: 0, unread input bytes: 0
Local host: 10.4.2.32, Local port: 23
Foreign host: 10.4.2.39, Foreign port: 11000
VRF table id is: 0
Current send queue size: 0 (max 65536)
Current receive queue size: 0 (max 32768) mis-ordered: 0 bytes
Event Timers (current time is 0xB9ACB9):
Timer Starts Wakeups Next(msec)
Retrans 6 0 0
SendWnd 0 0 0
TimeWait 0 0 0
AckHold 8 4 0
KeepAlive 11 0 7199992
PmtuAger 0 0 0
GiveUp 0 0 0
Throttle 0 0 0
irs: 1633857851 rcvnxt: 1633857890 rcvadv: 1633890620 rcvwnd: 32730
iss: 4231531315 snduna: 4231531392 sndnxt: 4231531392 sndwnd: 4052
sndmax: 4231531392 sndcwnd: 10220
SRTT: 84 ms, RTTO: 650 ms, RTV: 69 ms, KRTT: 0 ms
minRTT: 0 ms, maxRTT: 200 ms, ACK hold: 200 ms
Keepalive time: 7200 sec, SYN wait time: 75 sec
Giveup time: 0 ms, Retransmission retries: 0, Retransmit forever: FALSE
State flags: none
Feature flags: Nagle
Request flags: none
Window scales: rcv 0, snd 0, request rcv 0, request snd 0
Timestamp option: recent 0, recent age 0, last ACK sent 0
Datagrams (in bytes): MSS 1460, peer MSS 1460, min MSS 1460, max MSS 1460
Rcvd: 14 (out of order: 0), with data: 10, total data bytes: 38
Sent: 10 (retransmit: 0, fastretransmit: 0), with data: 5, total data bytes: 76
Header prediction hit rate: 72 %
Socket states: SS_ISCONNECTED, SS_PRIV
Read buffer flags: SB_WAIT, SB_SEL, SB_DEL_WAKEUP
Read notifications: 4
Write buffer flags: SB_DEL_WAKEUP
Write notifications: 0
Socket status: 0