-
Notifications
You must be signed in to change notification settings - Fork 9
/
home_devices_qod.yaml
381 lines (357 loc) · 17.5 KB
/
home_devices_qod.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
openapi: 3.0.3
info:
title: Home Devices QoD
description: |
Service Enabling Network Function API for *QoS-on-demand* (QoD) control applied to devices connected to the user's home network. API clients can request to change, on demand, the desired QoS behaviour for the IP traffic corresponding to a specific user home device. The QoS behaviour is determined by the Service Class provided by the API Client, which is mapped to a DSCP value according to [RFC4594](https://datatracker.ietf.org/doc/html/rfc4594) guidelines.
# Introduction
It may be useful for application developers to request on-demand QoS behaviours (service classes) to be configured at the user's home WiFi access point to ensure the required quality of experience for those services/applications running on a specific home device.
For example, the QoD control capability could be useful in scenarios such as:
- A user using head-mounted display device for VR/AR applications. VR/AR applications require high bandwidth for the big amount of data to be streamed.
- A user using VoIP application in a home device. Lower latency improves call quality or avoids dropped calls.
Generally speaking, QoS on demand may improve the qualty of experience for real time services like Videocomms, Cloud Gaming and Virtual Reality.
![Videocomms DSCP usage example](https://raw.githubusercontent.com/camaraproject/HomeDevicesQoD/main/documentation/API_documentation/resources/videocomm_dscp_example.png)
# Relevant terms and definitions
- **Home Device**:
User device connected to the user's home network.
- **NaaS**:
*Network-as-a-Service* model where Telco Network resources are exposed to third parties through APIs. In this particular API, QoD operations for home devices are exposed following this model.
- **Service Class**:
A statement of the required QoS characteristics of a traffic aggregate. Conceptually, a service class refers to applications with similar characteristics and performance requirements.
- **DSCP**:
*Differentiated Services (DiffServ) Code Point*. DiffServ is a simple and scalable mechanism for classifying and managing network traffic and providing quality of service (QoS) on IP networks. The DSCP value will be used to classify the traffic of the target home device in order to be treated accordingly.
# API Functionality
This API allows to third party clients to set, on demand, the desired QoS behaviour (service class) associated to the traffic of the device connected to the user's home network that matches the input criteria provided. The device traffic is classified (by DSCP) and treated accordingly.
- **NOTE: The scope of the API is as follows**:
- QoS treatment is applied to a target user device **only within the user's home network** (i.e., between the device and the home router)
- QoS treatment **only applies to downstream IP traffic** (i.e., from the home router to the target device)
- QoS treatment **only applies to home devices using WiFi access** (i.e., home router WiFi interface)
The API provides a single endpoint/operation:
- Set the desired QoS behaviour for a user home device.
# Further info and support
(FAQs will be added in a later version of the documentation)
termsOfService: http://example.com/terms/
contact:
name: API Support
url: http://www.example.com/support
email: [email protected]
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 0.2.0
servers:
- url: https://{host}{basePath}
variables:
host:
default: api.example.com
description: Host that serves the API
basePath:
default: /home-devices-qod/v0
description: API URL prefix for all API paths
paths:
/qos:
put:
summary: Set the desired QoS behaviour for a user home device
description: |
Set the desired QoS behaviour for the traffic corresponding to the user home device matching the input criteria. **QoS behaviour is determined by the service class provided by the API Client. Setting `standard` service class restores default traffic treatment for the target home device.**
- The operation is executed for the user whose `sub` is in the access token used to call this endpoint, and for the home network also deducted from the information included in the access token.
- The target user device is identified by the internal IP address of that device in the home network.
- In case there is no device matching the input criteria, the operation returns a 404 error.
tags:
- Home Devices QoD
operationId: setQos
parameters:
- $ref: '#/components/parameters/x-correlator'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/QosOnDemandUpdate'
example:
serviceClass: real_time_interactive
ipAddress: 192.168.1.27
required: true
responses:
'204':
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
description: Requested QoS passed all validations and was applied
'400':
$ref: '#/components/responses/Generic400'
'401':
$ref: '#/components/responses/Generic401'
'403':
$ref: '#/components/responses/setQosPermissionDenied403'
'404':
$ref: '#/components/responses/setQosNotFound404'
'409':
$ref: '#/components/responses/setQosConflict409'
'500':
$ref: '#/components/responses/Generic500'
'503':
$ref: '#/components/responses/setQosServiceUnavailable503'
'504':
$ref: '#/components/responses/Generic504'
components:
schemas:
QosOnDemandUpdate:
type: object
description: Payload to change the QoS behaviour associated to a device.
required:
- serviceClass
- ipAddress
properties:
serviceClass:
type: string
description: |
The name of the service class requested by the API client. It is associated with QoS behaviours optimised for a particular application type. Each service class is mapped to a DSCP value according to [RFC4594](https://datatracker.ietf.org/doc/html/rfc4594) guidelines. The DSCP value is used to classify the target home device's traffic so that it can be treated accordingly (i.e. to meet its QoS needs).
The following service classes are supported:
| Service Class Name | DSCP Name | DSCP value (decimal) | DCSP value (binary) | Application Examples |
|-----------------------|-----------|----------------------|---------------------|-----------------------------------------------|
| Real-Time Interactive | CS4 | 32 | 100000 | Video conferencing and Interactive gaming |
| Multimedia Streaming | AF31 | 26 | 011010 | Streaming video and audio on demand |
| Broadcast Video | CS3 | 24 | 011000 | Broadcast TV & live events |
| Low-Latency Data | AF21 | 18 | 010010 | Client/server transactions Web-based ordering |
| High-Throughput Data | AF11 | 10 | 001010 | Store and forward applications |
| Low-Priority Data | CS1 | 8 | 001000 | Any flow that has no BW assurance |
| Standard | DF(CS0) | 0 | 000000 | Undifferentiated applications |
enum:
- real_time_interactive
- multimedia_streaming
- broadcast_video
- low_latency_data
- high_throughput_data
- low_priority_data
- standard
example: real_time_interactive
ipAddress:
type: string
format: ipv4
pattern: '^([01]?\d\d?|2[0-4]\d|25[0-5])(?:\.(?:[01]?\d\d?|2[0-4]\d|25[0-5])){3}?$'
description: Internal IP address of the connected device in the LAN.
example: 192.168.1.27
ErrorInfo:
type: object
required:
- status
- code
- message
properties:
status:
type: integer
description: HTTP status code returned along with this error response
code:
type: string
description: A code value within the allowed set of values for this error
message:
type: string
description: A human readable description of what the event represents
responses:
Generic400:
description: Problem with the client request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param
Generic401:
description: Authentication problem with the client request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 401
code: UNAUTHENTICATED
message: Request not authenticated due to missing, invalid, or expired credentials
setQosPermissionDenied403:
description: |
Client does not have sufficient permission.
In addition to regular PERMISSION_DENIED scenario another scenario may exist:
- User home network cannot be deducted from access token context.("code": "HOME_DEVICES_QOD.INVALID_TOKEN_CONTEXT","message": "User home network cannot be deducted from access token context.").
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
PermissionDenied:
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action
InvalidTokenContext:
value:
status: 403
code: HOME_DEVICES_QOD.INVALID_TOKEN_CONTEXT
message: User home network cannot be deducted from access token context
setQosNotFound404:
description: |
Resource Not Found.
In addition to regular scenario of NOT_FOUND, another scenario may exist.
- There is no device matching the input criteria. ("code": "HOME_DEVICES_QOD.NO_DEVICE_MATCH","message": "No connected device found for the input criteria provided.").
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
NotFound:
value:
status: 404
code: NOT_FOUND
message: The specified resource is not found
NoDeviceMatch:
value:
status: 404
code: HOME_DEVICES_QOD.NO_DEVICE_MATCH
message: No connected device found for the input criteria provided
setQosConflict409:
description: |
Requested QoS can't be set.
In addition to regular CONFLICT scenario to handle conflict with the current state of the target resource, another scenarios may exist:
- HOME_DEVICES_QOD.TOO_MANY_DEVICES: Exceeded the maximum quantity of devices with non-default QoS behaviour.
- HOME_DEVICES_QOD.RSSI_BELOW_THRESHOLD: RSSI from device is below allowed threshold.
- HOME_DEVICES_QOD.QOS_TOO_HIGH: Requested QoS is higher than the maximum QoS allowed.
- HOME_DEVICES_QOD.OCCUPANCY_ABOVE_THRESHOLD: The occupancy is above the allowed threshold.
- HOME_DEVICES_QOD.NOT_CONNECTED_TO_REQUIRED_INTERFACE: Device is not connected to the required interface (e.g. WiFi 5GHz interface).
- HOME_DEVICES_QOD.NOT_SUPPORTED_REQUIRED_INTERFACE: Device does not support required interface (e.g. WiFi 5GHz interface).
- HOME_DEVICES_QOD.QOS_ALREADY_SET_TO_DEFAULT: Device QoS is already set to default value.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
Conflict:
value:
status: 409
code: CONFLICT
message: Conflict with the current state of the target resource
TooManyDevices:
value:
status: 409
code: HOME_DEVICES_QOD.TOO_MANY_DEVICES
message: Exceeded the maximum quantity of devices with non-default QoS behaviour
RssiBelowThreshold:
value:
status: 409
code: HOME_DEVICES_QOD.RSSI_BELOW_THRESHOLD
message: RSSI from device is below allowed threshold
QosTooHigh:
value:
status: 409
code: HOME_DEVICES_QOD.QOS_TOO_HIGH
message: Requested QoS is higher than the maximum QoS allowed
OccupancyAboveThreshold:
value:
status: 409
code: HOME_DEVICES_QOD.OCCUPANCY_ABOVE_THRESHOLD
message: The occupancy is above the allowed threshold
NotConnectedToRequiredInterface:
value:
status: 409
code: HOME_DEVICES_QOD.NOT_CONNECTED_TO_REQUIRED_INTERFACE
message: Device is not connected to the required interface (e.g. WiFi 5GHz interface)
NotSupportedRequiredInterface:
value:
status: 409
code: HOME_DEVICES_QOD.NOT_SUPPORTED_REQUIRED_INTERFACE
message: Device does not support required interface (e.g. WiFi 5GHz interface)
QosAlreadySetToDefault:
value:
status: 409
code: HOME_DEVICES_QOD.QOS_ALREADY_SET_TO_DEFAULT
message: Device QoS is already set to default value
Generic500:
description: Server error
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 500
code: INTERNAL
message: Server error
setQosServiceUnavailable503:
description: |
Service unavailable. Typically the server is down.
In addition to regular scenario of UNAVAILABLE to handle service availability problems, another scenario may exist.
- The router is offline ("code": "HOME_DEVICES_QOD.ROUTER_OFFLINE","message": "Router is not online. Try it later.").
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
Unavailable:
value:
status: 503
code: UNAVAILABLE
message: Request timeout exceeded
RouterOffline:
value:
status: 503
code: HOME_DEVICES_QOD.ROUTER_OFFLINE
message: Router is not online. Try it later
Generic504:
description: Request time exceeded. If it happens repeatedly, consider reducing the request complexity
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 504
code: TIMEOUT
message: Request timeout exceeded
parameters:
x-correlator:
name: x-correlator
in: header
description: Correlation id for the different services
schema:
type: string
headers:
x-correlator:
description: Correlation id for the different services
schema:
type: string
securitySchemes:
three_legged:
description: |
OAuth 2.0 3-legged access tokens must be used by API clients to invoke this API with dedicated scope. The API client must authenticate on behalf of a specific user to use this service. This can be done via IP-based authentication (i.e. using the public IP of the device in this case).
The 3-legged access of the Home Devices QoD API could also be combined with end-user consent management, depending on the legal basis applied. User consent would be required before personal data is processed by API clients for a specific purpose.
type: openIdConnect
openIdConnectUrl: https://example.com/.well-known/openid-configuration
security:
- three_legged:
- home-devices-qod-qos-write
tags:
- name: Home Devices QoD
description: QoD control operations for home devices
externalDocs:
description: Project documentation at CAMARA
url: https://github.com/camaraproject/