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

[gNB] APER decoding failed for SCTP message #684

Open
trawkam opened this issue Jan 11, 2024 · 6 comments
Open

[gNB] APER decoding failed for SCTP message #684

trawkam opened this issue Jan 11, 2024 · 6 comments

Comments

@trawkam
Copy link

trawkam commented Jan 11, 2024

Hello,

When connecting to E\ AMF NG Setup fails with error:

UERANSIM v3.2.6
[2024-01-11 13:23:14.344] [sctp] [info] Trying to establish SCTP connection... (10.9.248.202:38412)
[2024-01-11 13:23:14.357] [sctp] [info] SCTP connection established (10.9.248.202:38412)
[2024-01-11 13:23:14.358] [sctp] [debug] SCTP association setup ascId[424]
[2024-01-11 13:23:14.358] [ngap] [debug] Sending NG Setup Request
[2024-01-11 13:23:14.371] [ngap] [error] APER decoding failed for SCTP message
[2024-01-11 13:23:14.371] [ngap] [warning] Sending an error indication with cause: protocol/transfer-syntax-error

I have compared received response with the one from Open5GS (which works correct) and the only difference i see is additional IE-Extension in ServedGUAMIItem list item:

image

@Stg22
Copy link
Contributor

Stg22 commented Jan 11, 2024

