What is TCP?
Transmission Control Protocol is a connection oriented protocol. This means that before any data transfer can take place , Certain Parameters has to be negotiated in order to establish the connection.
Explain TCP Three Way Handshake process?
For Reliable connection the Transmitting device first establishes a connection-oriented (reliable) session with its peer system, which is called three way handshake. Data is then transferred. When the Data transfer is finished, connection is terminated and virtual circuit is teared down.
1.In the First Part of Three way Handshake, Source sends a TCP SYN Segment with the initial sequence number X indicating the desire to open the connection.
2.In Second Part, When Destination receives TCP SYN, It acknowledges this with Ack (X+1) as well as its own SYN Y (It informs Source what sequence number it will start its data with and will use in further messages). This response is called SYN/ACK.
3.In Third Part, Source Sends an ACK (ACK = Y+1) Segment to the destination indicating that the connection is set up. Data transfer can then begin.
During this 3 way Handshake, Devices are negotiating parameters like Window Size etc.
What does Window Size indicate?
It is 16-bit Window field which indicates the number of bytes a sender will send before receiving an acknowledgment from the receiver.
What is the purpose of RST bit?
When the connection Is not allowed by destination connection is reset.
What are TCP Flags?
TCP Flags are used to influence the Flow of Data across a TCP Connection.
1.PUSH (PSH) - It Pushes the Buffered data to the receivers application. If data is to be send on immediate Basis we will push it.
2.Reset (RST) - It Resets the connection.
3.Finish (FIN) - It finishes the session. It means No More Data from the Sender.
4.Urgent (URG) - It is use to set the priority to tell the receiver that this data is important for you.
5.Acknowledgement (ACK) - All packets after SYN packet sent by Client should have this Flag Set. ACK=10 means Host has received 0 through 9 and is expecting Byte 10 Next.
6.Synchronize (SYN) - It Initiates a Connection. It Synchronizes the sequence number.
What is the difference between PUSH and URG flag?
The PSH flag in the TCP header informs the receiving host that the data should be pushed up to the receiving application immediately. The URG flag is used to inform a receiving station that certain data within a segment is urgent and should be prioritized.
What is the importance of Sequence Number and Acknowledgement Number?
Sequence Number is a 32-bit field which indicates the amount of data that is sent during a TCP session. By Sequence Number sender can be assured that the receiver received the data because the receiver uses this sequence number as the acknowledgment number in the next segment it sends to acknowledge the received data. When the TCP session starts, the initial sequence number can be any number in the range 0–4,294,967,295.
Acknowledgment number is used to acknowledge the received data and is equal to the received sequence number plus 1.