Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIP registration problem #275

Open
ali-foroughi opened this issue Jan 23, 2024 · 10 comments
Open

SIP registration problem #275

ali-foroughi opened this issue Jan 23, 2024 · 10 comments

Comments

@ali-foroughi
Copy link

Hi all,

I"m having a lot of trouble with the SIP registration, I've checked everything in my configuration but to no avail.

My setup:

  • Pulled the project from the master branch and I'm using pyhss instead of fhoss

  • I'm using a real eNB. I've configured the S1MME interface to connect to the external eNB

  • S1U interface is also correctly connected to the eNB using SGWU_ADVERTISE_IP env

  • I've setup routing in my SGWU container so it can see my eNB IP. It can ping the eNB IP.

  • My UE is Samsung Galaxy S22

  • Changed the PLMN from 00101 to 42402

  • Simcard is also registered with 42402 PLMN

  • S1-MME: 172.30.247.175

  • S1-eNB: 172.30.247.114

Problem

My SIP registration procedure is incomplete. After getting the 401 Unauthorized packet, I expect S-SCSF to query the database using diameter but I don't have that in my PCAP. The procedure ends with 401 Unauthorized, P-CSCF doesn't get a reply from the UE, the process times out, and then the UE sends a new register request and the whole thing starts again.

I compared my own pcap with the sample mentioned here:
https://open5gs.org/open5gs/assets/pcapng/nonipsec_reg.pcapng

Below I've attached the logs and PCAP. The PCAP contains everything from S1-Setup all the way to Core shutdown.

I doubt that this is an actual issue with the code. I know its just my configuration problem, but I can't figure out what for the life of me! I would appreciate any help.

logs & pcap

Logs: logs.txt

PCAP: volte-test.pcap.tar.gz

DB records: db_configs.tar.gz

Some notes

I'm seeing the following log from PCRF, is it an issue?

pcrf           | 01/23 16:45:57.895: [pcrf] WARNING: Not supported(291) (../src/pcrf/pcrf-rx-path.c:333)
@ali-foroughi
Copy link
Author

ali-foroughi commented Jan 24, 2024

To add to this:

Right now in the PCRF and PCSCF, I'm seeing the diameter logs where it shows they both correctly connect to each other, but when I check my pcap there is nothing there? What's happening? I even captured the pcap from the individual containers but there is nothing there.

I should elaborate there is nothing between PCRF and PCSCF. I can see the packets exchanged between PCRF and SMF correctly, but PCRF doesn't talk to PCSCF but somehow it says its connected?!

pcrf_log

pcscf_peer

@herlesupreeth
Copy link
Owner

I'm seeing the following log from PCRF, is it an issue?

Those are just warning which can be ignored.

I took a look at the pcap and I see 401 Unauthorized not answered by the UE which can suggest only one thing, i.e. Ki or OP/OPc value programmed on the SIM or the details entered in pyHSS is wrong

@herlesupreeth
Copy link
Owner

Ki and OP can be desired value but OPc is a derived value from Ki and OP so your OPc is wrong what you entered in open5gs Web UI

@ali-foroughi
Copy link
Author

I verified the Ki and OPc value in the simcard as well as HSS and PyHSS but still no change. It's really odd.

multimedia-auth-answer

I can see that I'm getting Multimedia-Auth Answer and then 401 Unauthorized but then I get nothing back from the UE.

Could it possibly be a UE or eNB issue? Something I need to change?

Here's the new pcap:
any10.pcap.tar.gz

@ali-foroughi
Copy link
Author

Is it possible that my UE doesn't understand the requested Authentication algorithm so it can't respond? Is it possible to change the algorithm from PyHSS?

@herlesupreeth
Copy link
Owner

herlesupreeth commented Jan 29, 2024

I verified the Ki and OPc value in the simcard as well as HSS and PyHSS but still no change.

As I mentioned earlier the value of Ki and OPc is wrong both in your SIM and HSS and pyHSS. Please reprogram your SIM with following details and update the same in HSS and pyHSS. Since you are using COTS UE the Authentication Algorithm should be supported

Ki: 8baf473f2f8fd09487cccbd7097c6862
OP: 11111111111111111111111111111111
OPc: 8E27B6AF0E692E750F32667A3B14605D

@ali-foroughi
Copy link
Author

ali-foroughi commented Jan 29, 2024

Ki: 8baf473f2f8fd09487cccbd7097c6862
OP: 11111111111111111111111111111111
OPc: 8E27B6AF0E692E750F32667A3B14605D

Thanks I'll try it again. Could I ask how you got these values from the pcap? Or are these just a sample ki and OPc? thanks

@ali-foroughi
Copy link
Author

Also shouldn't the SQN value in the HSS database (MongoDB) be matched with the PYHSS database? (mysql)?

@herlesupreeth
Copy link
Owner

Could I ask how you got these values from the pcap?

OPc is computed based on Ki and OP value. Say you fix Ki: 8baf473f2f8fd09487cccbd7097c6862 and OP: 11111111111111111111111111111111 , you can use this repo to compute OPc - https://github.com/herlesupreeth/kiopcgenerator

Also shouldn't the SQN value in the HSS database (MongoDB) be matched with the PYHSS database? (mysql)?

No need. pyHSS will compensate for it

@armindoantuneswit
Copy link

@ali-foroughi hope you have solved your issue.
btw: did you have to do something to make the Samsung device initiate the IMS REGISTER process?
Maybe changing the MCC MNC to 42402?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants