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
|
# A1-PE-Simulator
A1-PE-Simulator (a1-pe-sim) is this is a Java SpringBoot application.
This application contains docker image with shared docker volume to store the configuration.
## Build package
Following mvn command in the current directory will build a1-pe-simulator package:
`mvn clean install`
### Artifacts
After build process described above, **/target** directory should contain:
- oran-sim-cba.zip - enriched CBA package for a1-pe-sim
- oran-sim-helm.tar.gz - helm chart for a1-pe-sim
- oran-sim-csar.zip - ONAP package with embedded the *cba* and *helm chart* for a1-pe-sim and can be used to onboard CNF to ONAP
## Docker image
The a1-pe-sim is stored in dedicated repo: https://gerrit.onap.org/r/admin/repos/integration/usecases/A1-policy-enforcement-r-apps
To create docker image pull and build this repository:
```
git clone "https://gerrit.onap.org/r/integration/simulators/A1-policy-enforcement-simulator"
cd A1-policy-enforcement-simulator
mvn clean install
```
After building you should find following docker image from local repository:
```
user@machine:~/A1-policy-enforcement-simulator$ docker images | grep sim
onap/integration/simulators/a1-pe-simulator latest 171e5843928d 41 seconds ago 187MB
```
## Run as docker
To run built docker images use `docker-compose up -d` in docker directory. You can stop it later with `docker-compose down -v` or without `-v` if you want to preserve shared volume (most likely, you don't).
## Test A1-PE-Simulator
### Manual test
Simulator part can be manually tested to be working e.g. by using curl request.
1. Get the configured cells (in *configuration/cells.json*):
curl --location --request GET 'http://localhost:9998/v1/ran/cells/'
Example response:
```json
{
"cells": [
{
"id": "Cell1",
"latitude": 50.11,
"longitude": 19.98,
"connectedUserEquipments": [
"emergency_samsung_s10_01"
],
"currentState": {
"value": "INACTIVE"
}
},
{
"id": "Cell2",
"latitude": 50.06,
"longitude": 20.03,
"connectedUserEquipments": [],
"currentState": {
"value": "INACTIVE"
}
},
{
"id": "Cell3",
"latitude": 50.06,
"longitude": 19.94,
"connectedUserEquipments": [
"emergency_police_01",
"mobile_samsung_s20_02"
],
"currentState": {
"value": "INACTIVE"
}
},
{
"id": "Cell4",
"latitude": 50.11,
"longitude": 19.88,
"connectedUserEquipments": [],
"currentState": {
"value": "INACTIVE"
}
},
{
"id": "Cell5",
"latitude": 50.01,
"longitude": 19.99,
"connectedUserEquipments": [],
"currentState": {
"value": "INACTIVE"
}
}
],
"itemsLength": 5
}
```
2. Get the configured user equipments (in *configuration/ue.json*):
curl --location --request GET 'http://localhost:9998/v1/ran/ues/'
Example response:
```json
{
"ues": [
{
"id": "emergency_police_01",
"latitude": 50.035,
"longitude": 19.97,
"cellId": "Cell3",
"cellsInRange": [
"Cell3",
"Cell5"
]
},
{
"id": "mobile_samsung_s20_02",
"latitude": 50.05,
"longitude": 19.95,
"cellId": "Cell3",
"cellsInRange": [
"Cell3"
]
},
{
"id": "emergency_samsung_s10_01",
"latitude": 50.09,
"longitude": 19.94,
"cellId": "Cell1",
"cellsInRange": [
"Cell1",
"Cell3",
"Cell4"
]
}
],
"itemsLength": 3
}
```
3. Start sending events (based on the configuration in *configuration/vnf.config* directory). Also in *vnf.config* file, replace the vesHost=vesconsumer, vesPort=30417 with real values.
curl --location --request POST 'http://localhost:9998/v1/ran/cells/Cell1/start'
Success response:
```
VES Event sending started
```
Check A1-PE-Simulator container logs by executing command:
```shell script
docker exec -it a1-pe-simulator tail -f log/a1-pe-simulator/application/metrics-2021-04-28.0.log
```
Example logs:
```
2021-04-28T08:47:14.758+00:00|NULL|INFO :o.o.a.service.ves.RanVesSender:send:66: Sending following VES event: {
"event" : {
"commonEventHeader" : {
"version" : "4.0.1",
"vesEventListenerVersion" : "7.0.1",
"sourceId" : "de305d54-75b4-431b-adb2-eb6b9e546014",
"reportingEntityName" : "ibcx0001vm002oam001",
"startEpochMicrosec" : 1619599800000000,
"eventId" : "measurement0000259",
"lastEpochMicrosec" : 1619599634754559,
"priority" : "Normal",
"sequence" : 3,
"sourceName" : "ibcx0001vm002ssc001",
"domain" : "measurement",
"eventName" : "Measurement_vIsbcMmc",
"reportingEntityId" : "cc305d54-75b4-431b-adb2-eb6b9e541234",
"nfcNamingCode" : "ssc",
"nfNamingCode" : "ibcx"
},
"measurementFields" : {
"measurementInterval" : 5,
"measurementFieldsVersion" : "4.0",
"additionalMeasurements" : [ {
"name" : "latency",
"hashMap" : {
"value" : "80"
}
}, {
"name" : "throughput",
"hashMap" : {
"value" : "60"
}
}, {
"name" : "identifier",
"hashMap" : {
"value" : "Cell1"
}
}, {
"name" : "trafficModel",
"hashMap" : {
"emergency_samsung_s10_01" : "33"
}
} ]
}
```
|