580 views
3 votes
3 votes
Why TCP requires three way handshake why not two way is sufficient..

What is the actual use of SYN packet

2 Answers

2 votes
2 votes

Why not just use a two-way handshake? The short answer is because a two way handshake would only allow one party to establish an ISN(Initial Sequence Number), and the other party to acknowledge it. Which means only one party can send data.

But TCP is a bi-directional communication protocol, which means either end ought to be able to send data reliably. Both parties need to establish an ISN, and both parties need to acknowledge the other's ISN.
 

Actual use of SYN packet

Sequence number doesn't start at 0. It starts at the ISN (Initial Sequence Number), which is a randomly chosen value. And since TCP is a bi-directional communication, both parties can "speak", and therefore both must randomly generate an ISN as their starting Sequence Number. Which in turn means, both parties need to notify the other party of their starting ISN.

So you end up with this sequence of events for a start of a TCP conversation between Alice and Bob:

Alice ---> Bob    SYNchronize with my Initial Sequence Number of X
Alice <--- Bob    I received your syn, I ACKnowledge that I am ready for [X+1]
Alice <--- Bob    SYNchronize with my Initial Sequence Number of Y
Alice ---> Bob    I received your syn, I ACKnowledge that I am ready for [Y+1]

Reference : https://networkengineering.stackexchange.com/questions/24068/why-do-we-need-a-3-way-handshake-why-not-just-2-way

0 votes
0 votes
Two handshaking is not enough to establish a connection. because when client initiates the connection to server, then both server and client have to acknowledge to each other.

SYN paacket is sent to establish the connection.
edited

Related questions

2 votes
2 votes
3 answers
3
atul_21 asked Oct 8, 2017
1,357 views
From where should I study TCP and UDP socket.I am unable to distinguish bind(),connect(),listen() etc . . plz help me . .Can anyone provide me the good source or links fo...