The server and client examples in this topic illustrate qtoq quality
of service (QoS) socket APIs written for a connection-oriented
functional flow.
The following figure illustrates the client/server relationship of the
qtoq socket functions enabled for QoS APIs for a connection-oriented protocol,
such as Transmission Control Protocol (TCP).
When the QoS enabled API functions are called for a connection-oriented
flow requesting that ReSerVation Protocol (RSVP) be initiated, additional
functions are initiated. These functions cause the QoS agents on the client
and server to set up the RSVP protocol for the data flow between the client
and the server.
qtoq flow of events: The following sequence of socket calls provide
a description of the figure. It also describes the relationship between the
server and client application in a connection-oriented design. These are modifications
of the basic socket APIs.
qtoq_accept() API for a
rule marked with no signaling
- The application calls the socket() function to get a socket descriptor.
- The application calls listen() to specify what connections it will wait
for.
- The application calls qtoq_accept() to wait for a connection request from
the client.
- The API calls the rapi_session() API and, if successful, a QoS session
ID is assigned.
- The API calls the standard accept() function to wait for a client connection
request.
- When the connection request is received, admission control is performed
on the requested rule. The rule is sent to the TCP/IP stack, and, if valid,
the rule returns to the calling application with the results and the session
ID.
- The applications for the server and the client perform the required data
transfers.
- The application calls the qtoq_close() function to close the socket and
to unload the rule.
- The QoS server deletes the rule from the QoS manager, deletes the QoS
session, and performs whatever other actions are needed.
qtoq_accept()
API with normal RSVP signaling
- The application calls the socket() function to get a socket descriptor.
- The application calls listen() to specify what connections it will wait
for.
- The application calls qtoq_accept() to wait for a connection request from
the client.
- When a connection request comes in, the rapi_session() API is called to
create a session with the QoS server for this connection and to get the QoS
session ID, which is returned to the caller.
- The rapi_sender() API is called to initiate a PATH message from the QoS
server and to inform the QoS server that it must expect an RESV message from
the client.
- The rapi_getfd() API is called to get the descriptor that the applications
use to wait for QoS event messages.
- The accept descriptor and the QoS descriptor are returned to the application.
- The QoS server waits for the RESV message to be received. When the message
is received, the server loads the appropriate rule with the QoS manager and
sends a message to the application if the application requested notification
on the call to the qtoq_accept() API.
- The QoS server continues to provide refreshes for the established session.
- The application calls qtoq_close() when the connection is completed.
- The QoS server deletes the rule from the QoS manager, deletes the QoS
session, and performs whatever other actions are needed.
qtoq_connect() API with
normal RSVP signaling
- The application calls the socket() function to get a socket descriptor.
- The application calls qtoq_connect() function to inform the server application
that it wants to make the connection.
- The qtoq_connect() function calls the rapi_session() API to create a session
with the QoS server for this connection.
- The QoS server is primed to wait for the PATH command from the requested
connection.
- The rapi_getfd() API is called to get the QoS descriptor that the applications
use to wait for QoS messages.
- The connect() function is called. The results of the connect() and the
QoS descriptor are returned to the application.
- The QoS server waits for the PATH message to be received. When the message
is received, it responds by sending an RESV message to the QoS server on the
application's server machine.
- If the application requested notification, the QoS server sends the notification
to the application by using the QoS descriptor.
- The QoS server continues to provide refreshes for the established session.
- The application calls qtoq_close() when the connection is complete.
- The QoS server closes the QoS session and performs whatever other actions
are necessary.
qtoq_connect()
API for a rule marked with no signaling
This request is not valid
for the client side because no response is required from the client in this
case.