edgecomllc / eupf

5G User Plane Function (UPF) based on eBPF
Apache License 2.0
100 stars 20 forks source link

Test OAI and srsRAN location interfaces #471

Closed pirog-spb closed 7 months ago

pirog-spb commented 11 months ago
kade-ddnkv commented 10 months ago

Messages order:

  1. LMF -> AMF [using NAMF, that is, AMF SBI]
  2. AMF -> gNB [NGAP, Downlink NRPPa Transport]
  3. Crash at gNB. Cannot decode NGAP message.

gNB used: RFsimulator (OAI gNB) UE used: OAI UE $$\ $$

Which should be used?

ASN1 Encoding. Looks like OAI and free5gc are using different types of encoding. OAI is using BER (DER); free5gc is using APER-encoding; $$\ $$

free5gc

kade-ddnkv commented 10 months ago

Current situation.

  1. PositioningInformationRequest is encoded (APER encoding).
  2. Message Transfer Request is sent to AMF (through NAMF).
  3. AMF sends payload of the message to gNB (though NGAP).
  4. gNB hangles message and doesn't send response (?).

$$\ $$ There are several reasons for that:

$$\ $$ Details:

Deployment configuration $$\ $$ * Using commit `5a2b9e29f4a74a0bc8344fd529a9134fc21dbe2b` (one of commits from [NRPPA_Procedures](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/NRPPA_Procedures) branch) * Using tutorial: [https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_OAI_nrUE.md](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_OAI_nrUE.md). Running RFsimulator. * Additional changes: * May need to install package `libgmp3-dev`. Or it is installed via `./build_oai -I` command in tutorial, I am not sure. * Code to encode message: [dec_nrppa.c](https://github.com/kade-ddnkv/lmf-emulation/blob/main/dec_nrppa.c) * Code to send message: [n1n2_send_nrppa.go](https://github.com/kade-ddnkv/lmf-emulation/blob/main/n1n2_post_nrppa.go) $$\ $$
HTTP2 response from AMF ``` &{200 OK 200 HTTP/2.0 2 0 map[Date:[Wed, 15 Nov 2023 09:19:47 GMT]] {0xc0000dc300} -1 [] false false map[] 0xc0000d6000 } {"cause":"N1_N2_TRANSFER_INITIATED"} ```
AMF logs ``` [2023-11-15 10:19:47.199] [amf_server] [debug] Message content ------Boundary Content-Type: application/json { "pduSessionId": 1, "n2InfoContainer": { "n2InformationClass": "NRPPa", "nrppaInfo": { "nfId": "lmf-emulator-0", "nrppaPdu": { "ngapIeType" : "NRPPA_PDU", "ngapData": { "contentId": "n2msg" } } } } } ------Boundary Content-Type: application/vnd.3gpp.5gnas Content-Id: n1SmMsg ------Boundary Content-Type: application/vnd.3gpp.ngap Content-Id: n2msg [2023-11-15 10:19:47.199] [amf_server] [info] ue_context_id imsi-001010000000001 [2023-11-15 10:19:47.199] [amf_app] [debug] Parsing the message with the Simple Parser [2023-11-15 10:19:47.199] [amf_app] [debug] Boundary: ----Boundary [2023-11-15 10:19:47.199] [amf_app] [debug] Content Type: application/json [2023-11-15 10:19:47.199] [amf_app] [debug] Content Id: root [2023-11-15 10:19:47.199] [amf_app] [debug] Body: { "pduSessionId": 1, "n2InfoContainer": { "n2InformationClass": "NRPPa", "nrppaInfo": { "nfId": "lmf-emulator-0", "nrppaPdu": { "ngapIeType" : "NRPPA_PDU", "ngapData": { "contentId": "n2msg" } } } } } [2023-11-15 10:19:47.199] [amf_app] [debug] Content Type: application/vnd.3gpp.5gnas [2023-11-15 10:19:47.199] [amf_app] [debug] Content Id: n1SmMsg [2023-11-15 10:19:47.199] [amf_app] [debug] Body: [2023-11-15 10:19:47.199] [amf_app] [debug] Content Type: application/vnd.3gpp.ngap [2023-11-15 10:19:47.199] [amf_app] [debug] Content Id: n2msg [2023-11-15 10:19:47.199] [amf_app] [debug] Body: [2023-11-15 10:19:47.199] [amf_server] [debug] Number of MIME parts 3 [2023-11-15 10:19:47.199] [amf_server] [debug] MIME part: root (249) [2023-11-15 10:19:47.199] [amf_server] [debug] MIME part: n1SmMsg (0) [2023-11-15 10:19:47.199] [amf_server] [debug] MIME part: n2msg (9) [2023-11-15 10:19:47.199] [amf_server] [info] Procedure n1-n2-messages [2023-11-15 10:19:47.199] [amf_server] [debug] Receive N1N2MessageTransfer Request, handling... [2023-11-15 10:19:47.199] [amf_server] [debug] NgapIeType_anyOf: set to NRPPA_PDU [2023-11-15 10:19:47.199] [amf_server] [debug] SUPI imsi-001010000000001 [2023-11-15 10:19:47.199] [amf_server] [debug] N2InfoContainer is present, handling... [2023-11-15 10:19:47.199] [amf_server] [debug] N2 Information Class: NRPPA [2023-11-15 10:19:47.199] [amf_server] [debug] N2 Content Id: n2msg [2023-11-15 10:19:47.199] [amf_server] [debug] NGAP IE Type: NRPPA_PDU [2023-11-15 10:19:47.199] [amf_app] [debug] Data input 00 09 00 00 7b 03 00 00 00 [2023-11-15 10:19:47.199] [amf_app] [debug] Msg hex 000900007b03000000 [2023-11-15 10:19:47.199] [amf_app] [debug] Received N1N2_MESSAGE_TRANSFER_REQ [2023-11-15 10:19:47.199] [amf_app] [info] Handle ITTI N1N2 Message Transfer Request for NRPPa PDU [2023-11-15 10:19:47.199] [amf_n2] [info] Received Downlink UE Associated NRPPA Transport message, handling [2023-11-15 10:19:47.199] [amf_n2] [debug] Handle Downlink UE Associated NRPPa Transport ... InitiatingMessage ::= { procedureCode: 8 criticality: 1 (ignore) value: DownlinkUEAssociatedNRPPaTransport ::= { protocolIEs: ProtocolIE-Container ::= { DownlinkUEAssociatedNRPPaTransportIEs ::= { id: 10 criticality: 0 (reject) value: 1 } DownlinkUEAssociatedNRPPaTransportIEs ::= { id: 85 criticality: 0 (reject) value: 0 } DownlinkUEAssociatedNRPPaTransportIEs ::= { id: 46 criticality: 0 (reject) value: 00 09 00 00 7B 03 00 00 00 } DownlinkUEAssociatedNRPPaTransportIEs ::= { id: 89 criticality: 0 (reject) value: 6C 6D 66 2D 65 6D 75 6C 61 74 6F 72 2D 30 } } } } [2023-11-15 10:19:47.199] [ngap] [debug] Encoded size (52) [2023-11-15 10:19:47.200] [sctp] [debug] [Socket 4, Assoc ID 269] Sending buffer 0x7fa348003a60 of 52 bytes on stream 1 with ppid 60 [2023-11-15 10:19:47.200] [sctp] [debug] Successfully sent 52 bytes on stream 1 [2023-11-15 10:19:47.200] [ngap] [debug] Free NGAP Message PDU ```
gNB logs ``` [NGAP] Ngap_gNB_itti_send_DownlinkUEAssociatedNRPPa Routing id size =14 and id is 6c 6d 66 2d 65 6d 75 6c 61 74 6f 72 2d 30 [NGAP] Ngap_gNB_itti_send_DownlinkUEAssociatedNRPPa Nrppa pdu size =9 and pdu is 00 09 00 00 7b 03 00 00 00 [NRPPA] Test Adeel: calling handler case NGAP_DOWNLINKUEASSOCIATEDNRPPA [NRPPA] Test 3 Adeel: nrppa_handle_DownlinkUEAssociatedNRPPaTransport Handling case NGAP_DOWNLINKUEASSOCIATEDNRPPA UE ASSOCIATED NRPPA BUFFER RECEIVED:0 9 0 0 7b 3 0 0 0 TEST 3: nrppa_handle_DownlinkUEAssociatedNRPPaTransport Nrppa pdu size =9 and value is Test 4 Adeel: nrppa_gNB_decode_pdu Handling [NRPPA][I]Positioning Information Request initiating message [NRPPA] Test 4 Adeel: procedureCode is 9 and direction 1 is Test 5 Adeel: procedureCode is 9 and direction 1 is NEEDED FUNCTION PTR: 0x55890f55e4a0 ACTUAL FUNCTION PTR: 0x55890f55e4a0 STARTING POS INF EXCHANGE FUNCTION Test 8 Adeel: procedureCode is 9 and direction 1 is Test 1 Adeel: NRPPA Waiting for message [NR_MAC] Frame.Slot 512.0 UE RNTI 4c38 (1) PH 0 dB PCMAX 0 dBm, average RSRP -44 (16 meas) UE 4c38: UL-RI 1, TPMI 0 UE 4c38: dlsch_rounds 123/0/0/0, dlsch_errors 0, pucch0_DTX 0, BLER 0.00000 MCS 9 UE 4c38: dlsch_total_bytes 15318 UE 4c38: ulsch_rounds 3139/0/0/0, ulsch_DTX 0, ulsch_errors 0, BLER 0.00000 MCS 28 UE 4c38: ulsch_total_bytes_scheduled 268076, ulsch_total_bytes_received 267844 UE 4c38: LCID 1: 684 bytes TX UE 4c38: LCID 4: 9 bytes TX UE 4c38: LCID 4: 162 bytes RX ```
kade-ddnkv commented 10 months ago

Looks like function nrppa_gNB_handle_PositioningInformationExchange was somehow failing without exiting program, idk...

gNB logs ``` [NGAP] Ngap_gNB_itti_send_DownlinkUEAssociatedNRPPa Routing id size =14 and id is [NRPPA] Received message NGAP_DOWNLINKUEASSOCIATEDNRPPA 6c 6d 66 2d 65 6d 75 6c 61 74 6f 72 2d 30 [NRPPA][I]Positioning Information Request initiating message [NRPPA] Procesing PositioningInformationRequest f1ap_req->req_SRS_info.bandwidth_SRS.fR2=0 [NRPPA] Forwarding to RRC PositioningInformationRequest gNB_CU_ue_id=1, gNB_DU_ue_id=0 TEST 0 [rrc_CU_process_positioning_information_request] Positioning_information_request(); rnti= 524d [RRC] Processing Received PositioningInformationRequest gNB_CU_ue_id=1, gNB_DU_ue_id=0 [MAC] DL Processing Received PositioningInformationRequest gNB_CU_ue_id=1, gNB_DU_ue_id=0 [MAC] Prepring PositioningInformationResponse gNB_CU_ue_id=1, gNB_DU_ue_id=0, ue_rnti= 524d [MAC] Extracting SRS Configuration for Positioning_information_response for ue rnti= 524d [RRC] Processing Received PositioningInformationResponse gNB_CU_ue_id=1, gNB_DU_ue_id=1 [NRPPA] Received message F1AP_POSITIONING_INFORMATION_RESP [NRPPA] Received PositioningInformationResponse info from RRC gNB_CU_ue_id=1, gNB_DU_ue_id=1 rnti= 524d Testing Processing Received PositioningInformationRequest gNB_ue_ngap_id=UE->rrc_ue_id=1n TEST 1 [NRPPA PIR] Positioning_information_response(); nb_of_srscarrier= 1Test 6 Adeel: PositioningInformationResponse nb_possrsresource=1 Test 5 Adeel: PositioningInformationResponse nb_srsresourceset=1 Test 7 Adeel: NRPPA PositioningInformationResponse nb_possrsresourceset=1 [NRPPA] Calling encoder for PositioningInformationResponse 9 123 26 1 0 0 0 0 0 0 0 1 0 0 25 0 0 0 0 40 0 0 0 0 0 0 0 0 0 0 0 0 0 [NRPPA] initiating nrppa_gNB_itti_send_UplinkUEAssociatedNRPPa [NGAP] Initiating ngap_gNB_UplinkUEAssociatedNRPPaTransport [NGAP] Sending sctp_data_req for ngap_gNB_UplinkUEAssociatedNRPPaTransport [NR_MAC] Frame.Slot 768.0 UE RNTI 524d (1) PH 0 dB PCMAX 0 dBm, average RSRP -50 (16 meas) UE 524d: UL-RI 1, TPMI 0 UE 524d: dlsch_rounds 35427/1/0/0, dlsch_errors 0, pucch0_DTX 0, BLER 0.00000 MCS 9 UE 524d: dlsch_total_bytes 4304716 UE 524d: ulsch_rounds 1062073/0/0/0, ulsch_DTX 0, ulsch_errors 0, BLER 0.00000 MCS 28 UE 524d: ulsch_total_bytes_scheduled 90630720, ulsch_total_bytes_received 90630488 UE 524d: LCID 1: TX 901 RX 290 bytes UE 524d: LCID 2: TX 0 RX 0 bytes UE 524d: LCID 4: TX 30 RX 540 bytes ```
kade-ddnkv commented 10 months ago

Mostly I don't understand Positioning Information Response. However it looks like some SRS configuration parameters - the way Sounding Reference Signals will be performed.

After looking at the specification, I will assume that I may need to send two more requests:

  1. Positioning Activation Request - to activate SRS transmissions by UE. "The Positioning Activation procedure is initiated by the LMF to request the NG-RAN node to activate semi-persistent or trigger aperiodic UL SRS transmission by the UE."
  2. Measurement Response - to get measurements from SRS (Sounding Reference Signal). For instance, UL-RTOA (Relative Time of Arrival) and UL-SRS-RSRP (Reference Signal Received Power) are the ones that can be used to locate UE. A picture of measurements, that can be retrieved in such way (see Pic. 1).
    image Pic 1.

OAI implementation status:

  1. Positioning Activation Request - probably? Not sure.
  2. Measurement Response - for now, its just dummy values (see Pic. 2). image Pic. 2.