Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RFC7413 on linux for server sockets #4196

Closed
wants to merge 1 commit into from

Conversation

serioussam
Copy link
Contributor

Motivation:

TCP Fast Open allows data to be carried in the SYN and SYN-ACK packets and consumed by the receiving end during the initial connection handshake, and saves up to one full round-trip time (RTT) compared to the standard TCP, which requires a three-way handshake (3WHS) to complete before data can be exchanged. This commit enables support for TFO on server sockets.

Modifications:

Added new Integer Option TCP_FASTOPEN in EpollChannelOption.
Added getters/setters in EpollServerChannelConfig for TCP_FASTOPEN.
Added way to check if TCP_FASTOPEN is supported on server in Native.
Added setting on socket opt TCP_FASTOPEN if value is set on channel options in doBind in EpollServerSocketChannel.
Enhanced EpollSocketTestPermutation to contain a permutation for server socket containing fast open.

Result:

Users of native-epoll can set TCP_FASTOPEN on server sockets and thus leverage fast connect features of RFC7413 if client is capable of it.

@normanmaurer normanmaurer self-assigned this Sep 5, 2015
@normanmaurer normanmaurer added this to the 4.0.32.Final milestone Sep 5, 2015
@normanmaurer
Copy link
Member

@serioussam awesome... let me check

@@ -136,6 +151,21 @@ void throwOutOfMemoryError(JNIEnv* env) {
(*env)->ThrowNew(env, exceptionClass, "");
}

int getSysctlValue(const char * property, int* returnValue) {
int rc=-1;
Copy link
Member

Choose a reason for hiding this comment

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

please put spaces around =

@normanmaurer
Copy link
Member

@serioussam please address my comments and ping me once done

@serioussam
Copy link
Contributor Author

@normanmaurer sure thing, I am travelling right now. I will address it once back in couple of days.

@@ -136,6 +151,21 @@ void throwOutOfMemoryError(JNIEnv* env) {
(*env)->ThrowNew(env, exceptionClass, "");
}

int getSysctlValue(const char * property, int* returnValue) {
Copy link
Member

Choose a reason for hiding this comment

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

also I think this could be static

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup that makes sense we dont have any other c file needing this function, I will make it static

@serioussam
Copy link
Contributor Author

@normanmaurer all corrections done. Please have a look.

return rc;
}


Copy link
Member

Choose a reason for hiding this comment

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

remove empty line (one is enough)

@normanmaurer
Copy link
Member

@serioussam just one nit to address... after that please squash your commits and after that I will cherry-pick

@normanmaurer
Copy link
Member

@serioussam just squash and I'm happy :)

Motivation:

TCP Fast Open allows data to be carried in the SYN and SYN-ACK packets and consumed by the receiving end during the initial connection handshake, and saves up to one full round-trip time (RTT) compared to the standard TCP, which requires a three-way handshake (3WHS) to complete before data can be exchanged. This commit enables support for TFO on server sockets.

Modifications:

Added new Integer Option TCP_FASTOPEN in EpollChannelOption.
Added getters/setters in EpollServerChannelConfig for TCP_FASTOPEN.
Added way to check if TCP_FASTOPEN is supported on server in Native.
Added setting on socket opt TCP_FASTOPEN if value is set on channel options in doBind in EpollServerSocketChannel.
Enhanced EpollSocketTestPermutation to contain a permutation for server socket containing fast open.

Result:

Users of native-epoll can set TCP_FASTOPEN on server sockets and thus leverage fast connect features of RFC7413 if client is capable of it.
@serioussam
Copy link
Contributor Author

@normanmaurer squashed :).

@normanmaurer
Copy link
Member

@serioussam thanks!

Cherry-picked into 4.0 (24860e7) , 4.1 (250a09d) and master (c449cea)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants