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

SGWC unable to connect to SMF gtpc port != default #897

Closed
pespin opened this issue Mar 31, 2021 · 10 comments
Closed

SGWC unable to connect to SMF gtpc port != default #897

pespin opened this issue Mar 31, 2021 · 10 comments
Labels
Housekeeping:ToClose Issues reviewed and closed. Old requests, issues which are not bug, feature or documentation request

Comments

@pespin
Copy link
Contributor

pespin commented Mar 31, 2021

For network setup convinience, in osmo-gsm-tester I am using 1 IP address per object when setting up tests, which means all nodes of an EPC object get 1 unique IP address, and I can configure all open5gs processes to work under the same IP address by configuring different ports to work fine.

I saw most config files can set the "port" together with the "addr", and it's working mostly fine, I have all processes running and connecting each other.

For instance in GTP, I have:
MME = 172.18.50.100:2123
SGWC = 172.18.50.100:2125
SMF = 172.18.50.100:2124

Hence, following config files:
mme.yaml:

mme:
    gtpc:
      - addr: ${epc.run_addr} #default port 2123 is used here
sgwc:
    gtpc:
      - addr: ${epc.run_addr}
        port: 2125
smf:
    gtpc:
      - addr: ${epc.run_addr}
        port: 2124

sgwc.yaml:

sgwc:
    gtpc:
      - addr: ${epc.run_addr}
        port: 2125

smf.yaml:

smf:
    gtpc:
      - addr: ${epc.run_addr}
        port: 2124

However, upon UE attachment, I noticed the following set of messages being sent:

MME  ->    SGWC:    Create Session Request
SGWC -> SGWU:    Session Establishment Request
SGWU -> SGWC:    Session Establishment Response
SGWC ->    MME:    Create Session Request

And MME then warning about unsupported rx message "Create Session Request". Looking at SGWC code (open5gs.git/src/sgwc/sxa-handler.c sgwc_sxa_handle_session_establishment_response()), that message is aimed at the SMF (interface S5), so clearly something is wrong, since it being sent to the MME (172.18.50.100:2123).

It seems that happens because the port being used in sgwc_sxa_handle_session_establishment_response() is taken from somewhere which is never set, and hence is always 2123. As a result, since the IP address is the same for all nodes, and 2123 was the port MME was listening to, the message is sent to the MME.

After finding that out, I simply did the following changes, and I can have the attachment complete fine with srsUE+srsENB (signalling, didn't get to the user plane setup yet):

diff --git a/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl b/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl
index 9aec578..d8e23de 100644
--- a/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl
+++ b/src/osmo_gsm_tester/templates/open5gs-mmed.yaml.tmpl
@@ -146,8 +146,8 @@ sgwc:
 #        apn: volte
 smf:
     gtpc:
-      - addr: ${epc.run_addr}
-        port: 2124
+      - addr: 127.0.0.1
+        port: 2123

 #
 # parameter:
diff --git a/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl b/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl
index 0e01337..dfd1092 100644
--- a/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl
+++ b/src/osmo_gsm_tester/templates/open5gs-smfd.yaml.tmpl
@@ -313,8 +313,8 @@ smf:
       - addr: ${epc.run_addr}
         port: 8808
     gtpc:
-      - addr: ${epc.run_addr}
-        port: 2124
+      - addr: 127.0.0.1
+        port: 2123
     gtpu:
       - addr: ${epc.run_addr}
         port: 2153

So as you see, I did temporarily change the IP address, and I can say the IP address is passed correctly. However, the port used by SGWC to connect to SMF is always 2123, despite being able to configure it fine in all nodes.
We do maybe need a new "smf: gtpc: port:" section in sgwc.yaml? That would be really useful to be able to run everything using 1 IP address, or simply to be able to pick any random port number by automated tests.

@acetcom
Copy link
Member

acetcom commented Mar 31, 2021

@pespin

That's just a testing purposes for me. You should not use this. According to the 3GPP standard, the port number cannot be delivered to the other entity using S1AP/GTPv2/PFCP.

Thanks a lot!
Sukchan

@pespin
Copy link
Contributor Author

pespin commented Mar 31, 2021

While I agree that in a usual setup the default port should be used, I see it totally confusing that one can actually configure those ports in some places except in one. So that's why I proposed adding the extra configuration node to set the port in SGWC. Otherwise, what's the point in being able to configure the other GTPC ports?

Would you accept such a patch?

@acetcom
Copy link
Member

acetcom commented Mar 31, 2021

@pespin I have no plan to be able to set the port in SGWC. Sorry for not help this!

@pespin
Copy link
Contributor Author

pespin commented Mar 31, 2021

Thanks for your feedback. However, my question was more in the line of knowing if you would accept such a patch if someone else (for example: me) submitted a PR for it.

@acetcom
Copy link
Member

acetcom commented Mar 31, 2021

No. I don't like to accept such a patch.

@laf0rge
Copy link
Contributor

laf0rge commented Mar 31, 2021

@acetcom would you then prefer a patch to remove the configuration option from all the other places?

As @pespin states, it is inconsistent that you can configure non-standard ports in all except one place in open5gs. This just makes it easy for users to shoot themselves into the foot. So IMHO, it should be possible everywhere (so it can create a working config), or nowhere.

@acetcom
Copy link
Member

acetcom commented Mar 31, 2021

@laf0rge Yes! I'll remove an unused port in the configuration files tomorrow!

@acetcom
Copy link
Member

acetcom commented Apr 1, 2021

Today I reviewed the configuration files related to port number. Port settings in GTP/PFCP have already been removed in configuration files. Only S1AP/NGAP/SGsAP/SBI port is configurable.

I think we can just leave it as it is.

Let me know if you have any further questions.
Sukchan

@pespin
Copy link
Contributor Author

pespin commented Apr 12, 2021

Hi,

so if I understand correctly, you simply checked that the example config files don't come with the "port:" attribute. Still, by looking at the code, one can infer that those ports can be set by config files (see the yaml parser related code), hence creating the false illusion that different ports than standard one can be used. That's precisely what happened to me.

Hence, the solution would be also to drop the code parsing the "port" attribute from yaml in the related nodes.

osmocom-gerrit pushed a commit to osmocom/osmo-gsm-tester that referenced this issue Apr 12, 2021
Despite open5gs allowing to change the GTP ports in the config file, in
reality changing those values to something else than the standard prot
will fail. Hence, we must use the standard port. As a result, we must
use different IP addresses in each process to avoid ip+port collisions.
Let's use some loopback addresses which shouldn't require extra
configuration on the host, and still only requiring 1 run_node as per
existing EPCs, with the limitation that only 1 open5gs EPC instance can
be run at one in a given run_node.

Related: open5gs/open5gs#897
Change-Id: Id3062c6ad9d6de4c6066547e1e46edad5da285c1
@pobk pobk added the Housekeeping:ToClose Issues reviewed and closed. Old requests, issues which are not bug, feature or documentation request label Feb 17, 2023
@github-actions
Copy link

This issue has been closed automatically due to lack of activity. This has been done to try and reduce the amount of noise. Please do not comment any further. The Open5GS Team may choose to re-open this issue if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping:ToClose Issues reviewed and closed. Old requests, issues which are not bug, feature or documentation request
Projects
None yet
Development

No branches or pull requests

4 participants