Skip to main content
Network APIs for Connectivity Quality

CAMARA Quality on Demand

warning

This documentation is currently under development and subject to change. It reflects outcomes elaborated by 5G-MAG members. If you are interested in becoming a member of the 5G-MAG and actively participating in shaping this work, please contact the Project Office

Description​

The "Quality-On-Demand" (QoD) API gives developers a programmable interface to request stable latency or prioritised throughput managed by networks. It abstracts the complexity of underlying network technologies (for example the 4G/5G system of a mobile network), so developers can focus on enhancing user experiences for applications that demand high-quality network communication.

QoD requests QoS for the duration of a single session. It uses a named profile from the QoS Profiles API or one agreed at onboarding: the qosProfile name passed to POST /sessions must be one the operator offers. For a persistent assignment (applied every time the device connects) see QoS Provisioning; to reserve capacity ahead of an event see QoS Booking.

Information: Quality on Demand project page and GitHub repository

The API definitions can be obtained here: QualityOnDemand API_definitions folder

The Quality on Demand API definition (YAML) is available at: quality-on-demand.yaml

Operations and dependencies​

Quality on Demand API​

  • POST /sessions with the request body including a device object, applicationServer IP, applicationServerPorts, devicePorts, qosProfile and duration, it is used to create a QoS session to manage latency/throughput priorities. The response includes information about the creation of the session, with a sessionId (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions POST; schemas CreateSession, BaseSessionInfo, SessionInfo).
    • Dependency: Needs a qosProfile name, which can be retrieved from the QoS Profiles API or is agreed during onboarding.
  • GET /sessions/{sessionId} - Get QoS session information (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions/{sessionId} GET)
  • DELETE /sessions/{sessionId} - Delete a QoS session (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions/{sessionId} DELETE)
  • POST /sessions/{sessionId}/extend - Extend the duration of an active session (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions/{sessionId}/extend POST)
  • POST /retrieve-sessions - Get QoS session information for a device (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /retrieve-sessions POST)

Standardisation context​

Quality on Demand is part of the CAMARA QualityOnDemand repository (OpenAPI 3.0.3): its event type is at v1 (org.camaraproject.quality-on-demand.v1.qos-status-changed), where the other APIs analysed here are at v0; the API definition itself is version: wip, like the others (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml info.version, schemas QosEventType). It takes a named profile from the QoS Profiles API.

Session lifecycle​

A session has a qosStatus of REQUESTED, AVAILABLE or UNAVAILABLE. POST /sessions creates it for a bounded duration; POST /sessions/{sessionId}/extend adds requestedAdditionalDuration (seconds); GET, POST /retrieve-sessions and DELETE read, find and end it. There is no reservation phase, so availability is known only when the session is requested: for guaranteed capacity use QoS Booking, and for a profile on every connection use QoS Provisioning.

For live media QoD is the most direct API: it is invoked when the boost is needed, can be extended, and reports through the sink when the QoS can no longer be sustained.


Workflow: Media application requesting a QoS session​

A user of a media application wants a QoS boost for the duration of a media flow. The following steps are executed:

Architecture drawing: a planning tool at the field location invokes the Quality on Demand API through a Network API Platform linked to the mobile network; a booking tool at the production centre is also an API consumer. The QoS session applies to the segment between the 5G-enabled production devices and the mobile network, to which devices can be attached with POST /sessions.
The Quality on Demand API is invoked by an API consumer through the Network API Platform. The QoS session applies to the segment between the devices and the mobile network, to which devices can be attached with POST /sessions (figure text).

Step 0: Pre-conditions​

  • The API invoker has signed up with the API provider (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml info.description (Authorization and authentication: flows 'agreed upon during the onboarding process'; QoS profiles agreed 'during the onboarding with the API provider')).
  • A qosProfile name has been obtained via the QoS Profiles API or agreed at onboarding. Unlike QoS Booking, there is no pre-booking phase; the session is created directly during operation.

Step 1: Create the session​

  • POST /sessions passing the device, applicationServer, ports, the chosen qosProfile and a duration. The response returns a sessionId used to query, extend or delete the session (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions POST; schemas SessionInfo.sessionId; path parameter sessionId).

5G-MAG's Self-Assessment​

This section records 5G-MAG's practical reading of the API and the open points it raises for media use.

  • QoD is the most direct of the QoS APIs for a live media flow: it is invoked at the moment the boost is needed and runs for a bounded duration, which can be extended with POST /sessions/{sessionId}/extend.
  • Because there is no reservation phase, availability is only established when the session is requested (it may stay REQUESTED until the network confirms or refuses); for a scheduled event where capacity must be guaranteed in advance, QoS Booking may be more appropriate.
  • The sink/notification mechanism (see Event notifications) lets the application react when the network can no longer sustain the requested QoS (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions POST description; schemas EventQosStatusChanged).

Quality-On-Demand (QoD) API Usage​

Request the creation of a session​

With POST /sessions, to manage latency/throughput priorities. The request specifies the device, the application server and ports, the chosen QoS profile, a sink for notifications and a duration (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions POST; schemas CreateSession, BaseSessionInfo):

{
"device": {
"phoneNumber": "+123456789",
"ipv4Address": {
"publicAddress": "203.0.113.0",
"publicPort": 59765
},
"ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
},
"applicationServer": {
"ipv4Address": "198.51.100.0/24",
"ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
},
"devicePorts": {
"ranges": [
{
"from": 5010,
"to": 5020
}
],
"ports": [5060, 5070]
},
"applicationServerPorts": {
"ranges": [
{
"from": 5010,
"to": 5020
}
],
"ports": [5060, 5070]
},
"qosProfile": "voice",
"sink": "https://endpoint.example.com/sink",
"sinkCredential": {
"credentialType": "ACCESSTOKEN",
"accessToken": "<access_token>",
"accessTokenExpiresUtc": "2025-12-31T23:59:59Z",
"accessTokenType": "bearer"
},
"duration": 3600
}

