vaggelis-sudo / 5G-UE-SecurityTesting

41 stars 12 forks source link

Request for Configuration Files or Guidance in Setting Up Environment #1

Closed roskeys closed 11 months ago

roskeys commented 11 months ago

Dear developers,

I'm currently in the process of trying out your repository. So far, I've successfully compiled Open5GS, cJSON, and SRSRAN. To proceed, I've followed the instructions provided in the Usage section of your repository. Specifically, I executed the command:

sudo open5gs/build/tests/app/5gc -n /home/user/5G-UE-SecurityTesting/open5gs/test.json

as outlined in the README file to start the 5GC component. It runs normally without any error messages.

Following this, I ran:

sudo ./srsRAN/build/srsenb/src/srsenb enb.conf

where the enb.conf file was copied from the .config file generated during the setup process.

Unfortunately, I'm encountering issues as the eNB component appears to be unable to connect to the Open5GS component. I've attached my current configuration files for reference, with IP configurations following the handler.py file.

Below is the message after running srsenb:

sudo ./srsRAN/build/srsenb/src/srsenb enb.conf
Active RF plugins: libsrsran_rf_uhd.so libsrsran_rf_zmq.so
Inactive RF plugins: 
---  Software Radio Systems LTE eNodeB  ---

Reading configuration file enb.conf...

Built in Release mode using commit 8e9728b on branch main.

Opening 1 channels in RF device=default with args=default
Supported RF device list: UHD zmq file
Trying to open RF device 'UHD'
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.4.0.HEAD-0-8e54b58d
[INFO] [LOGGING] Fastpath logging disabled at runtime.
Opening USRP channels=1, args: type=b200,master_clock_rate=23.04e6
[INFO] [UHD RF] RF UHD Generic instance constructed
[INFO] [B200] Detected Device: B210
[INFO] [B200] Operating over USB 3.
[INFO] [B200] Initialize CODEC control...
[INFO] [B200] Initialize Radio control...
[INFO] [B200] Performing register loopback test... 
[INFO] [B200] Register loopback test passed
[INFO] [B200] Performing register loopback test... 
[INFO] [B200] Register loopback test passed
[INFO] [B200] Asking for clock rate 23.040000 MHz... 
[INFO] [B200] Actually got clock rate 23.040000 MHz.
RF device 'UHD' successfully opened

==== eNodeB started ===
Type <t> to view trace
Setting frequency: DL=2680.0 Mhz, UL=2560.0 MHz for cc_idx=0 nof_prb=50
S1setup failed
Failed to initiate S1 connection. Attempting reconnection in 10 seconds
S1setup failed
Failed to initiate S1 connection. Attempting reconnection in 10 seconds
RACH:  tti=61, cc=0, pci=1, preamble=28, offset=1, temp_crnti=0x46
Disconnecting rnti=0x46.
S1setup failed
Failed to initiate S1 connection. Attempting reconnection in 10 seconds
RACH:  tti=10131, cc=0, pci=1, preamble=11, offset=1, temp_crnti=0x47
Disconnecting rnti=0x47.
S1setup failed
Failed to initiate S1 connection. Attempting reconnection in 10 seconds
RACH:  tti=9961, cc=0, pci=1, preamble=40, offset=0, temp_crnti=0x48
Disconnecting rnti=0x48.
RACH:  tti=9791, cc=0, pci=1, preamble=20, offset=1, temp_crnti=0x49
Disconnecting rnti=0x49.
S1setup failed
Failed to initiate S1 connection. Attempting reconnection in 10 seconds
RACH:  tti=9621, cc=0, pci=1, preamble=41, offset=1, temp_crnti=0x4a
Disconnecting rnti=0x4a.

In light of these challenges, I kindly request your assistance in sharing your configuration files or providing guidance on how to configure the environment correctly. Any insights or examples you can provide would be greatly appreciated and will help me in successfully setting up and utilizing this project.

Thank you in advance for your support and contributions to this project.

configs.zip

s21sm commented 11 months ago

Hi, The config.zip you shared is for open5gs, you need configuration files for srsRAN. We uploaded the srsRAN configuration files kindly use that. Couple of issues:

1) Are you using the same srsRAN, that is uploaded in our repository? if not, kindly use that. 2) It seems like your srsRAN and open5gs are not communicating each other, so you need to see what is going on open5gs side. what do you see in the terminal after sudo open5gs/build/tests/app/5gc -n /home/user/5G-UE-SecurityTesting/open5gs/test.json. Hope you put correct path for your testcase, I mean if needed change /home/user/5G-UE-SecurityTesting/open5gs/test.json according to your path. 3) Inside of the directory where is your srsRAN, create a folder 'configFiles' and put the four configuration files. I mean srsRAN and configFiles folders should be in the same level for sudo ./srsRAN/build/srsenb/src/srsenb configFiles/enb.conf

