Transmission Control Protocol#Connection establishment

The three-way handshake ( three-way handshake) is a method for constructing lossless data transmissions between two instances. Although mainly used in network technology, the three-way handshake is not limited thereto.

The two armies problem

During the transport of messages the participating instances need a way to ensure that they contacted instance has received the message. Thus, the sending entity wants an acknowledgment response when the message has arrived. The problems that can occur here if the communication medium is not reliable, are illustrated by the two armies problem:

Imagine two armies A and B, where A is stronger than Army Army Army as A but is split into two parts A1 and A2, each of these parts can not beat Army B alone. A1 and A2 must therefore simultaneously attack to win. It is therefore necessary to establish the exact time of attack before the attack by messenger. So A1 sends a message with the attack time to A2. However, the only way from A1 to A2 runs through the territory of B. A1 requires a confirmation that the message has arrived at A2, since A1 has to be sure that A2 was also informed about the attack time in knowledge. Here, the following two problems arise:

  • A1 sends message to A2, the messenger is, however, intercepted been in the camp of B. So A1 do not know if the original message was intercepted, or just the confirmation response from A2.
  • A1 sends message to A2, the messenger but is intercepted at the confirmation response from A2 in the camp of B. So A2 can not be certain that the confirmation response has been received by A1.

Both partial armies can be sure that is never that their message has been received at the other army, as well as the confirmation answers can not be transported reliably and A1 and A2 also the acknowledgment responses would have to be confirmed.

The three-way handshake

In communication engineering this problem always occurs when there is an unreliable communication channel between the communication partners.

The two armies problem is unsolvable. One would infinitely often " confirm confirmation " that in order to be sure to that the recipient also has received the message. Since this is unrealistic and would also lead to no end, you have to deal with appropriate measures with the possible packet loss when operating a communication system.

Particularly critical is the problem when establishing a connection, since the communication partner initially do not know each other, have made it thus in particular no provision for retransmission ( timeouts, etc.).

One often chooses therefore a three-step procedure for establishing a connection, the so-called three-way handshake. This can be thought of as an appointment by e -mail. Want to make an appointment with Anton Berta, the following messages are exchanged:

Step 3 is necessary for Berta knows if Anton has received confirmation. Message number 2 could well be lost, and Berta alone would appear to the meeting, as Anton has not received any confirmation.

Applications

TCP

The most famous application of the three-way handshake is the network technology and here again the protocol is TCP. It is there the erection and dismantling an outgoing trunk. A detailed description of this three-way handshake can be found in the article Transmission Control Protocol.

Asynchronous buses

The signals on asynchronous computer bus are clocked so that a clock can not be used for controlling the communication between the microprocessor and various connected components. Therefore, also in this area, some variants of the handshake process to be used. The basic principle remains largely unchanged.

An example of this bus communication provides a simple control of bus access on the system bus. Want a component read or write access to the system, it sends a special signal (Bus Request) to the microprocessor. Once the processor does not need the bus, it must allow the component to access by means of a specific response signal (Bus Grant). The component responds to this permit themselves with an acknowledgment (Bus Grant Acknowledge) to indicate to the processor and all other components that it has taken control of the bus. As can be seen, the names of each message can vary under different handshake method.

Similar methods can also be used for controlling the communication on different buses. Thereby, the method can be partially combined with a clock. A common case, the co-ordination of the address and data bus. The processor sets here a special signal (address strobe) on the control bus in order to signal that he has created a valid address on the address bus. This address belongs to a component (which may be about to memory or to a Ein-/Ausgabegerät act ). By means of a positive ACK - edge, this component may inform the processor about the fact that it has recognized as the addressee. The processor then withdraws its address strobe signal. The component can now write, for example, the requested data to the data bus, or even read them from there. By means of a negative ACK - edge component may notify the conclusion of this process. The type of communication is here because of the three participating buses ( control bus, address bus and data bus) bit more complex, but the basic principle of the three-way handshake is nevertheless also be seen here.

13659
de