Home > Back-end >  Small white inquired of TCP protocol related issues, seek help from bosses
Small white inquired of TCP protocol related issues, seek help from bosses

Time:11-03

When the client sends a request for network problems and lead to packet number cannot, will trigger the TCP retransmission mechanism, so that the packets sent will been received by the server, and for the client to create the connection? Thank you inquire, bosses

CodePudding user response:

Before the connection is the retransmission is built good, has nothing to do with the retransmission, retransmission is what happened after the connection is established successfully, the retransmission packets sent before likely been received by the server, of course, but after the retransmission because serial number is the same as before, the retransmission packet is agreement discarded,

CodePudding user response:

That for the first time in TCP handshake, send a connection request is also in the form of packets, that when sending the request packet number because the client's network problem and can't with packets after the serial number on, and the client can't send the request again because of network problems, that in this case, according to what you have said is that the server has received some packets, and will establish a connection for the requests of the data is not complete? Or is the server for a requested data is not complete and not for a connection to the client? Ask,??????

CodePudding user response:

I think can be seen as two phases, the first stage is to establish a connection, if the middle three times handshake failure, that you can't have a follow-up to send packets, data transmission is begin after the connection is established successfully, such as the package of shaking hands for the first time send a success, but have not received the other end of the return package, it is not connected, the success of the second stage is both sides of the data interaction, such as overtime retransmission mechanism among them,

CodePudding user response:

But why I hear as if the service side, after receipt of a request for the client to create a connection, when the server receives the third handshake, for the client to establish a complete connection, (I mean connection is server for the client to create a thread, or the preparation before doing something completely connections)
And I want to know is to shake hands for the first time, the client sends the request is to send it in the form of small packets (that is, a request is made up of many packets), then in no before a connection is established, the server for the client network problems and just received an incomplete request, the server will eventually create a half for the requests of the incomplete connection? Or not? please forgive my shallow knowledge

CodePudding user response:

I understand is this: the three-way handshake is not successful, the server will not establish a connection for the client, of course, also won't create processing threads, the half connections, is also the first time I've heard of, if not the things right, establish a connection, either start data interaction; Or connect the connection is not successful, can't for subsequent data interaction,

CodePudding user response:

Recommend a book, "a computer network: the top-down", explain the TCP chapter is quite easy to understand,

CodePudding user response:

Ok, thanks for answer, thank you??

CodePudding user response:

The building Lord said did you get this information from? I'm afraid is misguided, half connection exists only in unilateral close connection, for example server receives a request, it will no longer need to accept the client's subsequent requests, can unilaterally closed client connection, the corresponding API is shutdown, but this time it also can continue to send data to the client, then will send all the data before sending a FIN end of the session,

CodePudding user response:

There is no connection established by the incomplete connection, in the three-way handshake, as long as there is an incomplete data, in the case of a timeout, a connection will be judged failure, shaking hands for the first time, if received response will timeout retransmission, until the maximum timeout will think failure; Server to confirm connection if received response is the same, if both sides can not keep consistent state, for example, a client that is connected, but the server side received many times handshake signal, this time for the client's request, the server will use a reset to respond, the client receives the reset response will reset the connection, then you're ready to start the connection

CodePudding user response:

Will create a connection, this is a way of TCP attacks. The parameters of the monitoring function as is half the connection and the connection number

CodePudding user response:

Such as the client of sending the first handshake requests, and do not send the second handshake response, then the server will produce a lot of waiting for three-way handshake, until the server crash.
So the server configuration suitable for the number of the TCP three-way handshake

CodePudding user response:

11 references qq_29817615 response:
such as the client of sending the first handshake requests, and do not send the second handshake response, then the server will produce a lot of waiting for three-way handshake data, until the server crash.
So server configuration suitable for the number of the TCP three-way handshake
so could you please tell me, if in the process of sending requests a connection is established, if the client because the network problems lead to send the request of the incomplete, such as: because the request is made up of small packets, then due to the service side of packets received incomplete, because server will receive incomplete requests for a connection to the client? Or not? Thank??

CodePudding user response:


No matter which side have network anomalies, can only be disconnected reconnection (abnormal disconnect is ok),

TCP itself has no abnormal data retransmission mechanism, abnormal retransmission will only cause deal chaos

CodePudding user response:

If you want to know the working principle of TCP, find some articles to read online, online articles, of course, also a lot of nonsense, so recommend you buy a book about TCP,

If you just want to know how to do to TCP application programming, don't tube you of these problems, these problems are the TCP stack fix it for you, you don't need to pipe it,
  • Related