The current version of UERANSIM is based on the release 3GPP 15.8 (see https://github.com/aligungr/UERANSIM/blob/master/tools/ngap-15.8.0.asn1).
However, the use of GUAMIType has been defined into the Release 16.x. And unfortunately, the ASN.1 compiler uses for the project does not include UTF8String requires by the new ASN.1 file (Release 16.x).

So I guess significant code modification are required to support such exchanges.

@Stg22
Copy link
Contributor

Stg22 commented Jan 12, 2024

A temporary solution has been found...
By using the ASN1 file from the Release 3GPP 16.14 of the document TS.38.413, it is possible to get all required source code.

Indeed, the asn1 compiler from the OpenAirInterface project (with the branch velichkov_s1ap_plus_option_group ) with the environment variable ASN1C_PREFIX=ASN_NGAP_ is able to produce files .c and .h. These files will replace those in src/asn/ngap.

Note that RRC has to be updated in a similar way but needs slight additonal modifications.

Obviously, GUAMIType is not handled but do not stop the state machine. So it is not a final solution.

@huaperez
Copy link

@Stg22 I am facing a similar issue as described in the root cause. How to get the temporary solution? It is ok is GUAMIType is not handled at this moment.

@Stg22
Copy link
Contributor

Stg22 commented Jan 25, 2024

You need to get ASN1 compiler from the project Open Air Interface and to use that tool from the branch velichkov_s1ap_plus_option_group.
Then you need to extract ASN1 file from the 3GPP Document 38.413 Release 16 (for instance the latest one: 16.14).
Set the environment varaible export ASN_PREFIX=ASN_NGAP_ and launch the compiler with this file.
You will get a set of files (.c and .h) which will replaced those in the directory https://github.com/aligungr/UERANSIM/tree/master/src/asn/ngap. You will need also to put some additional files from the directory "skeletons" (UTF8String, ...) of asn1 source code to the following directory https://github.com/aligungr/UERANSIM/tree/master/src/asn/asn1c. If you don't do that, you will get compiling error (note that is is a good way to identify the additional files required from the directory "skeletons" :o) )
Finally, recompile UERANSIM.
You can apply the same procedure for RRC in order to have also a release 16.

I will try to provide a more detail procedure later.

@vulcanfan
Copy link

vulcanfan commented Apr 24, 2024

Hi @Stg22
I have tried to compile Rel 16 NGAP with the branch you indicated above, but I'm getting errors such as:

WARNING: Parameterized type NGAP-PRIVATE-IES expected for NGAP-PRIVATE-IES at line 8066 in ngap.asn1
WARNING: Parameterized type NGAP-PRIVATE-IES expected for NGAP-PRIVATE-IES at line 8067 in ngap.asn1
WARNING: Parameterized type NGAP-PRIVATE-IES expected for NGAP-PRIVATE-IES at line 8067 in ngap.asn1
WARNING: Parameterized type NGAP-PRIVATE-IES expected for NGAP-PRIVATE-IES at line 8067 in ngap.asn1
WARNING: Parameterized type NGAP-PRIVATE-IES expected for NGAP-PRIVATE-IES at line 8068 in ngap.asn1
WARNING: Parameterized type NGAP-PRIVATE-IES expected for NGAP-PRIVATE-IES at line 8068 in ngap.asn1
WARNING: Parameterized type NGAP-PRIVATE-IES expected for NGAP-PRIVATE-IES at line 8068 in ngap.asn1
FATAL: Name "e_ASN_NGAP_extensionValue" is generated by NGAP-Containers.extensionValue at line ngap.asn1:8055 and NGAP-Containers.extensionValue at line ngap.asn1:8055
FATAL: Name "enum ASN_NGAP_extensionValue" is generated by NGAP-Containers.extensionValue at line ngap.asn1:8055 and NGAP-Containers.extensionValue at line ngap.asn1:8055
FATAL: Name "ASN_NGAP_extensionValue_PR" is generated by NGAP-Containers.extensionValue at line ngap.asn1:8055 and NGAP-Containers.extensionValue at line ngap.asn1:8055

I don't know if the parameterization Warning can be ignored. But the Fatal errors seem related, and seems to be complaining that a type definition on a line is conflicting with itself.

If I use -fcompound-names then the compilation completes, but then building UERANSIM fails because of various missing type definitions related to parameterised types. Eg:

[  2%] Building C object src/asn/ngap/CMakeFiles/asn-ngap.dir/ASN_NGAP_AMF-TNLAssociationSetupItem.c.o
In file included from ./UERANSIM/src/asn/ngap/ASN_NGAP_ProtocolExtensionField.h:19,
                 from ./UERANSIM/src/asn/ngap/ASN_NGAP_ProtocolExtensionContainer.h:3234,
                 from ./UERANSIM/src/asn/ngap/ASN_NGAP_EndpointIPAddressAndPort.h:46,
                 from ./UERANSIM/src/asn/ngap/ASN_NGAP_ProtocolIE-Field.h:22,
                 from ./UERANSIM/src/asn/ngap/ASN_NGAP_ProtocolIE-SingleContainer.h:15,
                 from ./UERANSIM/src/asn/ngap/ASN_NGAP_CPTransportLayerInformation.h:16,
                 from ./UERANSIM/src/asn/ngap/ASN_NGAP_AMF-TNLAssociationSetupItem.h:15,
                 from ./UERANSIM/src/asn/ngap/ASN_NGAP_AMF-TNLAssociationSetupItem.c:8:
./UERANSIM/src/asn/ngap/ASN_NGAP_UPTransportLayerInformation.h:35:17: error: unknown type name ‘ASN_NGAP_ProtocolIE_SingleContainer_8012P48_t’
   35 |                 ASN_NGAP_ProtocolIE_SingleContainer_8012P48_t    choice_Extensions;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The reason it can't find the type definition is because it referenced by ASN_NGAP_UPTransportLayerInformation.h before the type gets declared lower down in ASN_NGAP_ProtocolIE-SingleContainer.h. That is, from above, ASN_NGAP_ProtocolIE-SingleContainer.h pulls in ASN_NGAP_ProtocolIE-Field.h and eventually ASN_NGAP_UPTransportLayerInformation.h before ASN_NGAP_ProtocolIE_SingleContainer_8012P48_t is declared lower down in ASN_NGAP_ProtocolIE-SingleContainer.h. So a dependency issue.

Please can you advise how you managed to compile Rel16, and any hints you can give here?
Many thanks in advance

@nie-off
Copy link

nie-off commented Nov 26, 2024

Hi @vulcanfan ,
I provided the PR #739 where you can find a current UERANSim version with compiled ASN1 NGAP filed from 3GPP Release 17 which works at least with open5gs and Ericsson. In the PR, I also shared a script how to compile and replace the ASN1 files by oneself, so you can adjust it to the Release 16 accordingly.

Hope it helps!

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

5 participants