Implementing server and client communications with the endpoint interface (Linux only)
If you develop applications that use the endpoint interface, fewer steps are required for Remote Direct Memory Access (RDMA) connections between server and client than an equivalent process that uses the verbs interface. An example is provided to guide developers through the process on both the server and client sides of the connection.
The endpoint API is simpler than the verbs API. You can create an endpoint and a connection in a similar way to TCP socket communications, by using bind, connect, and disconnect operations. However, after they are connected, endpoints register memory, post send and receive requests, and unregister memory in a similar way to RDMA connection IDs.
- Connection management
- Common event processing and dispatching for endpoints.
- RDMA resources
- Common associations between RDMA resources, such as queue pairs and completion queues.
- RDMA operations
- Common requirements for how RDMA resources are used.
- A thread for processing connection management events on an event channel
- A thread for processing completion events on a completion channel
An endpoint group shares the same completion queue, which can hold up to 500 work completion events. If the limit is reached, accepting new connections or creating new endpoints in the endpoint group results in an IOException exception.
The following sections provide an explanation of the server and client implementation that is illustrated in the diagram.
Server flow
- The RDMA endpoint group is created by using the RdmaActiveEndpointGroup() method.
- The RDMA server endpoint is created by using the RdmaActiveEndpointGroup.createServerEndpoint() method.
- A bind takes place.
- The connection is accepted.
- For each client request, the following steps take place:
- The client RDMA endpoint connection is opened.
- A send or receive work request is posted. The completion of the post is notified to an endpoint by calling the dispatchCQEvent() method.
- The connection with the client RDMA endpoint is closed.
- The RDMA server endpoint is closed.
- The RDMA endpoint group is closed.
Client flow
- The RDMA endpoint group is created by using the RdmaActiveEndpointGroup() method.
- The RDMA client endpoint is created by using the RdmaActiveEndpointGroup.createEndpoint() method.
- A connect request is made to the server.
- A send or receive work request is posted.
- The RDMA client endpoint is closed.
- The RDMA endpoint group is closed.