Skip to content

Commit

Permalink
Merge tag 'rt-5gms-application-function-v1.4.1-rc2'
Browse files Browse the repository at this point in the history
  • Loading branch information
David Waring committed May 23, 2024
2 parents 991588d + 899e28e commit 6238717
Show file tree
Hide file tree
Showing 90 changed files with 2,525 additions and 8,726 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "subprojects/open5gs"]
path = subprojects/open5gs
url = https://github.com/open5gs/open5gs.git
[submodule "subprojects/rt-common-shared"]
path = subprojects/rt-common-shared
url = https://github.com/5G-MAG/rt-common-shared.git
64 changes: 51 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# 5GMS Application Function

This repository holds the 5GMS Application Function implementation for the 5G-MAG Reference Tools.
Note that currently this implementation only supports downlink media streaming.
<h1 align="center">5GMS Application Function</h1>
<p align="center">
<a href="#"><img src="https://img.shields.io/badge/Status-Under_Development-yellow" alt="Under Development"></a>
<a href="https://github.com/5G-MAG/rt-5gms-application-function/releases/latest"><img src="https://img.shields.io/github/v/release/5G-MAG/rt-5gms-application-function?label=Version" alt="Version"></a>
<a href="https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view"><img src="https://img.shields.io/badge/License-5G--MAG%20Public%20License%20(v1.0)-blue" alt="License"></a>
</p>

## Introduction

The 5GMS Application Function (AF) is a Network Function that forms part of the 5G Media Services framework as defined in ETSI TS 126.501.

Additional information can be found at: https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/

### 5GMS Downlink Application Function
A 5GMSd Application Function (AF), which can be deployed in the 5G Core Network or in an External Data Network, is responsible for managing the 5GMSd System. The AF is a logical function which embodies the control plane aspects of the system, including provisioning, configuration, and reporting, among others. A 5GMSd Application Provider provisions 5GMS functions using a RESTful HTTP-based provisioning interface at reference point M1d. Another RESTful HTTP-based configuration and reporting interface is exposed to UE-based 5GMSd Clients at reference point M5d.

#### Specifications

