Home > other >  TCP protocol in the Nagle algorithm
TCP protocol in the Nagle algorithm

Time:10-01

TCP/IP, rounding a chapter 19 there is a question

Definition of Negle calculate in the book: the algorithm requires a T C P connection there can be at most one unconfirmed unfinished small group, the group does
Before the arrival of the recognition can't send other small group, on the contrary, T C P to collect the small amount of grouping, and upon confirmation of arrival to a
In the way of a group,

Then an example in the book, the diagram below:

The book contains:
Segments 4 and 1 5 appears to be conflict with N a g l e algorithm, through but we need to check the serial number to see
The truth, because to confirm the serial number is 5, 4, so the message in section 4 are message segment 1 2 confirmation reply, but customers in the send the newspaper article
While, received a message from the server before 1 3, paragraph 1 message 5 contains the serial number for message segment 1 3 5 6 confirmation,
So even if we see from the client to the server has two consecutive return message segment, the customer is keep a N a g l e algorithm,

But I still feel that message section 14 and 15 do not conform to the Negle algorithm, no matter what the author said, message section 14 is the client sent a group, but the group has not been confirmed and sent a message 15, it is against Nagle algorithm, just standing on the service side Angle is to observe the Nagle,

CodePudding user response:

I also recently in the drilling and the deep end, although said that from the common sense to explain the operation is reasonable, because the client after receiving 12 period of message, decided to send the current accumulation of message, but after sending, and received a server or paragraph 13 message sent to come over, at this time for the client, do have a message segment has not been confirmed, but it received the message server 13, you must send an ACK confirmed, if according to the definition of nagle, also is not send a new message, then the server will resend message section 13, and then the client send a new message segment, this operation is not as good as in the picture above,

CodePudding user response:

reference 1st floor u010002517 response:
I also recently in the drilling and the deep end, although said that from the common sense to explain the operation is reasonable, because the client after receiving 12 period of message, decided to send the current accumulation of message, but after sending, and received a server or paragraph 13 message sent to come over, at this time for the client, do have a message segment has not been confirmed, but it received the message server 13, you must send an ACK confirmed, if according to the definition of nagle, also is not send a new message, then the server will resend message section 13, and then the client send a new message segment, this operation is not as good as in the picture above,


Had better not should synthesize message section 14 and 15 a send together

CodePudding user response:

refer to the second floor lg1544650023 response:
Quote: refer to 1st floor u010002517 response:

I also recently in the drilling and the deep end, although said that from the common sense to explain the operation is reasonable, because the client after receiving 12 period of message, decided to send the current accumulation of message, but after sending, and received a server or paragraph 13 message sent to come over, at this time for the client, do have a message segment has not been confirmed, but it received the message server 13, you must send an ACK confirmed, if according to the definition of nagle, also is not send a new message, then the server will resend message section 13, and then the client send a new message segment, this operation is not as good as in the picture above,


Best not should synthesize message section 14 and 15 a send together

After he received 12 14 is sent, but MAY be just finished sending again after received 13, at that moment, the user process and submit the new needs to send data, namely (1), was at that time need to confirm, 13 and a new momentum to send data, so send message 15, this is in conformity with the rules, I think the TCP protocol just established rules, as for how to implement, each platform has difference, TCP protocol words MUST, SHOULD, MAY, etc., for Angle algorithm, the use of words is SHOULD,
A TCP SHOULD implement the Nagle Algorithm [TCP: 9] to coalesce short segments.
Hope to have a great god to preach trained to reassure

CodePudding user response:

reference u010002517 reply: 3/f
14 is received after 12 is sent, but MAY be just finished send after received 13, at that moment, the user process and submit the new needs to send data, namely (1), was at that time need to confirm, 13 and a new momentum to send data, so send message 15, this is in conformity with the rules, I think the TCP protocol just established rules, as for how to implement, each platform has difference, TCP protocol words MUST, SHOULD, MAY, etc., for Angle algorithm, the use of words is SHOULD,
A TCP SHOULD implement the Nagle Algorithm [TCP: 9] to coalesce short segments.
Hope to have a great god to preach trained to reassure

But look from time series, 14 is sent again after receiving the 12 and 13, don't know the TCPDUMP command monitoring is which layer protocol, print out the time such a strange,

CodePudding user response:

Ha ha ha, see chapter 20 will have more questions

CodePudding user response:

Specifies the Nagle algorithm, the sender a connection on a network link can have only one didn't get an ACK request packets, this means that the sender only after waiting for a request on an ACK back to send the next request, these two request process middle, the sender's buffer is stored enough sliding window size package for transmission, thus effectively avoid the large number of small package,
  • Related