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 { ...@@ -223,6 +223,8 @@ typedef struct {
/*! \brief MAC Logical Channel Descriptor /*! \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 { typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */ unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
#define MAX_MANAGED_ENB_PER_MOBILE 2 #define MAX_MANAGED_ENB_PER_MOBILE 2
///NB-IOT ///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 #define DEFAULT_RAB_ID 1
......
...@@ -130,13 +130,13 @@ rrc_mac_config_req( ...@@ -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); 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); LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index);
if (tdd_Config != NULL) { if (tdd_Config != NULL) {
UE_mac_inst[Mod_idP].tdd_Config = tdd_Config; UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
} }
} else { } else { //is eNB
UE_id = find_UE_id(Mod_idP, rntiP); UE_id = find_UE_id(Mod_idP, rntiP);
if (physicalConfigDedicated == NULL) { if (physicalConfigDedicated == NULL) {
LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP); LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP);
...@@ -173,7 +173,7 @@ rrc_mac_config_req( ...@@ -173,7 +173,7 @@ rrc_mac_config_req(
// SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup // SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
if (logicalChannelConfig!= NULL) { 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); 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].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
......
...@@ -1668,7 +1668,16 @@ pdcp_config_set_security( ...@@ -1668,7 +1668,16 @@ pdcp_config_set_security(
pdcp_pP->cipheringAlgorithm, pdcp_pP->cipheringAlgorithm,
pdcp_pP->integrityProtAlgorithm, pdcp_pP->integrityProtAlgorithm,
ctxt_pP->rnti); 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( MSC_LOG_EVENT(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
"0 Set security failed UE %"PRIx16" ", "0 Set security failed UE %"PRIx16" ",
...@@ -1680,6 +1689,7 @@ pdcp_config_set_security( ...@@ -1680,6 +1689,7 @@ pdcp_config_set_security(
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// MP: seems to be no more used (old code)
void void
rrc_pdcp_config_req ( rrc_pdcp_config_req (
const protocol_ctxt_t* const ctxt_pP, 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* ...@@ -160,7 +160,7 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
uint16_t sequence_number = pdu->sn; uint16_t sequence_number = pdu->sn;
pdu_buffer[1] = sequence_number & 0xFF; pdu_buffer[1] = sequence_number & 0xFF;
sequence_number >>= 8; sequence_number >>= 8;
pdu_buffer[0] = sequence_number & 0xFF; pdu_buffer[0] = sequence_number & 0xFF; // sequence_number & 0x0F
/* /*
* Fill Data or Control field * Fill Data or Control field
...@@ -173,6 +173,41 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* ...@@ -173,6 +173,41 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
return TRUE; 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 * 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 ...@@ -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, \ 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); 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 * Fills the incoming status report header with given value of bitmap
* and 'first missing pdu' sequence number * and 'first missing pdu' sequence number
......
This diff is collapsed.
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
#include <rtai.h> #include <rtai.h>
#endif #endif
//----Not needed for NB-IoT??-------- (but have to left for UE?) //----Not needed for NB-IoT??-------- (but have to left for UE?)
//#include "SystemInformationBlockType1.h" //#include "SystemInformationBlockType1.h"
//#include "SystemInformation.h" //#include "SystemInformation.h"
...@@ -314,7 +316,7 @@ typedef struct { ...@@ -314,7 +316,7 @@ typedef struct {
typedef struct RB_INFO_NB_s { typedef struct RB_INFO_NB_s {
uint16_t Rb_id; //=Lchan_id 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 //MAC_MEAS_REQ_ENTRY *Meas_entry; //may not needed for NB-IoT
} RB_INFO_NB; } RB_INFO_NB;
...@@ -322,7 +324,7 @@ typedef struct SRB_INFO_NB_s { ...@@ -322,7 +324,7 @@ typedef struct SRB_INFO_NB_s {
uint16_t Srb_id; //=Lchan_id---> useful for distinguish between SRB1 and SRB1bis? uint16_t Srb_id; //=Lchan_id---> useful for distinguish between SRB1 and SRB1bis?
RRC_BUFFER_NB Rx_buffer; RRC_BUFFER_NB Rx_buffer;
RRC_BUFFER_NB Tx_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; unsigned int Trans_id;
uint8_t Active; uint8_t Active;
} SRB_INFO_NB; } SRB_INFO_NB;
......
...@@ -39,8 +39,6 @@ ...@@ -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 //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; extern eNB_RRC_INST_NB *eNB_rrc_inst_NB;
......
...@@ -101,6 +101,7 @@ rrc_config_buffer_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 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 int
rrc_init_global_param_NB( rrc_init_global_param_NB(
void void
...@@ -110,20 +111,18 @@ rrc_init_global_param_NB( ...@@ -110,20 +111,18 @@ rrc_init_global_param_NB(
rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc
//FIXME: all this parameter must be properly set //XXX MP: most probably ALL of this stuff are no more needed (also the one not commented)
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;
//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_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.max_retx_threshold = 50;
Rlc_info_am_config.rlc.rlc_am_info_NB.t_poll_retransmit = 15; 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 ...@@ -1574,7 +1574,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
if (*DRB_configList) { if (*DRB_configList) {
free(*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)); *DRB_configList = CALLOC(1, sizeof(**DRB_configList));
memset(*DRB_configList, 0, sizeof(**DRB_configList)); memset(*DRB_configList, 0, sizeof(**DRB_configList));
...@@ -3753,7 +3753,7 @@ rrc_eNB_generate_RRCConnectionSetup( ...@@ -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 (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), rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
fp, 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); &ue_context_pP->ue_context.physicalConfigDedicated);
#ifdef RRC_MSG_PRINT #ifdef RRC_MSG_PRINT
...@@ -3771,7 +3771,7 @@ rrc_eNB_generate_RRCConnectionSetup( ...@@ -3771,7 +3771,7 @@ rrc_eNB_generate_RRCConnectionSetup(
if (*SRB_configList != NULL) { if (*SRB_configList != NULL) {
for (cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) { 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) { if ((*SRB_configList)->list.array[cnt]->srb_Identity == 1) {
SRB1_config = (*SRB_configList)->list.array[cnt]; SRB1_config = (*SRB_configList)->list.array[cnt];
...@@ -4134,7 +4134,7 @@ rrc_eNB_decode_ccch( ...@@ -4134,7 +4134,7 @@ rrc_eNB_decode_ccch(
"reconfigurationFailure")); "reconfigurationFailure"));
//qui in realt andr gestita diversamente senza reject sempre //qui in realt� andr� gestita diversamente senza reject sempre
/*{ /*{
uint64_t c_rnti = 0; uint64_t c_rnti = 0;
...@@ -4938,6 +4938,8 @@ rrc_eNB_decode_dcch( ...@@ -4938,6 +4938,8 @@ rrc_eNB_decode_dcch(
} }
#if defined(ENABLE_ITTI) #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, void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* ue_context_pP){ rrc_eNB_ue_context_t* ue_context_pP){
......
This diff is collapsed.
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