Giter VIP home page Giter VIP logo

Comments (8)

mubk00 avatar mubk00 commented on August 27, 2024 1

@alvasMan I apologize for the delay in my response. Due to unforeseen circumstances, I was unable to reply to your message earlier. I have been busy with other testing the setup. I'll re-try again on Friday when I have tested it with the setup, and I'll provide the logs. Thanks for the help so far.

from srsran_project.

mubk00 avatar mubk00 commented on August 27, 2024

Hi.
I was able to reproduce the same problem when testing earlier today (using B210 and X300).

Here are the debugging logs:

[2023-03-07T09:17:36.068790] [AMF] [sctp   ] [debug] SCTP Association Change event received
[2023-03-07T09:17:36.068810] [AMF] [sctp   ] [debug] Add new association with id (17812)
[2023-03-07T09:17:36.068850] [AMF] [ngap   ] [debug] Ready to handle new NGAP SCTP association request (id 17812)
[2023-03-07T09:17:36.068853] [AMF] [ngap   ] [debug] Create a new gNB context with assoc_id (17812)
[2023-03-07T09:17:36.070346] [AMF] [sctp   ] [error] Received data from peer with unsolicited PPID (0), 
expecting (60)

from srsran_project.

alvasMan avatar alvasMan commented on August 27, 2024

Thanks for the report.
Something as simple as this should fix the issue:

commit ec07389145175e86f9468363e67e934ca3ff1e44 (HEAD -> sctp_ppid, origin/sctp_ppid)
Author: Pedro Alvarez <[email protected]>
Date:   Tue Mar 7 18:48:52 2023 +0000

    sctp: fix NGAP ppid

diff --git a/apps/gnb/gnb.cpp b/apps/gnb/gnb.cpp
index ab5b8a00b..fe1a4b295 100644
--- a/apps/gnb/gnb.cpp
+++ b/apps/gnb/gnb.cpp
@@ -92,6 +92,7 @@ static void compute_derived_args(const gnb_appconfig& gnb_params)
   ngap_nw_config.connect_address = gnb_params.amf_cfg.ip_addr;
   ngap_nw_config.connect_port    = gnb_params.amf_cfg.port;
   ngap_nw_config.bind_address    = gnb_params.amf_cfg.bind_addr;
+  ngap_nw_config.ppid            = NGAP_PPID;
 }
 
 namespace {
diff --git a/include/srsran/gateways/sctp_network_gateway.h b/include/srsran/gateways/sctp_network_gateway.h
index 2b897c44e..fba94e626 100644
--- a/include/srsran/gateways/sctp_network_gateway.h
+++ b/include/srsran/gateways/sctp_network_gateway.h
@@ -19,10 +19,13 @@
 
 namespace srsran {
 
+constexpr uint16_t NGAP_PPID = 60; // NGAP PPID, see TS 38.412, section 7.
+
 /// \brief Configuration for SCTP network gateway
 struct sctp_network_gateway_config : common_network_gateway_config {
   std::string connect_address;
   int         connect_port = 0;
+  int         ppid         = 0; /// the Payload Protocol Identifier
   // TODO add SCTP specific options
 };
 
diff --git a/lib/gateways/sctp_network_gateway_impl.cpp b/lib/gateways/sctp_network_gateway_impl.cpp
index 48e374660..0cb6c0cd1 100644
--- a/lib/gateways/sctp_network_gateway_impl.cpp
+++ b/lib/gateways/sctp_network_gateway_impl.cpp
@@ -546,7 +546,7 @@ void sctp_network_gateway_impl::handle_pdu(const byte_buffer& pdu)
                                 pdu_span.size_bytes(),
                                 (struct sockaddr*)&server_addr,
                                 server_addrlen,
-                                ppi,
+                                htonl(config.ppid),
                                 0,
                                 stream_no,
                                 0,
diff --git a/lib/gateways/sctp_network_gateway_impl.h b/lib/gateways/sctp_network_gateway_impl.h
index 45df3cbe2..4d1b594d6 100644
--- a/lib/gateways/sctp_network_gateway_impl.h
+++ b/lib/gateways/sctp_network_gateway_impl.h
@@ -90,7 +90,6 @@ private:
   int                     server_ai_socktype = 0;
   int                     server_ai_protocol = 0;
 
-  unsigned ppi       = 0; /// the Payload Protocol Identifier (e.g. 18 for S1AP)
   unsigned stream_no = 0; /// the stream number to use for sending
 };

from srsran_project.

mubk00 avatar mubk00 commented on August 27, 2024

Thanks.

Earlier today, I attempted to hard-code the ppid value to 60 in the code, re-tested, and obtained the same error. I have also now just applied the patch you provided here, re-built the project, and re-tested running gNB and 5GC. However, I am still getting the same issue with [2023-03-07T20:00:21.495902] [AMF] [sctp ] [error] Received data from peer with unsolicited PPID (0), expecting (60)

Can you @iman432 confirm this to see if it works for you? I'll have to re-check my setup, I might be doing something wrong somewhere.

from srsran_project.

alvasMan avatar alvasMan commented on August 27, 2024

Hum... strange. I tested it, but only with the NG setup, tough.
I'll test again with the full attach.

Do you have a pcap?

from srsran_project.

alvasMan avatar alvasMan commented on August 27, 2024

@mubk00, just tested again (now with a full attach) and it seems fine to me. Did you apply the patch correctly?
You should be able to just do git am < 0001-sctp-fix-NGAP-ppid.patch.txt and re-compile.

0001-sctp-fix-NGAP-ppid.patch.txt

If you did apply the patch and are still seeing the error can you capture the traffic between the gNB and the core and attach the PCAP?

from srsran_project.

robertfalkenberg avatar robertfalkenberg commented on August 27, 2024

Confirming patch by @alvasMan is setting `payload protocol identifier correctly:

Before:
image

After:
image

from srsran_project.

mubk00 avatar mubk00 commented on August 27, 2024

Hi.

I just want to mention I got it to work, thanks for the patch @alvasMan

from srsran_project.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.