Thursday, April 14, 2011

TCP (Transmission Control Protocol)

          Transmission Control Protocol (TCP) is the major transport protocol because of its reliability. TCP is a layer 4 protocol which lies at transport layer. It is a connection oriented protocol which establishes a logical connection between source and destination computers before it transfers data.  

For Example:

            We make a phone call to contact a person, but we only Start our conversation if the person other side picked up the phone.
           
Same as the above example TCP first establishes connection between the computers. TCP is an end to end reliable protocol which takes responsible for whether the sent data is received by the other end by exchanging Acknowledgment (ACK).
                        Whenever a TCP Packet is sent, the acknowledgement is returned from the received end.

Getting into detail

            The data we supposed to send will be chopped into several pieces, the pieces were loaded into containers for transport, and the containers are which we called Segments.
            There is a limitation that how much of data should the segment carry at one go. This size keeps on changing according to the Network condition which is called Flow Control.
            Each and every segments sent by System A are identified by a number called Sequence Number which helps the receiving end to rearrange the data in its original order.

The above Picture shows how TCP establishes Connection before Communication takes Place.


Step 1: TCP of A informs B with SYNC flag ON that I want to start sending segments from Sequence No: 300 so keep track on it. Acknowledgement is 0 because this is the first packet that A transfers, it hadn’t received any packets before from B to Acknowledge.

Step 2: B replies back with SYNC flag ON that I got your 300 send me 301. I want to start sending segments from Seq No: 700 so keep track on it.

Step 3: I got your 700 so you can start sending 701.

This is called Sequence Number SYNC (or) 3 Way Handshake.

No comments:

Post a Comment