# Keysight
## RuSIM:
```
user@myLSU-112c:/lsu/cfg$ cat cardmap-backup-rusim-synergy
VMDq_ITF 0 6:oRAN 7:oRAN
ORAN OR.DRV0.1
# RLCMAC PPU
PPU_CAPABILITY NR_RLCMAC0.1 PROCESS:nr-rlcmac
PPU_CAPABILITY STK_PDCP0.2 PROCESS:pdcp
PPU_CAPABILITY STK_U-Plane0.1 PROCESS:u-plane
# UPLANE STK
OPT_STK STK_U-Plane0.1 2 io-pkt-v6-hc 17
NAT_2 STK_U-Plane0.1 1 192.168.31.1 255.255.255.0 192.168.31.2 V6
PPU_CAPABILITY STK_U-Plane0.1 PROCESS:u-plane
OPT_STK_ITF STK_U-Plane0.1 2 0 5 6 -
IP_ALIAS STK_U-Plane0.1 6 2 0 4 192.168.60.60 24
# MONITOR SERVER ON DEDICATED PPU
#OPT_STK TSTM0.1 2 io-pkt-v4 17 monsrv_stk_script
#OPT_STK_ITF TSTM0.1 2 9 2 2.2.2.3 255.255.0.0 -
#OOB
PPU_CAPABILITY STK_U-Plane0.1 FUNC:UDG_OOB
PPU_CAPABILITY STK_U-Plane0.2 FUNC:UDG_OOB
OPT_STK STK_U-Plane0.2 2 io-pkt-v6-hc 17
OPT_STK_ITF STK_U-Plane0.2 2 0 4 5 -
IP_ALIAS STK_U-Plane0.2 5 2 0 4 192.168.60.64 24
#SGI
OPT_STK_ITF STK_U-Plane0.2 2 1 9 7 set_gi
IP_ALIAS STK_U-Plane0.2 7 2 1 4 5.5.5.64 24
#IP_ALIAS MPU0.1 5 2 0 4 172.17.17.110 24
```
* hardware map:
```
user@myLSU-112c:/lsu/cfg$ cat hwmap
########################################################################
#
# LSUv3 /lsu/cfg/hwmap
#
# It defines the hardware configuration of the LSU.
#
########################################################################
#
# WARNING! Information in this file are really critical for a correct
# bootstrap procedure, and LSU functionalities in normal use.
# Please modify this file only while LSU is not in use, and
# issue a "lsubootenv" to ensure changes are taken into account.
#
# For help on the available tags and related syntax, please refer
# to /lsu/cfg/hwmap_help file.
#
########################################################################
CPU 0 default-mc myLSU
# Start template /lsu/cfg/osn_templates/osn_sl1_112c_2x2-1.12.9
TITLE 2x2 (4 Cells)
LSU_MODEL sl1_112c
## MPU
OSN 0 0 0,30.0 cores:0 -
ALIAS_PPU MPU0.1 0-0 TYPE_MPU
## AP.DRV PPU
OSN 0 1 1,1.0 cores:64,66 -
ALIAS_PPU AP.DRV0.1 0-1 TYPE_AP.DRV
## BB PPU
OSN 0 2 0,30.0 cores:2,4,6,8,10,12,16,18,20,22,24,26,28,32,34,36,38,40,42,44 - turbo_boost
ALIAS_PPU BB0.1 0-2 TYPE_BB
## BB PPU
OSN 0 3 3,30.0 cores:192,194,196,198,200,202,204,208,210,212,214,216,218,220,224,226,228,230,232,234 - turbo_boost
ALIAS_PPU BB0.2 0-3 TYPE_BB
## BB PPU
OSN 0 4 2,30.0 cores:128,130,132,134,136,138,140,144,146,148,150,152,154,156,160,162,164,166,168,170 - turbo_boost
ALIAS_PPU BB0.3 0-4 TYPE_BB
## BB PPU
OSN 0 5 1,30.0 cores:68,70,72,74,76,80,82,84,86,88,90,92,96,98,100,102,104,106,108,112 - turbo_boost
ALIAS_PPU BB0.4 0-5 TYPE_BB
## Placeholder PPU
OSN 0 6 1,2.0 cores:114 -
ALIAS_PPU Placeholder0.1 0-6 TYPE_Placeholder
## Monsrv PPU
OSN 0 7 0,10.0 cores:48 -
ALIAS_PPU Monsrv0.1 0-7 TYPE_Monsrv
## NR RLCMAC PPU
OSN 0 8 2,70.0 cores:172,176,178,180,182,184,186,188 - turbo_boost
ALIAS_PPU NR_RLCMAC0.1 0-8 TYPE_NR_RLCMAC
## STK U-Plane PPU
OSN 0 9 1,19.0 cores:116 -
ALIAS_PPU STK_U-Plane0.1 0-9 TYPE_STK_U-Plane
## STK PDCP PPU
OSN 0 10 3,21.0 cores:236,240 - turbo_boost
ALIAS_PPU STK_PDCP0.1 0-10 TYPE_STK_PDCP
## TSTM PPU
OSN 0 11 3,7.0 cores:242 -
ALIAS_PPU TSTM0.1 0-11 TYPE_TSTM
## TSTM PPU
OSN 0 12 3,7.0 cores:244 -
ALIAS_PPU TSTM0.2 0-12 TYPE_TSTM
## TSTM PPU
OSN 0 13 3,7.0 cores:246 -
ALIAS_PPU TSTM0.3 0-13 TYPE_TSTM
## TSTM PPU
OSN 0 14 3,7.0 cores:248 -
ALIAS_PPU TSTM0.4 0-14 TYPE_TSTM
## LTE RLCMAC PPU
OSN 0 15 0,10.0 cores:50,52 -
ALIAS_PPU LTE_RLCMAC0.1 0-15 TYPE_LTE_RLCMAC
## LTE RLCMAC PPU
OSN 0 16 0,10.0 cores:54,56 -
ALIAS_PPU LTE_RLCMAC0.2 0-16 TYPE_LTE_RLCMAC
## LTE RLCMAC PPU
OSN 0 17 0,10.0 cores:58,60 -
ALIAS_PPU LTE_RLCMAC0.3 0-17 TYPE_LTE_RLCMAC
## LTE RLCMAC PPU
OSN 0 18 1,10.0 cores:118,120 -
ALIAS_PPU LTE_RLCMAC0.4 0-18 TYPE_LTE_RLCMAC
## STK U-Plane PPU
OSN 0 19 1,19.0 cores:122 -
ALIAS_PPU STK_U-Plane0.2 0-19 TYPE_STK_U-Plane
## STK U-Plane PPU
OSN 0 20 1,19.0 cores:124 -
ALIAS_PPU STK_U-Plane0.3 0-20 TYPE_STK_U-Plane
## STK PDCP PPU
OSN 0 21 3,21.0 cores:250,252 - turbo_boost
ALIAS_PPU STK_PDCP0.2 0-21 TYPE_STK_PDCP
### Available Cores
# CPU0:
# CPU1:
# CPU2:
# CPU3:
###
### All Cores
# CPU0: 0,2,4,6,8,10,12,16,18,20,22,24,26,28,32,34,36,38,40,42,44,48,50,52,54,56,58,60
# CPU1: 64,66,68,70,72,74,76,80,82,84,86,88,90,92,96,98,100,102,104,106,108,112,114,116,118,120,122,124
# CPU2: 128,130,132,134,136,138,140,144,146,148,150,152,154,156,160,162,164,166,168,170,172,176,178,180,182,184,186,188
# CPU3: 192,194,196,198,200,202,204,208,210,212,214,216,218,220,224,226,228,230,232,234,236,240,242,244,246,248,250,252
###
MEM_BLK MEM_BB0 0 512
MEM_BLK MEM_BB1 1 512
MEM_BLK MEM_BB2 2 512
MEM_BLK MEM_BB3 3 512
# End template
# Ethernet cards mapping:
#
# (1017,1)(1017,0) (CPRI_1)(CPRI_0)
# (1528,0)(1528,1) (158b,1)(158b,0)
# (158b,3)(158b,2)
# (1589,2)(1589,3)
# (1589,0)(1589,1)(IPMI)
## 10 Gbps eth cards (cop) [CPU 0]
NET_ITF 0 0 0-0 devnp-ixl.so vid=0x8086,did=0x1589,pci=2,name=en - - nomsi
NET_ITF 0 1 - devnp-ixl.so vid=0x8086,did=0x1589,pci=3,name=en - - nomsi
NET_ITF 0 2 - devnp-ixl.so vid=0x8086,did=0x1589,pci=0,name=en - - nomsi
NET_ITF 0 3 - devnp-ixl.so vid=0x8086,did=0x1589,pci=1,name=en - - nomsi
## 10 Gbps eth cards (cop) [CPU 0]
NET_ITF 0 4 - devnp-ixgbe.so vid=0x8086,did=0x1528,pci=1,name=en - - nomsi
NET_ITF 0 5 - devnp-ixgbe.so vid=0x8086,did=0x1528,pci=0,name=en - - nomsi
## 25 Gbps eCPRI cards (opt) [CPU 1] slot 5
# 69:0:1
NET_ITF 0 6 - devnp-ixl.so vid=0x8086,did=0x158b,pci=1,name=en - - nomsi
# 69:0:0
NET_ITF 0 7 - devnp-ixl.so vid=0x8086,did=0x158b,pci=0,name=en - - nomsi
## 25 Gbps eCPRI cards (opt) [CPU 1] slot 6
# 89:0:1
NET_ITF 0 8 - devnp-ixl.so vid=0x8086,did=0x158b,pci=3,name=en - - nomsi
# 89:0:0
NET_ITF 0 9 - devnp-ixl.so vid=0x8086,did=0x158b,pci=2,name=en - - nomsi
## 100 Gbps eth cards (opt) [CPU 0] slot 2
NET_ITF 0 10 - devnp-mlx5.so vid=0x15b3,did=0x1017,pci=1,name=en - - nomsi
NET_ITF 0 11 - devnp-mlx5.so vid=0x15b3,did=0x1017,pci=0,name=en - - nomsi
# eof
```
## Run the E2E setup
* Stop (`lsustop`), Start RuSIM in lsu (172.27.2.112), via `lsustart`, and `run.sh`.
* Enable CUPLANE in DU, and wait for `Synchronized` status in RuSIM

