3

After reading Why do we need a 3-way handshake? Why not just 2-way? I understand that We need ACK otherwise the Server has no idea if the client ever received the SYN, and it's important that the client receives that. Once that ACK gets through, now the server knows that it can send packets to the client. It also knows that the client knows this, so it can start sending data right away. The handshake is complete. We have a good channel.

But I want to know If the final ACK segment (third step) is never sent by the client. What server will do then? Is it run out of memory or something else because as far as I know When a client sends a SYN segment to the server, the server reserves memory to keep state information? What server will do with this state information If there is no ACK from client?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 7 '17 at 19:20
5

the server will periodically retransmit the syn-ack and eventually timeout and abandon the connection entry if the final ack is not received.

This does consume some RAM and is the subject of DoS attacks. However there are operating system mitigations available - in linux minisocks are used to keep the footprint down and after a certain point you can transition to syncookies which don't require any server side state during this period. (but they have downsides).

| improve this answer | |
  • I understand but When a client sends a SYN segment to the server, the server reserves memory to keep state information. For which purpose server use this state information? – Humaun Rashid Nayan Jun 27 '16 at 17:04
  • @HumaunRashid: because the SYN packet contains information (like initial sequence number, MSS, etc.) that the server will need for the rest of the connection. When using SYN cookies, this info is 'encoded' into the SYN+ACK packet in such a way that when the client responds with the ACK, the info can be decoded from it (and from then on, kept in a state table until the end of the connection). – hertitu Sep 5 '16 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.