UERANSIM icon indicating copy to clipboard operation
UERANSIM copied to clipboard

Can I use -n to create multiple UEs, but send an authentication request every few seconds?

Open liuwei-network opened this issue 3 years ago • 17 comments

Hi,

Can I use -n to create multiple UEs, but send an authentication request every few seconds? I found that sending more than 30 authentication requests at the same time would crash UDM.

Where should I start to make changes?

Best regards.

liuwei-network avatar Jan 08 '22 05:01 liuwei-network

Hi

It's not possible to delay the authentication when using -n command.

But you can run different nr-ue processeses with a Linux sleep command.

aligungr avatar Jan 08 '22 08:01 aligungr

Hi,@aligungr Thanks for reply. That's what I'm currently doing, but this faces system resource issues: sudo unable to fork resource temporarily unavailable

Here is my script, I create a ue process every ten seconds.

for((i=1;i<10000;i=i+15))
do
	s=`printf "%04d" $i`
	cmd1="/home/wei/testbed/UERANSIM/build/nr-ue -c /home/wei/testbed/UERANSIM/config/open5gs-ue.yaml -i imsi-90170000000"
	cmd="${cmd1}${s} -n 15 &"
	eval $cmd
	sleep 10
done

I changed the ulimit max user processes and open files, but it didn't alleviate the problem...

liuwei-network avatar Jan 08 '22 08:01 liuwei-network

Here is screenshot of program.

Screenshot from 2022-01-08 16-44-20

liuwei-network avatar Jan 08 '22 08:01 liuwei-network

Btw, I think it might be more important to send the authentication request in stages. If the number of -n is large, almost no open source 5g core can handle so many authentication requests at the same time.

liuwei-network avatar Jan 08 '22 08:01 liuwei-network

@VLiu7 You can bypass the TUN configuration in UE side by starting the UE with: nr-ue --no-route-config. I wonder if that fixes the problem in the screenshot.

aligungr avatar Jan 09 '22 10:01 aligungr

@VLiu7 Hello, Did you fix the issue? I need to run multiple UEs at the same time. I run your code

#!/bin/bash for((i=1;i<100;i=i+15)) do s=printf "%04d" $i cmd1="sudo build/nr-ue -c config/free5gc-uen10.yaml -i imsi-2089300000000" #cmd="${cmd1}${s} -n 15 &" eval $cmd1 sleep 10 done

But I get this error ERROR: invalid IMSI value

In my free5gc-uen10.yaml the be link this :>>> supi: 'imsi-208930000000001'

Is that right?

Thanks

noormohammedli avatar Mar 14 '22 12:03 noormohammedli

Hi @noormohammedli I think you should remove 208 and make sure the imsi is in your DB.

liuwei-network avatar Mar 16 '22 04:03 liuwei-network

Hello @VLiu7,

Thank you,

I have this in my DB " imsi-208930000000001"

I can run it but when i try to add multi UE same time i get an error.

when i try to do link this " sudo build/nr-ue -c config/free5gc-uen10.yaml -n 20" i got time expire.

I can run 7 users individually, but i need them to run from the file.

Thanks,

noormohammedli avatar Mar 16 '22 09:03 noormohammedli

Hi, @noormohammedli

In fact, I'm not sure what problem you have, can you send me your test script and error log?

Did you make sure that all imsi you want to run are in the DB, not just the one in the config file? As far as I know, free5gc doesn't give a script to insert imsi in batches, I'm not sure if you've done that.

Did you have same error with open5gs?

If all imsi are in DB, let's see the error log.

liuwei-network avatar Mar 17 '22 05:03 liuwei-network

Hello, I do not think i have error in 5G core i can run 7 uses individual, they are working fine but when i try to add multi UE same time i get an error.

error when i run 10 ue at the same time.zip

this is my log files

Thanks

noormohammedli avatar Mar 17 '22 11:03 noormohammedli

Sorry, I would like to help you but it is more than I can handle. @aligungr Dear author, could you please help @noormohammedli fix that? Thanks!

liuwei-network avatar Mar 18 '22 02:03 liuwei-network

Hello @noormohammedli There is a core network problem according to your files. It looks like AMF crashes in your scenario.

aligungr avatar Mar 24 '22 17:03 aligungr

You can eventually add a sleep in the loop that triggers all the UE registers in the code.

in src/ue.cpp at the very end of the file: g_ueMap.invokeForeach([](const auto &ue) { ue.second->start(); sleep(3);});

Don't forget to include the standard library at the top: #include <stdlib.h>

This is what we did on our side.

elrandira avatar Apr 05 '22 09:04 elrandira

Hello @elrandira,

Thanks for your comment.

I put this line at the end of the main function but i get this error when i built the UERANSIM.

Screenshot 2022-04-13 at 12 06 20 am

Thanks

noormohammedli avatar Apr 13 '22 08:04 noormohammedli

I don't understand your error. This method is part of the code you retrieved on github, it shouldn't fail.

Did you make more modifications that the sleep and the stdlib import? Maybe retry from the start.

elrandira avatar Apr 19 '22 09:04 elrandira

Hello @elrandira

Thanks for the replay,

Screenshot 2022-04-19 at 12 31 36 pm

I have this code in the last part of the file, I put the sleep as in the image i think your commands if for the new version of the code, I will update the code and let you know.

Thanks for your help and support, Noor

noormohammedli avatar Apr 19 '22 11:04 noormohammedli

Yes, on the latest version it would look like this:

g_ueMap.invokeForeach([](const auto &ue) { ue.second->start(); sleep(10);});

elrandira avatar Apr 19 '22 12:04 elrandira