aligungr / UERANSIM

Open source 5G UE and RAN (gNodeB) implementation.
GNU General Public License v3.0
776 stars 319 forks source link

Implementing IoT Scenario using UERANSIM #298

Open hanifuuc opened 3 years ago

hanifuuc commented 3 years ago

Hi @aligungr, Thank you so much for your tremendous work. I am trying to implement an IoT scenario using UERANSIM where the UEs will send the registration request to the AMF at regular intervals. initially, the UEs will register with AMF, but if the devices (UEs) are not sending any data, they will move to sleep mode after a specific time, and once they are ready for sending the data, they will send an awake message to connect to the AMF again. So. it's a sleep-wake scenario with regular intervals. I think the periodic registration can do the same functionality.

Could you please let me know which particular fine I need to change and what will be the parameters for that particular file? The scenario is elaborated in the attached image. Please let me know if you need further explanation.

UERANSIM IoT usecase

aligungr commented 3 years ago

Hello @hanifuuc

Thanks for the kind words.

This concept is highly related to RRC_INACTIVE state. And currently we don't support RRC_INACTIVE at the moment, but it's on the roadmap.

Could you please let me know which particular file I need to change and what will be the parameters for that particular file

RRC_INACTIVE feature requires almost all control layers to be changed. That is, there are many changes need to be done in UE (NAS, and RRC layers) and gNB (NGAP and RRC layers). Therefore implementing this functionality may require some effort. But still if you want to implement it, I would appreciate, otherwise I will implement it in the future already.

I think the periodic registration can do the same functionality

Yes, from the core network perspective (but not for radio perspective), we can say that periodic registration can do the similar functionality. My suggestion is that you can set the T3512 (periodic registration) timer in AMF configurations in most core networks. (For example in free5gc you can set this value from config files, for Open5gs I don't remember). For example if you set T3512 to 60 seconds, UE will perform periodic registration every 60 seconds after the initial registration.

Also see https://github.com/aligungr/UERANSIM/issues/288#issuecomment-818002940 for additional information

Thank you for your commitment

hanifuuc commented 3 years ago

Hi @aligungr, Thank you so much for your detailed reply and help.

Yes, from the core network perspective (but not for radio perspective), we can say that periodic registration can do a similar functionality. My suggestion is that you can set the T3512 (periodic registration) timer in AMF

I have tried this configuration, but when the timer is triggered, gNB disconnects 1st, and then all the UEs disconnect in a similar fashion. could you please tell me why it happens?

Also, is there a simple way to automate the process of initial registration, deregistration, and periodic registration? This means that after the initial registration, I want to trigger the deregistration with a specific interval (say for example 60 seconds), and in the same way I want to trigger the periodic registration. could you please tell me that which particular file I need to change and how many changes I need to make in that file?

your help and cooperation in this regard will be highly appreciated. Thanks and regards

aligungr commented 3 years ago

Hi @hanifuuc

I have tried this configuration, but when the timer is triggered, gNB disconnects 1st, and then all the UEs disconnect in a similar fashion. could you please tell me why it happens?

Hmm this should not be the case, because T3512 is completely unrelated to gNB. Perhaps gNB crashes due to another error. PCAP and log files may be helpful to figure this out.

Also, is there a simple way to automate the process of initial registration, de-registration, and periodic registration?

Yes, sure. Indeed initial-registration and periodic-registration are always automatically performed, and no user input expected. However, in order to automate the de-registration, you can write a bash script such as:

./nr-ue -c <config-file>                        # 1. Start the UE and trigger an initial-registration
sleep 60                                        # 2. Wait for 60 seconds
./nr-cli <ue-imsi> --exec "deregister normal"   # 3. Trigger a de-registration

In this way, basically UE starts first, and after 60 seconds sleep, a CLI command is executed in order to trigger a de-registration. You can utilize the nr-cli however you want.

Please let me know anytime, if you have any further questions.

Regards


PS. I want to further clarify the following statement:

initial-registration and periodic-registration are always automatically performed

And please note that, if T3512 expires,

Therefore, to trigger a periodic registration, you just need to wait T3512 to expire in UE.

Please let me know if you have any further questions.

hanif81 commented 3 years ago

Hi @aligungr Thank you so much for your continuous help and support. Really appreciated.

./nr-ue -c <config-file>                        # 1. Start the UE and trigger an initial-registration
sleep 60                                        # 2. Wait for 60 seconds
./nr-cli <ue-imsi> --exec "deregister normal"   # 3. Trigger a de-registration

with respect to the bash script, i have written a script (attached with log file), but when i run it, it doesn't stop as normal and continue running by triggering the commands. Also, I executed the command "UERANSIM-gnb-208-93-1 --exec "ue-release 1" from the bash script to change the status of the device from connected to Idle, but the problem is it works for 1st time, and when it registers again with the AMF, the status of the UE doesn't change for the second time if I trigger the same command in the same Bash script as it create some dummy IDs which is not reflected on the core side. Could you please help me with that?

run1.log run1.txt

Yes, from the core network perspective (but not for radio perspective), we can say that periodic registration can do a similar functionality. My suggestion is that you can set the T3512 (periodic registration) timer in AMF

As discussed last time, when i change the T3512 timer on the core side, the periodic registration is just triggered once and then the AMF is terminated. A log file with amf.log is attached for the reference. Please have a look it this as well.

amf.log

aligungr commented 3 years ago

Hi @hanif81

But when i run it, it doesn't stop as normal and continue running by triggering the commands

Yes it's indeed an expected behavior. If you want to avoid an initial registration, you can use deregister disable-5g or deregister remove-sim, instead of deregister normal.


Also, I executed the command "UERANSIM-gnb-208-93-1 --exec "ue-release 1" from the bash script to change the status of the device from...

I think I don't really understand this question, but for my understanding; if you restart a UE process without restarting the gNB process, the new UE will have a different internal id from gNB perspective. Therefore you may need to execute for example ue-release 2, ue-release 3 ...


... the periodic registration is just triggered once and then the AMF is terminated...

Unfortunately I cannot reproduce this case. I set T3512 to 10sec in free5gc side, and the UE is continuously sending periodic registration in every 10 seconds successfully.

But in your case, if the AMF is being terminated after receiving a periodic registration, then I'd suspect some bug in AMF side.

Please let me know if you have any other questions

hanifuuc commented 3 years ago

Hi @aligungr,

Hope you are doing well. Could you please tell me where I can get the log files just like the previous version? In the previous version, the log files were created in the /logs folder, and the file was created by triggering the command "tail -f loadtesst.log". Can I create the log files in the same way, or is there any other way to create the same files? your cooperation in this regard will be highly appreciated.

Regards Hanif

aligungr commented 3 years ago

Thanks @hanifuuc

UERANSIM no longer saves the log outputs to a file. I removed this feature in v3.0.1, and there is no plan to bring this feature back. Because I think it breaks performance and robustness of the software. (From my experiences, many people had some trouble about log files, such as read/write permission in the file system etc.)

However you can still save output of the program to a file, using IO redirection.

Please see: https://askubuntu.com/questions/420981/how-do-i-save-terminal-output-to-a-file

Regards