Type of response: Information about the status of the request, including the assigned sessionId and the initial qosStatus (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml schemas SessionInfo; /sessions POST description):

{
"applicationServer": {
"ipv4Address": "198.51.100.0/24"
},
"qosProfile": "QOS_L",
"sink": "https://application-server.com/notifications",
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"duration": 3600,
"qosStatus": "REQUESTED"
}

Request QoS session information for a device​

With POST /retrieve-sessions and device object. The request identifies the device whose sessions are queried (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /retrieve-sessions POST; schemas RetrieveSessionsInput):

{
"device": {
"phoneNumber": "+123456789",
"ipv4Address": {
"publicAddress": "203.0.113.0",
"publicPort": 59765
},
"ipv6Address": "2001:db8:85a3:8d3:1319:8a2e:370:7344"
}
}

Type of response: QoS sessions information, returned as an array (a device may have more than one session) (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /retrieve-sessions POST 200 description; schemas RetrieveSessionsOutput):

[
{
"applicationServer": {
"ipv4Address": "0.0.0.0/0"
},
"qosProfile": "QOS_L",
"sink": "https://application-server.com/notifications",
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"duration": 3600,
"startedAt": "2024-06-01T12:00:00Z",
"expiresAt": "2024-06-01T13:00:00Z",
"qosStatus": "AVAILABLE"
}
]

Request duration extension of an active QoS session​

With POST /sessions/{sessionId}/extend and the requested additional duration (in seconds) (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml schemas ExtendSessionDuration.requestedAdditionalDuration; /sessions/{sessionId}/extend POST):

{
"requestedAdditionalDuration": 1800
}

Obtain QoS session information​

With GET /sessions/{sessionId}. The response returns the full current state of the session (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions/{sessionId} GET 200; schemas SessionInfo):

{
"duration": 3600,
"device": {
"ipv4Address": {
"publicAddress": "203.0.113.0",
"publicPort": 59765
}
},
"applicationServer": {
"ipv4Address": "198.51.100.0/24"
},
"qosProfile": "QOS_L",
"sink": "https://application-server.com/notifications",
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"startedAt": "2024-06-01T12:00:00Z",
"expiresAt": "2024-06-01T13:00:00Z",
"qosStatus": "AVAILABLE"
}

Event notifications​

The QoD API can notify the API consumer asynchronously when the status of a session changes (for example, when prioritised resources become available, expire, or are terminated by the network). This avoids the need to poll GET /sessions/{sessionId} (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions POST description; /sessions/{sessionId} DELETE description; schemas StatusInfo).

Mechanism​

Notifications are delivered to the callback URL supplied as the sink parameter when the session is created with POST /sessions (see the request example above). Where present, sinkCredential describes the credential the API provider uses to authenticate against that endpoint. The consumer's sink must accept HTTP POST requests carrying the notification payload (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml /sessions POST callbacks notifications {$request.body#/sink}; schemas BaseSessionInfo.sink, sinkCredential; CAMARA Commonalities main@b1a9f08 CAMARA-API-Event-Subscription-and-Notification-Guide.md section 2.1).

The payload follows the CloudEvents 1.0 specification (JSON format) (CAMARA Commonalities main@b1a9f08 CAMARA-API-Event-Subscription-and-Notification-Guide.md section 3.1). A notification carries the required attributes id, source, specversion (1.0), type and time, and a data object; if datacontenttype is present it must be application/json. The sink must be an https URL (CAMARA Commonalities main@b1a9f08 CAMARA_event_common.yaml schemas CloudEvent, Sink).

Event types​

The Quality on Demand API defines a single notification event type (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml schemas QosEventType; /sessions POST callbacks):

Event typeMeaning
org.camaraproject.quality-on-demand.v1.qos-status-changedThe QoS status of the session changed. (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml schemas QosEventType, EventQosStatusChanged)

The change itself is conveyed in the data object (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml schemas EventQosStatusChanged.data):

ParameterDescription
qosStatusIndicates the new status. In notifications the value is AVAILABLE or UNAVAILABLE. (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml schemas EventQosStatus)
statusInfoIs included when qosStatus is UNAVAILABLE and gives the reason. Documented values are DURATION_EXPIRED, NETWORK_TERMINATED and DELETE_REQUESTED. (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml schemas StatusInfo (DURATION_EXPIRED, NETWORK_TERMINATED, DELETE_REQUESTED; 'only applicable when qosStatus is UNAVAILABLE'))

Example notification payload​

A CloudEvent sent to the sink when a session becomes unavailable because its duration expired (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml components/examples QOS_STATUS_CHANGED_EXAMPLE):

{
"id": "83a0d986-0866-4f38-b8c0-fc65bfcda452",
"source": "https://api.example.com/qod/v1/sessions/3fa85f64-5717-4562-b3fc-2c963f66afa6",
"specversion": "1.0",
"type": "org.camaraproject.quality-on-demand.v1.qos-status-changed",
"time": "2024-06-01T13:00:00Z",
"data": {
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"qosStatus": "UNAVAILABLE",
"statusInfo": "DURATION_EXPIRED"
}
}
note

Event type and enum values above are taken from the CAMARA Quality on Demand API definition. Confirm the exact values against the quality-on-demand.yaml for the API version you are integrating against, as they can change between releases (CAMARA QualityOnDemand main@471aa35 quality-on-demand.yaml info.version; schemas QosEventType, StatusInfo).