Enhance the JDK networking API to support remote direct memory access (RDMA) using the rsocket protocol on Linux-based platforms.
For HPC and cloud applications, fully utilizing networking hardware capabilities to reach maximum bandwidth at low latency is challenging. Networking libraries inside the JDK currently use operating-system kernel sockets. Multiple memory copies between user and kernel spaces are involved during data transfers, which are expensive in both memory bandwidth and CPU cycles.
To improve this, we propose to add support for rsocket, a protocol over remote direct memory access (RDMA) that permits high-throughput, low-latency networking. For more details, please refer to JEP 337 .
A JDK-specific API is proposed as the rsocket feature is non-standard and only available on Linux platforms. Therefore, the proposal here is to add a JDK-specific API to the
jdk.net package of the
jdk.net module, which is where other JDK-specific networking features are already exposed. On platforms where rsocket is not supported, an
UnsupportedOperationException will be thrown by the factory methods.
A new class named
jdk.net.RdmaSockets will define factory methods to create RDMA-based TCP sockets and channels.
java.net.Socket openSocket(ProtocolFamily family) java.net.ServerSocket openServerSocket(ProtocolFamily family) java.nio.channels.SocketChannel openSocketChannel(ProtocolFamily family) java.nio.channels.ServerSocketChannel openServerSocketChannel(ProtocolFamily family) java.nio.channels.Selector openSelector()
A new class named
jdk.net.RdmaSocketOptions will define three RDMA related socket options.
public static final SocketOption<Integer> RDMA_SQSIZE public static final SocketOption<Integer> RDMA_RQSIZE public static final SocketOption<Integer> RDMA_INLINE