magma / magma

Platform for building access networks and modular network services
https://www.magmacore.org/
Other
1.68k stars 602 forks source link

5G can't handle userLocationInformationNR timestamp field #12846

Closed jrobsing closed 2 years ago

jrobsing commented 2 years ago

Your Environment

Describe the Issue

Tested the AGW against UERANSIM v3.2.6. The InitialUEMessage fails. The mme log says "tasks/ngap/ngap_amf_decoder.c:0043 Failed to decode PDU". There was no reply message from the AGW. The timestamp field is optional per ts 38.413 UserLocationInformationNR section 9.4.5.

To Reproduce

  1. Install UERANSIM v3.2.6
  2. Modify the UERANSIM config/custom-gnb.yaml file to match the AGW settings
  3. Run "./nr_gnb -c ../config/custom-gnb.yaml"
  4. Modify the UERANSIM config/custom-ue.yaml file to match the AGW settings
  5. Run "./nr_ue -c ../config/custom-ue.yaml"

Expected behavior The UERANSIM UE should register, get an IP, and be able to pass traffic. Although I modified UERANSIM to get my test to work (see below), I believe the actual bug is in the amf because it should have accepted the timestamp field.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context I was able to modify UERANSIM to make it work, by commenting out the timestamp field in file UERANSIM/src/gnb/ngap/transport.cpp function NgapTask::sendNgapUeAssociated. See below. The two commented out lines below are the changes.

        asn::ngap::AddProtocolIeIfUsable(
            *pdu, asn_DEF_ASN_NGAP_UserLocationInformation, ASN_NGAP_ProtocolIE_ID_id_UserLocationInformation,
            FindCriticalityOfUserIe(pdu, ASN_NGAP_ProtocolIE_ID_id_UserLocationInformation), [this](void *mem) {
                auto *loc = reinterpret_cast<ASN_NGAP_UserLocationInformation *>(mem);
                loc->present = ASN_NGAP_UserLocationInformation_PR_userLocationInformationNR;
                loc->choice.userLocationInformationNR = asn::New<ASN_NGAP_UserLocationInformationNR>();

                auto &nr = loc->choice.userLocationInformationNR;
//                nr->timeStamp = asn::New<ASN_NGAP_TimeStamp_t>();

                ngap_utils::ToPlmnAsn_Ref(m_base->config->plmn, nr->nR_CGI.pLMNIdentity);
                asn::SetBitStringLong<36>(m_base->config->nci, nr->nR_CGI.nRCellIdentity);
                ngap_utils::ToPlmnAsn_Ref(m_base->config->plmn, nr->tAI.pLMNIdentity);
                asn::SetOctetString3(nr->tAI.tAC, octet3{m_base->config->tac});
//                asn::SetOctetString4(*nr->timeStamp, octet4{utils::CurrentTimeStamp().seconds32()});
            });
jrobsing commented 2 years ago

This is the packet dissection of the failing case.

eth1.txt

stale[bot] commented 2 years ago

This issue or pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs in the next 14 days.

stale[bot] commented 2 years ago

This issue or pull request has exceeded its lifecylce and was automatically closed. Should you wish to continue working on this, please reopen it.

stale[bot] commented 2 years ago

This issue or pull request has exceeded its lifecylce and was automatically closed. Should you wish to continue working on this, please reopen it.

jao-tm commented 1 year ago

Has this been added to AGW v1.8? I am still getting the same error