# Running NexRAN Demos
These demos run srsLTE in simulated mode with a single UE, allowing you to observe dynamic slice resource reconfiguration effects via a TCP stream. This setup is straightforward and ideal for demonstrating RAN slicing concepts.
## 環境前置 (Environment Prerequisites)
- **Powder Wireless 帳號**: You need an account on the [Powder Wireless platform](https://www.powderwireless.net/) and membership in a project with access to the O-RAN profile.
- **SSH 密鑰**: Ensure your SSH public key is uploaded to the platform for node access.
## 帳號與專案設定 (Account and Project Settings)
1. **註冊帳號**: If you don’t have an account, sign up at the [Powder Wireless website](https://www.powderwireless.net/) [^1].
2. **加入專案**: Log in and join or create a project with permissions to use the O-RAN profile.
3. **上傳 SSH 公鑰**: Upload your SSH public key in your account settings.
## 實驗配置 (Experiment Configuration)
### 1. 實例化 O-RAN Profile
- Navigate to "Experiments" > "Start Experiment" on the Powder platform.
- Select the "O-RAN" profile [^3].
- Follow the prompts to configure and start the experiment.
- Wait for the experiment to be fully provisioned.
### 2. 獲取 Grafana Admin 密碼
- SSH into the control node (typically "node-0").
- List secrets in the grafana namespace:
```
kubectl get secrets -n grafana | grep grafana
```
Example output:
```
mygrafana-grafana Opaque 2 5m
```
- Retrieve and decode the password:
```
kubectl get secret mygrafana-grafana -n grafana -o jsonpath="{.data.admin-password}" | base64 -d && echo
```
- Note the password for use in the next step.
### 3. 訪問 Grafana
- Find the "node-0" hostname from the experiment page.
- Open `http://<node-0-hostname>:3003/d/VKl6zaTVz/nexran` in a browser.
- Log in with username `admin` and the password retrieved above.
- If the direct link fails, click the menu icon, select Dashboards > General > NexRAN to load the dashboard. Initially, graphs may show "No Data" until RAN components are started.
### 4. 啟動 EPC
- SSH into "node-0".
- Run:
```
sudo /local/setup/srslte-ric/build/srsepc/src/srsepc --spgw.sgi_if_addr=192.168.0.1 2>&1 >> /local/logs/srsepc.log &
```
This starts the EPC in the background, logging to `/local/logs/srsepc.log`.
### 5. 啟動 eNodeB
- In the same SSH session, set environment variables:
```
. /local/repository/demo/get-env.sh
```
- Then run:
```
sudo /local/setup/srslte-ric/build/srsenb/src/srsenb \
--enb.n_prb=15 --enb.name=enb1 --enb.enb_id=0x19B --rf.device_name=zmq \
--rf.device_args="fail_on_disconnect=true,id=enb,base_srate=23.04e6,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001" \
--ric.agent.remote_ipv4_addr=${E2TERM_SCTP} \
--ric.agent.local_ipv4_addr=10.10.1.1 --ric.agent.local_port=52525 \
--log.all_level=warn --ric.agent.log_level=debug --log.filename=stdout \
--slicer.enable=1 --slicer.workshare=0
```
Expect to see E2SetupRequest and E2SetupResponse XML messages within seconds, indicating a successful RIC connection.
### 6. 啟動 UE
- In a new SSH session to "node-0", create a network namespace:
```
sudo ip netns add ue1
```
- Then run:
```
sudo /local/setup/srslte-ric/build/srsue/src/srsue \
--rf.device_name=zmq --rf.device_args="tx_port=tcp://*:2001,rx_port=tcp://localhost:2000,id=ue,base_srate=23.04e6" \
--usim.algo=xor --usim.imsi=001010123456789 --usim.k=00112233445566778899aabbccddeeff --usim.imei=353490069873310 \
--log.all_level=warn --log.filename=stdout --gw.netns=ue1
```
This places the UE’s network interface in the `ue1` namespace to avoid conflicts with the EPC’s SPGW interface.
## 常見錯誤與除錯 (Common Errors and Troubleshooting)
- **Grafana 訪問問題**: Verify the hostname and port. Use `telnet <node-0-hostname> 3003` to check connectivity. Ensure the Grafana service is running.
- **EPC/eNodeB/UE 啟動失敗**: Check logs (e.g., `/local/logs/srsepc.log`) for errors. Verify file paths and permissions.
- **UE 無法附著**: Ensure IMSI and key in `/etc/srslte/user_db.csv` match the UE configuration. Stop the EPC (`pkill srsepc`), edit the file, and restart.
- **E2 連接問題**: Verify `${E2TERM_SCTP}` is set (`echo $E2TERM_SCTP`) and check network connectivity to the E2 termination service.
## 版本差異與引用 (Version Differences and References)
- **與草稿的差異**:
- Added Environment Prerequisites and Account and Project Settings sections for completeness.
- Included steps to retrieve the Grafana admin password using Kubernetes commands, as provided by the user.
- Structured the guide into the required five sections for clarity.
- Specified the "O-RAN" profile name based on user clarification and platform documentation.
- **引用**:
- Powder Wireless platform overview [^1].
- Powder Manual for general usage instructions [^2].
- Example Profiles listing the O-RAN profile [^3].
**參考資料**:
[^1]: Powder Wireless. https://www.powderwireless.net/
[^2]: The POWDER Manual. https://docs.powderwireless.net/
[^3]: Powder Example Profiles. https://www.powderwireless.net/example-profiles.php
---
# NexRAN Demo Deployment Guide
This guide provides a step-by-step process to set up and run NexRAN demos on the Powder Wireless platform, focusing on srsLTE in simulated mode with a single UE. It leverages the O-RAN profile to demonstrate RAN slicing, allowing observation of dynamic resource reconfiguration via a TCP stream. The guide is structured to be directly operable, with each step verified against the latest Powder Wireless documentation where possible.
## Key Points
- **Purpose**: Demonstrates RAN slicing using srsLTE in simulated mode with a single UE.
- **Profile**: Uses the "O-RAN" profile, which sets up a Kubernetes cluster with O-RAN components.
- **Grafana Access**: Requires retrieving an admin password via Kubernetes commands.
- **Components**: Involves starting an EPC, eNodeB, and UE, all configured for simulated RF using ZeroMQ.
- **Verification**: Commands and configurations are based on the provided draft and user clarifications, with references to Powder’s documentation.
## Environment Setup
To begin, you need an account on the [Powder Wireless platform](https://www.powderwireless.net/) and membership in a project with access to the O-RAN profile. Ensure your SSH public key is uploaded to the platform to enable secure access to experiment nodes. This setup assumes a basic familiarity with SSH and Kubernetes commands.
## Account and Project Configuration
1. **Account Creation**: If you lack an account, register at the [Powder Wireless website](https://www.powderwireless.net/) by clicking “Sign Up,” providing necessary details, and uploading your SSH public key. If you have an Emulab or CloudLab account, these credentials are valid for Powder due to federation.
2. **Project Membership**: Log in and join or create a project with permissions to instantiate the O-RAN profile. This profile supports O-RAN experimentation, including RAN slicing with the NexRAN xApp.
3. **SSH Key Setup**: In your account settings, upload your SSH public key to enable access to experiment nodes.
## Experiment Configuration
The following steps guide you through instantiating the O-RAN profile, accessing the Grafana dashboard, and starting the necessary RAN components.
### Step 1: Instantiate the O-RAN Profile
- Navigate to “Experiments” > “Start Experiment” on the Powder platform.
- Select the “O-RAN” profile, which creates a Kubernetes cluster with O-RAN SC Near-RT RIC and xApps, including NexRAN for policy-driven RAN slicing [^3].
- Configure the experiment as prompted (e.g., select a project and cluster) and start it.
- Wait for the experiment to be fully provisioned, which may take a few minutes. Check the experiment status page for node details, particularly the hostname of “node-0.”
### Step 2: Retrieve Grafana Admin Password
- SSH into the control node, typically named “node-0,” using the hostname from the experiment page.
- List the secrets in the grafana namespace to identify the Grafana secret:
```
kubectl get secrets -n grafana | grep grafana
```
Example output:
```
mygrafana-grafana Opaque 2 5m
```
- Retrieve and decode the admin password:
```
kubectl get secret mygrafana-grafana -n grafana -o jsonpath="{.data.admin-password}" | base64 -d && echo
```
- Record the password for use in accessing the Grafana dashboard.
### Step 3: Access the Grafana NexRAN Dashboard
- From the experiment page, note the hostname of “node-0.”
- Open `http://<node-0-hostname>:3003/d/VKl6zaTVz/nexran` in a web browser.
- Log in using the username `admin` and the password obtained in Step 2.
- If the direct link fails but the Grafana interface loads, navigate to the dashboard manually:
- Click the menu icon in the upper left corner.
- Select Dashboards > General > NexRAN to load the NexRAN dashboard.
- Initially, the dashboard may display “No Data” or errors, which is expected until the RAN components are running. Once traffic is generated, refresh the page to populate the UE and Slice panels.
### Step 4: Start the Simulated EPC
- SSH into “node-0.”
- Launch the srsLTE EPC in the background, directing logs to a file:
```
sudo /local/setup/srslte-ric/build/srsepc/src/srsepc --spgw.sgi_if_addr=192.168.0.1 2>&1 >> /local/logs/srsepc.log &
```
- This command configures the SPGW interface with the IP address 192.168.0.1, ensuring proper network setup for the simulated environment.
### Step 5: Start the Simulated eNodeB
- In the same SSH session, source the environment variables to obtain the E2 termination service’s SCTP IP address:
```
. /local/repository/demo/get-env.sh
```
- Launch the srsLTE eNodeB with the following command:
```
sudo /local/setup/srslte-ric/build/srsenb/src/srsenb \
--enb.n_prb=15 --enb.name=enb1 --enb.enb_id=0x19B --rf.device_name=zmq \
--rf.device_args="fail_on_disconnect=true,id=enb,base_srate=23.04e6,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001" \
--ric.agent.remote_ipv4_addr=${E2TERM_SCTP} \
--ric.agent.local_ipv4_addr=10.10.1.1 --ric.agent.local_port=52525 \
--log.all_level=warn --ric.agent.log_level=debug --log.filename=stdout \
--slicer.enable=1 --slicer.workshare=0
```
- **Configuration Details**:
- `--enb.n_prb=15`: Limits physical resource blocks to 15, optimizing for single-node simulation on older hardware.
- `--rf.device_name=zmq`: Uses ZeroMQ for simulated RF communication.
- `--slicer.enable=1 --slicer.workshare=0`: Enables the slicer with non-work-conserving mode, allowing observation of dynamic slice resource allocation.
- Within seconds, you should see XML messages for E2SetupRequest and E2SetupResponse, confirming the eNodeB’s connection to the RIC.
### Step 6: Start the Simulated UE
- Open a new SSH session to “node-0.”
- Create a network namespace for the UE to isolate its network interface:
```
sudo ip netns add ue1
```
- Launch the srsLTE UE:
```
sudo /local/setup/srslte-ric/build/srsue/src/srsue \
--rf.device_name=zmq --rf.device_args="tx_port=tcp://*:2001,rx_port=tcp://localhost:2000,id=ue,base_srate=23.04e6" \
--usim.algo=xor --usim.imsi=001010123456789 --usim.k=00112233445566778899aabbccddeeff --usim.imei=353490069873310 \
--log.all_level=warn --log.filename=stdout --gw.netns=ue1
```
- **Configuration Details**:
- `--gw.netns=ue1`: Places the UE’s network interface in the `ue1` namespace to avoid conflicts with the EPC’s SPGW interface, which uses the same subnet (192.168.0.x).
- `--usim.imsi` and `--usim.k`: Must match entries in `/etc/srslte/user_db.csv`. To modify these, stop the EPC (`pkill srsepc`), edit the file, and restart the EPC.
## Troubleshooting Common Issues
The following table summarizes common issues and their resolutions:
| **Issue** | **Description** | **Resolution** |
|-----------|-----------------|----------------|
| **Grafana Access Failure** | Cannot access the dashboard or login fails. | Verify the hostname and port (3003). Test connectivity with `telnet <node-0-hostname> 3003`. Ensure the Grafana service is running (`kubectl get pods -n grafana`). |
| **EPC/eNodeB/UE Startup Failure** | Components fail to start or crash. | Check logs (e.g., `/local/logs/srsepc.log`, stdout for eNodeB/UE). Verify file paths and sudo permissions. |
| **UE Attachment Failure** | UE cannot connect to the EPC. | Ensure IMSI and key in `/etc/srslte/user_db.csv` match UE configuration. Restart EPC after changes. |
| **E2 Connection Issues** | eNodeB fails to connect to RIC. | Verify `${E2TERM_SCTP}` is set (`echo $E2TERM_SCTP`). Check network connectivity to the E2 termination service IP. |
Additional troubleshooting tips are available in the [Powder Manual](https://docs.powderwireless.net/) [^2].
## Version Differences and References
- **Differences from the Draft**:
- **Profile Specification**: The draft did not specify the profile name; this guide uses “O-RAN” based on user clarification and platform documentation.
- **Password Retrieval**: Added Kubernetes commands to retrieve the Grafana admin password, as provided by the user.
- **Structured Sections**: Included Environment Prerequisites and Account and Project Settings, absent in the draft, to ensure a complete setup process.
- **Troubleshooting**: Added a dedicated section with a table for common issues, enhancing usability.
- **References**:
- The [Powder Wireless platform](https://www.powderwireless.net/) provides the infrastructure for this demo [^1].
- The [Powder Manual](https://docs.powderwireless.net/) offers general guidance on platform usage [^2].
- The O-RAN profile is listed in the [Powder Example Profiles](https://www.powderwireless.net/example-profiles.php) page [^3].
## Key Citations
- [Powder Wireless Platform Overview](https://www.powderwireless.net/)
- [The POWDER Manual for Usage Instructions](https://docs.powderwireless.net/)
- [Powder Example Profiles Listing O-RAN](https://www.powderwireless.net/example-profiles.php)
</xaiArtifact>