Read the original speed -TCP / IP (TCP open simultaneously)

Establishment and termination Chapter 18 TCP connections

18.8 open simultaneously

Two applications simultaneously execute another case of active open is possible, although the possibility of occurrence of extremely small. Each party must send a SYN, SYN and these must be passed to the other side. This requires each party to use a port other well-known as a local port. This is also known as open simultaneously (simultaneous open).

For example, an application of the host A local port 7777, and the host B port 8888 active open. Application host B is in the local port 8888, and the port of the host A 7777 active open. This situation is different with the following: establishing a connection Te lnet host server program A is Te lnet client and host B, at the same time, Te lnet host server program B is Te lnet A host client is connecting to the . Te lnet In this example, two Te lnet servers perform passive open, rather than take the initiative to open, and Te lnet customers to choose the local port is not the other end of Te lnet server processes familiar to the port.

TCP is purposely designed to handle simultaneously opened, while the opening for the connection is that only one rather than two connections (Other protocol, the most prominent of the OSI transport layer, in this case to establish a connection rather than two connection). When the case is opened simultaneously occurs, the state transition in FIG. 1 8 - 13 differs from that shown. Both ends while transmitting the SYN, SYN _ SENT state and enter. When each client receives SYN, state to SYN _ RCVD (FIG. 18--12), while they are received and then send a SYN SYN confirmed. When both sides have received and the corresponding SYN ACK, the state will change to ES TA BLISHED. FIG 18--17 shows the state transition of these processes.
Here Insert Picture Description
A simultaneous open requires the exchange of four segments, one more than the normal three-way handshake. In addition, we should note that we do not have any client or server end is called, because each end of both client and server.

An example
although it is difficult, but still possible to produce a simultaneous open connections. The two ends must start at the same time, in order to receive each other's SYN. As long as both ends of a long round-trip time will be able to guarantee this. We will one end disposed on the main bsdi, the other end disposed in the host vangogh. Cs. Berkeley. On edu. Since there is a dial-up SLIP link between its round-trip time of receiving the SYN synchronization is guaranteed both long (several hundred milliseconds) sufficiently.

One end (bsdi to) a local port to 8888 (using the command line option - b), and the other end of the host port 7777 active open.
Here Insert Picture Description
We specify with - sock program v flag to verify the IP address and port number to connect both ends. This option also shows the value of each end of the MSS. To confirm that indeed talk to each other at both ends, we also enter a line of characters at each end, to see if they would be sent to the other end and displayed.

Figure 18--18 shows this exchange of segments connected (we remove the emergence of some new TCP option in the first SYN from vangogh, because vangogh use 4 4 ​​BSD system in 1810... section describes these newer options). Followed by two belt SYN ACK SYN attention two (1 to 2 lines) and after (lines 3 to 4). They will perform open simultaneously.

Line 5 shows from bsdi to vangogh input line "hello, world", line 6 to confirm this. 7 to 8 rows corresponding to the other direction of the input line "and hi there" and confirm. 9 - 12 show normal line connection is closed.

Many TCP implementations Berkeley version can not properly support open simultaneously. In these systems, if able to synchronize to receive SYN, you will experience very many segments exchange process in order to close them. Each segment includes a switching process in each direction SYN and an ACK. FIG 18 - 1 2 SYN _ SENT from a state
SYN_RCVD the changes very little in many TCP implementations tested.

Here Insert Picture Description

Released 1521 original articles · won praise 1444 · Views 130,000 +

Guess you like

Origin blog.csdn.net/weixin_42528266/article/details/104759659