---
title: Install E2 simulator logs
image:
---
:::warning
# <center><i class="fa fa-cog fa-spin fa-1x fa-fw"></i> Install E2 simulator logs </center>
:::
###### tags: `study` `E2 simulator`
:::success
**🎯 Goals:**
- [x] - <a href="#2-Building-docker-image-and-running"> Install</a>
- [ ] - <a href="#3-Problems"> Solve the problem</a>
- [x] **First**. installFollow the steps of [/SIM/E2+Simulator](https://wiki.o-ran-sc.org/display/SIM/E2+Simulator) to install & run by **docker**
- [x] [works fine](#272-View-docker-container-status)
- [x] [The result is correct](#273-View-docker-container-Logs)
- [x] **Second**. Follow the steps of [/SIM/E2+Simulator](https://wiki.o-ran-sc.org/display/SIM/E2+Simulator) to install & run by **Helm**
- [ ] [works fine - <span style="color:red">Can't work](#28-Start-the-helm-chart-)
</span>
- [ ] The result is correct
- [x] **Third**. Follow the steps of [RIC benchmarking Note](@Min-xiang/Skj7hGYyF#2-Install-E2SIM) to install
- [x] [works fine](#43-Check-the-pod-of-the-e2sim:)
- [ ] [The result is correct - <span style="color:red">Seems incomplete
</span>](#444-Summarize)
- [ ] Deploy the bouncer xApp
- [x] Fourth. Follow the steps of [/SIM/Near-RT+RIC+Deployment](https://wiki.o-ran-sc.org/display/SIM/Near-RT+RIC+Deployment) to install
- [x] [works fine](#54-Check-Container-Status)
- [x] [The result is correct](#55-Check-Container-Logs)
<!-- - [ ] - <a href="">Summary </a> -->
:::
:::info
:bookmark: **Reference:**
- [Wiki O-RAN - E2 Simulator](https://wiki.o-ran-sc.org/display/SIM/E2+Simulator)
- [Near-RT RIC Deployment - E2 Simulator deployment steps](https://wiki.o-ran-sc.org/display/SIM/Near-RT+RIC+Deployment#:~:text=example_recipe.yaml-,E2%20Simulator%20deployment%20steps,-1)
- [RIC benchmarking - Installing E2Sim(E2-interface)](https://wiki.o-ran-sc.org/display/RICP/RIC+benchmarking#:~:text=Installing%20E2Sim(E2%2Dinterface)%3A)
- [Source summary](https://gerrit.o-ran-sc.org/r/gitweb?p=sim/e2-interface.git;a=summary)
- [Install README.md](https://gerrit.o-ran-sc.org/r/gitweb?p=sim/e2-interface.git;a=blob;f=e2sim/README.md;h=fd995835490d6c7af38fd8faf2904641c971852b;hb=0eae7e61338d6bf71f01eb4356048525e9bc094e)
- [[video] Install platform & E2 simulator](https://wiki.o-ran-sc.org/display/RICP/2022-05-24+Release+F?preview=/51904936/53870824/demo_f_release_1680x1050.mp4)
---
- [Senior Notes - Demo of RIC benchmarking](/@Min-xiang/Skj7hGYyF)
- [My install cmd LOGs](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/EZU1GxwjiixMv8xOO2nNa5wBssARw9sUq7gCALJOZU9ZSw?e=q7034U)
- [My reinstall logs](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/ERW-R4mQ9UpGisMsI40cOUQB-NAsfWOwrhrSGKeFqBejAg?e=5L6fgy)
- [My Install E2SIM logs (in RIC benchmarking)](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/EawEEBLSLmhBoV7727M-OEgBTLGB7MrCi8iJVO1vp1LDmw?e=9SOneU)
- [My Install E2SIM logs (in E2 Simulator deployment steps )](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/EXxgh726S0ZBrPM3D_Iv98wBS9eZpNJntgdjG5u6UZ2jUg?e=6J40eY)
:::
[toc]
# 1. E2 Simulator Usage:
- How to configure E2Sim to initiate the connection towards E2Term(nRT-RIC)
- The E2 Simulator breaks up the simulation roles into two:
1. Base E2AP support (is the role supported by E2 Simulator library)
2. E2SM Support (is supported by the calling application)

## 1.1 Flow:
1. Upon startup, Simulator generates E2 Setup Request
For each E2SM that is registered, include RAN function definition
2. Upon receiving incoming requests, decode
Identify RAN function ID
Call appropriate callback function for RAN function ID and request type
Provide entire encoded request
If no callback is provided, we return an error response
3. Upon receiving responses, decode:
Identify RAN function ID
If a callback is registered for this message type, call it based on RAN function ID and request type
Provide entire encoded response
If no callback is registered, no action is taken
## 1.2 E2SM
E2 Simulator enables a specific E2SM to be supported by the calling application in
the following way:
* E2SM must be registered by the calling application
* E2SM-specific code uses callbacks to handle interaction from xApp
* E2SM-specific code must continuously implement simulation logic
Registration of an E2SM with the E2 Simulator entails the following:
* RAN function definition
* Callback functions for any of the following:
Subscription
Control
Any Responses
## 1.3 E2SM Callback Functions:
* Callback functions are responsible for sending responses
* They may also need to set up ongoing simulation messaging
REPORT Service sends back periodic Indication messages containing REPORT
INSERT Service sends back periodic Indication messages containing INSERT
* They may need to associate incoming messages with existing service invocation
Modify Subscription
CONTROL message associated with INSERT
* Base E2 simulator should not be concerned with these details; only specific E2SM code should be responsible for any messaging
## 1.4 Simulation
For this simulation, we make the following assumptions:
DU ID can differ and we assign a separate ID
CU-CP and CU-UP are always the same
Cell Identities are different
FQI and QFI Values are the same
# 2. Building docker image and running
- [e2sim / README.md](https://gerrit.o-ran-sc.org/r/gitweb?p=sim/e2-interface.git;a=blob;f=e2sim/README.md;h=fd995835490d6c7af38fd8faf2904641c971852b;hb=0eae7e61338d6bf71f01eb4356048525e9bc094e)
- Git
```cmd=
git clone https://gerrit.o-ran-sc.org/r/sim/e2-interface.git
git clone "https://gerrit.o-ran-sc.org/r/sim/e2-interface"
```
## 2.1. Install dependencies
```cmd=
sudo apt-get update
sudo apt-get install -y
sudo apt-get install build-essential
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install libsctp-dev
sudo apt-get install lksctp-tools
sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libboost-all-dev
```
- [x] build-essential
- [x] git
- [x] cmake
- [x] libsctp-dev
- [x] lksctp-tools
- [x] autoconf
- [x] automake
- [x] libtool
- [x] bison
- [x] flex
- [x] libboost-all-dev
```cmd=
sudo apt-get clean
```
## 2.2. Build the official e2sim
```cmd=
cd ~/e2-interface/e2sim/
mkdir build
cd build
cmake ..
make package
cmake .. -DDEV_PKG=1
make package
```
## 2.3. Generate .deb packages and move it
- On plain Ubuntu you might need to install `apt install cmake c++ libsctp-dev`
- To start building docker image one should generate the `.deb` packages using following
- Generate .deb packages and move it to `e2sm_examples/kpm_e2sm` folder :
```cmd=
cmake .. && make package && cmake .. -DDEV_PKG=1 && make package
cp *.deb ../e2sm_examples/kpm_e2sm/
```
## 2.4 Change the e2tern-sctp-alpha address to connect
- if you wish to change the e2t address to connect then modify the `Dockerfile` in `e2sm_examples/kpm_e2sm/` path.
### 2.4.1 View E2term SCTP IP
- **List all**
```cmd=
kubectl get service -n ricplt
```

- **Or list only E2tern**
```cmd=
kubectl get svc -n ricplt | grep -i e2term-sctp
```
<!--  -->
Command return :
```cmd=
root@ric-yuehhuan:~# kubectl get svc -n ricplt | grep -i e2term-sctp
service-ricplt-e2term-sctp-alpha NodePort 10.108.94.138 <none> 36422:32222/SCTP 2d8h
```
:::info
- **Get IP:** 10.108.94.138 36422:32222
:::
---
- **Docker service port:port** [- [useful link]](https://docs.docker.com/config/containers/container-networking/)

---
### 2.4.2 Edit file with address to connect
```cmd=
vim Dockerfile
```
- **Use `Ctrl + F` to flip to the next page**

- **Change text below command:**
```cmd=
CMD kpm_sim 10.108.94.138 36422
```
## 2.5 Ready to build the docker image using below command:
:::warning
- [Here , should first change the information in the Dockerfile (in 2.4)](#24-Change-the-e2tern-sctp-alpha-address-to-connect)
- Come back to build after making changes address
:::
```cmd=
cd ../e2sm_examples/kpm_e2sm/
```
### 2.5.1 Build Image
- `docker build -t <simulator-image-name> .`
:::danger
- **Can't build**
- showMSG:
```cmd=
"docker build" requires exactly 1 argument.
See 'docker build --help'.
```
:::
:::success
- **The dot** at the end of the command is important.
```cmd=
docker build -t e2sim:v1 .
```
- **Format:** `image_name:tag_name`
- [Docker Note Link](/@MingHung/Docker#22-Image)
:::
### <font color="indianred">2.4.2 **Many Error</font>** - [[See also my Install log]](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/EZU1GxwjiixMv8xOO2nNa5wBssARw9sUq7gCALJOZU9ZSw?e=q7034U)
:::danger
- **Error 1:**
```cmd=
debconf: delaying package configuration, since apt-utils is not installed
```
:::success
- **Solutions:**
- [x] install apt-utils
```cmd=
sudo apt-get update -y
sudo apt-get install -y apt-utils
```
:::
<!-- :::danger
- **Error 2:**
```cmd=
+++ debugging is set to off
fatal: not a git repository (or any of the parent directories): .git
+++ profiling is off
```
:::success
[- **Solution in 3.1.1**](#311-Try-to-rebuild-Docker-Image)
::: -->
:::success
- **But at the end it shows a success message:**
Successfully built d69e0d79d6b9
Successfully tagged e2sim:v1
- **So I move on to the next step**
:::
## 2.6 Run docker container
### 2.6.1 `docker run <simulator-image-name>`
```cmd=
docker run e2sim:v1
```
>I named it `e2sim:v1` myself [color=pink]
## 2.7 Successfully run the container
### 2.7.2 **View docker container status**
```cmd=
docker ps -a
```
- **Command response :**
<!--  -->
```cmd=
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e9e1a1c724c1 e2sim:v1 "/bin/sh -c 'kpm_sim…" About a minute ago Up About a minute condescending_kilby
```
### 2.7.2 It seems that there is no successful connection with E2tern
- [Something wrong in 3.1 Problem](#31-✅-solved-Connection-timed-out)
### 2.7.3 **View docker container Logs**
```cmd=
docker logs <CONTAINER ID>
```
- **The last few lines show the screen:**
```cmd=
</E2setupResponse>
</value>
</successfulOutcome>
</E2AP-PDU>
receive data1
receive data2
```
## 2.8 Start the helm chart :
### 2.8.1 install helm
```cmd=
helm install e2sim ./helm -n ricplt
```
:::danger
- Error: unable to build kubernetes objects from release manifest:
error validating "": error validating data: ValidationError(Deployment.spec.template.spec.containers[0]):
unknown field "restartPolicy" in io.k8s.api.core.v1.Container
- [Question in 3.3 problem (✅ solved)](#33-✅-solved-Why-is-there-no-content-in-OSC’s-valuesyaml-git-source)
:::
# 3. Problems
<!-- ❓ ✅ -->
## 3.1 ✅ (solved) Connection timed out
:::danger
**Error Messege :**
- **[SCTP] Connecting to server at 10.110.102.29:36422 ...**
- 
:::
:::success
- **The file should be modified before [Build in 2.5](#25-Ready-to-build-the-docker-image-using-below-command)**
:::
### 3.1.1 Try to rebuild Docker Image
:::info
**In conclusion :**
- After deleting and reinstalling this time, I followed the steps of ==++[/SIM/E2+Simulator](https://wiki.o-ran-sc.org/display/SIM/E2+Simulator#:~:text=specified%20e2t%20instance.-,Building%20docker%20image%20and%20running%20simulator%20instance%20as%20helm%20chart,-o%20start%20building)++== to install by running simulator instance **as helm chart**.
- I thus found the cause of the [3.1 problem](#31-✅-solved-Connection-timed-out)
- but no other issues
:::
:::warning
**Why I do it :**
- Because I think it may be because of [a lot of Errors in 2.4.2](#242-Many-Error)
- And problem with 3.1 occurred
- Also and I don't know why I [can't use Helm install](#281-install-helm)
:::
- [x] Install apt-utils
- [x] kill Container
- [x] Delete Image
- [x] Delete source code
- [x] Re-Git source code
:::success
- Need vim Dockerfile First and then to **build**
:::
- [x] reBuild Docker Image
```cmd=
cd ../e2sm_examples/kpm_e2sm/
docker build -t e2simul:0.0.2 .
```
:::danger
- **Lots of Error, too** - [[See also my reInstall log]](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/ERW-R4mQ9UpGisMsI40cOUQB-NAsfWOwrhrSGKeFqBejAg?e=5L6fgy)
```cmd=
Cloning into 'nlohmann_json_release'...
```
```cmd=
+++ debugging is set to off
fatal: not a git repository (or any of the parent directories): .git
+++ profiling is off
```
```cmd=
Scanning dependencies of target kpm_sim
[ 99%] Building CXX object src/kpm/CMakeFiles/kpm_sim.dir/kpm_callbacks.cpp.o
/playpen/src/src/kpm/kpm_callbacks.cpp: In function 'int main(int, char**)':
/playpen/src/src/kpm/kpm_callbacks.cpp:93:50: warning: format '%d' expects argument of type 'int', but argument 3 has type 'ssize_t {aka long int}' [-Wformat=]
fprintf(stderr, "er encded is %d\n", er.encoded);
~~~~~~~~~~^
```
There are many more error messages in between...
```cmd=
[100%] Linking CXX executable kpm_sim
[100%] Built target kpm_sim
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/kpm_sim
Removing intermediate container 011033f2dd24
---> ce7155650f2c
Step 17/17 : CMD kpm_sim 10.108.94.138 36422
---> Running in 1c469e5f8de3
Removing intermediate container 1c469e5f8de3
---> 4ba8515276ba
Successfully built 4ba8515276ba
Successfully tagged e2simul:0.0.2
```
:::
- [x] reRun Docker Image
```cmd=
docker run e2simul:0.0.2
```
> container ID: `999ca173753d`
- **The last few lines show the screen:** - [[See also my reInstall log (near the bottom)]](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/ERW-R4mQ9UpGisMsI40cOUQB-NAsfWOwrhrSGKeFqBejAg?e=5L6fgy)
```cmd=
</RIC-ReportStyle-List>
</ric-ReportStyle-List>
</e2SM-KPM-RANfunction-Item>
</E2SM-KPM-RANfunction-Description>
er encded is 489
after encoding message
here is encoded message ORAN-E2SM-KPM
%%about to register callback for subscription for func_id 0
<E2AP-PDU>
<initiatingMessage>
```
```cmd=
</E2AP-PDU>
er encded is 581
in sctp send data func
data.len is 581after getting sent_len
receive data1
receive data2
receive data3
in e2ap_handle_sctp_data()
decoding...
full buffer
length of data 60
result 0
index is 2
showing xer of data
<E2AP-PDU>
```
```cmd=
</E2setupResponse>
</value>
</successfulOutcome>
</E2AP-PDU>
receive data1
receive data2
```
- This screen can also be reproduced by viewing the logs
```cmd=
docker ps -a
docker logs -f --until=2s <CONTAINER ID>
```
- [x] Check container status
```cmd=
root@ric-yuehhuan:~# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c45e463b27bd e2simul:0.0.2 "/bin/sh -c 'kpm_sim…" 10 hours ago Up 10 hours interesting_easley
```
:::danger
- **It's not the same as the logs of the [senior's E2sim](/@Min-xiang/Skj7hGYyF#42-Logs-of-E2SIM)**
- **Problem in [3.2❓](#32-❓-E2sim-container-cannot-successfully-the-execution)**
:::
- [ ] Start the helm chart:
```cmd=
cd ~/e2-interface/e2sim/e2sm_examples/kpm_e2sm
helm install e2sim ./helm -n ricplt
helm install OSCe2sim ./helm -n ricplt
```
:::danger
- **The same error occurs as above [2.8.1Install helm](#281-install-helm)**
- Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Deployment.spec.template.spec.containers[0]): unknown field "restartPolicy" in io.k8s.api.core.v1.Container
:::
## 3.2 ❓ E2sim container cannot successfully the execution
- Although the Container can be run
- But it has been running continuously for more than 10 hours
- Still can't finish execution
- **To this :**
```cmd=
</E2setupResponse>
</value>
</successfulOutcome>
</E2AP-PDU>
receive data1
receive data2
```
## 3.3 ✅ (solved) <br> Why is there no content in OSC's values.yaml git source
:::danger
- **There is no content in values.yaml** - [[direct link]](https://gerrit.o-ran-sc.org/r/gitweb?p=sim/e2-interface.git;a=blob;f=e2sim/e2sm_examples/kpm_e2sm/helm/values.yaml;h=da0d3201c7f43f7530e32f4e78de7dc1dd2240f2;hb=refs/heads/master)
- 
- So I think that's why I can't install Helm [in 2.8.1 install helm](#281-install-helm)
:::
:::success
**Answer (Solution):**
- Because Helm subordinates in benchmarking **use parameters**, values need to be filled in with data.
- In OSC E2sim, the file Helm deployment method has ==already filled in== the data, instead of using variables, so the data in the **values.yaml is empty**.
- **benchmarking's deployment.yaml**

- **OSC sim/e2-interface.git 's deployment.yaml**

:::
# 4. Follow Senior's RIC Benchmark Steps
- [Senior Notes - Demo of RIC benchmarking](/@Min-xiang/Skj7hGYyF)
## 4.1 The previous steps were successfully followed
## 4.2 Helm install:
:::danger
- Error MSG
```cmd=
root@ric-yuehhuan:~/test/ric_benchmarking/e2-interface/e2sim/e2sm_examples/kpm_e2sm/helm# helm install -n e2sim . --namespace ricplt
Error: must either provide a name or specify --generate-name
```
:::
:::success
- **Solution:** -[[From stackoverflow](https://stackoverflow.com/questions/57322873/how-to-fix-error-must-either-provide-a-name-or-specify-generate-name-in-he#:~:text=just%20to%20add%20%2D%2Dgenerate%2Dname%20at%20the%20end%20of%20helm%20command)]
 **just to add `--generate-name` at the end of helm command**
:::
- Re
```cmd=
root@ric-yuehhuan:~/test/ric_benchmarking/e2-interface/e2sim/e2sm_examples/kpm_e2sm/helm# helm install -n e2sim . --namespace ricplt --generate-name
NAME: chart-1658044648
LAST DEPLOYED: Sun Jul 17 07:57:28 2022
NAMESPACE: ricplt
STATUS: deployed
REVISION: 1
TEST SUITE: None
```
## 4.3 Check the pod of the e2sim:
- **Finish install E2 simulator**
```cmd=
kubectl get pod -n ricplt
```
- 
## 4.4 Logs of E2SIM <br>- [[My Install E2SIM logs (in RIC benchmarking)]](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/EawEEBLSLmhBoV7727M-OEgBTLGB7MrCi8iJVO1vp1LDmw?e=9SOneU)
### 4.4.1 Get all namespace & pod name
```cmd=
kubectl get pod -A
```
> `namespace` : ricplt
> `pod name` : e2sim-5bf8b8d995-5ssbt
### 4.4.2 Get logs
```cmd=
kubectl logs -f -n ricplt e2sim-5bf8b8d995-5ssbt
kubectl logs e2sim-5bf8b8d995-5ssbt -n ricplt --follow
```
:::danger
**The logs must show the entries in the end as below:**
```cmd=
[E2AP] Unpacked E2AP-PDU: index = 2, procedureCode = 1
[E2AP] Received SETUP-RESPONSE-SUCCESS
```
This means the E2Sim(RAN) has connected to E2term pod of RIC Platform successfully, and its ready to communicate with xApp. So keep it as it is. and run the Bouncer xApp.
- **but I can't find them**
:::
### 4.4.3 Get describe pod
```cmd=
kubectl describe pod -n ricplt e2sim-5bf8b8d995-5ssbt
```
- **Just stop here**
```cmd=
</E2setupRequestIEs>
</protocolIEs>
</E2setupRequest>
</value>
</initiatingMessage>
</E2AP-PDU>
er encded is 509
```
:::danger
- **Seems incomplete**
After comparing with the Logs recorded [in the senior's notes](/@Min-xiang/Skj7hGYyF#42-Logs-of-E2SIM), I feel that the output results are not complete
:::
### 4.4.4 Summarize
:::success
- I rummaged through [the back of the senior's notes](/@MingHung/StudyBook/%2F%40Min-xiang%2FSkj7hGYyF#Record-of-Bug-amp-Solution) and found that my situation was the same as what was described in the notes, which was caused by my **++failure to communicate with xApp.++**
- **Because I have not installed xApp, I think the correctness of the current E2sim installation can only be verified here**
:::
# 5. Follow E2 Simulator deployment steps
- [In Near-RT RIC Deployment](https://wiki.o-ran-sc.org/display/SIM/Near-RT+RIC+Deployment)
## 5.1 Build source and prepare cmake file
```cmd=
git clone "https://gerrit.o-ran-sc.org/r/sim/e2-interface"
sudo apt-get install -y cmake build-essential libsctp-dev autoconf automake libtool bison flex libboost-all-dev
cd e2-interface/e2sim
mkdir build
cd build
cmake .. && make package && cmake .. -DDEV_PKG=1 && make package
cp *.deb ../e2sm_examples/kpm_e2sm/
```
- YAML
```cmd=
################################################################################
# Copyright 2022 highstreet technologies GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
version: '3.8'
services:
e2-simulator:
image: "o-ran-sc/ntsim-e2-simulator:2.0.0"
build:
context: ~/e2-interface/e2sim/e2sm_examples/kpm_e2sm
container_name: e2-simulator
entrypoint: ["kpm_sim", "10.0.10.205", "32222"]
```
- script (shell file)
```cmd=
#!/bin/bash
NODE_IP=$(kubectl get pod -n=ricplt -l app=ricplt-e2term-alpha -o jsonpath="{.items[0].status.hostIP}")
NODE_PORT=$(kubectl get svc -n=ricplt service-ricplt-e2term-sctp-alpha -o jsonpath="{.spec.ports[0].nodePort}")
echo "E2 term IP address: ${NODE_IP}"
echo "E2 term port: ${NODE_PORT}"
```
## 5.2 Run the script to get E2tern IP
```cmd=
chmod +x e2sim-infra.sh
./e2sim-infra.sh
```
- Get responce
```cmd=
root@ric-yuehhuan:~/e2-sim# ./e2sim-infra.sh
E2 term IP address: 10.0.10.205
E2 term port: 32222
```
## 5.3 Run Main Command
```cmd=
cd ~
mkdir e2-sim
cd e2-sim
nano e2sim-infra.sh
# copy above script for getting the IP and Port of the E2 termination point
# run the script and use the IP and port in the following docker-compose
nano docker-compose.yml
# copy above YAML into this file
# replace the entrypoint IP and port with the above IP and port
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-compose-plugin
sudo docker compose build
sudo docker compose up -d
```
- **Command response**
```cmd=
[+] Running 0/1
⠿ e2-simulator Error 3.3s
[+] Building 218.4s (18/18) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 3.14kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for nexus3.o-ran-sc.org:10001/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 0.0s
=> [ 1/13] FROM nexus3.o-ran-sc.org:10001/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 0.1s
=> [internal] load build context 0.1s
=> => transferring context: 4.95MB 0.1s
=> [ 2/13] RUN mkdir -p /playpen/assets /playpen/src /playpen/bin 0.3s
=> [ 3/13] WORKDIR /playpen 0.0s
=> [ 4/13] RUN apt-get update && apt-get install -y build-essential git cmake libsctp-dev lksctp-tools autoconf automake libtool bison flex libboost-all-dev iputils-ping net-tools nano vim tcpdump net-tools 197.2s
=> [ 5/13] COPY e2sim_1.0.0_amd64.deb /playpen 0.0s
=> [ 6/13] COPY e2sim-dev_1.0.0_amd64.deb /playpen 0.0s
=> [ 7/13] RUN dpkg -i e2sim_1.0.0_amd64.deb e2sim-dev_1.0.0_amd64.deb 0.4s
=> [ 8/13] RUN mkdir /usr/local/include/nlohmann 0.3s
=> [ 9/13] RUN git clone https://github.com/azadkuh/nlohmann_json_release.git 1.4s
=> [10/13] RUN cp nlohmann_json_release/json.hpp /usr/local/include/nlohmann 0.3s
=> [11/13] COPY . /playpen/src/ 0.1s
=> [12/13] RUN wc -l /playpen/src/reports.json 0.3s
=> [13/13] RUN cd /playpen/src && rm -fr .build && mkdir .build && cd .build && cmake .. && make install 14.5s
=> exporting to image 3.4s
=> => exporting layers 3.4s
=> => writing image sha256:0233359713b757b26d0afb07a9d48b78f373c0c6ecb6c7e4f9b9ad1142e24861 0.0s
=> => naming to docker.io/o-ran-sc/ntsim-e2-simulator:2.0.0 0.0s
[+] Running 2/2
⠿ Network e2-sim_default Created 0.0s
⠿ Container e2-simulator Started 0.4s
```
## 5.4 Check Container Status
:::success
- **Does find a working Container**
```cmd=
root@ric-yuehhuan:~/e2-sim# docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
51c48af9e9e9 o-ran-sc/ntsim-e2-simulator:2.0.0 "kpm_sim 10.0.10.205…" 8 minutes ago Up 8 minutes e2-simulator
```
:::
## 5.5 Check Container Logs
> `CONTAINER ID` : 51c48af9e9e9
- **The last few lines show the screen:** - [[See also my log (near the bottom)]](https://mailntustedutw-my.sharepoint.com/:t:/g/personal/b10902214_ms_ntust_edu_tw/EXxgh726S0ZBrPM3D_Iv98wBS9eZpNJntgdjG5u6UZ2jUg?e=6J40eY)
```cmd=
</value>
</E2setupResponseIEs>
</protocolIEs>
</E2setupResponse>
</value>
</successfulOutcome>
</E2AP-PDU>
receive data1
receive data2
```
<!-- # Summarize -->
# 6. Additional:
## 6.1 Remove file in Linux
- **Command in linux:** ==delete selected folder== (contains all directories and files)
```cmd=
rm -rf <folder name>
```
## 6.2 Run shell file
- [useful link](https://www.cyberciti.biz/faq/run-execute-sh-shell-script/)
```cmd=
nano script-name-here.sh
chmod +x script-name-here.sh
./script-name-here.sh
#or
sh script-name-here.sh
```
----
<!-- >**Name**: `名稱` -->
<style>
/* 僅指定連結的圖片去背且靠右模擬置中 */
img[src^="https"]{
/* position: relative;
left: 17%; */
background-color: #fff0;
}
.title {
color: #009933;
font-weight:bold;
}
.highlight {
color: #ff4d4d;
font-weight:bold;
border-bottom:2px red solid; padding-bottom:2px;
}
</style>
<!-- <font class="highlight"> -->
<!-- <font class="title"> -->
<!-- 縮寫提示 -->
<!-- *[O-RAN]:Open Radio Access Network -->