A list of specification related to this repository is available in the [Standards Wiki](https://github.com/5G-MAG/Standards/wiki/5G-Downlink-Media-Streaming-Architecture-(5GMSd):-Relevant-Specifications).

#### About the implementation
### About the implementation

This AF uses the [Open5GS](https://open5gs.org/) framework to implement the network function.

A list of currently supported features is available [here](https://github.com/5G-MAG/rt-5gms-application-function/wiki/Feature-Matrix).
A list of currently supported features is available [here](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/features-af.html).

## Install dependencies

Expand Down Expand Up @@ -84,11 +84,49 @@ specify an alternative configuration file. For example:

The source example configuration file can be found in `~/rt-5gms-application-function/src/5gmsaf/msaf.yaml`.

Also see the [Configuring the Application Function](https://github.com/5G-MAG/rt-5gms-application-function/wiki/Configuring-the-Application-Function) wiki page for details on configuration.
Also see the [Configuring the Application Function](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/configuration-5GMSAF.html) page for details on configuration.

## Testing

See the section on [Testing](https://github.com/5G-MAG/rt-5gms-application-function/wiki/Developing-and-Contributing#testing) in the wiki.
Follow the [Testing as a Local User](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/installation-local-user-5GMSAF.html) page for setting up a test environment without requiring full
system installation.

### Testing: M1 Interface

The details of these tests change with different versions of the 5GMSd Application Function.

If you are testing the v1.2.x versions then please visit the [Testing the M1 Interface on v1.2.0](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m1-v120.html) page.

If you are testing the M1 interface on 5GMSd Application Function v1.3.0 to v1.4.0 then please visit the
[Testing the M1 Interface on v1.3.0](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m1-v130.html) page.

For testing the M1 interface on 5GMSd Application Function v1.4.1 or later, then please visit the
[Testing the M1 Interface on v1.4.1](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m1-v141.html) page.

### Testing the M3 Interface

Depending on which version of the 5GMSd Application Function you wish to test, the commands to test the interface at reference point M3 change.

If you wish to test 5GMSd Application Function v1.1.x then please see the [Testing the M3 Interface on v1.1.0](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m3-v110.html) page.

For versions after v1.1.x (i.e. v1.2.0 and above) please use the [Testing the M3 Interface on v1.2.0](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m3-v120.html) page.

### Testing: M5 Interface

The details of these tests change with different versions of the 5GMSd Application Function.

If you are testing versions up to v1.1.x then please visit the [Testing: M5 Interface on v1.0.0](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m5-v100.html)
page.

If you are testing the M5 interface on 5GMSd Application Function v1.2.x please visit the
[Testing the M5 Interface on v1.2.0](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m5-v120.html) page.

If you are testing the M5 interface on 5GMSd Application Function v1.3.0 or later please visit the
[Testing the M5 Interface on v1.3.0](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-m5-v130.html) page.

### Testing with Postman

For detailed instructions on how to use the Postman Collection please refer to this [documentation](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/testing-postman.html).

## Development

Expand All @@ -97,6 +135,6 @@ the [Gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflo
`development` branch of this project serves as an integration branch for new features. Consequently, please make sure to
switch to the `development` branch before starting the implementation of a new feature.

## Support
## Acknowledgements

The reference implementation of the Network Assistance and Dynamic Policies features was funded by the UK Government through the [REASON](https://reason-open-networks.ac.uk/) project.
6 changes: 2 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
# Meson module fs and its functions like fs.hash_file require atleast meson 0.59.0

project('rt-5gms-application-function', 'c',
version : '1.4.0',
version : '1.4.1',
license : '5G-MAG Public',
meson_version : '>= 0.59.0',
meson_version : '>= 0.63.0',
default_options : [
'c_std=gnu89',
],
)

sh_cmd = find_program('sh')
patch_open5gs_result = run_command([sh_cmd, '-c', '"$MESON_SOURCE_ROOT/subprojects/patch_open5gs.sh" open5gs'], check: true, capture: false)
open5gs_project=subproject('open5gs',required:true)
svc_consumers_project=subproject('rt-5gc-service-consumers',required:true)

Expand Down
161 changes: 161 additions & 0 deletions src/5gmsaf/5G_APIs-overrides/TS26512_M5_DynamicPolicies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
openapi: 3.0.0
info:
title: M5_DynamicPolicies
version: 2.0.2
description: |
5GMS AF M5 Dynamic Policy API
© 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).
All rights reserved.
tags:
- name: M5_DynamicPolicies
description: '5G Media Streaming: Media Session Handling (M5) APIs: Dynamic Policies'
externalDocs:
description: 'TS 26.512 V17.6.0; 5G Media Streaming (5GMS); Protocols'
url: 'https://www.3gpp.org/ftp/Specs/archive/26_series/26.512/'
servers:
- url: '{apiRoot}/3gpp-m5/v2'
variables:
apiRoot:
default: https://example.com
description: See 3GPP TS 29.512 clause 6.1.
paths:
/dynamic-policies:
post:
operationId: createDynamicPolicy
summary: 'Create (and optionally upload) a new Dynamic Policy resource'
requestBody:
description: 'An optional JSON representation of a Dynamic Policy resource'
content:
application/json:
schema:
$ref: '#/components/schemas/DynamicPolicy'
responses:
'201':
description: 'Created Dynamic Policy Resource'
content:
application/json:
schema:
$ref: '#/components/schemas/DynamicPolicy'
headers:
Location:
description: 'The URL of the newly created Dynamic Policy resource'
required: true
schema:
$ref: 'TS26512_CommonData.yaml#/components/schemas/AbsoluteUrl'
'400':
description: 'Bad Request'
'401':
description: 'Unauthorized'

/dynamic-policies/{dynamicPolicyId}:
parameters:
- name: dynamicPolicyId
description: 'The resource identifier of a Dynamic Policy resource'
in: path
required: true
schema:
$ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
get:
operationId: retrieveDynamicPolicy
summary: 'Retrieve an existing Dynamic Policy resource'
responses:
'200':
description: 'Success'
content:
application/json:
schema:
$ref: '#/components/schemas/DynamicPolicy'
'400':
description: 'Bad Request'
'401':
description: 'Unauthorized'
'404':
description: 'Not Found'
put:
operationId: updateDynamicPolicy
summary: 'Update an existing Dynamic Policy resource'
requestBody:
description: 'A replacement JSON representation of a Dynamic Policy resource'
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DynamicPolicy'
responses:
'400':
description: 'Bad Request'
'401':
description: 'Unauthorized'
'404':
description: 'Not found'
patch:
operationId: patchDynamicPolicy
summary: 'Patch an existing Dynamic Policy resource'
requestBody:
description: 'A JSON patch to a Dynamic Policy resource'
required: true
content:
application/merge-patch+json:
schema:
$ref: '#/components/schemas/DynamicPolicy'
application/json-patch+json:
schema:
$ref: '#/components/schemas/DynamicPolicy'
responses:
'200':
description: 'Patched Dynamic Policy'
content:
application/json:
schema:
$ref: '#/components/schemas/DynamicPolicy'
'204':
description: 'Patched Dynamic Policy'
'400':
description: 'Bad Request'
'401':
description: 'Unauthorized'
'404':
description: 'Not found'
delete:
operationId: destroyDynamicPolicy
summary: 'Destroy an existing Dynamic Policy resource'
responses:
'204':
description: 'Destroyed Dynamic Policy'
'400':
description: 'Bad Request'
'401':
description: 'Unauthorized'
'404':
description: 'Not Found'
components:
schemas:
DynamicPolicy:
description: "A representation of a Dynamic Policy resource."
type: object
required:
- dynamicPolicyId
- policyTemplateId
- serviceDataFlowDescriptions
- provisioningSessionId
properties:
dynamicPolicyId:
readOnly: true
allOf:
- $ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
policyTemplateId:
$ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
serviceDataFlowDescriptions:
type: array
items:
$ref: 'TS26512_CommonData.yaml#/components/schemas/ServiceDataFlowDescription'
mediaType:
$ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/MediaType'
provisioningSessionId:
$ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
qosSpecification:
$ref: 'TS26512_CommonData.yaml#/components/schemas/M5QoSSpecification'
enforcementMethod:
type: string
enforcementBitRate:
type: integer
16 changes: 8 additions & 8 deletions src/5gmsaf/app.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
License: 5G-MAG Public License (v1.0)
Author: Dev Audsin
Copyright: (C) 2022 British Broadcasting Corporation
For full license terms please see the LICENSE file distributed with this
program. If this file is missing then the license can be retrieved from
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
*/
* License: 5G-MAG Public License (v1.0)
* Author: Dev Audsin <[email protected]>
* Copyright: (C) 2022 British Broadcasting Corporation
*
* For full license terms please see the LICENSE file distributed with this
* program. If this file is missing then the license can be retrieved from
* https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
*/

#include "ogs-app.h"

Expand Down
33 changes: 17 additions & 16 deletions src/5gmsaf/application-server-context.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
License: 5G-MAG Public License (v1.0)
Author: Dev Audsin
Copyright: (C) 2022 British Broadcasting Corporation
For full license terms please see the LICENSE file distributed with this
program. If this file is missing then the license can be retrieved from
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
*/
* License: 5G-MAG Public License (v1.0)
* Authors: Dev Audsin <[email protected]>
* David Waring <[email protected]>
* Copyright: (C) 2022-2024 British Broadcasting Corporation
*
* For full license terms please see the LICENSE file distributed with this
* program. If this file is missing then the license can be retrieved from
* https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
*/

#include "ogs-core.h"
#include "ogs-sbi.h"
Expand Down Expand Up @@ -48,7 +49,7 @@ msaf_application_server_state_set_on_post( msaf_provisioning_session_t *provisio

msaf_as = ogs_list_first(&msaf_self()->config.applicationServers_list);
ogs_assert(msaf_as);
ogs_list_for_each(&msaf_self()->application_server_states, as_state){
ogs_list_for_each(&msaf_self()->application_server_states, as_state) {
if (as_state->application_server == msaf_as) {
msaf_application_server_state_ref_node_t *as_state_ref;

Expand Down Expand Up @@ -90,7 +91,7 @@ msaf_application_server_state_update( msaf_provisioning_session_t *provisioning_
{
msaf_application_server_state_ref_node_t *as_state_ref;

ogs_list_for_each(&provisioning_session->application_server_states, as_state_ref){
ogs_list_for_each(&provisioning_session->application_server_states, as_state_ref) {
resource_id_node_t *chc;
msaf_application_server_state_node_t *as_state = as_state_ref->as_state;
ogs_list_t *certs = msaf_retrieve_certificates_from_map(provisioning_session);
Expand Down Expand Up @@ -188,11 +189,11 @@ msaf_application_server_add(char *canonical_hostname, char *url_path_prefix_form

void msaf_application_server_state_log(ogs_list_t *list, const char* list_name) {
resource_id_node_t *state_node;
if(!list || (ogs_list_count(list) == 0)){
if (!list || (ogs_list_count(list) == 0)) {
ogs_debug("%s is empty",list_name);
} else{
int i = 1;
ogs_list_for_each(list, state_node){
ogs_list_for_each(list, state_node) {
ogs_debug("%s[%d]: %s\n", list_name, i, state_node->state);
i++;
}
Expand Down Expand Up @@ -274,26 +275,26 @@ void next_action_for_application_server(msaf_application_server_state_node_t *as
cJSON_Delete(json);
cJSON_free(data);

} else if (ogs_list_first(&as_state->delete_content_hosting_configurations) != NULL) {
} else if (ogs_list_first(&as_state->delete_content_hosting_configurations) != NULL) {
char *component;
resource_id_node_t *delete_chc = ogs_list_first(&as_state->delete_content_hosting_configurations);
ogs_debug("M3 client: Sending DELETE method for Content Hosting Configuration [%s] to the Application Server [%s]", delete_chc->state, as_state->application_server->canonicalHostname);
component = ogs_msprintf("content-hosting-configurations/%s", delete_chc->state);
m3_client_as_state_requests(as_state, NULL, NULL, NULL, (char *)OGS_SBI_HTTP_METHOD_DELETE, component);
ogs_free(component);
} else if (ogs_list_first(&as_state->delete_certificates) != NULL) {
} else if (ogs_list_first(&as_state->delete_certificates) != NULL) {
char *component;
resource_id_node_t *delete_cert = ogs_list_first(&as_state->delete_certificates);
ogs_debug("M3 client: Sending DELETE method for certificate [%s] to the Application Server [%s]", delete_cert->state, as_state->application_server->canonicalHostname);
component = ogs_msprintf("certificates/%s", delete_cert->state);
m3_client_as_state_requests(as_state, NULL, NULL, NULL, (char *)OGS_SBI_HTTP_METHOD_DELETE, component);
ogs_free(component);
} else if(ogs_list_first(&as_state->purge_content_hosting_cache) != NULL){
} else if (ogs_list_first(&as_state->purge_content_hosting_cache) != NULL) {
purge_resource_id_node_t *purge_chc = ogs_list_first(&as_state->purge_content_hosting_cache);
ogs_assert(purge_chc);
ogs_assert(purge_chc->provisioning_session_id);
char *component = ogs_msprintf("content-hosting-configurations/%s/purge", purge_chc->provisioning_session_id);
if(purge_chc->purge_regex) {
if (purge_chc->purge_regex) {
ogs_debug("M3 client: Sending cache purge operation for resource [%s] to the Application Server", purge_chc->provisioning_session_id);
m3_client_as_state_requests(as_state, purge_chc, "application/x-www-form-urlencoded", purge_chc->purge_regex, OGS_SBI_HTTP_METHOD_POST, component);
} else {
Expand Down
Loading

0 comments on commit 6238717

Please sign in to comment.