Established TCP connection

22 Dec

    TCP connection is connected protocol. We will take a closer look at the states  and how to handled basic TCP protocol.

    To guaranteed the safe connection. We need to established the connection until close session. Detail:

    1. Established connection(3-way handshake)

    2. Transmitted Data

    3. Close connection (4-way handshake)

    4. Established connection:



      To established TCP connection, it’s always initiated with 3-way handshake, which establishes and negotiates(đàm phán) the actual connection over sending data.

      Before begin 3-way handshake. We have one listening connection on server. So, server need to register one static connection on one static port connection . This is passive connection and listen connection from client.


    tcp      6 117 SYN_SENT src= dst= sport=1031 \

         dport=23 [UNREPLIED] src= dst= sport=23 \

         dport=1031 use=1


    Way-1: Client send SYN packet to server . This is new connection and could be block if don’t register by firewall. The SYN_SENT is flag set.


    tcp      6 57 SYN_RECV src= dst= sport=1031 \

         dport=23 src= dst= sport=23 dport=1031 \



    Way-2: After than, Server will feedback  corresponding SYN_RECV packet. This is accepted from server to client . Client will receive and tell " ready send" to end of 3-way handshake.


    tcp      6 431999 ESTABLISHED src= dst= \

         sport=1031 dport=23 src= dst= \

         sport=23 dport=1031 use=1


    Way-3: Client will send established flag. After more packets, the connection will also become [ASSURED]


    Close Connection:



    Ending of connection, stations always using the 4-way-handshake. One station will send FIN packet to done connection. Stepping follow picture. After that station stop send and wait other station ending session. In other station, it do that, too. After that, 2 station ending with together.


    written by hotdream1990

    Leave a comment

    Posted by on December 22, 2010 in Java, TCP/IP


    Tags: ,

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s