Improved cell reestablishment procedure timers (still not working the authentication)

master
Ismael Gomez 7 years ago
parent 240eba2af5
commit 177f36fc8c

@ -158,7 +158,7 @@ private:
uint32_t current_earfcn; uint32_t current_earfcn;
uint32_t sync_sfn_cnt; uint32_t sync_sfn_cnt;
const static uint32_t SYNC_SFN_TIMEOUT = 200; const static uint32_t SYNC_SFN_TIMEOUT = 1000;
float ul_dl_factor; float ul_dl_factor;
int cur_earfcn_index; int cur_earfcn_index;
bool cell_search_in_progress; bool cell_search_in_progress;
@ -166,7 +166,7 @@ private:
float measure_rsrp; float measure_rsrp;
srslte_ue_dl_t ue_dl_measure; srslte_ue_dl_t ue_dl_measure;
const static int RSRP_MEASURE_NOF_FRAMES = 5; const static int RSRP_MEASURE_NOF_FRAMES = 10;
int cell_sync_sfn(); int cell_sync_sfn();
int cell_meas_rsrp(); int cell_meas_rsrp();

@ -98,6 +98,8 @@ private:
uint8_t transaction_id; uint8_t transaction_id;
bool drb_up; bool drb_up;
bool reestablishment_in_progress;
// timeouts in ms // timeouts in ms
uint32_t connecting_timeout; uint32_t connecting_timeout;
@ -244,6 +246,7 @@ private:
// Helpers // Helpers
void rrc_connection_release(); void rrc_connection_release();
void con_restablish_cell_reselected();
void radio_link_failure(); void radio_link_failure();
static void* start_sib_thread(void *rrc_); static void* start_sib_thread(void *rrc_);
void sib_search(); void sib_search();

@ -117,7 +117,8 @@ void mac::reset()
Info("Resetting MAC\n"); Info("Resetting MAC\n");
timers.stop_all(); timers.get(timer_alignment)->stop();
timers.get(contention_resolution_timer)->stop();
ul_harq.reset_ndi(); ul_harq.reset_ndi();

@ -336,6 +336,7 @@ void phch_common::reset_ul()
pthread_mutex_trylock(&tx_mutex[i]); pthread_mutex_trylock(&tx_mutex[i]);
pthread_mutex_unlock(&tx_mutex[i]); pthread_mutex_unlock(&tx_mutex[i]);
} }
radio_h->tx_end();
} }
} }

@ -35,8 +35,6 @@
#include "srslte/common/security.h" #include "srslte/common/security.h"
#include "srslte/common/bcd_helpers.h" #include "srslte/common/bcd_helpers.h"
#define TIMEOUT_RESYNC_REESTABLISH 100
using namespace srslte; using namespace srslte;
namespace srsue { namespace srsue {
@ -92,6 +90,8 @@ void rrc::init(phy_interface_rrc *phy_,
pthread_mutex_init(&mutex, NULL); pthread_mutex_init(&mutex, NULL);
reestablishment_in_progress = false;
ue_category = SRSLTE_UE_CATEGORY; ue_category = SRSLTE_UE_CATEGORY;
t301 = mac_timers->timer_get_unique_id(); t301 = mac_timers->timer_get_unique_id();
t310 = mac_timers->timer_get_unique_id(); t310 = mac_timers->timer_get_unique_id();
@ -207,7 +207,11 @@ void rrc::run_thread() {
break; break;
case RRC_STATE_CELL_SELECTED: case RRC_STATE_CELL_SELECTED:
rrc_log->info("RRC Cell Selected: Sending connection request...\n"); rrc_log->info("RRC Cell Selected: Sending connection request...\n");
if (reestablishment_in_progress) {
con_restablish_cell_reselected();
} else {
send_con_request(); send_con_request();
}
state = RRC_STATE_CONNECTING; state = RRC_STATE_CONNECTING;
connecting_timeout = 0; connecting_timeout = 0;
break; break;
@ -226,6 +230,7 @@ void rrc::run_thread() {
usleep(60000); usleep(60000);
rrc_log->info("Leaving RRC_CONNECTED state\n"); rrc_log->info("Leaving RRC_CONNECTED state\n");
drb_up = false; drb_up = false;
reestablishment_in_progress = false;
pdcp->reset(); pdcp->reset();
rlc->reset(); rlc->reset();
phy->reset(); phy->reset();
@ -663,6 +668,8 @@ void rrc::send_con_restablish_request() {
ul_ccch_msg.msg.rrc_con_reest_req.cause = LIBLTE_RRC_CON_REEST_REQ_CAUSE_OTHER_FAILURE; ul_ccch_msg.msg.rrc_con_reest_req.cause = LIBLTE_RRC_CON_REEST_REQ_CAUSE_OTHER_FAILURE;
liblte_rrc_pack_ul_ccch_msg(&ul_ccch_msg, (LIBLTE_BIT_MSG_STRUCT *) &bit_buf); liblte_rrc_pack_ul_ccch_msg(&ul_ccch_msg, (LIBLTE_BIT_MSG_STRUCT *) &bit_buf);
reestablishment_in_progress = true;
rrc_log->info("Initiating RRC Connection Reestablishment Procedure\n"); rrc_log->info("Initiating RRC Connection Reestablishment Procedure\n");
rrc_log->console("RRC Connection Reestablishment\n"); rrc_log->console("RRC Connection Reestablishment\n");
mac_timers->timer_get(t310)->stop(); mac_timers->timer_get(t310)->stop();
@ -673,19 +680,16 @@ void rrc::send_con_restablish_request() {
set_phy_default(); set_phy_default();
mac->reset(); mac->reset();
set_mac_default(); set_mac_default();
}
// FIXME: Cell selection should be different?? // Actions following cell reselection 5.3.7.3
void rrc::con_restablish_cell_reselected()
// Wait for cell re-synchronization {
uint32_t timeout_cnt = 0; reestablishment_in_progress = false;
while (!phy->sync_status() && timeout_cnt < TIMEOUT_RESYNC_REESTABLISH) { rrc_log->info("Cell Selection finished. Initiating transmission of RRC Connection Reestablishment Request\n");
usleep(10000);
timeout_cnt++;
}
mac_timers->timer_get(t301)->reset(); mac_timers->timer_get(t301)->reset();
mac_timers->timer_get(t301)->run(); mac_timers->timer_get(t301)->run();
mac_timers->timer_get(t311)->stop(); mac_timers->timer_get(t311)->stop();
rrc_log->info("Cell Selection finished. Initiating transmission of RRC Connection Reestablishment Request\n");
// Byte align and pack the message bits for PDCP // Byte align and pack the message bits for PDCP
if ((bit_buf.N_bits % 8) != 0) { if ((bit_buf.N_bits % 8) != 0) {

Loading…
Cancel
Save