Commit a12ff84c authored by luis_pereira87's avatar luis_pereira87

Merge remote-tracking branch 'origin/handling-Msg4-Ack-failure' into Fix_Msg4_segfault

parents 0ac69fb1 c8ed1a21
...@@ -965,7 +965,7 @@ class RANManagement(): ...@@ -965,7 +965,7 @@ class RANManagement():
if result is not None: if result is not None:
mbmsRequestMsg += 1 mbmsRequestMsg += 1
#FR1 NSA test : add new markers to make sure gNB is used #FR1 NSA test : add new markers to make sure gNB is used
result = re.search('\[gNB [0-9]+\]\[RAPROC\] PUSCH with TC_RNTI [0-9a-fA-F]+ received correctly, adding UE MAC Context UE_id [0-9]+\/RNTI [0-9a-fA-F]+', str(line)) result = re.search('\[gNB [0-9]+\]\[RAPROC\] PUSCH with TC_RNTI 0x[0-9a-fA-F]+ received correctly, adding UE MAC Context UE_id [0-9]+\/RNTI 0x[0-9a-fA-F]+', str(line))
if result is not None: if result is not None:
NSA_RAPROC_PUSCH_check = 1 NSA_RAPROC_PUSCH_check = 1
#dlsch and ulsch statistics #dlsch and ulsch statistics
......
...@@ -200,7 +200,7 @@ void rx_func(void *param) { ...@@ -200,7 +200,7 @@ void rx_func(void *param) {
int down_removed = 0; int down_removed = 0;
int pucch_removed = 0; int pucch_removed = 0;
for (int i = 0; i < rnti_to_remove_count; i++) { for (int i = 0; i < rnti_to_remove_count; i++) {
LOG_W(NR_PHY, "to remove rnti %d\n", rnti_to_remove[i]); LOG_W(NR_PHY, "to remove rnti 0x%04x\n", rnti_to_remove[i]);
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch); void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch); void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
int j; int j;
......
...@@ -520,12 +520,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -520,12 +520,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
NR_COMMON_channels_t *cc = &RC.nrmac[Mod_idP]->common_channels[0]; NR_COMMON_channels_t *cc = &RC.nrmac[Mod_idP]->common_channels[0];
RC.nrmac[Mod_idP]->sib1_tda = sib1_tda; RC.nrmac[Mod_idP]->sib1_tda = sib1_tda;
for (int n=0;n<NR_NB_RA_PROC_MAX;n++ ) { for (int n=0;n<NR_NB_RA_PROC_MAX;n++ ) {
cc->ra[n].cfra = false; cc->ra[n].cfra = false;
cc->ra[n].rnti = 0; cc->ra[n].msg3_dcch_dtch = false;
cc->ra[n].preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES; cc->ra[n].rnti = 0;
cc->ra[n].preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t)); cc->ra[n].preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES;
for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++) cc->ra[n].preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t));
cc->ra[n].preambles.preamble_list[i] = i; for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++)
cc->ra[n].preambles.preamble_list[i] = i;
} }
} }
} }
...@@ -603,6 +604,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -603,6 +604,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++) for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++)
ra->preambles.preamble_list[i] = i; ra->preambles.preamble_list[i] = i;
} }
ra->msg3_dcch_dtch = false;
LOG_I(NR_MAC,"Added new RA process for UE RNTI %04x with initial CellGroup\n", rnti); LOG_I(NR_MAC,"Added new RA process for UE RNTI %04x with initial CellGroup\n", rnti);
} else { // CellGroup has been updated } else { // CellGroup has been updated
const int UE_id = find_nr_UE_id(Mod_idP,rnti); const int UE_id = find_nr_UE_id(Mod_idP,rnti);
......
...@@ -802,7 +802,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ...@@ -802,7 +802,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n");
int CCEIndex = allocate_nr_CCEs(nr_mac, NULL, coreset, aggregation_level, 0, 0, nr_of_candidates); int CCEIndex = allocate_nr_CCEs(nr_mac, NULL, coreset, aggregation_level, 0, 0, nr_of_candidates);
if (CCEIndex < 0) { if (CCEIndex < 0) {
LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI 0x%04x!\n", __func__, ra->rnti);
return; return;
} }
...@@ -1178,7 +1178,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1178,7 +1178,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n");
int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates); int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates);
if (CCEIndex < 0) { if (CCEIndex < 0) {
LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI 0x%04x!\n", __func__, ra->rnti);
return; return;
} }
...@@ -1215,7 +1215,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1215,7 +1215,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
dl_req->nPDUs+=1; dl_req->nPDUs+=1;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15;
LOG_I(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d, CoreSetType %d\n", LOG_I(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%04x, state %d, CoreSetType %d\n",
module_idP, CC_id, frameP, slotP, ra->RA_rnti, ra->state,pdcch_pdu_rel15->CoreSetType); module_idP, CC_id, frameP, slotP, ra->RA_rnti, ra->state,pdcch_pdu_rel15->CoreSetType);
// SCF222: PDU index incremented for each PDSCH PDU sent in TX control message. This is used to associate control // SCF222: PDU index incremented for each PDSCH PDU sent in TX control message. This is used to associate control
...@@ -1405,6 +1405,12 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1405,6 +1405,12 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg4\n"); AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg4\n");
rnti_t tc_rnti = ra->rnti;
// If UE is known by the network, C-RNTI to be used instead of TC-RNTI
if(ra->msg3_dcch_dtch) {
ra->rnti = ra->crnti;
}
int UE_id = find_nr_UE_id(module_idP, ra->rnti); int UE_id = find_nr_UE_id(module_idP, ra->rnti);
NR_UE_info_t *UE_info = &nr_mac->UE_info; NR_UE_info_t *UE_info = &nr_mac->UE_info;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
...@@ -1438,6 +1444,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1438,6 +1444,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
harq->is_waiting = true; harq->is_waiting = true;
ra->harq_pid = current_harq_pid; ra->harq_pid = current_harq_pid;
// Remove UE associated to TC-RNTI
if(harq->round==0 && ra->msg3_dcch_dtch) {
mac_remove_nr_ue(module_idP, tc_rnti);
}
// get CCEindex, needed also for PUCCH and then later for PDCCH // get CCEindex, needed also for PUCCH and then later for PDCCH
uint8_t aggregation_level; uint8_t aggregation_level;
uint8_t nr_of_candidates; uint8_t nr_of_candidates;
...@@ -1449,7 +1460,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1449,7 +1460,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n");
int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates); int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates);
if (CCEIndex < 0) { if (CCEIndex < 0) {
LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI 0x%04x!\n", __func__, ra->rnti);
return; return;
} }
...@@ -1473,15 +1484,21 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1473,15 +1484,21 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
uint8_t *buf = (uint8_t *) harq->tb; uint8_t *buf = (uint8_t *) harq->tb;
// Bytes to be transmitted // Bytes to be transmitted
if (harq->round == 0) { if (harq->round == 0) {
uint16_t mac_pdu_length = nr_write_ce_dlsch_pdu(module_idP, nr_mac->sched_ctrlCommon, buf, 255, ra->cont_res_id); if (ra->msg3_dcch_dtch) {
LOG_D(NR_MAC,"Encoded contention resolution mac_pdu_length %d\n",mac_pdu_length); // If the UE used MSG3 to transfer a DCCH or DTCH message, then contention resolution is successful if the UE receives a PDCCH transmission which has its CRC bits scrambled by the C-RNTI
uint16_t mac_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, CCCH, ra->rnti, 1, &buf[mac_pdu_length+2]); // Just send padding LCID
((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->R = 0; ra->mac_pdu_length = 0;
((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->F = 0; } else {
((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->LCID = DL_SCH_LCID_CCCH; uint16_t mac_pdu_length = nr_write_ce_dlsch_pdu(module_idP, nr_mac->sched_ctrlCommon, buf, 255, ra->cont_res_id);
((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->L = mac_sdu_length; LOG_D(NR_MAC,"Encoded contention resolution mac_pdu_length %d\n",mac_pdu_length);
ra->mac_pdu_length = mac_pdu_length + mac_sdu_length + sizeof(NR_MAC_SUBHEADER_SHORT); uint16_t mac_sdu_length = mac_rrc_nr_data_req(module_idP, CC_id, frameP, CCCH, ra->rnti, 1, &buf[mac_pdu_length+2]);
LOG_D(NR_MAC,"Encoded RRCSetup Piggyback (%d + %d bytes), mac_pdu_length %d\n", mac_sdu_length, (int)sizeof(NR_MAC_SUBHEADER_SHORT), ra->mac_pdu_length); ((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->R = 0;
((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->F = 0;
((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->LCID = DL_SCH_LCID_CCCH;
((NR_MAC_SUBHEADER_SHORT *) &buf[mac_pdu_length])->L = mac_sdu_length;
ra->mac_pdu_length = mac_pdu_length + mac_sdu_length + sizeof(NR_MAC_SUBHEADER_SHORT);
LOG_D(NR_MAC,"Encoded RRCSetup Piggyback (%d + %d bytes), mac_pdu_length %d\n", mac_sdu_length, (int)sizeof(NR_MAC_SUBHEADER_SHORT), ra->mac_pdu_length);
}
} }
// Calculate number of symbols // Calculate number of symbols
...@@ -1741,8 +1758,23 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1741,8 +1758,23 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
LOG_D(NR_MAC,"precoderGranularity: %i\n", pdcch_pdu_rel15->precoderGranularity); LOG_D(NR_MAC,"precoderGranularity: %i\n", pdcch_pdu_rel15->precoderGranularity);
LOG_D(NR_MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci); LOG_D(NR_MAC,"numDlDci: %i\n", pdcch_pdu_rel15->numDlDci);
ra->state = WAIT_Msg4_ACK; if(ra->msg3_dcch_dtch) {
LOG_D(NR_MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state); // If the UE used MSG3 to transfer a DCCH or DTCH message, then contention resolution is successful upon transmission of PDCCH
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) CBRA procedure succeeded!\n", UE_id, ra->rnti);
nr_clear_ra_proc(module_idP, CC_id, frameP, ra);
UE_info->active[UE_id] = true;
UE_info->Msg4_ACKed[UE_id] = true;
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
harq->feedback_slot = -1;
harq->is_waiting = false;
add_tail_nr_list(&sched_ctrl->available_dl_harq, current_harq_pid);
harq->round = 0;
harq->ndi ^= 1;
} else {
ra->state = WAIT_Msg4_ACK;
LOG_D(NR_MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state);
}
} }
} }
...@@ -1756,23 +1788,22 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram ...@@ -1756,23 +1788,22 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram
NR_UE_harq_t *harq = &sched_ctrl->harq_processes[current_harq_pid]; NR_UE_harq_t *harq = &sched_ctrl->harq_processes[current_harq_pid];
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
LOG_D(NR_MAC, "ue %d, rnti %d, harq is waiting %d, round %d, frame %d %d, harq id %d\n", UE_id, ra->rnti, harq->is_waiting, harq->round, frame, slot, current_harq_pid); LOG_D(NR_MAC, "ue %d, rnti 0x%04x, harq is waiting %d, round %d, frame %d %d, harq id %d\n", UE_id, ra->rnti, harq->is_waiting, harq->round, frame, slot, current_harq_pid);
if (harq->is_waiting == 0) { if (harq->is_waiting == 0) {
if (harq->round == 0) { if (harq->round == 0) {
if (stats->dlsch_errors == 0) { if (stats->dlsch_errors == 0) {
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti); LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti);
nr_clear_ra_proc(module_id, CC_id, frame, ra);
UE_info->active[UE_id] = true; UE_info->active[UE_id] = true;
UE_info->Msg4_ACKed[UE_id] = true; UE_info->Msg4_ACKed[UE_id] = true;
if(sched_ctrl->retrans_dl_harq.head>=0)
remove_nr_list(&sched_ctrl->retrans_dl_harq, current_harq_pid);
} }
else { else {
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti); LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti);
nr_mac_remove_ra_rnti(module_id, ra->rnti); }
nr_clear_ra_proc(module_id, CC_id, frame, ra);
mac_remove_nr_ue(module_id, ra->rnti); nr_clear_ra_proc(module_id, CC_id, frame, ra);
if(sched_ctrl->retrans_dl_harq.head >= 0) {
remove_nr_list(&sched_ctrl->retrans_dl_harq, current_harq_pid);
} }
} }
else { else {
...@@ -1790,6 +1821,8 @@ void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t ...@@ -1790,6 +1821,8 @@ void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t
ra->timing_offset = 0; ra->timing_offset = 0;
ra->RRC_timer = 20; ra->RRC_timer = 20;
ra->msg3_round = 0; ra->msg3_round = 0;
ra->msg3_dcch_dtch = false;
ra->crnti = 0;
if(ra->cfra == false) { if(ra->cfra == false) {
ra->rnti = 0; ra->rnti = 0;
} }
......
...@@ -1925,7 +1925,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG ...@@ -1925,7 +1925,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
{ {
NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_idP]->common_channels[0].ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_idP]->common_channels[0].ServingCellConfigCommon;
NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info; NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info;
LOG_I(NR_MAC, "[gNB %d] Adding UE with rnti %x (num_UEs %d)\n", LOG_I(NR_MAC, "[gNB %d] Adding UE with rnti 0x%04x (num_UEs %d)\n",
mod_idP, mod_idP,
rntiP, rntiP,
UE_info->num_UEs); UE_info->num_UEs);
...@@ -2063,7 +2063,7 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti) ...@@ -2063,7 +2063,7 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti)
destroy_nr_list(&sched_ctrl->available_ul_harq); destroy_nr_list(&sched_ctrl->available_ul_harq);
destroy_nr_list(&sched_ctrl->feedback_ul_harq); destroy_nr_list(&sched_ctrl->feedback_ul_harq);
destroy_nr_list(&sched_ctrl->retrans_ul_harq); destroy_nr_list(&sched_ctrl->retrans_ul_harq);
LOG_I(NR_MAC, "[gNB %d] Remove NR UE_id %d : rnti %x\n", LOG_I(NR_MAC, "[gNB %d] Remove NR UE_id %d: rnti 0x%04x\n",
mod_id, mod_id,
UE_id, UE_id,
rnti); rnti);
......
...@@ -298,6 +298,17 @@ int nr_process_mac_pdu(module_id_t module_idP, ...@@ -298,6 +298,17 @@ int nr_process_mac_pdu(module_id_t module_idP,
break; break;
case UL_SCH_LCID_C_RNTI: case UL_SCH_LCID_C_RNTI:
for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
NR_RA_t *ra = &RC.nrmac[module_idP]->common_channels[CC_id].ra[i];
if (ra->state >= WAIT_Msg3 && ra->rnti == UE_info->rnti[UE_id]) {
ra->crnti = ((pduP[1]&0xFF)<<8)|(pduP[2]&0xFF);
ra->msg3_dcch_dtch = true;
LOG_I(NR_MAC, "Received UL_SCH_LCID_C_RNTI with C-RNTI 0x%04x\n", ra->crnti);
break;
}
}
//38.321 section 6.1.3.2 //38.321 section 6.1.3.2
//fixed length //fixed length
mac_ce_len = 2; mac_ce_len = 2;
...@@ -365,10 +376,25 @@ int nr_process_mac_pdu(module_id_t module_idP, ...@@ -365,10 +376,25 @@ int nr_process_mac_pdu(module_id_t module_idP,
mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
mac_subheader_len = 2; mac_subheader_len = 2;
} }
if (UE_info->CellGroup[UE_id]) {
LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: %d \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, UE_info->rnti[UE_id]); rnti_t crnti = UE_info->rnti[UE_id];
int UE_idx = UE_id;
for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
NR_RA_t *ra = &RC.nrmac[module_idP]->common_channels[CC_id].ra[i];
if (ra->state >= WAIT_Msg3 && ra->rnti == UE_info->rnti[UE_id]) {
uint8_t *next_subpduP = pduP + mac_subheader_len + mac_sdu_len;
if ((pduP[mac_subheader_len+mac_sdu_len] & 0x3F) == UL_SCH_LCID_C_RNTI) {
crnti = ((next_subpduP[1]&0xFF)<<8)|(next_subpduP[2]&0xFF);
UE_idx = find_nr_UE_id(module_idP, crnti);
break;
}
}
}
if (UE_info->CellGroup[UE_idx]) {
LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: 0x%04x \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, crnti);
mac_rlc_data_ind(module_idP, mac_rlc_data_ind(module_idP,
UE_info->rnti[UE_id], crnti,
module_idP, module_idP,
frameP, frameP,
ENB_FLAG_YES, ENB_FLAG_YES,
...@@ -533,7 +559,7 @@ void handle_nr_ul_harq(const int CC_idP, ...@@ -533,7 +559,7 @@ void handle_nr_ul_harq(const int CC_idP,
ra->rnti == crc_pdu->rnti) ra->rnti == crc_pdu->rnti)
return; return;
} }
LOG_E(NR_MAC, "%s(): unknown RNTI %04x in PUSCH\n", __func__, crc_pdu->rnti); LOG_E(NR_MAC, "%s(): unknown RNTI 0x%04x in PUSCH\n", __func__, crc_pdu->rnti);
return; return;
} }
NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info; NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info;
...@@ -541,7 +567,7 @@ void handle_nr_ul_harq(const int CC_idP, ...@@ -541,7 +567,7 @@ void handle_nr_ul_harq(const int CC_idP,
int8_t harq_pid = sched_ctrl->feedback_ul_harq.head; int8_t harq_pid = sched_ctrl->feedback_ul_harq.head;
while (crc_pdu->harq_id != harq_pid || harq_pid < 0) { while (crc_pdu->harq_id != harq_pid || harq_pid < 0) {
LOG_W(NR_MAC, LOG_W(NR_MAC,
"Unexpected ULSCH HARQ PID %d (have %d) for RNTI %04x (ignore this warning for RA)\n", "Unexpected ULSCH HARQ PID %d (have %d) for RNTI 0x%04x (ignore this warning for RA)\n",
crc_pdu->harq_id, crc_pdu->harq_id,
harq_pid, harq_pid,
crc_pdu->rnti); crc_pdu->rnti);
...@@ -752,13 +778,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -752,13 +778,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP; UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP;
LOG_D(NR_MAC, LOG_D(NR_MAC,
"reset RA state information for RA-RNTI %04x/index %d\n", "reset RA state information for RA-RNTI 0x%04x/index %d\n",
ra->rnti, ra->rnti,
i); i);
LOG_I(NR_MAC, LOG_I(NR_MAC,
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, " "[gNB %d][RAPROC] PUSCH with TC_RNTI 0x%04x received correctly, "
"adding UE MAC Context UE_id %d/RNTI %04x\n", "adding UE MAC Context UE_id %d/RNTI 0x%04x\n",
gnb_mod_idP, gnb_mod_idP,
current_rnti, current_rnti,
UE_id, UE_id,
...@@ -796,7 +822,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -796,7 +822,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
ra->state = Msg4; ra->state = Msg4;
ra->Msg4_frame = (frameP + 2) % 1024; ra->Msg4_frame = (frameP + 2) % 1024;
ra->Msg4_slot = 1; ra->Msg4_slot = 1;
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI %04x (state %d, frame %d, slot %d)\n", ra->rnti, ra->state, ra->Msg4_frame, ra->Msg4_slot); LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI 0x%04x (state %d, frame %d, slot %d)\n",
(ra->msg3_dcch_dtch?ra->crnti:ra->rnti), ra->state, ra->Msg4_frame, ra->Msg4_slot);
} }
else { else {
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
......
...@@ -155,6 +155,8 @@ typedef struct { ...@@ -155,6 +155,8 @@ typedef struct {
uint8_t msg3_cqireq; uint8_t msg3_cqireq;
/// Round of Msg3 HARQ /// Round of Msg3 HARQ
uint8_t msg3_round; uint8_t msg3_round;
/// Flag to indicate if Msg3 carries a DCCH or DTCH message
bool msg3_dcch_dtch;
/// TBS used for Msg4 /// TBS used for Msg4
int msg4_TBsize; int msg4_TBsize;
/// MCS used for Msg4 /// MCS used for Msg4
......
Active_gNBs = ( "gNB-Eurecom-5GNRBox"); Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying # Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none"; Asn1_verbosity = "none";
...@@ -7,7 +7,7 @@ gNBs = ...@@ -7,7 +7,7 @@ gNBs =
{ {
////////// Identification parameters: ////////// Identification parameters:
gNB_ID = 0xe00; gNB_ID = 0xe00;
gNB_name = "gNB-Eurecom-5GNRBox"; gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = 1;
...@@ -204,7 +204,7 @@ gNBs = ...@@ -204,7 +204,7 @@ gNBs =
}; };
////////// MME parameters: ////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.70.132"; amf_ip_address = ( { ipv4 = "192.168.70.132";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
...@@ -226,59 +226,61 @@ gNBs = ...@@ -226,59 +226,61 @@ gNBs =
); );
MACRLCs = ( MACRLCs = (
{ {
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150; pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200; pucch_TargetSNRx10 = 200;
} ulsch_max_frame_inactivity = 1;
}
); );
L1s = ( L1s = (
{ {
num_cc = 1; num_cc = 1;
tr_n_preference = "local_mac"; tr_n_preference = "local_mac";
pusch_proc_threads = 8; pusch_proc_threads = 8;
prach_dtx_threshold = 120; prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150; pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
} }
); );
RUs = ( RUs = (
{ {
local_rf = "yes" local_rf = "yes"
nb_tx = 1 nb_tx = 1
nb_rx = 1 nb_rx = 1
att_tx = 0 att_tx = 0
att_rx = 0; att_rx = 0;
bands = [41]; bands = [41];
max_pdschReferenceSignalPower = -27; max_pdschReferenceSignalPower = -27;
max_rxgain = 114; max_rxgain = 114;
eNB_instances = [0]; sf_extension = 0;
#beamforming 1x4 matrix: eNB_instances = [0];
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #beamforming 1x4 matrix:
clock_src = "internal"; bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
} clock_src = "internal";
}
); );
THREAD_STRUCT = ( THREAD_STRUCT = (
{ {
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD"; parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE"; worker_config = "WORKER_ENABLE";
} }
); );
rfsimulator : rfsimulator :
{ {
serveraddr = "server"; serveraddr = "server";
serverport = "4043"; serverport = "4043";
options = (); #("saviq"); or/and "chanmod" options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN"; modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"; IQfile = "/tmp/rfsimulator.iqs";
}; };
security = { security = {
...@@ -298,23 +300,23 @@ security = { ...@@ -298,23 +300,23 @@ security = {
drb_integrity = "no"; drb_integrity = "no";
}; };
log_config : log_config :
{ {
global_log_level ="info"; global_log_level ="info";
global_log_verbosity ="medium"; global_log_verbosity ="medium";
hw_log_level ="info"; hw_log_level ="info";
hw_log_verbosity ="medium"; hw_log_verbosity ="medium";
phy_log_level ="info"; phy_log_level ="info";
phy_log_verbosity ="medium"; phy_log_verbosity ="medium";
mac_log_level ="info"; mac_log_level ="info";
mac_log_verbosity ="high"; mac_log_verbosity ="high";
rlc_log_level ="info"; rlc_log_level ="info";
rlc_log_verbosity ="medium"; rlc_log_verbosity ="medium";
pdcp_log_level ="info"; pdcp_log_level ="info";
pdcp_log_verbosity ="medium"; pdcp_log_verbosity ="medium";
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
ngap_log_level ="debug"; ngap_log_level ="debug";
ngap_log_verbosity ="medium"; ngap_log_verbosity ="medium";
}; };
Active_gNBs = ( "gNB-Eurecom-5GNRBox"); Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying # Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none"; Asn1_verbosity = "none";
...@@ -7,7 +7,7 @@ gNBs = ...@@ -7,7 +7,7 @@ gNBs =
{ {
////////// Identification parameters: ////////// Identification parameters:
gNB_ID = 0xe00; gNB_ID = 0xe00;
gNB_name = "gNB-Eurecom-5GNRBox"; gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = 1;
...@@ -204,7 +204,7 @@ gNBs = ...@@ -204,7 +204,7 @@ gNBs =
}; };
////////// MME parameters: ////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.70.132"; amf_ip_address = ( { ipv4 = "192.168.70.132";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
...@@ -226,59 +226,61 @@ gNBs = ...@@ -226,59 +226,61 @@ gNBs =
); );
MACRLCs = ( MACRLCs = (
{ {
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150; pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200; pucch_TargetSNRx10 = 200;
} ulsch_max_frame_inactivity = 1;
}
); );
L1s = ( L1s = (
{ {
num_cc = 1; num_cc = 1;
tr_n_preference = "local_mac"; tr_n_preference = "local_mac";
pusch_proc_threads = 8; pusch_proc_threads = 8;
prach_dtx_threshold = 120; prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150; pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
} }
); );
RUs = ( RUs = (
{ {
local_rf = "yes" local_rf = "yes"
nb_tx = 1 nb_tx = 1
nb_rx = 1 nb_rx = 1
att_tx = 0 att_tx = 0
att_rx = 0; att_rx = 0;
bands = [78]; bands = [78];
max_pdschReferenceSignalPower = -27; max_pdschReferenceSignalPower = -27;
max_rxgain = 114; max_rxgain = 114;
eNB_instances = [0]; sf_extension = 0;
#beamforming 1x4 matrix: eNB_instances = [0];
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #beamforming 1x4 matrix:
clock_src = "internal"; bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
} clock_src = "internal";
}
); );
THREAD_STRUCT = ( THREAD_STRUCT = (
{ {
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD"; parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE"; worker_config = "WORKER_ENABLE";
} }
); );
rfsimulator : rfsimulator :
{ {
serveraddr = "server"; serveraddr = "server";
serverport = "4043"; serverport = "4043";
options = (); #("saviq"); or/and "chanmod" options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN"; modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"; IQfile = "/tmp/rfsimulator.iqs";
}; };
security = { security = {
...@@ -298,23 +300,23 @@ security = { ...@@ -298,23 +300,23 @@ security = {
drb_integrity = "no"; drb_integrity = "no";
}; };
log_config : log_config :
{ {
global_log_level ="info"; global_log_level ="info";
global_log_verbosity ="medium"; global_log_verbosity ="medium";
hw_log_level ="info"; hw_log_level ="info";
hw_log_verbosity ="medium"; hw_log_verbosity ="medium";
phy_log_level ="info"; phy_log_level ="info";
phy_log_verbosity ="medium"; phy_log_verbosity ="medium";
mac_log_level ="info"; mac_log_level ="info";
mac_log_verbosity ="high"; mac_log_verbosity ="high";
rlc_log_level ="info"; rlc_log_level ="info";
rlc_log_verbosity ="medium"; rlc_log_verbosity ="medium";
pdcp_log_level ="info"; pdcp_log_level ="info";
pdcp_log_verbosity ="medium"; pdcp_log_verbosity ="medium";
rrc_log_level ="info"; rrc_log_level ="info";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="medium";
ngap_log_level ="debug"; ngap_log_level ="debug";
ngap_log_verbosity ="medium"; ngap_log_verbosity ="medium";
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment