mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-20 16:10:29 +00:00
Compare commits
2 Commits
test-slice
...
pdu_sessio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17c8f88993 | ||
|
|
460073ffa0 |
@@ -577,9 +577,6 @@ typedef struct ngap_ue_ctxt_modification_resp_s {
|
||||
uint32_t gNB_ue_ngap_id;
|
||||
} ngap_ue_ctxt_modification_resp_t;
|
||||
|
||||
typedef struct ngap_ue_release_complete_s {
|
||||
uint32_t gNB_ue_ngap_id;
|
||||
} ngap_ue_release_complete_t;
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// NGAP -> RRC messages
|
||||
@@ -793,6 +790,14 @@ typedef struct ngap_ue_release_req_s {
|
||||
long cause_value;
|
||||
} ngap_ue_release_req_t, ngap_ue_release_resp_t;
|
||||
|
||||
typedef struct ngap_ue_release_complete_s {
|
||||
uint32_t gNB_ue_ngap_id;
|
||||
|
||||
uint8_t nb_of_pdusessions;
|
||||
/* list of pdusession resource by RRC layers */
|
||||
pdusession_release_t pdusessions[NGAP_MAX_PDUSESSION];
|
||||
} ngap_ue_release_complete_t;
|
||||
|
||||
typedef struct ngap_pdusession_modify_req_s {
|
||||
/* AMF UE id */
|
||||
uint64_t amf_ue_ngap_id;
|
||||
|
||||
@@ -279,7 +279,8 @@ void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP);
|
||||
|
||||
void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
|
||||
//void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
|
||||
uint8_t nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP);
|
||||
|
||||
@@ -789,7 +789,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
} else {
|
||||
// The UE identified by C-RNTI still exists at the gNB
|
||||
// Reset uplink failure flags/counters/timers at RRC
|
||||
nr_mac_gNB_rrc_ul_failure_reset(gnb_mod_idP, frameP, slotP, ra->crnti);
|
||||
uint8_t status;
|
||||
status = nr_mac_gNB_rrc_ul_failure_reset(gnb_mod_idP, frameP, slotP, ra->crnti);
|
||||
if (status > 0) {
|
||||
mac_remove_nr_ue(gNB_mac, ra->rnti);
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset HARQ processes
|
||||
reset_dl_harq_list(&UE_C->UE_sched_ctrl);
|
||||
@@ -1663,10 +1669,13 @@ void pf_ul(module_id_t module_id,
|
||||
|
||||
const NR_bler_options_t *bo = &nrmac->ul_bler;
|
||||
const int max_mcs = bo->max_mcs; /* no per-user maximum MCS yet */
|
||||
if (bo->harq_round_max == 1)
|
||||
if (bo->harq_round_max == 1){
|
||||
sched_pusch->mcs = max_mcs;
|
||||
else
|
||||
LOG_I(MAC,"Case 1 ULSCH UL MCS and BLER sched_pusch->mcs %d, bo->harq_round_max %d\n",sched_pusch->mcs, bo->harq_round_max);
|
||||
}else{
|
||||
sched_pusch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->ul_bler_stats, max_mcs, frame);
|
||||
LOG_I(MAC,"Case 2 ULSCH UL MCS and BLER sched_pusch->mcs %d, bo->harq_round_max %d\n",sched_pusch->mcs, bo->harq_round_max);
|
||||
}
|
||||
|
||||
/* Schedule UE on SR or UL inactivity and no data (otherwise, will be scheduled
|
||||
* based on data to transmit) */
|
||||
|
||||
@@ -130,7 +130,8 @@ void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
}
|
||||
}
|
||||
|
||||
void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
|
||||
//void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
|
||||
uint8_t nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP) {
|
||||
@@ -138,7 +139,9 @@ void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
|
||||
if (ue_context_p != NULL) {
|
||||
LOG_W(RRC,"Frame %d, Subframe %d: UE %x UL failure reset, deactivating timer\n",frameP,subframeP,rntiP);
|
||||
ue_context_p->ue_context.ul_failure_timer=0;
|
||||
return 0;
|
||||
} else {
|
||||
LOG_W(RRC,"Frame %d, Subframe %d: UL failure reset: UE %x unknown \n",frameP,subframeP,rntiP);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ static void rrc_gNB_generate_RRCSetup(instance_t instance,
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static void rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t module_id, rnti_t rnti, const int CC_id)
|
||||
static void rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t module_id, rnti_t rnti, const int CC_id,int *MCG, int MCG_len)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
LOG_I(NR_RRC, "generate RRCSetup for RRCReestablishmentRequest \n");
|
||||
@@ -1756,7 +1756,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
|
||||
" NR_RRCReestablishmentRequest ue_Identity.physCellId(%ld) is not equal to current physCellId(%d), fallback to RRC establishment\n",
|
||||
physCellId,
|
||||
gnb_rrc_inst->carrier.physCellId);
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0);
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0, NULL, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1770,7 +1770,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
|
||||
if (rrcReestablishmentRequest.ue_Identity.c_RNTI < 0x1 || rrcReestablishmentRequest.ue_Identity.c_RNTI > 0xffef) {
|
||||
/* c_RNTI range error should not happen */
|
||||
LOG_E(NR_RRC, "NR_RRCReestablishmentRequest c_RNTI range error, fallback to RRC establishment\n");
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0);
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0, NULL, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1780,7 +1780,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
|
||||
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
|
||||
if (ue_context_p == NULL) {
|
||||
LOG_E(NR_RRC, "NR_RRCReestablishmentRequest without UE context, fallback to RRC establishment\n");
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, c_rnti, 0);
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, c_rnti, 0, du_to_cu_rrc_container, du_to_cu_rrc_container_len);
|
||||
break;
|
||||
}
|
||||
// c-plane not end
|
||||
@@ -3417,6 +3417,7 @@ void *rrc_gnb_task(void *args_p) {
|
||||
MessageDef *msg_p;
|
||||
instance_t instance;
|
||||
int result;
|
||||
uint16_t status;
|
||||
protocol_ctxt_t ctxt = {.module_id = 0, .enb_flag = 1, .instance = 0, .rntiMaybeUEid = 0, .frame = -1, .subframe = -1, .eNB_index = 0, .brOption = false};
|
||||
|
||||
/* timer to write stats to file */
|
||||
@@ -3665,7 +3666,7 @@ rrc_gNB_generate_RRCRelease(
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(ctxt_pP->instance, ue_context_pP->ue_context.gNB_ue_ngap_id);
|
||||
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(ctxt_pP->instance, ue_context_pP);
|
||||
ue_context_pP->ue_context.ue_release_timer_rrc = 1;
|
||||
/* TODO: 38.331 says for RRC Release that the UE should release everything
|
||||
* after 60ms or if lower layers acked receipt of release. Hence, from the
|
||||
|
||||
@@ -756,6 +756,10 @@ void rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(MessageDef *msg_p, instance_t ins
|
||||
|
||||
for (int i = 0; i < msg->nb_pdusessions_tosetup; i++) {
|
||||
rrc_pdu_session_param_t *pduSession = find_pduSession(UE, msg->pdusession_setup_params[i].pdusession_id, true);
|
||||
if (NULL == pduSession) {
|
||||
LOG_E(NR_RRC, "UE PDU Sessions: %d, PDU Session to setup: %d \n", UE->nb_of_pdusessions, msg->pdusession_setup_params[i].pdusession_id);
|
||||
continue;
|
||||
}
|
||||
pdusession_t *session = &pduSession->param;
|
||||
LOG_I(NR_RRC, "Adding pdusession %d, total nb of sessions %d\n", session->pdusession_id, UE->nb_of_pdusessions);
|
||||
session->pdusession_id = msg->pdusession_setup_params[i].pdusession_id;
|
||||
@@ -818,6 +822,15 @@ void rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(MessageDef *msg_p, instance_t ins
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bearer_req.rnti == 0) {
|
||||
LOG_E(NR_RRC, "Couldnt find PDU Sessions. reject !!!\n");
|
||||
MessageDef *msg_fail_p = NULL;
|
||||
msg_fail_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_PDUSESSION_SETUP_REQUEST_FAIL);
|
||||
NGAP_PDUSESSION_SETUP_FAIL(msg_fail_p).gNB_ue_ngap_id = msg->gNB_ue_ngap_id;
|
||||
// TODO add failure cause when defined!
|
||||
itti_send_msg_to_task (TASK_NGAP, instance, msg_fail_p);
|
||||
return ;
|
||||
}
|
||||
rrc->cucp_cuup.bearer_context_setup(&bearer_req, instance);
|
||||
return;
|
||||
}
|
||||
@@ -1173,9 +1186,14 @@ int rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(MessageDef *msg_p, instance_
|
||||
|
||||
void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(
|
||||
instance_t instance,
|
||||
uint32_t gNB_ue_ngap_id) {
|
||||
rrc_gNB_ue_context_t *const ue_context_pP) {
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = gNB_ue_ngap_id;
|
||||
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id;
|
||||
|
||||
for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) {
|
||||
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).pdusessions[i].pdusession_id = ue_context_pP->ue_context.pduSession[i].param.pdusession_id;
|
||||
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).nb_of_pdusessions++;
|
||||
}
|
||||
itti_send_msg_to_task(TASK_NGAP, instance, msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ int rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_REQ(MessageDef *msg_p, instance_t in
|
||||
|
||||
int rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(MessageDef *msg_p, instance_t instance);
|
||||
|
||||
void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, uint32_t gNB_ue_ngap_id);
|
||||
void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, rrc_gNB_ue_context_t *const ue_context_pP);
|
||||
|
||||
void
|
||||
rrc_gNB_send_NGAP_UE_CAPABILITIES_IND(
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "ngap_gNB_management_procedures.h"
|
||||
#include "ngap_gNB_context_management_procedures.h"
|
||||
#include "NGAP_PDUSessionResourceItemCxtRelReq.h"
|
||||
#include "NGAP_PDUSessionResourceItemCxtRelCpl.h"
|
||||
|
||||
|
||||
int ngap_ue_context_release_complete(instance_t instance,
|
||||
@@ -100,6 +101,24 @@ int ngap_ue_context_release_complete(instance_t instance,
|
||||
ie->value.choice.RAN_UE_NGAP_ID = ue_release_complete_p->gNB_ue_ngap_id;
|
||||
}
|
||||
|
||||
/* optional */
|
||||
{
|
||||
// Add PDU Sessions to release
|
||||
NGAP_INFO("UE CONTEXT RELEASE COMPLETE for AMF-UE-NGAP-ID:%d RAN-UE-NGAP-ID:%d Num PDU Ssn: %d\n", ue_context_p->amf_ue_ngap_id, ue_release_complete_p->gNB_ue_ngap_id, ue_release_complete_p->nb_of_pdusessions);
|
||||
if (ue_release_complete_p->nb_of_pdusessions > 0) {
|
||||
asn1cSequenceAdd(out->protocolIEs.list, NGAP_UEContextReleaseComplete_IEs_t, ie);
|
||||
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceListCxtRelCpl;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present = NGAP_UEContextReleaseComplete_IEs__value_PR_PDUSessionResourceListCxtRelCpl;
|
||||
for (int i = 0; i < ue_release_complete_p->nb_of_pdusessions; i++) {
|
||||
NGAP_PDUSessionResourceItemCxtRelCpl_t *item;
|
||||
item = (NGAP_PDUSessionResourceItemCxtRelCpl_t *)calloc(1,sizeof(NGAP_PDUSessionResourceItemCxtRelCpl_t));
|
||||
item->pDUSessionID = ue_release_complete_p->pdusessions[i].pdusession_id;
|
||||
asn1cSeqAdd(&ie->value.choice.PDUSessionResourceListCxtRelCpl.list, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
||||
/* Encode procedure has failed... */
|
||||
NGAP_ERROR("Failed to encode UE context release complete\n");
|
||||
|
||||
@@ -762,8 +762,10 @@ static int ngap_gNB_handle_initial_context_request(uint32_t assoc_id, uint32_t s
|
||||
for (i = 0; i < ie->value.choice.PDUSessionResourceSetupListCxtReq.list.count; i++) {
|
||||
NGAP_PDUSessionResourceSetupItemCxtReq_t *item_p = ie->value.choice.PDUSessionResourceSetupListCxtReq.list.array[i];
|
||||
msg->pdusession_param[i].pdusession_id = item_p->pDUSessionID;
|
||||
|
||||
allocCopy(&msg->pdusession_param[i].nas_pdu, *item_p->nAS_PDU);
|
||||
if(item_p->nAS_PDU) {
|
||||
allocCopy(&msg->pdusession_param[i].nas_pdu, *item_p->nAS_PDU);
|
||||
}
|
||||
//allocCopy(&msg->pdusession_param[i].nas_pdu, *item_p->nAS_PDU);
|
||||
allocCopy(&msg->pdusession_param[i].pdusessionTransfer, item_p->pDUSessionResourceSetupRequestTransfer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,14 +11,21 @@ gNBs =
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
plmn_list = ({ mcc = 001; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1; }) });
|
||||
plmn_list = ({ mcc = 001; mnc = 01; mnc_length = 2; snssaiList = ({ sst = 1; sd = 0x1; }) });
|
||||
|
||||
nr_cellid = 12345678L;
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
do_CSIRS = 1;
|
||||
do_SRS = 1;
|
||||
do_CSIRS = 0;
|
||||
do_SRS = 0;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
{
|
||||
controlResourceSetZero = 12;
|
||||
searchSpaceZero = 0;
|
||||
}
|
||||
);
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
@@ -29,10 +36,10 @@ gNBs =
|
||||
# downlinkConfigCommon
|
||||
#frequencyInfoDL
|
||||
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
|
||||
absoluteFrequencySSB = 641280;
|
||||
absoluteFrequencySSB = 621312; #641280;
|
||||
dl_frequencyBand = 78;
|
||||
# this is 3600 MHz
|
||||
dl_absoluteFrequencyPointA = 640008;
|
||||
dl_absoluteFrequencyPointA = 620040; #640008;
|
||||
#scs-SpecificCarrierList
|
||||
dl_offstToCarrier = 0;
|
||||
# subcarrierSpacing
|
||||
@@ -169,10 +176,10 @@ gNBs =
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
|
||||
GNB_INTERFACE_NAME_FOR_NG_AMF = "enp6s0";
|
||||
GNB_IPV4_ADDRESS_FOR_NG_AMF = "10.87.0.21";
|
||||
GNB_INTERFACE_NAME_FOR_NGU = "enp6s0";
|
||||
GNB_IPV4_ADDRESS_FOR_NGU = "10.87.0.21";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
|
||||
@@ -184,9 +191,9 @@ MACRLCs = (
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
pusch_TargetSNRx10 = 150;
|
||||
pusch_TargetSNRx10 = 300;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
ulsch_max_frame_inactivity = 0;
|
||||
ulsch_max_frame_inactivity = 10;
|
||||
ul_max_mcs = 28;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user