-
Notifications
You must be signed in to change notification settings - Fork 68
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
Configuring PyHSS with open5Gs #215
Comments
In the Open5GS config:
The "connectPeer = " line, typically at the end of the file, would need to point to the PyHSS instance. The hostname should be the same as the OriginHost value set in PyHSS config.yaml and the IP obviously the address it is running on. This is for the S6a interface from MME to HSS.
This should have the same "connectPeer =" line as above. This is for the Gx interface from SMF to the PCRF provided by PyHSS. Assuming you are running everything on the same host, you would probably also want to stop Open5GS HSS and PCRF from starting. |
Hey! Thanks a lot for your reply, ok i understood that i'll stop open5gs hss and PCRF services. is this setup enough to perform online charging ? i'm still a bit confused There are 2 interfaces Gx and Gy, from what i understand connection SMF - PyHss implements Gx But for credit control i need to implement Gy? how will i set this up |
I don't know much about PCRF to be honest. My use case is for private networks and I just wanted to remove any reliance on Open5GS HSS/WebUI and MongoDB. There are some PCRF notes in this repo, but I didn't see mention of Gy. |
Hello @9600 I am encountering the same issue now. I have followed your instructions above, but still the problem persists, attach fails.. with the following logs: Under mme section, under freediameter, under connect, I gave the hss identity and the ip address. Did the same for freediameter connection under smf also. Hope its fine. Updated the s1ap server address with the host address, updated the gummei and tai values appropriately. Under sgwu, gtpu server address also I updated with host's ip address. and disabled hss and pcrf and launched the EPC. On the pyHSS config, I just updated the realm name with the same realm which was used by open5gs mme and the bind ip address and identity which was given for mme's freediameter. Is this all I need to do or did I miss anything? I launched the pyhss, added the APN, AUC, subscriber details and tried to attach a UE, initial authentication is passing and then attach is failing with diameter error 5030. Attaching the epc console log for reference here. 02/27 19:13:30.225: [sgwc] INFO: [Added] Number of SGWC-Sessions is now 1 (../src/sgwc/context.c:924) Please someone help me identify the issue and suggest the steps to overcome this. Thanks & regards, |
Hi @9600 Any update here? I did the 2 steps that you mentioned, but I have used srsenb.yaml on the open5gs to configure and launch the EPC. I did the 2 steps (for mme and smf that you mentioned in that only) and launched pyhss and configured apn, auc, subscriber, tfts and charging rule. But when I try to attach the UE, the s6a/s6d interface between the mme and hss is success. But the Gx interface between SMF and PCRF is failing with DIAMETER_USER_UNKNOWN message for Credit Control Answers. Not able to figure out how to solve this. Please share any pointers. Thanks & Regards, |
Found some differences between a working log (with the docker image based core+hss+ims) and the non-working log (with plain open5gs+pyhss) In the working log, I see that the Credit Control Request is sending only the END_USER_IMSI (for the imsi) but for the non-working case, the Credit Control Request is coming with both END_USER_IMSI and END_USER_E164 (for msisdn). But in the pyhss code, they are not parsing this filed (subscription-id type) while decoding the AVPs and while creating the response they iterate over the number of AVPs to copy the data directly to IMSI variable...so the 1st imsi is getting overwritten with msisdn value and subsequent usage of imsi variable is creating an issue. So there are two issues...
Attaching the screenshots of both the working and non-working case logs for your reference! |
In the working case above, both the hss in Open5GS and hss in pyhss are used. Open5GS for normal subscriber and pyhss for ims subscriber. And for open5gs hss, in the steps given under docker image usage, msisdn was not part of the subscriber config. Hence when msisdn is not present, the SMF will not send the msisdn in Gx CCR. But now when I am using pyhss's hss itself for normal subscriber, I had entered msisdn and hence open5gs was sending msisdn also in CCR. But if I remove msisdn from the subscriber config, then it fails in the Authentication itself (in s6a/s6d interface). So only if I add msisdn again for the same subscriber then only Authentication will be success and it fails in CCA. This is because briefly the HSS stops with the following error on console where I am running diameterService.py [03/14/2025 15:01:09] [INFO] [Diameter] [writeOutboundData] [472a2135-c0a3-4126-8ac8-3871bc220df2] Connection closed for 127.0.0.1 on port 57712, closing writer.Traceback (most recent call last): and hence mme connection is lost and then connection gets reestablished. and the process repeats itself... Any comments..? Has anyone faced similar issue ? Or am I the only one facing this issue? Should I open a new issue for this ? |
In the pyhss code for the Credit Control Answer, when the subscriber details are derived from AVPs, the imsi variable was getting overwritten with msisdn value because they were not checking for the Subscriber-ID Type to distinguish if it is IMSI or MSISDN, when both imsi and msisdn is sent over the Credit Control Request. Added a code for the same and UE attached and traffic also worked :-) |
Hey ! Thanks guys so far i could make it work and playing with different eNbs. My goal is to create very basic billing and i'm familiar with python i'd like to create certain flows -> captive portal ips, my webiste ip, paypal ips and add them in rating group as zero rate and the rest of traffic report to OSC and when user makes attach install proper limits with "reauth limits" please give me a vector of implementation if you can :) i'm brand new to 3GPP protocols so my brain blows up ha ha For example i see OCS webhook, so from what i understand i can push consumptions to my OCS but how can i reinstall for user updated remaining quotas? |
@ashokhs77: Thank you for the Fix! I made a patch file for your code. |
Thanks ! Very helpful . I made a fork in my case and managed to add conditions . Without your input I would probably spend weeks solving this trouble haha |
Hello everyone, i have several questions
I successfully installed Pyhss and could populace AcUs, Subscribers, apns,
how can i connect my open5gs setup to PyHSS to completely avoid using built-in hss and be able to run it as EPC / 4G ?
Thank you in advance, would be great to add some example here
The text was updated successfully, but these errors were encountered: