Why tcp connect termination need 4-way-handshake?

后端 未结 5 1253
感动是毒
感动是毒 2021-02-03 23:30

When connection sets up, there is:

Client ------SYN-----> Server

Client <---ACK/SYN---- Server ----①

Client ------ACK-----> Ser

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 00:00

    I think of course the 2 and 3 can merge technically, but not flexible enough as not atomic.
    The first FIN1 C to S means and only means: I would close on my way of communication. The first ACK1 S to C means a response to FIN1. OK, I know your channel is disconnected but for my S(server) way connection, I'm not sure yet. Maybe my receiving buffer is not fully handled yet. The time I need is uncertain. Thus 2 and 3 are not appropriate to merge. Only the server would have right to decide when his way of connection can be disconnected.

提交回复
热议问题