Skip to content

Comments

Add a note about Nagle's algorithm on the SSL_connect man page#6143

Closed
mattcaswell wants to merge 2 commits intoopenssl:masterfrom
mattcaswell:nagle
Closed

Add a note about Nagle's algorithm on the SSL_connect man page#6143
mattcaswell wants to merge 2 commits intoopenssl:masterfrom
mattcaswell:nagle

Conversation

@mattcaswell
Copy link
Member

Fixes #4237

@mattcaswell mattcaswell added branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) labels May 1, 2018
@mattcaswell mattcaswell added this to the 1.1.1 milestone May 1, 2018

In many operating systems the TCP_NODELAY socket option is available to disable
Nagle's algorithm. If an application opts to disable Nagle's algorithm
consideration should be given to turning it back on again later if appropriate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is convenience BIO_set_tcp_ndelay, which would be appropriate to mention here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On hardly related note, #if-spaghetti in BIO_set_tcp_ndelay formally opens for uninitialized variable use. It might be more appropriate to add #error directive as last resort option...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a sentence mentioning it.

condition. When using a buffering BIO, like a BIO pair, data must be written
into or retrieved out of the BIO before being able to continue.

Many OSes implement Nagle's algorithm by default which means that the OS will
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/OSes/system/ or platforms
s/the OS/it/

impacts after a successful TLSv1.3 handshake or a successful TLSv1.2 (or below)
resumption handshake because the last peer to communicate in the handshake is
the client. If the client is also the first to send application data (as is
typical for many protocols) then this data could be buffered by the OS until an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/by the OS//

typical for many protocols) then this data could be buffered by the OS until an
ACK has been received for the final handshake message.

In many operating systems the TCP_NODELAY socket option is available to disable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The B<TCP_NODELAY> option is often available

buffer outgoing TCP data if a TCP packet has already been sent for which no
corresponding ACK has been received yet from the peer. This can have performance
impacts after a successful TLSv1.3 handshake or a successful TLSv1.2 (or below)
resumption handshake because the last peer to communicate in the handshake is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a long sentence, perhaps a comma after handshake

@mattcaswell
Copy link
Member Author

I pushed a fixup commit addressing all of the above comments.

@richsalz richsalz added the approval: done This pull request has the required number of approvals label May 1, 2018
@mattcaswell
Copy link
Member Author

Pushed. Thanks.

@mattcaswell mattcaswell closed this May 2, 2018
levitte pushed a commit that referenced this pull request May 2, 2018
Fixes #4237

Reviewed-by: Rich Salz <[email protected]>
Reviewed-by: Ben Kaduk <[email protected]>
(Merged from #6143)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: done This pull request has the required number of approvals branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants