c11588e28e8c2206e8b32568f725ecd05e8e18c9
[nonrtric/rapp/ransliceassurance.git] / icsversion / README.md
1 # O-RAN-SC Non-RealTime RIC O-DU Closed Loop Usecase Slice Assurance integrated with ICS
2
3 This basic slice assurance usecases use two slices per UE, one default slice and another dedicated slice. The default slice shall not be provisioned with resource quota by the operator where as the dedicated slice shall be provisioned with a resource quota so as to meet it’s slice level throughput requirement. O-DU system shall ensure the dedicated slice will be allocated resources as per the resource quota. O-DU shall monitor the slice performance and provide the slice level performance metrics to SMO. SMO sends this metrics to Non-RT RIC to perform analytic functions and decide to reoptimize the resource quota for the dedicated slice if needed.
4
5 This consumer creates a job of type `Performance_Measurement_Streaming` in the Information Coordinator Service (ICS). This job is associated with Dmaap topic "/events/unauthenticated.VES_O_RAN_SC_HELLO_WORLD_PM_STREAMING_OUTPUT". Messages from this topic contain information regarding throughput in a specific slice. With that information, rApp will check if throughput requirements are fulfilled for the slice and in case is not it sends configuration message to the O-DU through SDNC to reconfigure "radio-resource-management-policy-dedicated-ratio" property.
6
7 ## Configuration
8
9 The consumer takes a number of environment variables, described below, as configuration.
10
11 >- CONSUMER_HOST        **Required**. The host address for this consumer.                          Example: `http://consumer-sa`
12 >- CONSUMER_PORT        **Required**. The port for this consumer.                                  Example: `8095`
13 >- SDNR_ADDR            Optional. The address for SDNR.                                            Defaults to `http://sdnr:3904`.
14 >- SDNR_USER            Optional. The user for the SDNR.                                           Defaults to `admin`.
15 >- SDNR_PASSWORD        Optional. The password for the SDNR user.                                  Defaults to `Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U`.
16 >- INFO_COORD_ADDR      Optional. The address of the Information Coordinator.                      Defaults to `http://enrichmentservice:8083`.
17 >- LOG_LEVEL            Optional. The log level, which can be `Error`, `Warn`, `Info` or `Debug`.  Defaults to `Info`.
18
19 ## Functionality
20
21 The creation of the job is not done when the consumer is started. Instead the consumer provides a REST API where it can be started and stopped, described below. The API is available on the host and port configured for the consumer.
22
23 >- /admin/start  Creates the job in ICS.
24 >- /admin/stop   Deletes the job in ICS.
25
26 If the consumer is shut down with a SIGTERM, it will also delete the job before exiting.
27
28 There is also a status call provided in the REST API. This will return the running status of the consumer as JSON.
29 >- /status  {"status": "started/stopped"}
30
31 ## Development
32
33 To make it easy to test during development of the consumer, two stubs are provided in the `stub` folder.
34
35 Under the `prodSdnc` folder, there is a stub that simulate both received VES messages from Dmaap MR with information about performance measurements for the slices in a DU and also simulates SDNR, that sends information about Radio Resource Management Policy Ratio and allows to modify value for RRM Policy Dedicated Ratio from default to higher value.
36
37 The stub does not start to send messages until it recieves a create job call from the ICS stub. When a delete job call comes from the ICS stub it stops sending messages. To build and start the stub, do the following:
38 >1. cd stub/prodSdnc
39 >2. go build
40 >3. ./prodSdnc
41
42 An ICS stub, under the `ics` folder, that listens for create and delete job calls from the consumer. When it gets a call it calls the producer stub with the correct create or delete call and the provided job ID. By default, it listens to the port `8083`, but his can be overridden by passing a `-port [PORT]` flag when starting the stub. To build and start the stub, do the following:
43 >1. cd stub/ics
44 >2. go build
45 >3. ./ics
46
47 There is also a docker-compose file available that will build both stubs and start application. In order to use it, do the following:
48 docker-compose up
49
50 ## License
51
52 Copyright (C) 2021 Nordix Foundation.
53 Licensed under the Apache License, Version 2.0 (the "License")
54 you may not use this file except in compliance with the License.
55 You may obtain a copy of the License at
56
57       http://www.apache.org/licenses/LICENSE-2.0
58
59 Unless required by applicable law or agreed to in writing, software
60 distributed under the License is distributed on an "AS IS" BASIS,
61 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
62 See the License for the specific language governing permissions and
63 limitations under the License.
64
65 For more information about license please see the [LICENSE](LICENSE.txt) file for details.