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

Huawei Commercial gNB - NG error indication ("id-RANNodeName" and "id-Extended-RANNodeName") #994

Closed
fefer opened this issue May 12, 2021 · 4 comments

Comments

@fefer
Copy link

fefer commented May 12, 2021

Hi,

I am trying to integrate a Huawei commercial gNB but I am getting an "error indication" after the ng setup request. I believe the error is caused because of mal functioning of parsing 2 fields of the ng setup request, the "id-RANNodeName" and "id-Extended-RANNodeName". Should I be able to parse both items? I am attaching the pcap too.

test.pcapng.zip

BR

@fefer fefer changed the title Commercial gNB - NG error indication Commercial gNB - NG error indication ("id-RANNodeName" and "id-Extended-RANNodeName") May 12, 2021
@fefer fefer changed the title Commercial gNB - NG error indication ("id-RANNodeName" and "id-Extended-RANNodeName") Huawei Commercial gNB - NG error indication ("id-RANNodeName" and "id-Extended-RANNodeName") May 12, 2021
acetcom added a commit that referenced this issue May 13, 2021
So, I've added forcely APC_EXTENSIBLE.
@acetcom
Copy link
Member

acetcom commented May 13, 2021

@fefer

There seems to be a problem with the asn1c compiler in open5gs. So, I manually created branch issues994 to handle this problem. You can find my patch code in this commit a3195bc. It's not a fundamental solution, but it work well at least in open5gs simulation environment.

And also, @riebl provided the following patch in the @mouse07410 vlm_master as below.
mouse07410/asn1c@c35ebd3

However, there is no APC_EXTENSION in RAN NodeName UTF8String of Extended RAN NodeName.

I'll try, but I'm not sure if I can fix it.

Thank you for sharing this issue.
Sukchan

@acetcom
Copy link
Member

acetcom commented May 14, 2021

@fefer

I've fixed and updated it to the main branch. It was solved by manually modifying the code generated by asn1c.

The asn1c decoding/encoding does not work properly when UTF8String requires APC_EXTENSIBLE(...).

AMFNameUTF8String ::= UTF8String (SIZE(1..150, ...))
RANNodeNameUTF8String ::= UTF8String (SIZE(1..150, ...))

The following code shows that UTF8String is not a known multiplier and there is a bug where APC_EXTENSIBLE is lost in this case. For your reference, in PrintableString and VisibleString, APC_EXTENSIBLE is generated well. Because they are a known multiplier.

### libasn1parser/asn1p_expr.h

 87 #define ASN_STRING_KM_MASK  0x100   /* Known multiplier */
 88 #define ASN_STRING_NKM_MASK 0x200   /* Not a known multiplier */
 89 #define ASN_STRING_MASK     0x300   /* Every restricted string type */
 90     ASN_STRING_IA5String    = ASN_STRING_KM_MASK,
 91     ASN_STRING_PrintableString,
 92     ASN_STRING_VisibleString,
 93     ASN_STRING_ISO646String,    /* aka VisibleString */
 94     ASN_STRING_NumericString,
 95     ASN_STRING_UniversalString,
 96     ASN_STRING_BMPString,
 97     ASN_STRING_UTF8String   = ASN_STRING_NKM_MASK,
 98     ASN_STRING_GeneralString,
 99     ASN_STRING_GraphicString,
100     ASN_STRING_TeletexString,
101     ASN_STRING_T61String,

If you analyze the asn1c source code a little more, range->non_PER_visible is set to 1 in Not a known multipler.

### libasn1fix/asn1fix_crange.c

1022     /*
1023      * X.691, #9.3.6
1024      * Constraints on restricted character string types
1025      * which are not known-multiplier are not PER-visible.
1026      */
1027     if((expr_type & ASN_STRING_NKM_MASK))
1028         range->not_PER_visible = 1;
1029 

In this case, it is returned from line 2036 according to line 2034 of the code below. Lines 2098-2101 cannot be executed. So, APC_EXTENSIBLE is lost in UTF8String.

### libasn1compiler/asn1c_C.c

2032 static int
2033 emit_single_member_PER_constraint(arg_t *arg, asn1cnst_range_t *range, int      alphabetsize, const char *type) {
2034     if(!range || range->incompatible || range->not_PER_visible) {
2035         OUT("{ APC_UNCONSTRAINED,\t-1, -1,  0,  0 }");
2036         return 0;
2037     }
...
2098             OUT("{ APC_CONSTRAINED%s,%s% d, % d, ",
2099                 range->extensible
2100                     ? " | APC_EXTENSIBLE" : "",
2101                 range->extensible ? " " : "\t", (int)rbits, (int)ebits);

I haven't been tracking this issue anymore. I solved it manually as Open5GS only uses UTF8String in AMFNameUTF8String and RANNodeNameUTF8String.

Let me know if you have any further questions.

Thank you so much for sharing this issue.
Sukchan

@fefer
Copy link
Author

fefer commented May 19, 2021

Hi Sukchan,

Thanks a lot! With your update I was able to integrate the Huawei model is a BTS 5900 in case you want to add to your list. I was able to get up to 1Gbps (which is the max of my current interface) on a single device.

Best regards

@Matheus-Garbelini
Copy link

Matheus-Garbelini commented Jun 30, 2021

Hi, is BTS 5900 operating in 5G NSA or SA mode?
Could not find any official datasheet information of this product on google. Thanks

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