ASN.1 concepts are mapped to Protobuf to work with modern code tools and make the development of Service Models (and various E2* interfaces) easier. Go APER library works with these Protobuf definitions to encode and decode information in APER format. It is a fork of the free5gc project, which was significantly reworked and enhanced to work with protobuf driven Go structs, rather than plain Go structs.
How to deal with encoding/decoding problems?
When you integrate your SW with ONF’s RIC you may face some issues related to the encoding/decoding of the information sent over the wire. Here is a summary of potential problems you may face.
Incompatibility of APER encodings is the most common issue.
APER encoding is specified in ITU-T X.691 and may seem to be a bit vague. In O-RAN, encoding/decoding schema is generated with asn1c tool, which generates a C code. Reference asn1c tool recommended by O-RAN is Nokia’s distribution of asn1c.
Go APER library is fully compatible with Nokia’s asn1c tool (and thus compliant with O-RAN). It was proven with unit tests for E2AP and E2SMs (KPMv2, RC-PRE, MHO, Test-SM).
What may cause incompatibility in APER bytes?
Make sure you’ve inserted all tags in Protobuf, so they correspond to the ASN.1 definition of your SM.
Clarify if all tags are present in the Protobuf (wrapped with Golang, file extension is
.pb.go
). If you don’t see them (tags), please revisit tutorial on how to create your own SM.
Enable DEBUG mode in Go APER library and do a bit by bit analysis by hand (see next section). It helps to determine what goes wrong in the encoding/decoding process, and helps to understand APER encoding/decoding flow better.
Do a bit by bit analysis
Sometimes, doing a bit by bit analysis may help a lot. General rule is to go through the APER bytes and decode them by hand, i.e., verify that all bits correspond to ASN.1 definition. Here are few examples on how to do such analysis:
An analysis of GlobalKPMnode-ID structure per KPM v2.0.3 specification can be found here
It describes encoding of
CHOICE
structures.
An analysis of MeasurementLabel structure per KPM v2.0.3 specification can be found here
It describes encoding of
SEQUENCE
structure with multipleOPTIONAL
items.
An analysis of MeasurementData (a part of IndicationMessage) per KPM v2.0.3 specification can be found here
It describes encoding of lists, i.e.,
SEQUENCE OF
structures.
An analysis of a header of RANfunction-Description per KPMv2.0.3 specification can be found here
It describes encoding of
SEQUENCE
structure headers.
Please consider tacking a look at the links in “Some useful resources” section. It may help to understand the APER encoding flow.
General steps on tackling encoding/decoding problems
Read error message carefully. You may exceed the boundary or forgot to include an item in the message.
You may refer to this guide to get a tip on what does certain error message mean.
Revisit APER tags and make sure they’re present in the
.pb.go
file.Do a bit by bit analysis to understand where is the root cause of the problem.