* Start UDG (gi, li):
```
user@myLSU-112c:/home/user/synergy/gi_000/script$ ./start_001
GI_TSTM_SCRIPT_DIR=/usr/local/Gi_tm-v2.13.3_qnx7
gi_tm_server[489353320-1]: @ppu0-0 CLOCK: TSC_FREQ 2194800779 Hz
gi_tm_server[489353320-1]: @ppu0-0 MONITOR: MSG REPORT: ENABLED
gi_tm_server[489353320-1]: @ppu0-0 *** RUNNING AT PRIORITY 10 SCHED_RR @ppu0-0
gi_tm_server[489353320-1]: @ppu0-0 MONITOR: LOCK CHECK: fwLOCK_CHECK_MODE=0
-----------------
Gi Simulator
-----------------
....
1.817 2023-05-25 04:01:34.888 [0-2] LOGSCR > GI STACK UP!
```
* Run CoreSIM: at 172.27.2.190 (admin/admin), select configs: `CoreSim_Synergy_UDG`.

* Wait until there is 1 gNodeB established in SCTP connection for N2/N3 in Statistic tab:

* Run AirMosaic for the scenario (stop and start a new AirMosaic):
* Load sci file:

* load sce file:

* Connect to TSTM, wait until the green arrow button appear:

* Before running the scenario, we should bring up few chart for monitoring, such as downlink throughput, uplink throughput, global counter application UDG DL/UL instant throughput-NET


