Implementation of RRC NR_Paging message at gNB
This commit is contained in:
@@ -52,3 +52,10 @@ abort();
|
||||
int dl_rrc_message(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc) {
|
||||
abort();
|
||||
}
|
||||
|
||||
int rrc_gNB_generate_pcch_msg(uint32_t tmsi,
|
||||
uint8_t paging_drx,
|
||||
instance_t instance,
|
||||
uint8_t CC_id) {
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file f1ap_du_interface_management.h
|
||||
* \brief f1ap interface management for DU
|
||||
/*! \file f1ap_cu_paging.c
|
||||
* \brief f1ap interface paging for CU
|
||||
* \author EURECOM/NTUST
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
@@ -28,4 +28,94 @@
|
||||
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "f1ap_common.h"
|
||||
#include "f1ap_encoder.h"
|
||||
#include "f1ap_itti_messaging.h"
|
||||
#include "f1ap_cu_paging.h"
|
||||
|
||||
extern f1ap_setup_req_t *f1ap_du_data_from_du;
|
||||
|
||||
int CU_send_Paging(instance_t instance, f1ap_paging_ind_t *paging) {
|
||||
F1AP_F1AP_PDU_t pdu;
|
||||
F1AP_Paging_t *out;
|
||||
F1AP_PagingIEs_t *ie;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
|
||||
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_Paging;
|
||||
pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
|
||||
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_Paging;
|
||||
out = &pdu.choice.initiatingMessage->value.choice.Paging;
|
||||
|
||||
/* mandatory */
|
||||
/* UEIdentityIndexValue */
|
||||
ie = (F1AP_PagingIEs_t *)calloc(1, sizeof(F1AP_PagingIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_UEIdentityIndexValue;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_PagingIEs__value_PR_UEIdentityIndexValue;
|
||||
ie->value.choice.UEIdentityIndexValue.present = F1AP_UEIdentityIndexValue_PR_indexLength10;
|
||||
UEIDENTITYINDEX_TO_BIT_STRING(paging->ueidentityindexvalue, &ie->value.choice.UEIdentityIndexValue.choice.indexLength10);
|
||||
//LOG_D(F1AP, "indexLength10 %d \n", BIT_STRING_to_uint32(&ie->value.choice.UEIdentityIndexValue.choice.indexLength10));
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* PagingIdentity */
|
||||
ie = (F1AP_PagingIEs_t *)calloc(1, sizeof(F1AP_PagingIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_PagingIdentity;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_PagingIEs__value_PR_PagingIdentity;
|
||||
ie->value.choice.PagingIdentity.present = F1AP_PagingIdentity_PR_cNUEPagingIdentity;
|
||||
ie->value.choice.PagingIdentity.choice.cNUEPagingIdentity = (F1AP_CNUEPagingIdentity_t*)calloc(1, sizeof(F1AP_CNUEPagingIdentity_t));
|
||||
ie->value.choice.PagingIdentity.choice.cNUEPagingIdentity->present = F1AP_CNUEPagingIdentity_PR_fiveG_S_TMSI;
|
||||
FIVEG_S_TMSI_TO_BIT_STRING(paging->fiveg_s_tmsi,
|
||||
&ie->value.choice.PagingIdentity.choice.cNUEPagingIdentity->choice.fiveG_S_TMSI);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional */
|
||||
/* PagingDRX */
|
||||
ie = (F1AP_PagingIEs_t *)calloc(1, sizeof(F1AP_PagingIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_PagingDRX;
|
||||
ie->criticality = F1AP_Criticality_ignore;
|
||||
ie->value.present = F1AP_PagingIEs__value_PR_PagingDRX;
|
||||
ie->value.choice.PagingDRX = paging->paging_drx;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
/* PagingCell_list */
|
||||
ie = (F1AP_PagingIEs_t *)calloc(1, sizeof(F1AP_PagingIEs_t));
|
||||
ie->id = F1AP_ProtocolIE_ID_id_PagingCell_List;
|
||||
ie->criticality = F1AP_Criticality_reject;
|
||||
ie->value.present = F1AP_PagingIEs__value_PR_PagingCell_list;
|
||||
F1AP_PagingCell_ItemIEs_t *itemies;
|
||||
F1AP_PagingCell_Item_t item;
|
||||
memset((void *)&item, 0, sizeof(F1AP_PagingCell_Item_t));
|
||||
itemies = (F1AP_PagingCell_ItemIEs_t *)calloc(1, sizeof(F1AP_PagingCell_ItemIEs_t));
|
||||
itemies->id = F1AP_ProtocolIE_ID_id_PagingCell_Item;
|
||||
itemies->criticality = F1AP_Criticality_reject;
|
||||
itemies->value.present = F1AP_PagingCell_ItemIEs__value_PR_PagingCell_Item;
|
||||
F1AP_NRCGI_t nRCGI;
|
||||
MCC_MNC_TO_PLMNID(paging->mcc,
|
||||
paging->mnc,
|
||||
paging->mnc_digit_length,
|
||||
&nRCGI.pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(paging->nr_cellid, &nRCGI.nRCellIdentity);
|
||||
item.nRCGI = nRCGI;
|
||||
itemies->value.choice.PagingCell_Item = item;
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.PagingCell_list, itemies);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* encode */
|
||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
LOG_E(F1AP, "Failed to encode F1 Paging failure\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
f1ap_itti_send_sctp_data_req(true, instance, buffer, len, 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -19,8 +19,8 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file f1ap_du_interface_management.h
|
||||
* \brief f1ap interface management for DU
|
||||
/*! \file f1ap_cu_paging.h
|
||||
* \brief f1ap interface paging for CU
|
||||
* \author EURECOM/NTUST
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
@@ -28,4 +28,9 @@
|
||||
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef F1AP_CU_PAGING_H_
|
||||
#define F1AP_CU_PAGING_H_
|
||||
int CU_send_Paging(instance_t instance, f1ap_paging_ind_t *paging);
|
||||
#endif /* F1AP_DU_PAGING_H_ */
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "f1ap_cu_interface_management.h"
|
||||
#include "f1ap_cu_rrc_message_transfer.h"
|
||||
#include "f1ap_cu_ue_context_management.h"
|
||||
#include "f1ap_cu_paging.h"
|
||||
#include "f1ap_cu_task.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
@@ -193,6 +194,12 @@ void *F1AP_CU_task(void *arg) {
|
||||
&F1AP_UE_CONTEXT_RELEASE_CMD(received_msg));
|
||||
break;
|
||||
|
||||
case F1AP_PAGING_IND:
|
||||
LOG_I(F1AP, "CU Task Received F1AP_PAGING_IND\n");
|
||||
CU_send_Paging(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
|
||||
&F1AP_PAGING_IND(received_msg));
|
||||
break;
|
||||
|
||||
// case F1AP_SETUP_RESPONSE: // This is from RRC
|
||||
// CU_send_F1_SETUP_RESPONSE(instance, *f1ap_setup_ind, &(F1AP_SETUP_RESP) f1ap_setup_resp)
|
||||
// break;
|
||||
|
||||
@@ -83,6 +83,10 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) {
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextModification\n", __func__);
|
||||
break;
|
||||
|
||||
case F1AP_ProcedureCode_id_Paging:
|
||||
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_Paging\n", __func__);
|
||||
break;
|
||||
|
||||
// case F1AP_ProcedureCode_id_InitialContextSetup:
|
||||
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
// message_id = F1AP_INITIAL_CONTEXT_SETUP_LOG;
|
||||
|
||||
@@ -28,4 +28,70 @@
|
||||
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
*/
|
||||
#include "f1ap_common.h"
|
||||
#include "f1ap_du_paging.h"
|
||||
#include "conversions.h"
|
||||
#include "asn1_conversions.h"
|
||||
#include "openair2/RRC/LTE/rrc_proto.h"
|
||||
|
||||
int DU_handle_Paging(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu) {
|
||||
F1AP_Paging_t *paging;
|
||||
F1AP_PagingIEs_t *ie;
|
||||
long tmsi;
|
||||
uint8_t pagingdrx;
|
||||
uint8_t *fiveg_tmsi_buf = NULL;
|
||||
|
||||
DevAssert(pdu);
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||
}
|
||||
|
||||
paging = &pdu->choice.initiatingMessage->value.choice.Paging;
|
||||
// get UEIdentityIndexValue
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_PagingIEs_t, ie, paging,
|
||||
F1AP_ProtocolIE_ID_id_UEIdentityIndexValue, true);
|
||||
|
||||
LOG_D(F1AP, "indexLength10 %d\n", BIT_STRING_to_uint32(&ie->value.choice.UEIdentityIndexValue.choice.indexLength10));
|
||||
|
||||
// get PagingIdentity
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_PagingIEs_t, ie, paging,
|
||||
F1AP_ProtocolIE_ID_id_PagingIdentity, true);
|
||||
|
||||
if(ie != NULL){
|
||||
fiveg_tmsi_buf = ie->value.choice.PagingIdentity.choice.cNUEPagingIdentity->choice.fiveG_S_TMSI.buf;
|
||||
|
||||
tmsi = ((long)fiveg_tmsi_buf[0] << 40) +
|
||||
((long)fiveg_tmsi_buf[1] << 32) +
|
||||
(fiveg_tmsi_buf[2] << 24) +
|
||||
(fiveg_tmsi_buf[3] << 16) +
|
||||
(fiveg_tmsi_buf[4] << 8) +
|
||||
fiveg_tmsi_buf[5];
|
||||
|
||||
LOG_D(F1AP, "tmsi %ld\n", tmsi);
|
||||
}
|
||||
|
||||
// get PagingDRX
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_PagingIEs_t, ie, paging,
|
||||
F1AP_ProtocolIE_ID_id_PagingDRX, true);
|
||||
|
||||
if(ie != NULL) {
|
||||
pagingdrx = (uint8_t)ie->value.choice.PagingDRX;
|
||||
}
|
||||
|
||||
LOG_D(F1AP, "pagingdrx %u\n", pagingdrx);
|
||||
|
||||
// get PagingCell_List
|
||||
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_PagingIEs_t, ie, paging,
|
||||
F1AP_ProtocolIE_ID_id_PagingCell_List, true);
|
||||
|
||||
for (uint8_t CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
rrc_gNB_generate_pcch_msg((uint32_t)tmsi, pagingdrx, instance, CC_id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -28,4 +28,14 @@
|
||||
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
*/
|
||||
|
||||
#ifndef F1AP_DU_PAGING_H_
|
||||
#define F1AP_DU_PAGING_H_
|
||||
|
||||
int DU_handle_Paging(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
F1AP_F1AP_PDU_t *pdu);
|
||||
|
||||
#endif /* F1AP_DU_PAGING_H_ */
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "f1ap_du_rrc_message_transfer.h"
|
||||
#include "f1ap_cu_ue_context_management.h"
|
||||
#include "f1ap_du_ue_context_management.h"
|
||||
#include "f1ap_du_paging.h"
|
||||
|
||||
/* Handlers matrix. Only f1 related procedure present here */
|
||||
f1ap_message_processing_t f1ap_messages_processing[][3] = {
|
||||
@@ -61,7 +62,7 @@ f1ap_message_processing_t f1ap_messages_processing[][3] = {
|
||||
{ 0, 0, 0 }, /* UEInactivityNotification */
|
||||
{ 0, 0, 0 }, /* GNBDUResourceCoordination */
|
||||
{ 0, 0, 0 }, /* SystemInformationDeliveryCommand */
|
||||
{ 0, 0, 0 }, /* Paging */
|
||||
{ DU_handle_Paging, 0, 0 }, /* Paging */
|
||||
{ 0, 0, 0 }, /* Notify */
|
||||
{ 0, 0, 0 }, /* WriteReplaceWarning */
|
||||
{ 0, 0, 0 }, /* PWSCancel */
|
||||
|
||||
Reference in New Issue
Block a user