summaryrefslogtreecommitdiffstats
path: root/sleepingcelldetector/README.md
blob: b91c15a7d4ed06566b29971bcfc5db336d9766f2 (plain)
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
# SleepingCellDetector R-APP

SleepingCellDetector R-APP is a Java SpringBoot application for reading Aggregated PM Metrics from DataCollector R-APP
and make sleeping cell prediction based on PM data

## Use of SleepingCellDetector R-APP

SleepingCellDetector R-APP needs several parameters to be defined before start.

TCA Algorithm configuration situated in `resources/tca.json` file, example:

```json
[
  {
    "name": "latency",
    "condition": "MORE_OR_EQUAL",
    "averageThresholdValue": 400,
    "latestThresholdValue": 150,
    "latestSize": 2
  },
  {
    "name": "throughput",
    "condition": "LESS_OR_EQUAL",
    "averageThresholdValue": 10,
    "latestThresholdValue": 10,
    "latestSize": 2
  }
]
```

File contains information about names of performance measurement parameters, conditions and values of thresholds for
them.
`"averageThresholdValue"`- is a threshold of performance signal average
`"latestThresholdValue"` - is a threshold of last slots of performance signal (number defined in "
latestThresholdValue"). Needed to detect correction of performance signal. Conditions available: "LESS", "LESS_OR_EQUAL"
, "EQUAL", "MORE_OR_EQUAL", "MORE"'

Actually DataCollector R-APP returns Aggregated Metrics of "latency" and "throughput" parameters, example:

```json
{
  "pm": [
    {
      "cellId": "Cell1",
      "performance": [
        {
          "latency": 50,
          "throughput": 80
        },
        {
          "latency": 50,
          "throughput": 80
        },
        {
          "latency": 50,
          "throughput": 80
        }
      ]
    }
  ],
  "itemsLength": 1
}
```

Set parameters of environment variables:

A1PolicyManagementService URL can be set using environment variables:

- A1\_PROTOCOL
- A1\_HOST
- A1\_PORT

To customize DataCollector R-APP connectivity you need to set the following:

- DATACOLLECTOR_PROTOCOL
- DATACOLLECTOR_HOST
- DATACOLLECTOR_PORT
- DATACOLLECTOR_VERSION

SleepingCellDetector R-APP configuration fields:

- SLEEPINGCELLDETECTOR_PREFIX
- SLEEPINGCELLDETECTOR_SLOT
- SLEEPINGCELLDETECTOR_COUNT

Prefix of high priority user equipment (policy instances will be created only for user equipments with this prefix),
example:
`"emergency_"` - policy instances will be created only for UEs with `"emergency_"` prefix Slot of time in seconds,
number of slots for DataCollector R-APP Aggregated Metrics endpoint call. Slot: aggregation period (in seconds) for
which an average performance metrics are calculated Count: number of aggregated performance metrics that should be
returned by the method, one aggregated performance metric per each slot. The first performance metrics is average
metrics for (startTime, startTime +slot). StartTime for DataCollector R-APP Aggregated Metrics endpoint call is
generated based on slot and count parameters as "time.now - slot\*count"

Example configuration in environment variables in application.yml:

```
server:
  port: 8382
a1:
  host: "policy-agent"
  port: 8081
dc:
  host: "localhost"
  port: 8087
  version: "v1"
scd:
  prefix: "emergency"
  slot: 10
  count: 12
logging:
  level:
    org:
      springframework: DEBUG
  logging.file.name: logs/rapp-sleepingcelldetector.log
  pattern:
    console: "%d %-5level %logger : %msg%n"
    file: "%d %-5level [%thread] %logger : %msg%n"
```

During start-up, SleepingCellDetector R-APP registers itself as a service in A1PolicyManagmentService(PMS). After that
SleepingCellDetector R-APP sends periodic keepalive requests to PMS. PMS exposes the Ric Configuration for SleepingCellDetector R-APP.
Ric Configuration contains information about Policy Type and Ric name, example:

```json
[
  {
    "ricName": "ric1",
    "managedElementIds": [
    ],
    "policyTypes": [
      "1000"
    ],
    "state": "AVAILABLE"
  }
]
```

SleepingCellDetector R-APP uses this information with created UUID are used for Policy Instances creation request to
A1PolicyManagementService, example:

`{a1policymanagementservicehost}/policy?id=123e4567-e89b-12d3-a456-426614174000&ric=ric1&service=rapp-sleepingcelldetector&type=1000`

```json
{
  "scope": {
    "ueId": "emergency_samsung_s10_01"
  },
  "resources": [
    {
      "cellIdList": [
        "Cell3"
      ],
      "preference": "AVOID"
    }
  ]
}
```

SleepingCellDetector R-APP creates the policy resources, which are used to traffic steering,
selecting cell for a connection, or scheduling traffic on available cells,
in a different way than what would be done through default behaviour.

Like was presented on the example above, created policy instances provided information
which cells (mention in the array "cellIdList") the User Equipment (define in the section "scope", key "ueId"")
should avoid (section "resources", key "preference").

After start-up SleepingCellDetector R-APP begins to make predictions periodically in intervals defined by CSD_SLOT
period based on new PM metrics measurement data received in each interval.
When sleeping cell is detected, creation of A1 Policy instance is enforced by SleepingCellDetector R-APP.
If cell becomes active again, A1Policy instance deletion request is sent.

# Developer Guide

## Build SleepingCellDetector R-APP

Following mvn command (in the current directory) will build SleepingCellDetector R-APP:

```bash
mvn clean install
```

To build docker image add `-P docker:build` flag.

## Run SleepingCellDetector R-APP

Following command will run SleepingCellDetector R-APP:

```bash
java -jar sleepingcelldetector-0.0.1-SNAPSHOT.jar org.onap.rapp.sleepingcelldetector.SleepingCellDetectorApplication
```

## Logging

The log file will be created in the /log path. Parameters of logging are in application.yml file.
After SleepingCellDetector R-APP starts successfully, log/rapp-sleepingcelldetector.log should start to contain the logs:

```
.
└──log
    └── rapp-sleepingcelldetector.log
```