Commit b49bfe6e authored by Michele Paffetti's avatar Michele Paffetti

Managment of SRBs, SecurityFailure, introduction of new function in PDCP for...

Managment of SRBs, SecurityFailure, introduction of new function in PDCP for short SN and other small chages. Introduction of Develop-Records.txt file for keep tracking
parent a228777c
Develop_nb_iot_RRC Records
2017_05_16
*for the moment all the interfaces are in L2_interface_nb_iot.c
*pdcp_primitives.c --> pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer (new function) --> used in NB_pdcp_data_req interface
included also in the proper header file pdcp_primitives.h
*management of SecurityModeFailure message (rrc_eNB_nb_iot.c) --> we call the NB_rrc_pdcp_config_asn1_req with a particular case for securityMode =-1;
modify NB_rrc_pdcp_config_asn1_req function in L2_interface_nb_iot.c
modify pdcp_config_set_security this particular case "else if(security_modeP == -1)"
*modified rrc_eNB_process_RRCConnectionReconfigurationComplete_NB function ---> DRBs are never deleted and ue_cuontext_pP->ue_context.DRB_active[drb_id] == 1 called only once
*modified rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB--> no need of qci switch case since only RLC-AM mode in NB-IoT (no GBR)
*LCHAN_DESC Lchan_desc[2] --> old structure and is mainly a "good practice" but non used anymore so deleted from the rrc_eNB_nb_iot.c file
......@@ -223,6 +223,8 @@ typedef struct {
/*! \brief MAC Logical Channel Descriptor
* XXX MP: is an old structure no more used actually in the code
* we left it just because it could be useful for future development
*/
typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
......
......@@ -84,7 +84,7 @@
#define MAX_MANAGED_ENB_PER_MOBILE 2
///NB-IOT
#define NB_RB_MAX_NB_IOT (maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2+3 = 5
#define NB_RB_MAX_NB_IOT (maxDRB_NB_r13 + 3) //MP: NB_IoT --> 2(DRB)+3(SRBs - 2 is not used) = 5
#define DEFAULT_RAB_ID 1
......
......@@ -130,13 +130,13 @@ rrc_mac_config_req(
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
if (eNB_flagP==0) {
if (eNB_flagP==0) { //is UE
LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index);
if (tdd_Config != NULL) {
UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
}
} else {
} else { //is eNB
UE_id = find_UE_id(Mod_idP, rntiP);
if (physicalConfigDedicated == NULL) {
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP);
......@@ -173,7 +173,7 @@ rrc_mac_config_req(
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
if (logicalChannelConfig!= NULL) {
if (eNB_flagP==0) {
if (eNB_flagP==0) { //is UE
LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_idP,eNB_index);
UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
......
......@@ -1668,7 +1668,16 @@ pdcp_config_set_security(
pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm,
ctxt_pP->rnti);
} else {
}
/*particular case activated by SecurityModeFailure*/
else if(security_modeP == -1){
// in this way in NB_pdcp_data_req function you never call "pdcp_apply_security"
// and we never call pdcp_validate_security in NB_pdcp_data_indi
pdcp_pP->security_activated = 0;
pdcp_pP->cipheringAlgorithm = 0;
pdcp_pP->integrityProtAlgorithm = 0;
}
else {
MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
"0 Set security failed UE %"PRIx16" ",
......@@ -1680,6 +1689,7 @@ pdcp_config_set_security(
}
//-----------------------------------------------------------------------------
// MP: seems to be no more used (old code)
void
rrc_pdcp_config_req (
const protocol_ctxt_t* const ctxt_pP,
......
......@@ -160,7 +160,7 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
uint16_t sequence_number = pdu->sn;
pdu_buffer[1] = sequence_number & 0xFF;
sequence_number >>= 8;
pdu_buffer[0] = sequence_number & 0xFF;
pdu_buffer[0] = sequence_number & 0xFF; // sequence_number & 0x0F
/*
* Fill Data or Control field
......@@ -173,6 +173,41 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
return TRUE;
}
/*
* Fills the incoming buffer with the fields of the header for short SN
*
* Created for Nb-IoT purpose
*
* @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise
*/
boolean_t pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer(unsigned char* pdu_buffer, \
pdcp_user_plane_data_pdu_header_with_short_sn* pdu)
{
if (pdu_buffer == NULL || pdu == NULL) {
return FALSE;
}
/*
* Fill the Sequence Number field
*/
uint16_t sequence_number = pdu->sn;
pdu_buffer[0] = sequence_number & 0x7F; //is a mask that set the octec; 0111 1111 --> so the first bit (D/C field) is set to 0 (Control PDU)
/*
* Fill Data or Control field
* DC field =1 for Data PDU, and =0 for Control PDU (status report, ROCH feedback ecc..)
*/
if (pdu->dc == PDCP_DATA_PDU_BIT_SET) { //if required Data PDU
LOG_D(PDCP, "Setting PDU as a DATA PDU\n");
pdu_buffer[0] |= 0x80; // set the first bit as 1 (0x80 = 1000 0000)
}
return TRUE;
}
/*
* Fills the incoming PDU buffer with with given control PDU
*
......
......@@ -155,6 +155,18 @@ boolean_t pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer(unsigned char
boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* pdu_buffer, \
pdcp_user_plane_data_pdu_header_with_long_sn* pdu);
/*
* Fills the incoming buffer with the fields of the header for Short SN (RLC AM)
*
* Created for NB-IoT purposes
*
* @param pdu_buffer PDCP PDU buffer
* @return TRUE on success, FALSE otherwise
*/
boolean_t pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer(unsigned char* pdu_buffer, \
pdcp_user_plane_data_pdu_header_with_short_sn* pdu);
/*
* Fills the incoming status report header with given value of bitmap
* and 'first missing pdu' sequence number
......
......@@ -41,6 +41,7 @@
#include "msc.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "gtpv1u.h"
#include "osa_defs.h"
#ifdef PHY_EMUL
#include "SIMULATION/simulation_defs.h"
......@@ -116,7 +117,7 @@ int NB_rrc_mac_config_req_eNB(
BCCH_BCH_Message_NB_t *mib_NB,
RadioResourceConfigCommonSIB_NB_r13_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated,
MAC_MainConfig_NB_r13_t *mac_MainConfig,
MAC_MainConfig_NB_r13_t *mac_MainConfig, //most probably not needed since only used at UE side
long logicalChannelIdentity,//FIXME: decide how to use it
LogicalChannelConfig_NB_r13_t *logicalChannelConfig //FIXME: decide how to use it
)
......@@ -145,7 +146,7 @@ int NB_rrc_mac_config_req_eNB(
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].eutra_band = eutra_band;
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].dl_CarrierFreq = dl_CarrierFreq;
// mac_xface->NB_phy_config_mib_eNB(Mod_idP,CC_idP, //XXX MP: defined by Nick in lte_init_nb_iot.c
// NB_phy_config_mib_eNB(Mod_idP,CC_idP, //XXX MP: defined by Nick in lte_init_nb_iot.c
// eutra_band,
// physCellId,
// Ncp,
......@@ -162,8 +163,11 @@ int NB_rrc_mac_config_req_eNB(
if (radioResourceConfigCommon!=NULL) {
LOG_I(MAC,"[CONFIG]SIB2/3-NB Contents (partial)\n");
//TODO:show something on npusch parameters
//LOG_I(MAC,"[CONFIG]npusch_config_common_r13.
LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13= %d\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13);
LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13= %d\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13);
LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13= %d\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13);
LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13= %d\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13);
eNB_mac_inst_NB[Mod_idP].common_channels[CC_idP].radioResourceConfigCommon = radioResourceConfigCommon;
......@@ -171,7 +175,7 @@ int NB_rrc_mac_config_req_eNB(
//no ul_Bandwidth
// mac_xface->NB_phy_config_sib2_eNB( //XXX MP: defined by Nick in lte_init_nb_iot.c
// NB_phy_config_sib2_eNB( //XXX MP: defined by Nick in lte_init_nb_iot.c
// Mod_idP,
// CC_idP,
// radioResourceConfigCommon,
......@@ -185,17 +189,21 @@ int NB_rrc_mac_config_req_eNB(
if (UE_id == -1) {
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
} else {
//TODO logical channel configuration for UE_list->UE_template
//no logical channel group not defined for nb-iot --> no UL specific Parameter
//XXX: lcgidmap in MAC/defs.h most probably is not needed
}
}
///mac_mainConfig not needed for the eNB side but only for UE
if (physicalConfigDedicated != NULL) {
if (UE_id == -1)
LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
else
{
// mac_xface->NB_phy_config_dedicated_eNB( //XXX MP: defined by Nick in lte_init_nb_iot.c
// NB_phy_config_dedicated_eNB( //XXX MP: defined by Nick in lte_init_nb_iot.c
// Mod_idP,
// CC_idP,
// UE_RNTI(Mod_idP, UE_id),
......@@ -251,7 +259,7 @@ int8_t NB_mac_rrc_data_req_eNB(
//within the 2560 ms period
//Implementation: //FIXME should be checked if compatible if SIB23-NB scheduling
//SchedulingInfoSIB_r13 = 0 --> nrepetitions= 4 + NcelliD mod 4 = 1 --> start_sfn_sib1_Nb = 16
//SchedulingInfoSIB_r13 = 0 --> nrepetitions= 4 + NcelliD mod 4 = 1 --> start_sfn_sib1_Nb = 16
/*logic*/
//1) check if the current frame is before/after the starting frame of sib1-NB transmission
......@@ -549,6 +557,81 @@ int NB_mac_eNB_get_rrc_status(
/*----------------------------------RRC-PDCP--------------------------------------*/
//defined in pdcp_security.c
//called in NB_pdcp_data_req
//-----------------------------------------------------------------------------
int
NB_pdcp_apply_security(
const protocol_ctxt_t* const ctxt_pP,
pdcp_t *const pdcp_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_id, //rb_idP % maxDRB_NB_r13
const uint8_t pdcp_header_len,
const uint16_t current_sn,
uint8_t * const pdcp_pdu_buffer,
const uint16_t sdu_buffer_size
)
{
uint8_t *buffer_encrypted = NULL;
stream_cipher_t encrypt_params;
DevAssert(pdcp_pP != NULL);
DevAssert(pdcp_pdu_buffer != NULL);
DevCheck(rb_id < NB_RB_MAX_NB_IOT && rb_id >= 0, rb_id, NB_RB_MAX_NB_IOT, 0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_APPLY_SECURITY, VCD_FUNCTION_IN);
encrypt_params.direction = (pdcp_pP->is_ue == 1) ? SECU_DIRECTION_UPLINK : SECU_DIRECTION_DOWNLINK;
encrypt_params.bearer = rb_id - 1;
encrypt_params.count = pdcp_get_next_count_tx(pdcp_pP, srb_flagP, current_sn);
encrypt_params.key_length = 16;
if (srb_flagP) {
/* SRBs */
uint8_t *mac_i;
LOG_D(PDCP, "[OSA][RB %d] %s Applying control-plane security %d \n",
rb_id, (pdcp_pP->is_ue != 0) ? "UE -> eNB" : "eNB -> UE", pdcp_pP->integrityProtAlgorithm);
encrypt_params.message = pdcp_pdu_buffer;
encrypt_params.blength = (pdcp_header_len + sdu_buffer_size) << 3;
encrypt_params.key = pdcp_pP->kRRCint + 16; // + 128;
mac_i = &pdcp_pdu_buffer[pdcp_header_len + sdu_buffer_size];
/* Both header and data parts are integrity protected for
* control-plane PDUs */
stream_compute_integrity(pdcp_pP->integrityProtAlgorithm,
&encrypt_params,
mac_i);
encrypt_params.key = pdcp_pP->kRRCenc; // + 128 // bit key
} else {
LOG_D(PDCP, "[OSA][RB %d] %s Applying user-plane security\n",
rb_id, (pdcp_pP->is_ue != 0) ? "UE -> eNB" : "eNB -> UE");
encrypt_params.key = pdcp_pP->kUPenc;// + 128;
}
encrypt_params.message = &pdcp_pdu_buffer[pdcp_header_len];
encrypt_params.blength = sdu_buffer_size << 3;
buffer_encrypted = &pdcp_pdu_buffer[pdcp_header_len];
/* Apply ciphering if any requested */
stream_encrypt(pdcp_pP->cipheringAlgorithm,
&encrypt_params,
&buffer_encrypted);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_APPLY_SECURITY, VCD_FUNCTION_OUT);
return 0;
}
//FIXME for the moment we not configure PDCP for SRB1bis (but used as it is SRB1)
//defined in pdcp.c
boolean_t NB_rrc_pdcp_config_asn1_req (
......@@ -561,12 +644,11 @@ boolean_t NB_rrc_pdcp_config_asn1_req (
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP,
rb_id_t *const defaultDRB,
long LCID
long LCID //its only for check purposes (if correctly called could be deleted)
)
{
long int lc_id = 0;
DRB_Identity_t srb_id = 0;
long int mch_id = 0;
rlc_mode_t rlc_type = RLC_MODE_NONE;
DRB_Identity_t drb_id = 0;
DRB_Identity_t *pdrb_id_p = NULL;
......@@ -599,7 +681,7 @@ boolean_t NB_rrc_pdcp_config_asn1_req (
if(LCID == DCCH0) //SRB1bis
{
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" PDCP Configiration for SRB1bis not allowed\n");
return TRUE;
return 0;
}
else
{
......@@ -608,6 +690,37 @@ boolean_t NB_rrc_pdcp_config_asn1_req (
lc_id = srb_id;
}
/*Security Mode Failure*/
if(security_modeP == -1){
LOG_D(PDCP, "SecurityModeFailure --> NB_rrc_pdcp_config_asn1_req --> Disabling security for srb2add_list_pP\n");
for(int cnt=0; cnt< srb2add_list_pP->list.count; cnt++)//may not needed a loop
{
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ENB_FLAG_YES, srb_id, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p,key, (void**)&pdcp_p);
if(h_rc != HASH_TABLE_OK){
LOG_I(PDCP, "SecurityModeFailure --> NB_rrc_pdcp_config_asn1_req not available pdcp entity for disable security for this SRB");
continue;
}
pdcp_config_set_security(
ctxt_pP,
pdcp_p,
srb_id,//DCCH1
lc_id, //1
security_modeP,// should be -1
kRRCenc_pP,//Should be NULL
kRRCint_pP,//Should be NULL
kUPenc_pP //Should be NULL
);
}
return 0;
}
for (cnt=0; cnt<srb2add_list_pP->list.count; cnt++) {
srb_toaddmod_p = srb2add_list_pP->list.array[cnt];
rlc_type = RLC_MODE_AM; //only mode available in NB-IOT
......@@ -615,7 +728,6 @@ boolean_t NB_rrc_pdcp_config_asn1_req (
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, srb_id, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
//for the moment left the same logic
if (h_rc == HASH_TABLE_OK) {
action = CONFIG_ACTION_MODIFY;
LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_MODIFY key 0x%"PRIx64"\n",
......@@ -664,7 +776,7 @@ boolean_t NB_rrc_pdcp_config_asn1_req (
srb_id,
srb_sn, //rb_sn
0, // drb_report
0, // header compression
0, // header compression no for SRBs
security_modeP,
kRRCenc_pP,
kRRCint_pP,
......@@ -766,7 +878,7 @@ boolean_t NB_rrc_pdcp_config_asn1_req (
if (drb_toaddmod_p->pdcp_Config_r13) {
if (drb_toaddmod_p->pdcp_Config_r13->discardTimer_r13) {
// set the value of the timer
//TODO: set the value of the timer
}
if (drb_toaddmod_p->pdcp_Config_r13) {
......@@ -950,7 +1062,7 @@ NB_pdcp_config_req_asn1 (
(rlc_modeP == RLC_MODE_AM ) ? "AM" : "TM");
/* Setup security */
if (security_modeP != 0xff) {
//TODO: check this function
pdcp_config_set_security(
ctxt_pP,
pdcp_pP,
......@@ -1188,7 +1300,7 @@ boolean_t NB_pdcp_data_req(
}
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ENB_FLAG_YES, rb_idP, srb_flagP);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
if (h_rc != HASH_TABLE_OK) {
......@@ -1306,8 +1418,7 @@ boolean_t NB_pdcp_data_req(
pdu_header.sn = pdcp_get_next_tx_seq_number(pdcp_p);
current_sn = pdu_header.sn ;
//TODO: should change this function for NB-IoT --> define for short sn
if (pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer((unsigned char*)pdcp_pdu_p->data, &pdu_header) == FALSE) {
if (pdcp_serialize_user_plane_data_pdu_with_short_sn_buffer((unsigned char*)pdcp_pdu_p->data, &pdu_header) == FALSE) {
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" Cannot fill PDU buffer with relevant header fields!\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p));
......@@ -1351,6 +1462,9 @@ boolean_t NB_pdcp_data_req(
//For control plane data that are not integrity protected,
// the MAC-I field is still present and should be padded with padding bits set to 0.
// NOTE: user-plane data are never integrity protected
//XXX MP: in OAI seems that they not use integrity protection at all --> they padding to 0 all bits
for (i=0; i<pdcp_tailer_len; i++) {
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP + i] = 0x00;// pdu_header.mac_i[i];
}
......@@ -1367,8 +1481,8 @@ boolean_t NB_pdcp_data_req(
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].apply_security);
}
//FIXME also this function should be checked for NB-IoT
pdcp_apply_security(ctxt_pP,
//FIXME also this function should be checked for NB-IoT (defined in pdcp_security.c)
NB_pdcp_apply_security(ctxt_pP,
pdcp_p,
srb_flagP,
rb_idP % maxDRB_NB_r13,
......@@ -1472,6 +1586,9 @@ boolean_t NB_pdcp_data_req(
return ret;
}
//defined in L2_interface
void NB_rrc_data_ind(
const protocol_ctxt_t* const ctxt_pP,
......
......@@ -51,6 +51,8 @@
#include <rtai.h>
#endif
//----Not needed for NB-IoT??-------- (but have to left for UE?)
//#include "SystemInformationBlockType1.h"
//#include "SystemInformation.h"
......@@ -314,7 +316,7 @@ typedef struct {
typedef struct RB_INFO_NB_s {
uint16_t Rb_id; //=Lchan_id
LCHAN_DESC Lchan_desc[2]; //XXX LCHAN_DESC should be changed for NB-IoT
LCHAN_DESC Lchan_desc[2]; //MP: Lchan_desc is an old structure no more used in general --> remove also where it is setup
//MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
} RB_INFO_NB;
......@@ -322,7 +324,7 @@ typedef struct SRB_INFO_NB_s {
uint16_t Srb_id; //=Lchan_id---> useful for distinguish between SRB1 and SRB1bis?
RRC_BUFFER_NB Rx_buffer;
RRC_BUFFER_NB Tx_buffer;
LCHAN_DESC Lchan_desc[2];//LCHAN_DESC should be changed for NB-IoT
LCHAN_DESC Lchan_desc[2]; //MP: Lchan_desc is an old structure no more used in general --> remove also where it is setup
unsigned int Trans_id;
uint8_t Active;
} SRB_INFO_NB;
......
......@@ -39,8 +39,6 @@
//MP: NOTE:XXX some of the parameters defined in vars_nb_iot are called by the extern.h file so not replicated here
//should be modified
//extern LCHAN_DESC BCCH_LCHAN_DESC,CCCH_LCHAN_DESC,DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
extern eNB_RRC_INST_NB *eNB_rrc_inst_NB;
......
......@@ -101,6 +101,7 @@ rrc_config_buffer_NB(
//-----------------------------------------------------------------------------
//XXX NEW mplementation by Raymond: still used but no more called by MAC/main.c instead directly called by rrc_eNB_nb_iot.c
//XXX maybe this function is no more useful
int
rrc_init_global_param_NB(
void
......@@ -110,20 +111,18 @@ rrc_init_global_param_NB(
rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc
//FIXME: all this parameter must be properly set
DCCH_LCHAN_DESC.transport_block_size = 4;
DCCH_LCHAN_DESC.max_transport_blocks = 16;
DCCH_LCHAN_DESC.Delay_class = 1;
DTCH_DL_LCHAN_DESC.transport_block_size = 52;
DTCH_DL_LCHAN_DESC.max_transport_blocks = 20;
DTCH_DL_LCHAN_DESC.Delay_class = 1;
DTCH_UL_LCHAN_DESC.transport_block_size = 52;
DTCH_UL_LCHAN_DESC.max_transport_blocks = 20;
DTCH_UL_LCHAN_DESC.Delay_class = 1;
//XXX MP: most probably ALL of this stuff are no more needed (also the one not commented)
//UM mode not allowed in NB-IoT
// DCCH_LCHAN_DESC.transport_block_size = 4;
// DCCH_LCHAN_DESC.max_transport_blocks = 16;
// DCCH_LCHAN_DESC.Delay_class = 1;
// DTCH_DL_LCHAN_DESC.transport_block_size = 52;
// DTCH_DL_LCHAN_DESC.max_transport_blocks = 20;
// DTCH_DL_LCHAN_DESC.Delay_class = 1;
// DTCH_UL_LCHAN_DESC.transport_block_size = 52;
// DTCH_UL_LCHAN_DESC.max_transport_blocks = 20;
// DTCH_UL_LCHAN_DESC.Delay_class = 1;
//XXX MP:structure rlc_am_info_NB --> rlc.h
Rlc_info_am_config.rlc_mode = RLC_MODE_AM;
Rlc_info_am_config.rlc.rlc_am_info_NB.max_retx_threshold = 50;
Rlc_info_am_config.rlc.rlc_am_info_NB.t_poll_retransmit = 15;
......
......@@ -1574,7 +1574,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
if (*DRB_configList) {
free(*DRB_configList);
}
//DRB_ConfigList era gi stato linkato a ue_context al momento della dichiarazione
//DRB_ConfigList era gi stato linkato a ue_context al momento della dichiarazione
*DRB_configList = CALLOC(1, sizeof(**DRB_configList));
memset(*DRB_configList, 0, sizeof(**DRB_configList));
......@@ -3753,7 +3753,7 @@ rrc_eNB_generate_RRCConnectionSetup(
(fp->nb_antenna_ports_eNB==2)?2:1, //at this point we do not have the UE capability information, so it can only be TM1 or TM2
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
fp,
SRB_configList, //qui le mando come argomento puntatore di puntatore cos vengono configurate
SRB_configList, //qui le mando come argomento puntatore di puntatore cos vengono configurate
&ue_context_pP->ue_context.physicalConfigDedicated);
#ifdef RRC_MSG_PRINT
......@@ -3771,7 +3771,7 @@ rrc_eNB_generate_RRCConnectionSetup(
if (*SRB_configList != NULL) {
for (cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) {
//sta lavorando solo con SRB1--> perch RRCConnectionSetup setta solo SRB1 (per NB_IoT??)
//sta lavorando solo con SRB1--> perch RRCConnectionSetup setta solo SRB1 (per NB_IoT??)
if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) {
SRB1_config = (*SRB_configList)->list.array[cnt];
......@@ -4134,7 +4134,7 @@ rrc_eNB_decode_ccch(
"reconfigurationFailure"));
//qui in realt andr gestita diversamente senza reject sempre
//qui in realt� andr� gestita diversamente senza reject sempre
/*{
uint64_t c_rnti = 0;
......@@ -4938,6 +4938,8 @@ rrc_eNB_decode_dcch(
}
#if defined(ENABLE_ITTI)
// This function triggers the establishemnt of dedicated bearer in the absence of EPC
// to emulate it only establish 3 bearers but it can also establish 10 dedicated bearers.
void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* ue_context_pP){
......
......@@ -540,8 +540,8 @@ rrc_eNB_generate_RRCConnectionSetup_NB(
(BCCH_BCH_Message_NB_t*) NULL,
(RadioResourceConfigCommonSIB_NB_r13_t *) NULL,
(PhysicalConfigDedicated_NB_r13_t*) ue_context_pP->ue_context.physicalConfigDedicated_NB,
ue_context_pP->ue_context.mac_MainConfig_NB, //FIXME WHo have set this??
DCCH0, //LCID = 3 of SRB1bis //XXX for the moment have been defined in MAC/defs.h but should move to MAC/defs_nb_iot.h
ue_context_pP->ue_context.mac_MainConfig_NB, //XXX most probably is not needed since is only at UE side
DCCH0, //LCID = 3 of SRB1bis
SRB1bis_logicalChannelConfig
);
break;
......@@ -603,6 +603,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
/*Derive Keys*/
#if defined(ENABLE_SECURITY)
/* Derive the keys from kenb */
......@@ -635,7 +637,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
SRB_configList2,
DRB_configList2,
(DRB_ToReleaseList_NB_r13_t *) NULL,
0xff, //security mode already configured during the securitymodecommand
0xff, //security mode already configured during the securitymodecommand --> they comes from S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).security_capabilities
kRRCenc,
kRRCint,
kUPenc,
......@@ -670,7 +672,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
}
// Loop through DRBs and establish if necessary
// Loop through DRBs, configure MAC, and (optionally) bringup the IP interface if needed
if (DRB_configList2 != NULL) {
for (i = 0; (i < DRB_configList2->list.count) && (i<2); i++) { // num maxDRB-NB = 2
......@@ -692,14 +694,11 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
(int)DRB_configList2->list.array[i]->drb_Identity_r13,
(int)*DRB_configList2->list.array[i]->logicalChannelIdentity_r13);
if (ue_context_pP->ue_context.DRB_active[drb_id] == 0) {
if (ue_context_pP->ue_context.DRB_active[drb_id] == 0) { //is a new DRB
ue_context_pP->ue_context.DRB_active[drb_id] = 1;
LOG_D(RRC,
"[eNB %d] Frame %d: Establish RLC UM Bidirectional??, DRB %d Active\n",
ctxt_pP->module_id, ctxt_pP->frame, (int)DRB_configList2->list.array[i]->drb_Identity_r13);
//FIXME: RLC UM not exist in NB-IoT and what means the stuff belows?
/*this should run only once at first time for each DRB since later are never deactivated but only modified*/
#if defined(PDCP_USE_NETLINK) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
// can mean also IPV6 since ether -> ipv6 autoconf
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET)
......@@ -749,7 +748,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
DRB2LCHAN_NB[i] = (uint8_t) * DRB_configList2->list.array[i]->logicalChannelIdentity_r13; //set in RRCConnectionReconfiguration (x+3)
}
//for each DRB I send a rrc_mac_config_req
//MP: for each DRB I send a rrc_mac_config_req--> what change is the DRB2LCHAN_NB and logicalChannelConfig_r13
NB_rrc_mac_config_req_eNB(
ctxt_pP->module_id,
ue_context_pP->ue_context.primaryCC_id,
......@@ -775,30 +774,17 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
DRB_configList2->list.array[i]->logicalChannelConfig_r13
);
} else {
} else { //ue_context_pP->ue_context.DRB_active[drb_id] == 1 (means that DRB has been modified)
/*MP:
* This part of the code is wrong since a the list that we manage are ADD/MOD lists and not RELEASE lists
* so it means that nothing should be deleted but only modified!!
* since a the list that we manage are ADD/MOD lists and not RELEASE lists
* it means that nothing should be deleted but only modified!!
*/
if (DRB_configList2->list.array[i]->logicalChannelIdentity_r13) {
DRB2LCHAN_NB[i] = (uint8_t) * DRB_configList2->list.array[i]->logicalChannelIdentity_r13; //set in RRCConnectionReconfiguration (x+3)
}
//remove LCHAN from MAC/PHY
//MP: DRB_active could take values different from 0 and 1 for errors?
if (ue_context_pP->ue_context.DRB_active[drb_id] == 1) {
// DRB has just been removed (by UE) so remove RLC + PDCP for DRB
//FIXME: MP: why not from PDCP?
NB_rrc_rlc_config_req(
ctxt_pP,
SRB_FLAG_NO,
CONFIG_ACTION_REMOVE, //XXXmodify
DRB2LCHAN_NB[i],
Rlc_info_am); //XXX: should send a RLC_info_am--> RRC/vars_nb_iot.h //rlc_infoP
}
ue_context_pP->ue_context.DRB_active[drb_id] = 0;
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RRC_eNB --- MAC_CONFIG_REQ (DRB) ---> MAC_eNB\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
......@@ -825,7 +811,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
ue_context_pP->ue_context.physicalConfigDedicated_NB,
ue_context_pP->ue_context.mac_MainConfig_NB,
DRB2LCHAN_NB[i], //over the logical channel id of the DRB (>=4)
(LogicalChannelConfig_NB_r13_t*)NULL //MP: change this
(LogicalChannelConfig_NB_r13_t*)NULL //XXX MP: is the only change w.r.t previous case
);
}
}
......@@ -835,6 +821,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete_NB(
//-----------------------------------------------------------------------------
void //was under ITTI
// This function triggers the establishment of dedicated bearer in the absence of EPC (oaisim case -- noS1)
// to emulate it only establish 2 bearers (max number for NB-IoT
rrc_eNB_reconfigure_DRBs_NB(const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_NB_t* ue_context_pP)
//------------------------------------------------------------------
......@@ -843,14 +831,13 @@ rrc_eNB_reconfigure_DRBs_NB(const protocol_ctxt_t* const ctxt_pP,
int i;
int e_rab_done=0;
//TODO: MP: to be check the number of e-rab and the parameter set over them
for (i = 0; i < 2; i++) { //NB_RB_MAX - 3; // S1AP_MAX_E_RAB //MP: why 3??--> i think at most 2 DRB = at most 2 e-rab
for (i = 0; i < NB_RB_MAX_NB_IOT-3; i++) { //most 2 DRB for NB-IoT = at most 2 e-rab (DRB)
if ( ue_context_pP->ue_context.e_rab[i].status < E_RAB_NB_STATUS_DONE){ // all those new e-rab ( E_RAB_NB_STATUS_NEW)
ue_context_pP->ue_context.e_rab[i].status = E_RAB_NB_STATUS_NEW;
ue_context_pP->ue_context.e_rab[i].param.e_rab_id = i + 1;
ue_context_pP->ue_context.e_rab[i].param.qos.qci = (i % 9) + 5; //FIXME: if NB-IoT work on non-GBR range (5-9)
ue_context_pP->ue_context.e_rab[i].param.qos.qci = i % 9;
ue_context_pP->ue_context.e_rab[i].param.qos.allocation_retention_priority.priority_level= i % PRIORITY_LEVEL_LOWEST;
ue_context_pP->ue_context.e_rab[i].param.qos.allocation_retention_priority.pre_emp_capability= PRE_EMPTION_CAPABILITY_DISABLED;
ue_context_pP->ue_context.e_rab[i].param.qos.allocation_retention_priority.pre_emp_vulnerability= PRE_EMPTION_VULNERABILITY_DISABLED;
......@@ -868,11 +855,8 @@ rrc_eNB_reconfigure_DRBs_NB(const protocol_ctxt_t* const ctxt_pP,
}
ue_context_pP->ue_context.setup_e_rabs+=e_rab_done;
//should be at most 2 DRBs set
if(ue_context_pP->ue_context.setup_e_rabs > 2)
LOG_E(RRC, PROTOCOL_RRC_CTXT_FMT "e_context.setup_e_rabs > 2 but maxDRBs ==2", PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB(ctxt_pP, ue_context_pP ); //no ho state
//MP: in the case of EPC this function is called directly by S1AP (see rrc_eNB_S1AP.c)
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB(ctxt_pP, ue_context_pP ); //XXX MP: no ho state
}
//-----------------------------------------------------------------------------
uint8_t qci_to_priority[9]={2,4,3,5,1,6,7,8,9}; //FIXME understand if used in NB_IoT (no GBR so only 5-9)
......@@ -923,6 +907,11 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB(
/* Initialize NAS list */
dedicatedInfoNASList_NB = CALLOC(1, sizeof(struct RRCConnectionReconfiguration_NB_r13_IEs__dedicatedInfoNASList_r13));
//MP:add a check on number of setup e_rabs
if(ue_context_pP->ue_context.setup_e_rabs > 2){
LOG_E(RRC, "generate_dedicatedRRCConnectionReconfiguration_NB--> more that 2 e_rabs setup for NB-IoT");
return;
}
for ( i = 0 ; i < ue_context_pP->ue_context.setup_e_rabs ; i++){ //max must be 2 DRBs that are established
......@@ -935,10 +924,10 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB(
DRB_config = CALLOC(1, sizeof(*DRB_config));
DRB_config->eps_BearerIdentity_r13 = CALLOC(1, sizeof(long));
// allowed value 5..15, value : x+4 // e_rab_id setted previously in rrc_eNB_reconfigure_DRB_NB function
// allowed value 5..15, value : x+4 // e_rab_id set previously in rrc_eNB_reconfigure_DRB_NB function or in the EPC
*(DRB_config->eps_BearerIdentity_r13) = ue_context_pP->ue_context.e_rab[i].param.e_rab_id;// x+4; // especial case generation
DRB_config->drb_Identity_r13 = 1 + drb_identity_index + e_rab_done; //FIXME: max 2 DRBs could be established, x
DRB_config->drb_Identity_r13 = 1 + drb_identity_index + e_rab_done; //x
// allowed values (3..10) but 3 is reserved for SRB1bis so value : x+3
DRB_config->logicalChannelIdentity_r13 = CALLOC(1, sizeof(long));
......@@ -952,49 +941,33 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB(
DRB_pdcp_config->discardTimer_r13 = CALLOC(1, sizeof(long));
*(DRB_pdcp_config->discardTimer_r13) = PDCP_Config_NB_r13__discardTimer_r13_infinity;
//must be checked in TS 36.413 and TS 23.401 if this parameter exist for NB_IoT
switch (ue_context_pP->ue_context.e_rab[i].param.qos.qci){
//GBR is not supported by NB-IoT
/*
* type: non-realtime data with low packer error rate
* action: switch to RLC AM
*/
case 5: // 100ms, 10^-6, p1 , IMS signaling
case 6: // 300ms, 10^-6, p6
case 8: // 300ms, 10^-6, p8
case 69: // 60ms, 10^-6, p0.5, mission critical delay sensitive data, Lowest Priority
case 70: // 200ms, 10^-6, p5.5, mission critical data
// RLC
DRB_rlc_config->present = RLC_Config_NB_r13_PR_am;
DRB_rlc_config->choice.am.ul_AM_RLC_r13.t_PollRetransmit_r13 = T_PollRetransmit_NB_r13_ms250; //random
DRB_rlc_config->choice.am.ul_AM_RLC_r13.maxRetxThreshold_r13 = UL_AM_RLC_NB_r13__maxRetxThreshold_r13_t8;
DRB_rlc_config->choice.am.dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 = CALLOC(1,sizeof(long));
*(DRB_rlc_config->choice.am.dl_AM_RLC_r13.enableStatusReportSN_Gap_r13)= DL_AM_RLC_NB_r13__enableStatusReportSN_Gap_r13_true;
// PDCP FIXME: something to set for PDCP?
break;
default :
LOG_E(RRC,"not supported qci %d\n", ue_context_pP->ue_context.e_rab[i].param.qos.qci);
ue_context_pP->ue_context.e_rab[i].status = E_RAB_NB_STATUS_FAILED;
ue_context_pP->ue_context.e_rab[i].xid = xid;
continue;
}
/*XXX MP:old implementation foresee a switch case on e_context_pP->ue_context.e_rab[i].param.qos.qci (TS 36.413 and TS 23.401)
* but in reality since in NB-IoT only RLC-AM mode is allowed we can directly set DRBs whatever the qci
*/
// RLC conf
//TODO: set properly the following parameters for the DRBs establishment
DRB_rlc_config->present = RLC_Config_NB_r13_PR_am;
DRB_rlc_config->choice.am.ul_AM_RLC_r13.t_PollRetransmit_r13 = T_PollRetransmit_NB_r13_ms250; //random
DRB_rlc_config->choice.am.ul_AM_RLC_r13.maxRetxThreshold_r13 = UL_AM_RLC_NB_r13__maxRetxThreshold_r13_t8;
DRB_rlc_config->choice.am.dl_AM_RLC_r13.enableStatusReportSN_Gap_r13 = CALLOC(1,sizeof(long));
*(DRB_rlc_config->choice.am.dl_AM_RLC_r13.enableStatusReportSN_Gap_r13)= DL_AM_RLC_NB_r13__enableStatusReportSN_Gap_r13_true;
//FIXME MP: TS 36.323 v14.2.0 PDCP status report operation is not applicable for NB-IoT
//(in any case they set to FALSE in the LTE DRBs setup in OAI)
//MP: not used header compression PDCP in OAI
DRB_pdcp_config->headerCompression_r13.present = PDCP_Config_NB_r13__headerCompression_r13_PR_notUsed;
DRB_lchan_config = CALLOC(1, sizeof(*DRB_lchan_config));
DRB_config->logicalChannelConfig_r13 = DRB_lchan_config;
DRB_lchan_config->priority_r13 = CALLOC(1,sizeof(long));
*(DRB_lchan_config->priority_r13) = 1L;
if (ue_context_pP->ue_context.e_rab[i].param.qos.qci < 9 )
*(DRB_lchan_config->priority_r13) = qci_to_priority[ue_context_pP->ue_context.e_rab[i].param.qos.qci-1] + 3;//FIXME ??
else
*(DRB_lchan_config->priority_r13)= 4L;
//DRB_lchan_config->logicalChannelSR_Prohibit_r13 = NULL; /*OPTIONAL*/ --> FIXME not needed to set it now?
//no prioritized bitrate
//no bucketsize duration
......@@ -1026,9 +999,9 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB(
LOG_I(RRC,"add NAS info with size %d (rab id %d)\n",ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length, i);
}
else {
LOG_W(RRC,"Not received activate dedicated EPS bearer context request\n");
LOG_W(RRC,"Not received activate dedicated EPS bearer context request (NAS pdu buffer = NULL)\n");
}
/* TODO parameters yet to process ... */
/* OLD TODO parameters yet to process ... */
{
// ue_context_pP->ue_context.e_rab[i].param.qos;
// ue_context_pP->ue_context.e_rab[i].param.sgw_addr;
......@@ -1102,6 +1075,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_NB(
rrc_eNB_mui,
size);
//transmit the RRCConnectionReconfiguration-NB
NB_rrc_data_req(
ctxt_pP,
DCCH1,//through SRB1
......@@ -1230,7 +1204,7 @@ rrc_eNB_generate_UECapabilityEnquiry_NB(
)
//-----------------------------------------------------------------------------
{
//TODO: Clarify: this message is also called when we receive SecurityModeFailure--> we should continue to use SRB1bis?
//XXX: Clarify: this message is also called when we receive SecurityModeFailure--> we agree that in any case we start using SRB1
uint8_t buffer[100];
uint8_t size;
......@@ -1268,7 +1242,7 @@ rrc_eNB_generate_UECapabilityEnquiry_NB(
NB_rrc_data_req( //to PDCP
ctxt_pP,
DCCH1, //FIXME SRB1 or SRB1bis? depends if successful security activation by UE
DCCH1, //XXX we send it over SRB1
rrc_eNB_mui++,
SDU_CONFIRM_NO,
size,
......@@ -1996,6 +1970,7 @@ rrc_eNB_decode_ccch_NB(
/* replace rnti in the context */
/* for that, remove the context from the RB tree */
///FIXME MP: warning --> implicit declaration because I insert the new type "rrc_ue_tree_NB_s"
RB_REMOVE(rrc_ue_tree_NB_s, &eNB_rrc_inst_NB[ctxt_pP->module_id].rrc_ue_head, ue_context_p);
/* and insert again, after changing rnti everywhere it has to be changed */
......@@ -2097,12 +2072,6 @@ rrc_eNB_decode_ccch_NB(
// SRB1bis (LCID = 3 = DCCH0)
ue_context_p->ue_context.Srb1bis.Active = 1;
ue_context_p->ue_context.Srb1bis.Srb_info.Srb_id = DCCH0;
memcpy(&ue_context_p->ue_context.Srb1bis.Srb_info.Lchan_desc[0],
&DCCH_LCHAN_DESC,//FIXME MP: LCHAN_DESC (mac_rrc_primitives) to be changed
LCHAN_DESC_SIZE);
memcpy(&ue_context_p->ue_context.Srb1bis.Srb_info.Lchan_desc[1],
&DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE);
//generate RRCConnectionSetup-NB
rrc_eNB_generate_RRCConnectionSetup_NB(ctxt_pP, ue_context_p, CC_id);
......@@ -2120,7 +2089,7 @@ rrc_eNB_decode_ccch_NB(
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_p->ue_context.rnti);
//XXX we should not configure PDCP for SRB1bis but only for SRB1 (we do it now?)
//XXX we should not configure PDCP for SRB1bis but only for SRB1
NB_rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList, //contain SRB1bis but used as SRB1
(DRB_ToAddModList_NB_r13_t *) NULL,
......@@ -2455,6 +2424,7 @@ rrc_eNB_decode_dcch_NB(
ue_context_p,
&ul_dcch_msg_NB->message.choice.c1.choice.rrcConnectionSetupComplete_r13.criticalExtensions.choice.rrcConnectionSetupComplete_r13);
//set Ue status CONNECTED
ue_context_p->ue_context.Status = RRC_CONNECTED;
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_CONNECTED \n",
......@@ -2518,10 +2488,15 @@ rrc_eNB_decode_dcch_NB(
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message_NB, (void *)ul_dcch_msg_NB);
#endif
//XXX MP: ???
// confirm with PDCP about the security mode for DCCH
//rrc_pdcp_config_req (enb_mod_idP, frameP, 1,CONFIG_ACTION_SET_SECURITY_MODE, (ue_mod_idP * NB_RB_MAX) + DCCH, 0x77);
// continue the procedure
//MP: this is OPTIONAL operation
ue_context_p->ue_context.Srb1bis.Active=0;
rrc_eNB_generate_UECapabilityEnquiry_NB(ctxt_pP, ue_context_p);
break;
......@@ -2576,10 +2551,33 @@ rrc_eNB_decode_dcch_NB(
#ifdef XER_PRINT
xer_fprint(stdout, &asn_DEF_UL_DCCH_Message_NB, (void *)ul_dcch_msg_NB);
#endif
// cancel the security mode in PDCP??
// followup with the remaining procedure
//#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
//XXX MP: make sense to go ahead with the procedure without security? --> means that we should continue to use SRB1bis?
//XXX MP: According with prof.Navid, after reception of SecurityModeFailure we should configure no security
//therefore setting securityActivated=0 for the corresponding PDCP entity in the PDCP but still start the usage of SRB1
//MP: problem1: rrc_pdcp_config_req function is no more used and have no definition for CONFIG_ACTION_REMOVE (old implementation)
// pdcp_pP-> security_activated modified (=1) by pdcp_config_set_security in NB_pdcp_config_req_asn1 at configuration time
// we now create a particular case for pdcp_config_set_securityy function in which for a particular securityMode (= -1) we deactivate security.
// we first invoke the NB_rrc_pdcp_config_asn1_req that with the particular case of securityMode = -1 will disable security through the pdcp_config_set_security
//XXX MP: the integrity protection is still not used in OAI --> MAC-I is padded always to 0 so no need to modify it
NB_rrc_pdcp_config_asn1_req(
ctxt_pP,
ue_context_p->ue_context.SRB_configList,
(DRB_ToAddModList_NB_r13_t *)NULL,
(DRB_ToReleaseList_NB_r13_t*)NULL,
-1, //security_modeP particular case
NULL,
NULL,
NULL,
NULL,
DCCH1//its only for check purposes (if correctly called could be deleted)
);
rrc_eNB_generate_UECapabilityEnquiry_NB(ctxt_pP, ue_context_p);
break;
......
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