Regards

roskeys commented 11 months ago

Dear developers, Thank you for your updates, yes, I'm using srsran compiled from this repository. Unfortunately I still get the same error with your provided configurations.

But I successfully run the open5gs with srsRan with the modifications on the following configurations. But the question here is that your provided document is asking to use sudo ./open5gs/build/tests/app/5gc -n /home/usr/Desktop/5G/Test_nas/test1.json to run the open5gs. While the configurations below only works with sudo ./open5gs/build/tests/app/app. Kindly check if you have made any modifications on the 5gc file and is there any difference running the app program and the 5gc program for running the security tests.

enb.conf

[enb]
enb_id = 0x19B
mcc = 001
mnc = 01
mme_addr = 127.0.1.2
gtp_bind_addr = 127.0.1.1
s1c_bind_addr = 127.0.1.1
s1c_bind_port = 0
n_prb = 50

And the things need to change in the amf.yaml is that

amf:
    tai:
      - plmn_id:
          mcc: 001
          mnc: 01
        tac: 7

As well as mme.yaml

mme:
    tai:
      plmn_id:
        mcc: 001
        mnc: 01
      tac: 7

Running sudo ./open5gs/build/tests/app/app -n /home/user/5G-UE-SecurityTesting/open5gs/test.json will give message that looks the open5gc is working correctly as below:

10/04 10:26:05.851: [sbi] INFO: [6d063b2c-62a0-41ee-9798-f98bba3b6258] NF registered [Heartbeat:10s] (../lib/sbi/nf-sm.c:216)
10/04 10:26:08.690: [mme] INFO: eNB-S1 accepted[127.0.1.1]:48035 in s1_path module (../src/mme/s1ap-sctp.c:115)
10/04 10:26:08.690: [mme] INFO: eNB-S1 accepted[127.0.1.1] in master_sm module (../src/mme/mme-sm.c:107)
10/04 10:26:08.690: [mme] INFO: [Added] Number of eNBs is now 1 (../src/mme/mme-context.c:1842)
10/04 10:26:08.690: [mme] INFO: eNB-S1[127.0.1.1] max_num_of_ostreams : 30 (../src/mme/mme-sm.c:149)

And on the enb side, without the S1setup failed error message

 ./srsRAN/build/srsenb/src/srsenb enb.conf
Active RF plugins: libsrsran_rf_uhd.so libsrsran_rf_zmq.so
Inactive RF plugins: 
---  Software Radio Systems LTE eNodeB  ---

Reading configuration file enb.conf...

Built in Release mode using commit 8e9728b on branch main.

Opening 1 channels in RF device=default with args=default
Supported RF device list: UHD zmq file
Trying to open RF device 'UHD'
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_4.4.0.HEAD-0-8e54b58d
[INFO] [LOGGING] Fastpath logging disabled at runtime.
Opening USRP channels=1, args: type=b200,master_clock_rate=23.04e6
[INFO] [UHD RF] RF UHD Generic instance constructed
[INFO] [B200] Detected Device: B210
[INFO] [B200] Operating over USB 3.
[INFO] [B200] Initialize CODEC control...
[INFO] [B200] Initialize Radio control...
[INFO] [B200] Performing register loopback test... 
[INFO] [B200] Register loopback test passed
[INFO] [B200] Performing register loopback test... 
[INFO] [B200] Register loopback test passed
[INFO] [B200] Asking for clock rate 23.040000 MHz... 
[INFO] [B200] Actually got clock rate 23.040000 MHz.
RF device 'UHD' successfully opened

==== eNodeB started ===
Type <t> to view trace
Setting frequency: DL=2680.0 Mhz, UL=2560.0 MHz for cc_idx=0 nof_prb=50

Regards

s21sm commented 11 months ago

Do you have 5gc in the app folder?

git
roskeys commented 11 months ago

Do you have 5gc in the app folder? git

Yes, I have the 5gc file in the same folder as the app. But executing this file will result in the error message.

root@minipc-1:~/5G-UE-SecurityTesting/open5gs/build/tests/app# ls
5gc  e632ce7@@5gc@exe  e632ce7@@epc@exe      e632ce7@@testapp@sta  epc           libtestapp.a
app  e632ce7@@app@exe  e632ce7@@test5gc@sta  e632ce7@@testepc@sta  libtest5gc.a  libtestepc.a