Reputation: 365
I am working on a protocol on top of UDP that is connection-oriented (just for learning). The three-way handshake used by for example TCP is simple:
however, any of these packages can get lost. How does TCP recover from errors in the initialization phase? What happens if step 1 never happens? Just resend the SYN, but what if the client never receives the SYN + ACK, then either the SYN + ACK got lost or the first SYN got lost. What if the last ACK never makes it, should the server just assume after some time that everything is alright? So many possibilities for errors :o
Upvotes: 0
Views: 1691
Reputation: 123541
It is fairly simply: if the sender does not receive an ACK it will send the same packet again. This will be done multiple times and and after a while without success the sender will give up and consider it broken. This is true with ACK to a SYN, ACK to data or ACK to FIN.
Upvotes: 3