* To make charts nicely appear, we should use `tile` by right click on a selected chart item:

* To check the cell status.

## UeSIM:
* cardmap:
```
user@myLSU-112c:/lsu/cfg$ cat cardmap
#ORAN OR.DRV0.1
VMDq_ITF 0 1:MAC
OPT_STK MPU0.1 2 io-pkt-v4 10 -
CHASSIS_STK 2
CHASSIS 0 172.17.17.152
SDR_NET AP.DRV0.1 0 VMDq 0 AP
SDR_SET 0 0
# If change SDR, we need to change this MAC address.
SDR_BASE 0 4 70:B3:D5:68:9A:F7 0 0 5
# RLCMAC PPU
PPU_CAPABILITY NR_RLCMAC0.1 PROCESS:nr-rlcmac
PPU_CAPABILITY STK_PDCP0.2 PROCESS:pdcp
PPU_CAPABILITY STK_U-Plane0.1 PROCESS:u-plane
# UPLANE STK
OPT_STK STK_U-Plane0.1 2 io-pkt-v6-hc 17
NAT_2 STK_U-Plane0.1 1 192.168.31.1 255.255.255.0 192.168.31.2 V6
PPU_CAPABILITY STK_U-Plane0.1 PROCESS:u-plane
OPT_STK_ITF STK_U-Plane0.1 2 0 5 6 -
IP_ALIAS STK_U-Plane0.1 6 2 0 4 192.168.60.60 24
# MONITOR SERVER ON DEDICATED PPU
#OPT_STK TSTM0.1 2 io-pkt-v4 17 monsrv_stk_script
#OPT_STK_ITF TSTM0.1 2 9 2 2.2.2.3 255.255.0.0 -
#OOB: out of band, stack u-plane 0.1 (control plane) and 0.2 (User data)
PPU_CAPABILITY STK_U-Plane0.1 FUNC:UDG_OOB
PPU_CAPABILITY STK_U-Plane0.2 FUNC:UDG_OOB
OPT_STK STK_U-Plane0.2 2 io-pkt-v6-hc 17
OPT_STK_ITF STK_U-Plane0.2 2 0 4 5 -
IP_ALIAS STK_U-Plane0.2 5 2 0 4 192.168.60.64 24
#SGI
OPT_STK_ITF STK_U-Plane0.2 2 1 9 7 set_gi
IP_ALIAS STK_U-Plane0.2 7 2 1 4 5.5.5.64 24
IP_ALIAS MPU0.1 5 2 0 4 172.17.17.110 24
OPT_STK_ITF MPU0.1 2 0 VMDqMAC:vmdq_dev=0 5 -
```
## Stop and start LSU:
```
lsustop
....
lsustart
```
* Stop and start coresim: Note Established SCTP connections 1.

