Three-way handshake / four wave

Three-way handshake:

1.A transmission request

2.B + B in response to the request

3.A response

Connection A → B: 1 and 2 to achieve

Connection B → A: 2 and 3 to achieve


How to ensure that the other party sent each time have received it, the request receives a response means that the success of the previous transmission

That will always be next to ensure the success of the last

So, how do you know 3 sends a success of it, because there is no response to ensure 3 4 ah?

1 and 2 have to ensure that the connection A → B is successful, 3 is connected to the A → B, so the default is successful


Four waving

1.A transmission request

2.B response

3.B request

4.A response

Close A → B: 1 and 2 to achieve

Close the B → A: 3 and 4 to achieve


Two questions:

3 and 4 1. Why not put together?

B → A is closed before, the data is not finished their past


2. Why is the first step to wait 4 A 2MSL?

Because always next time to guarantee a success, and Step 4 is the last step, not a guarantee of success

When shaking hands three times that do not need to guarantee ah, because acquiesced connection A → B is effective; and four wave if you can not guarantee the success of the last, then B will never release the connection has been occupied resources, the actual server face a lot of connections, it is necessary to ensure the success of the last to disconnect

principle:

If the last B did not receive, then re-send a disconnect request, A side will receive the request, and A → B is 1msl, B → A is 1msl, a total of 2msl

If the last received a B, then A side will not receive the request, but still have to wait 2msl, in case it has received in the last minute

Therefore, according to the A response is sent back, then there is no disconnection request is received to determine whether the successfully transmitted their 2MSL, thus ensuring the reliability of the last

Guess you like

Origin www.cnblogs.com/justaman/p/11485235.html