Problem:
- Product Name: VisiBroker
- Product Version: All
- Product Component: Communication
- Platform/OS Version: All
- JDK: All
Most applications will not encounter TCP packets out of state issue as the application will initiate a TCP connection and wait for the server to respond back synchronously. The operating system will close the TCP connection immediately.
However, some applications do maintain long TCP connection. In certain situation, the TCP packets out of state is due to 1 hour timeout in a firewall setting.
Resolution:
1. TCP State Machine
1.1 Establishing a connection
- The server TCP will be in the LISTEN state waiting for TCP SYN packet from the client
- The client will move to SYN_SENT state after sending the SYN packet to the server
- The server will move to the SYN_RECVD state and send the SYN ACK packet to the client
- The client will move to the ESTABLISHED state after receiving the SYN ACK packet from the server. Next, it will send the SYN ACK ACK packet to the server.
- The server will move to the ESTABLISHED state after receiving the SYN ACK ACK packet.
1.2 Transmission of data using sliding window
- The sending side will send a block of bytes in a packet to the receiving end. The sending side will use a pointer to keep track of the packet sent to the receiving end. It will ensure the last packet acknowledged
- The packets between the last packet sent and acknowledged will be buffered and resent if necessary.
- The sending side will wait for the acknowledgement before moving the pointer and sending the next packet.
- The receiving side will ensure the last packet received
- The receiving side will always send the ACK packet to acknowledge receiving the packet.
1.3 Terminating a Connection
- Any side (client or server) can initiate to close the TCP connection.
- If the initiating side (can be client or server) closes first, it will follows the TCP states stated below.
ESTABLISHED -> FIN_WAIT_1-> FIN_WAIT_2 -> TIME_WAIT -> CLOSED. - The other side (can be client or server) who receives the message to close will follow the TCP states illustrated below.
ESTABLISHED -> CLOSE_WAIT -> LAST_ACK -> CLOSED. - Both sides close at the same time:
ESTABLISHED -> FIN_WAIT_1-> CLOSING ->TIME_WAIT -> CLOSED.
2. Solution
- Create a cron job that will trigger a new corba client process to make a connection to the corba server before an hour to simulate the traffic.
- Tune the TCP/IP stack to trigger the keepAlive message to keep alive the connection.
References
#VisiBroker
#Security