* Check UEsim status "Synchronized"
# Kubernetes cluster
IP address of master 172.27.2.51, user: master, pass: fcpsutd
IP address of slave1: 172.27.2.52, user: slave1, pass: fcpsutd
# Rebooting eLSU
1. Go to https://172.27.2.111/

2. Login.
Username: ADMIN
Password: ADMIN
3. Click the "Power Down" button, the eLSU server will reboot.

4. Open the Go to the remote console. Wait for the LSUv.3 login page to appear. The server has started.

# Switch between UeSIM config and RuSIM:
## Change to uesim config map:
Go to eLSU server:
Either script (preferable) or manual:
* script:
```
user@myLSU-112c:/home/user$ cd .backup_cfg/UESim_QCT_gNodeB/
user@myLSU-112c:/home/user/.backup_cfg/UESim_QCT_gNodeB$ ls
cardmap change_to_uesim.sh hwmap
user@myLSU-112c:/home/user/.backup_cfg/UESim_QCT_gNodeB$ bash change_to_uesim.sh
```
* Manual:
```
user@myLSU-112c:/home/user$ lsusuid cp /lsu/cfg/cardmap-backup-uesim /lsu/cfg/cardmap
user@myLSU-112c:/lsu/cfg$ lsusuid cp /lsu/cfg/hwmap-backup-uesim /lsu/cfg/hwmap
lsusuid lsubootenv
lsusuid shutdown
```
* After that start GI server:
```
user@myLSU-112c:/home/user$ lsustart
user@myLSU-112c:/home/user/QCT_UESim/gi_000/script$ ./start_001
user@myLSU-112c:/home/user/QCT_UESim/gi_000/script$ ./stop_001
```
## Change to RuSIM config map:
Either manually or using script:
* script:
```===bash===
user@myLSU-112c:/home/user$ cd .backup_cfg/RUSim_Synergy/
user@myLSU-112c:/home/user/.backup_cfg/RUSim_Synergy$ ls
cardmap change_to_rusim.sh hwmap
user@myLSU-112c:/home/user/.backup_cfg/RUSim_Synergy$ bash ./change_to_rusim.sh
```
* Manual:
```
user@myLSU-112c:/lsu/cfg$ lsusuid cp /lsu/cfg/cardmap-backup-rusim-synergy /lsu/cfg/cardmap
user@myLSU-112c:/lsu/cfg$ lsusuid cp /lsu/cfg/hwmap-backup-rusim-synergy /lsu/cfg/hwmap
lsusuid lsubootenv
lsusuid shutdown
```
```===bash===
user@myLSU-112c:/home/user$ lsustart
user@myLSU-112c:/lsu/cfg$ cd /home/user/synergy/
user@myLSU-112c:/home/user/synergy$ ./run.sh
user@myLSU-112c:/home/user/synergy$ cd gi_000/script/
user@myLSU-112c:/home/user/synergy/gi_000/script$ ./start_001
user@myLSU-112c:/home/user/synergy/gi_000/script$ ./stop_001
```
## Change IP address of UDG server
<!--If we want to change IPv4 of UDG server from 5.5.5.64 to 6.6.6.64, we need to change in `cardmap`, `/home/user/synergy/gi_000/csv/`. But after changing it is still failed. -->
1. Change config in `/home/user/qct_uesim/gi_000/csv/ipv4_vpn_routing.csv`

2. Update `cardmap`

3. Update `/lsu/cfg/opt_stk/set_gi`

4. Update `/home/user/qct_uesim/gi_000/csv/ipv4_server.csv`

But after changing it is still unsuccessful.