TCP/IP Sockets Reset Concerns

Technote (troubleshooting)


Problem(Abstract)

This technote states the reasons why a TCP connection might be reset.

Resolving the problem

-A Stream Socket is Closed While Unread Data is Queued
A reset is issued from the z/OS IP side because an application closed its stream (TCP) socket while it had unread data in the TCP receive buffer associated with the socket.
If any application data has not been read at the time of the socket close(), the TCP layer on z/OS will send a reset packet to the remote end, aborting the connection.

Documentation needed: CTRACE COMP(SYSTCPIP) with options: ENGINE, PFS, SOCKET,SOCKAPI,TCP filtered on the application job name.

Action: The application programmer needs to pursue this problem to determine why all the data was not read before closing the socket.

-LINGER Value of Zero
The SETSOCKOPT call can be used to set a linger condition, in which TCP/IP will continue to attempt to complete data transmission for a specified period of time in seconds after the CLOSE call is issued. The close() call will not complete until the remote TCP acknowledges the FIN that is sent during close processing or the linger timer expires, whichever occurs first. However, If linger is enabled and linger time is 0, TCP aborts the connection during close() processing instead of sending a FIN. The abort process discards all data on the socket send and receive buffers, and sends a reset (RST) to the peer.

See the z/OS V1R12.0 Comm Svr: IP Sockets Application Programming Interface Guide and Reference for additional information regarding the setsockopt SO_LINGER option.

Documentation needed: CTRACE COMP(SYSTCPIP) with options: TCP filtered on the application job name.

-TCP/IP Packet Retransmissions Limit Exceeded
The TCP layer will retransmit application data until it is acknowledged by the peer TCP/IP or the retransmission limit has been reached. When the retransmission limit is exceeded, the TCP layer will abort the connection. The abort process discards all data on the socket send and receive buffers, and sends a reset (RST) to the peer.

Documentation needed: Packet Trace or Network Analyzer trace (in other words, sniffer).

-TCP Protocol Violations
Certain TCP layer protocol violations that occur between connection partners can result in a reset (RST) packet being sent to the violator.

Documentation needed: Packet Trace or Network Analyzer trace (in other words, sniffer).

-An application closed it socket, but data arrives from the peer after the close
An application issues a close() or shutdown() for read when it does not expect any additional data to be received from a peer. If data arrives from a peer after the application's socket has been closed or shut down for read, a reset packet is sent from the z/OS TCP layer to the peer.

Documentation needed: Packet Trace or Network Analyzer trace (in other words, sniffer).

Action: The application programmer needs to pursue the problem to determine why its peer continued to send data after the connection was closed or shut down.
.
-Socket Application is Cancelled or Abends
When a z/OS socket application is canceled or abends, all open sockets are closed by a resource manager. Sockets that use one of the Communications Server sockets APIs will have the LINGER option enabled with a timeout value of 0 before the socket is closed. During the resource manager initiated close, any of the aforementioned reasons for aborting a connection might apply.

Documentation needed: Dump of the abending application to determine the cause of the abend.

Note: This will also occur if the application terminates normally with sockets still open.

Rate this page:

(0 users)Average rating

Document information


More support for:

z/OS Communications Server
All

Software version:

1.2, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 2.1, 2.10

Operating system(s):

OS/390, z/OS

Software edition:

All Editions

Reference #:

1378567

Modified date:

2014-02-21

Translate my page

Machine Translation

Content navigation