METHODS, SYSTEMS, AND COMPUTER PROGRAM PRODUCTS FOR DETECTING AN IDLE TCP CONNECTION
Methods and systems are described for detecting an idle TCP connection. In one aspect, a packet in a TCP connection is received by a first node. The first node identifies in the packet a header for detecting a time period during which the first node receives no data included in a data stream sent in the connection from a second node. The first node detects the time period based on the header and deactivates the connection, in response. In another aspect, information is received by a second node for detecting an idle TCP connection. The second node creates a packet including a header based on the information. The second node sends the packet in the connection to a first node for detecting a time period during which the first node receives no data in a data stream sent in the connection from the second node.
1 . A method for detecting an idle TCP connection, the method comprising:
receiving, by a first node from a second node, a first transmission control protocol (TCP) packet in a TCP connection;
identifying a first idle time period header, in the first packet, for detecting a first idle time period during which no TCP packet including data in a first TCP data stream sent in the TCP connection from the second node is received by the first node;
detecting the first idle time period based on the first idle time period header; and
deactivating the TCP connection in response to detecting the first idle time period.
2 . The method of claim 1 wherein the TCP connection is identified by a first connection endpoint and a second connection endpoint, and the first node includes at least one of the first connection endpoint and a first proxy endpoint representing the first connection endpoint.
3 . The method of claim 1 wherein the first idle time period header identifies, for detecting the first idle time period, at least one of a duration of time, a generator for determining a duration of time, and an input for determining a duration of time.
4 . The method of claim 1 further comprising modifying at least one of a TCP keep-alive option, a TCP user timeout, a retransmission timeout, an acknowledgment timeout, and another timeout associated with the TCP connection, in response to identifying the first idle time period header.
5 . The method of claim 1 wherein detecting the first idle time period includes detecting a time period, in the first idle time period, during which the first node has received acknowledgment for all data in a second TCP data stream sent in the TCP connection to the second node.
6 . The method of claim 1 wherein the first idle time period header is based on a previous idle time period header identified in a previous TCP packet in the TCP connection sent by the first node to the second node prior to the receiving of the first TCP packet.
7 . The method of claim 1 further comprising:
detecting a timeout based on a duration of time identified by the first idle information header; and
sending, in response to detecting the timeout, a TCP keep-alive packet in the TCP connection to the second node.
8 . The method of claim 7 further comprising:
detecting an acknowledgment timeout associated with sending the TCP keep-alive packet; and
detecting the first idle time period based on detecting the acknowledgment timeout.
9 . The method of claim 1 wherein detecting the first idle time period comprises:
receiving an empty TCP packet including no data in the first TCP data stream after detecting a beginning of a potential first idle time period;
in response to receiving the empty TCP packet, detecting a beginning of a next potential first idle time period.
10 . The method of claim 9 wherein detecting the beginning of the next potential first idle time period is performed in response to determining the empty TCP packet matches a specified condition.
11 . The method of claim 1 further comprising:
receiving the first TCP packet after receiving a previous TCP packet including a previous idle time period header for detecting a previous idle time period; and
detecting, in response to receiving the first TCP packet, the first idle time period rather than detecting the previous idle time period.
12 . The method of claim 1 further comprising sending a second TCP packet in the TCP connection to the second node including an informational idle time period header identifying to the second node metadata for the first idle time period.
13 . The method of claim 1 further comprising sending in the TCP connection a second TCP packet including a second idle time period header for detecting a second idle time period during which no TCP packet including data in a second TCP data stream sent in the TCP connection from the first node is received by the second node.
14 . The method of claim 1 wherein deactivating includes at least one of closing the TCP connection, sending by the first node a TCP packet including a reset indication, and releasing a resource previously allocated for the TCP connection by the first node.
15 . A method for detecting an idle TCP connection, the method comprising:
receiving, by a second node, first idle information for detecting when a TCP connection is idle;
generating a TCP packet including a first idle time period header based on the first idle information; and
sending the TCP packet in the TCP connection to the first node for detecting a first idle time period during which no TCP packet including data in a first data stream sent in the TCP connection from the second node is received by the first node.
16 . The method of claim 15 further comprising modifying based on the first idle information at least one of a keep-alive option, a TCP user timeout, a retransmission timeout, an acknowledgment timeout, and another timeout associated with the TCP connection.
17 . The method of claim 16 further comprising:
detecting a keep-alive timeout based on the modified keep-alive option;
generating, in response to detecting the keep-alive timeout, a second TCP packet including a second idle time period header for resetting the detecting of the first idle time period; and
sending the second TCP packet in the TCP connection to the first node.
18 . The method of claim 15 further comprising:
receiving in the TCP connection from the first node a second TCP packet;
identifying in the second TCP packet a second idle time period header for detecting a second idle time period during which no TCP packet including data in a second TCP data stream sent in the TCP connection from the first node is received by the second node;
detecting the second idle time period based on the second idle time period header; and
deactivating the TCP connection in response to detecting the second idle time period.
19 . The method of claim 18 wherein the second idle time period header is based on the first idle time period header.
20 . The method of claim 18 wherein deactivating includes at least one of closing the TCP connection, sending a TCP packet including a reset indication to the first node, and releasing a resource previously allocated for the TCP connection by the second node.
21 . The method of claim 20 wherein the second idle time period includes a time period during which the second node has received acknowledgment for all data in the first TCP data stream sent in the TCP connection.
22 . A system for detecting an idle TCP connection, the system comprising:
an execution environment including an instruction processing unit configured to process an instruction included in at least one of a net in-port component, an idle time period option handler component, and an idle time period monitor component;
the net in-port component configured for receiving, by a first node from a second node, a first transmission control protocol (TCP) packet in a TCP connection;
the idle time period option handler component configured for identifying a first idle time period header, in the first packet, for detecting a first idle time period during which no TCP packet including data in a first TCP data stream sent in the TCP connection from the second node is received by the first node;
the idle time period monitor component configured for detecting the first idle time period based on the first idle time period header; and
the connection state component configured for deactivating the TCP connection in response to detecting the first idle time period.
23 . A system for detecting an idle TCP connection, the system comprising:
an execution environment including an instruction processing unit configured to process an instruction included in at least one of an idle time period policy component, a packet generator component, and a net out-port component;
the idle time period policy component configured for receiving, by a second node, first idle information for detecting when a TCP connection is idle;
the packet generator component configured for generating a TCP packet including a first idle time period header based on the first idle information; and
the net out-port component configured for sending the TCP packet in the TCP connection to the first node for detecting a first idle time period during which no TCP packet including data in a first data stream sent in the TCP connection from the second node is received by the first node;
24 . A computer readable medium embodying a computer program, executable by a machine, for detecting an idle TCP connection, the computer program comprising executable instructions for:
receiving, by a first node from a second node, a first transmission control protocol (TCP) packet in a TCP connection;
identifying a first idle time period header, in the first packet, for detecting a first idle time period during which no TCP packet including data in a first TCP data stream sent in the TCP connection from the second node is received by the first node;
detecting the first idle time period based on the first idle time period header; and
deactivating the TCP connection in response to detecting the first idle time period.
25 . A computer readable medium embodying a computer program, executable by a machine, for detecting an idle TCP connection, the computer program comprising executable instructions for:
receiving, by a second node, first idle information for detecting when a TCP connection is idle;
generating a TCP packet including a first idle time period header based on the first idle information; and
sending the TCP packet in the TCP connection to the first node for detecting a first idle time period during which no TCP packet including data in a first data stream sent in the TCP connection from the second node is received by the first node.