Commit 231c7342 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.15.0: Added make requirement for polarSSL, common, pdcp, and...

Version 0.15.0: Added make requirement for polarSSL, common, pdcp, and security portions of liblte, more decoding/encoding to liblte_mme and liblte_rrc, NACK support to liblte_rlc, and many changes to LTE_fdd_enodeb (limit PCAP output, authentication vector support, HSS interface support, message parsers/senders and state machines for MME, RRC command messages, transmit functionality for PDCP, RLC, and RRC, and refactoring of user identities).
parent a2836d1d
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.14.1)
set(openLTE_version 0.15.0)
enable_testing()
#select the release build type by default to get optimization flags
......@@ -93,6 +93,7 @@ find_package(Gnuradio "3.7.0")
find_package(GnuradioOsmosdr)
find_package(Uhd)
find_package(FFTW3F)
find_package(Polarssl)
if(NOT GNURADIO_RUNTIME_FOUND)
message(FATAL_ERROR "GNURadio required to compile openLTE")
......
......@@ -116,3 +116,10 @@ v00.14.01 Pulled in patches from Mike Peters to fix an uninitialized N_bits
unlock bug, Jeff Long to optimally set the master clock rate for
USRP B2X0 in the LTE_fdd_dl_scan application, and added clock source
as a configurable parameter in the LTE_fdd_enodeb application.
v00.15.00 Added make requirement for polarSSL, common, pdcp, and security
portions of liblte, more decoding/encoding to liblte_mme and
liblte_rrc, NACK support to liblte_rlc, and many changes to
LTE_fdd_enodeb (limit PCAP output, authentication vector support,
HSS interface support, message parsers/senders and state machines
for MME, RRC command messages, transmit functionality for PDCP,
RLC, and RRC, and refactoring of user identities).
......@@ -23,5 +23,5 @@ add_executable(LTE_fdd_enodeb
src/LTE_fdd_enb_rrc.cc
src/LTE_fdd_enb_mme.cc
)
target_link_libraries(LTE_fdd_enodeb lte fftw3f tools pthread rt ${UHD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
target_link_libraries(LTE_fdd_enodeb lte fftw3f tools pthread rt ${POLARSSL_LIBRARIES} ${UHD_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_PMT_LIBRARIES})
install(TARGETS LTE_fdd_enodeb DESTINATION bin)
......@@ -27,6 +27,7 @@
11/09/2013 Ben Wojtowicz Created file
01/18/2014 Ben Wojtowicz Added set/get routines for uint32 values.
03/26/2014 Ben Wojtowicz Using the latest LTE library.
08/03/2014 Ben Wojtowicz Added support for limiting PCAP output.
*******************************************************************************/
......@@ -85,6 +86,10 @@ typedef struct{
bool sib6_present;
bool sib7_present;
bool sib8_present;
bool mib_pcap_sent;
bool sib1_pcap_sent;
bool sib_pcap_sent[4];
bool continuous_sib_pcap;
}LTE_FDD_ENB_SYS_INFO_STRUCT;
/*******************************************************************************
......
......@@ -25,6 +25,7 @@
Revision History
---------- ------------- --------------------------------------------
06/15/2014 Ben Wojtowicz Created file
08/03/2014 Ben Wojtowicz Added authentication vector support.
*******************************************************************************/
......@@ -43,6 +44,9 @@
DEFINES
*******************************************************************************/
#define LTE_FDD_ENB_IND_HE_N_BITS 5
#define LTE_FDD_ENB_IND_HE_MAX_VALUE 31
#define LTE_FDD_ENB_SEQ_HE_MAX_VALUE 0x7FFFFFFFFFFFUL
/*******************************************************************************
FORWARD DECLARATIONS
......@@ -53,6 +57,34 @@
TYPEDEFS
*******************************************************************************/
typedef struct{
uint8 k[16];
uint8 amf[2];
}LTE_FDD_ENB_STORED_DATA_STRUCT;
typedef struct{
uint8 rand[16];
uint8 res[8];
uint8 ck[16];
uint8 ik[16];
uint8 autn[16];
}LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT;
typedef struct{
LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT auth_vec;
uint64 sqn_he;
uint64 seq_he;
uint8 ak[6];
uint8 mac[8];
uint8 k_asme[32];
uint8 ind_he;
}LTE_FDD_ENB_GENERATED_DATA_STRUCT;
typedef struct{
LTE_FDD_ENB_USER_ID_STRUCT id;
LTE_FDD_ENB_STORED_DATA_STRUCT stored_data;
LTE_FDD_ENB_GENERATED_DATA_STRUCT generated_data;
}LTE_FDD_ENB_HSS_USER_STRUCT;
/*******************************************************************************
CLASS DECLARATIONS
......@@ -66,10 +98,15 @@ public:
static void cleanup(void);
// External interface
LTE_FDD_ENB_ERROR_ENUM add_user(std::string imsi);
LTE_FDD_ENB_ERROR_ENUM find_user(std::string imsi, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM add_user(std::string imsi, std::string imei, std::string k, std::string amf);
LTE_FDD_ENB_ERROR_ENUM del_user(std::string imsi);
std::string print_all_users(void);
bool is_imsi_allowed(uint64 imsi);
bool is_imei_allowed(uint64 imei);
LTE_FDD_ENB_USER_ID_STRUCT* get_user_id_from_imsi(uint64 imsi);
LTE_FDD_ENB_USER_ID_STRUCT* get_user_id_from_imei(uint64 imei);
void generate_security_data(LTE_FDD_ENB_USER_ID_STRUCT *id, uint16 mcc, uint16 mnc);
LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* get_auth_vec(LTE_FDD_ENB_USER_ID_STRUCT *id);
private:
// Singleton
......@@ -78,8 +115,8 @@ private:
~LTE_fdd_enb_hss();
// Allowed users
boost::mutex user_mutex;
std::list<LTE_fdd_enb_user *> user_list;
boost::mutex user_mutex;
std::list<LTE_FDD_ENB_HSS_USER_STRUCT *> user_list;
};
#endif /* __LTE_FDD_ENB_HSS_H__ */
......@@ -34,6 +34,7 @@
messages, and using the latest LTE library.
07/22/2014 Ben Wojtowicz Added clock source as a configurable
parameter.
08/03/2014 Ben Wojtowicz Added HSS support.
*******************************************************************************/
......@@ -87,6 +88,7 @@ typedef enum{
LTE_FDD_ENB_ERROR_RB_ALREADY_SETUP,
LTE_FDD_ENB_ERROR_TIMER_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_REASSEMBLE_SDU,
LTE_FDD_ENB_ERROR_DUPLICATE_ENTRY,
LTE_FDD_ENB_ERROR_N_ITEMS,
}LTE_FDD_ENB_ERROR_ENUM;
static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"none",
......@@ -109,7 +111,8 @@ static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"non
"RB not setup",
"RB already setup",
"timer not found",
"cant reassemble SDU"};
"cant reassemble SDU",
"duplicate entry"};
typedef enum{
LTE_FDD_ENB_DEBUG_TYPE_ERROR = 0,
......@@ -324,6 +327,9 @@ private:
void handle_start(void);
void handle_stop(void);
void handle_help(void);
void handle_add_user(std::string msg);
void handle_del_user(std::string msg);
void handle_print_users(void);
// Variables
std::map<std::string, LTE_FDD_ENB_VAR_STRUCT> var_map;
......@@ -338,6 +344,7 @@ private:
LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, int64 value);
LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, std::string value);
LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, uint32 value);
bool is_string_valid_as_number(std::string str, uint32 length, uint8 max_value);
};
#endif /* __LTE_FDD_ENB_INTERFACE_H__ */
......@@ -27,6 +27,8 @@
11/09/2013 Ben Wojtowicz Created file
01/18/2014 Ben Wojtowicz Added an explicit include for boost mutexes.
06/15/2014 Ben Wojtowicz Added RRC NAS message handler.
08/03/2014 Ben Wojtowicz Added message parsers, state machines, and
message senders.
*******************************************************************************/
......@@ -93,6 +95,19 @@ private:
// RRC Message Handlers
void handle_nas_msg(LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT *nas_msg);
// Message Parsers
void parse_attach_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_authentication_failure(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_identity_response(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// State Machines
void attach_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Senders
void send_attach_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, uint8 rej_cause);
void send_authentication_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_identity_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, uint8 id_type);
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
......
......@@ -30,6 +30,7 @@
05/04/2014 Ben Wojtowicz Added messages for MAC, RLC, PDCP, and RRC
communication.
06/15/2014 Ben Wojtowicz Added MME<->RRC messages.
08/03/2014 Ben Wojtowicz Added RRC command messages.
*******************************************************************************/
......@@ -95,6 +96,7 @@ typedef enum{
// MME -> RRC Messages
LTE_FDD_ENB_MESSAGE_TYPE_RRC_NAS_MSG_READY,
LTE_FDD_ENB_MESSAGE_TYPE_RRC_CMD_READY,
// RRC -> MME Messages
LTE_FDD_ENB_MESSAGE_TYPE_MME_NAS_MSG_READY,
......@@ -115,6 +117,7 @@ static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS
"PDCP sdu ready",
"RRC pdu ready",
"RRC NAS message ready",
"RRC command ready",
"MME NAS message ready"};
typedef enum{
......@@ -214,6 +217,16 @@ typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT;
typedef enum{
LTE_FDD_ENB_RRC_CMD_RELEASE = 0,
LTE_FDD_ENB_RRC_CMD_N_ITEMS,
}LTE_FDD_ENB_RRC_CMD_ENUM;
static const char LTE_fdd_enb_rrc_cmd_text[LTE_FDD_ENB_RRC_CMD_N_ITEMS][20] = {"Release"};
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
LTE_FDD_ENB_RRC_CMD_ENUM cmd;
}LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT;
// RRC -> MME Messages
typedef struct{
......@@ -254,6 +267,7 @@ typedef union{
// MME -> RRC Messages
LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT rrc_nas_msg_ready;
LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT rrc_cmd_ready;
// RRC -> MME Messages
LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT mme_nas_msg_ready;
......
......@@ -27,6 +27,9 @@
05/04/2014 Ben Wojtowicz Created file
06/15/2014 Ben Wojtowicz Added more states and procedures, QoS, MME,
RLC, and uplink scheduling functionality.
08/03/2014 Ben Wojtowicz Added MME procedures/states, RRC NAS support,
RRC transaction id, PDCP sequence numbers,
and RLC transmit variables.
*******************************************************************************/
......@@ -67,6 +70,26 @@ static const char LTE_fdd_enb_rb_text[LTE_FDD_ENB_RB_N_ITEMS][20] = {"SRB0",
"SRB1",
"SRB2"};
typedef enum{
LTE_FDD_ENB_MME_PROC_IDLE = 0,
LTE_FDD_ENB_MME_PROC_ATTACH,
LTE_FDD_ENB_MME_PROC_N_ITEMS,
}LTE_FDD_ENB_MME_PROC_ENUM;
static const char LTE_fdd_enb_mme_proc_text[LTE_FDD_ENB_MME_PROC_N_ITEMS][100] = {"IDLE",
"ATTACH"};
typedef enum{
LTE_FDD_ENB_MME_STATE_IDLE = 0,
LTE_FDD_ENB_MME_STATE_ID_REQUEST_IMSI,
LTE_FDD_ENB_MME_STATE_REJECT,
LTE_FDD_ENB_MME_STATE_AUTHENTICATE,
LTE_FDD_ENB_MME_STATE_N_ITEMS,
}LTE_FDD_ENB_MME_STATE_ENUM;
static const char LTE_fdd_enb_mme_state_text[LTE_FDD_ENB_MME_STATE_N_ITEMS][100] = {"IDLE",
"ID REQUEST IMSI",
"REJECT",
"AUTHENTICATE"};
typedef enum{
LTE_FDD_ENB_RRC_PROC_IDLE = 0,
LTE_FDD_ENB_RRC_PROC_RRC_CON_REQ,
......@@ -142,18 +165,28 @@ public:
void queue_mme_nas_msg(LIBLTE_BYTE_MSG_STRUCT *nas_msg);
LTE_FDD_ENB_ERROR_ENUM get_next_mme_nas_msg(LIBLTE_BYTE_MSG_STRUCT **nas_msg);
LTE_FDD_ENB_ERROR_ENUM delete_next_mme_nas_msg(void);
void set_mme_procedure(LTE_FDD_ENB_MME_PROC_ENUM procedure);
LTE_FDD_ENB_MME_PROC_ENUM get_mme_procedure(void);
void set_mme_state(LTE_FDD_ENB_MME_STATE_ENUM state);
LTE_FDD_ENB_MME_STATE_ENUM get_mme_state(void);
// RRC
LIBLTE_RRC_UL_CCCH_MSG_STRUCT ul_ccch_msg;
LIBLTE_RRC_UL_DCCH_MSG_STRUCT ul_dcch_msg;
LIBLTE_RRC_DL_CCCH_MSG_STRUCT dl_ccch_msg;
LIBLTE_RRC_DL_DCCH_MSG_STRUCT dl_dcch_msg;
void queue_rrc_pdu(LIBLTE_BIT_MSG_STRUCT *pdu);
LTE_FDD_ENB_ERROR_ENUM get_next_rrc_pdu(LIBLTE_BIT_MSG_STRUCT **pdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_rrc_pdu(void);
void queue_rrc_nas_msg(LIBLTE_BYTE_MSG_STRUCT *nas_msg);
LTE_FDD_ENB_ERROR_ENUM get_next_rrc_nas_msg(LIBLTE_BYTE_MSG_STRUCT **nas_msg);
LTE_FDD_ENB_ERROR_ENUM delete_next_rrc_nas_msg(void);
void set_rrc_procedure(LTE_FDD_ENB_RRC_PROC_ENUM procedure);
LTE_FDD_ENB_RRC_PROC_ENUM get_rrc_procedure(void);
void set_rrc_state(LTE_FDD_ENB_RRC_STATE_ENUM state);
LTE_FDD_ENB_RRC_STATE_ENUM get_rrc_state(void);
uint8 get_rrc_transaction_id(void);
void set_rrc_transaction_id(uint8 transaction_id);
// PDCP
void queue_pdcp_pdu(LIBLTE_BIT_MSG_STRUCT *pdu);
......@@ -163,6 +196,10 @@ public:
LTE_FDD_ENB_ERROR_ENUM get_next_pdcp_sdu(LIBLTE_BIT_MSG_STRUCT **sdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_pdcp_sdu(void);
LTE_FDD_ENB_PDCP_CONFIG_ENUM get_pdcp_config(void);
uint16 get_pdcp_rx_sn(void);
void set_pdcp_rx_sn(uint16 rx_sn);
uint16 get_pdcp_tx_sn(void);
void set_pdcp_tx_sn(uint16 tx_sn);
// RLC
void queue_rlc_pdu(LIBLTE_BIT_MSG_STRUCT *pdu);
......@@ -178,7 +215,18 @@ public:
uint16 get_rlc_vrh(void);
void set_rlc_vrh(uint16 vrh);
void rlc_add_to_reception_buffer(LIBLTE_RLC_AMD_PDU_STRUCT *amd_pdu);
void rlc_get_reception_buffer_status(LIBLTE_RLC_STATUS_PDU_STRUCT *status);
LTE_FDD_ENB_ERROR_ENUM rlc_reassemble(LIBLTE_BIT_MSG_STRUCT *sdu);
uint16 get_rlc_vta(void);
void set_rlc_vta(uint16 vta);
uint16 get_rlc_vtms(void);
uint16 get_rlc_vts(void);
void set_rlc_vts(uint16 vts);
void rlc_add_to_transmission_buffer(LIBLTE_RLC_AMD_PDU_STRUCT *amd_pdu);
void rlc_update_transmission_buffer(uint32 ack_sn);
void rlc_start_t_poll_retransmit(void);
void rlc_stop_t_poll_retransmit(void);
void handle_t_poll_retransmit_timer_expiry(uint32 timer_id);
// MAC
void queue_mac_sdu(LIBLTE_BIT_MSG_STRUCT *sdu);
......@@ -191,6 +239,8 @@ public:
// Generic
void set_qos(LTE_FDD_ENB_QOS_ENUM _qos);
LTE_FDD_ENB_QOS_ENUM get_qos(void);
uint32 get_qos_tti_freq(void);
uint32 get_qos_bits_per_subfn(void);
private:
// Identity
......@@ -200,12 +250,17 @@ private:
// MME
boost::mutex mme_nas_msg_queue_mutex;
std::list<LIBLTE_BYTE_MSG_STRUCT *> mme_nas_msg_queue;
LTE_FDD_ENB_MME_PROC_ENUM mme_procedure;
LTE_FDD_ENB_MME_STATE_ENUM mme_state;
// RRC
boost::mutex rrc_pdu_queue_mutex;
std::list<LIBLTE_BIT_MSG_STRUCT *> rrc_pdu_queue;
LTE_FDD_ENB_RRC_PROC_ENUM rrc_procedure;
LTE_FDD_ENB_RRC_STATE_ENUM rrc_state;
boost::mutex rrc_pdu_queue_mutex;
boost::mutex rrc_nas_msg_queue_mutex;
std::list<LIBLTE_BIT_MSG_STRUCT *> rrc_pdu_queue;
std::list<LIBLTE_BYTE_MSG_STRUCT *> rrc_nas_msg_queue;
LTE_FDD_ENB_RRC_PROC_ENUM rrc_procedure;
LTE_FDD_ENB_RRC_STATE_ENUM rrc_state;
uint8 rrc_transaction_id;
// PDCP
boost::mutex pdcp_pdu_queue_mutex;
......@@ -213,26 +268,33 @@ private:
std::list<LIBLTE_BIT_MSG_STRUCT *> pdcp_pdu_queue;
std::list<LIBLTE_BIT_MSG_STRUCT *> pdcp_sdu_queue;
LTE_FDD_ENB_PDCP_CONFIG_ENUM pdcp_config;
uint16 pdcp_rx_sn;
uint16 pdcp_tx_sn;
// RLC
boost::mutex rlc_pdu_queue_mutex;
boost::mutex rlc_sdu_queue_mutex;
std::list<LIBLTE_BIT_MSG_STRUCT *> rlc_pdu_queue;
std::list<LIBLTE_BIT_MSG_STRUCT *> rlc_sdu_queue;
std::map<uint16, LIBLTE_BIT_MSG_STRUCT *> rlc_reception_buffer;
LTE_FDD_ENB_RLC_CONFIG_ENUM rlc_config;
uint16 rlc_vrr;
uint16 rlc_vrmr;
uint16 rlc_vrh;
uint16 rlc_first_segment_sn;
uint16 rlc_last_segment_sn;
boost::mutex rlc_pdu_queue_mutex;
boost::mutex rlc_sdu_queue_mutex;
std::list<LIBLTE_BIT_MSG_STRUCT *> rlc_pdu_queue;
std::list<LIBLTE_BIT_MSG_STRUCT *> rlc_sdu_queue;
std::map<uint16, LIBLTE_BIT_MSG_STRUCT *> rlc_reception_buffer;
std::map<uint16, LIBLTE_RLC_AMD_PDU_STRUCT *> rlc_transmission_buffer;
LTE_FDD_ENB_RLC_CONFIG_ENUM rlc_config;
uint16 rlc_vrr;
uint16 rlc_vrmr;
uint16 rlc_vrh;
uint16 rlc_first_segment_sn;
uint16 rlc_last_segment_sn;
uint16 rlc_vta;
uint16 rlc_vtms;
uint16 rlc_vts;
// MAC
boost::mutex mac_sdu_queue_mutex;
std::list<LIBLTE_BIT_MSG_STRUCT *> mac_sdu_queue;
LTE_FDD_ENB_MAC_CONFIG_ENUM mac_config;
uint32 ul_sched_timer_id;
uint32 ul_sched_timer_m_seconds;
uint32 ul_sched_timer_id;
uint32 t_poll_retransmit_timer_id;
// Generic
void queue_msg(LIBLTE_BIT_MSG_STRUCT *msg, boost::mutex *mutex, std::list<LIBLTE_BIT_MSG_STRUCT *> *queue);
......
......@@ -27,6 +27,7 @@
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added communication to MAC and PDCP.
06/15/2014 Ben Wojtowicz Using the latest LTE library.
08/03/2014 Ben Wojtowicz Added transmit functionality.
*******************************************************************************/
......@@ -74,6 +75,7 @@ public:
// External interface
void update_sys_info(void);
void handle_retransmit(LIBLTE_RLC_AMD_PDU_STRUCT *amd, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
private:
// Singleton
......@@ -98,6 +100,7 @@ private:
void handle_tm_pdu(LIBLTE_BIT_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_um_pdu(LIBLTE_BIT_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_am_pdu(LIBLTE_BIT_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_status_pdu(LIBLTE_BIT_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// PDCP Message Handlers
void handle_sdu_ready(LTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT *sdu_ready);
......@@ -105,6 +108,10 @@ private:
void handle_um_sdu(LIBLTE_BIT_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_am_sdu(LIBLTE_BIT_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Constructors
void send_status_pdu(LIBLTE_RLC_STATUS_PDU_STRUCT *status_pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_amd_pdu(LIBLTE_RLC_AMD_PDU_STRUCT *amd, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
......
......@@ -29,6 +29,8 @@
machine.
06/15/2014 Ben Wojtowicz Added UL DCCH message handling and MME NAS
message handling.
08/03/2014 Ben Wojtowicz Added downlink NAS message handling and
connection release.
*******************************************************************************/
......@@ -101,6 +103,7 @@ private:
// MME Message Handlers
void handle_nas_msg(LTE_FDD_ENB_RRC_NAS_MSG_READY_MSG_STRUCT *nas_msg);
void handle_cmd(LTE_FDD_ENB_RRC_CMD_READY_MSG_STRUCT *cmd);
// State Machines
void ccch_sm(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
......@@ -111,6 +114,8 @@ private:
void parse_ul_dcch_message(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Senders
void send_dl_info_transfer(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, LIBLTE_BYTE_MSG_STRUCT *msg);
void send_rrc_con_release(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_rrc_con_setup(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Parameters
......
......@@ -26,6 +26,7 @@
---------- ------------- --------------------------------------------
05/04/2014 Ben Wojtowicz Created file
06/15/2014 Ben Wojtowicz Added millisecond resolution.
08/03/2014 Ben Wojtowicz Added an invalid timer id.
*******************************************************************************/
......@@ -44,6 +45,7 @@
DEFINES
*******************************************************************************/
#define LTE_FDD_ENB_INVALID_TIMER_ID 0xFFFFFFFF
/*******************************************************************************
FORWARD DECLARATIONS
......
......@@ -27,6 +27,7 @@
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added radio bearer support.
06/15/2014 Ben Wojtowicz Added initialize routine.
08/03/2014 Ben Wojtowicz Refactored user identities.
*******************************************************************************/
......@@ -57,6 +58,10 @@
TYPEDEFS
*******************************************************************************/
typedef struct{
uint64 imsi;
uint64 imei;
}LTE_FDD_ENB_USER_ID_STRUCT;
/*******************************************************************************
CLASS DECLARATIONS
......@@ -66,16 +71,25 @@ class LTE_fdd_enb_user
{
public:
// Constructor/Destructor
LTE_fdd_enb_user(std::string _imsi);
LTE_fdd_enb_user(uint16 _c_rnti);
~LTE_fdd_enb_user();
// Initialize
void init(void);
// Identity
std::string get_imsi(void);
void set_id(LTE_FDD_ENB_USER_ID_STRUCT *identity);
LTE_FDD_ENB_USER_ID_STRUCT* get_id(void);
bool is_id_set(void);
void set_temp_id(uint64 id);
uint64 get_temp_id(void);
std::string get_imsi_str(void);
uint64 get_imsi_num(void);
std::string get_imei_str(void);
uint64 get_imei_num(void);
void set_c_rnti(uint16 _c_rnti);
uint16 get_c_rnti(void);
bool is_c_rnti_set(void);
// Radio Bearers
void get_srb0(LTE_fdd_enb_rb **rb);
......@@ -89,16 +103,26 @@ public:
// MAC
LIBLTE_MAC_PDU_STRUCT pusch_mac_pdu;
// Generic
void set_delete_at_idle(bool dai);
bool get_delete_at_idle(void);
private:
// Identity
std::string imsi;
uint32 c_rnti;
LTE_FDD_ENB_USER_ID_STRUCT id;
uint64 temp_id;
uint32 c_rnti;
bool id_set;
bool c_rnti_set;
// Radio Bearers
LTE_fdd_enb_rb *srb0;
LTE_fdd_enb_rb *srb1;
LTE_fdd_enb_rb *srb2;
LTE_fdd_enb_rb *drb[8];
// Generic
bool delete_at_idle;
};
#endif /* __LTE_FDD_ENB_USER_H__ */
......@@ -26,6 +26,7 @@
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added C-RNTI timeout timers.
08/03/2014 Ben Wojtowicz Refactored add_user.
*******************************************************************************/
......@@ -71,7 +72,6 @@ public:
LTE_FDD_ENB_ERROR_ENUM get_free_c_rnti(uint16 *c_rnti);
void assign_c_rnti(uint16 c_rnti, LTE_fdd_enb_user *user);
LTE_FDD_ENB_ERROR_ENUM free_c_rnti(uint16 c_rnti);
LTE_FDD_ENB_ERROR_ENUM add_user(std::string imsi);
LTE_FDD_ENB_ERROR_ENUM add_user(uint16 c_rnti);
LTE_FDD_ENB_ERROR_ENUM find_user(std::string imsi, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM find_user(uint16 c_rnti, LTE_fdd_enb_user **user);
......@@ -88,13 +88,13 @@ private:
void handle_c_rnti_timer_expiry(uint32 timer_id);
// User storage
std::map<std::string, LTE_fdd_enb_user*> user_map;
std::map<uint16, LTE_fdd_enb_user*> c_rnti_map;
std::map<uint32, uint16> timer_id_map;
boost::mutex user_mutex;
boost::mutex c_rnti_mutex;
boost::mutex timer_id_mutex;
uint16 next_c_rnti;
std::map<uint64, LTE_fdd_enb_user*> user_map;
std::map<uint16, LTE_fdd_enb_user*> c_rnti_map;
std::map<uint32, uint16> timer_id_map;
boost::mutex user_mutex;
boost::mutex c_rnti_mutex;
boost::mutex timer_id_mutex;
uint16 next_c_rnti;
};
#endif /* __LTE_FDD_ENB_USER_MGR_H__ */
......@@ -32,6 +32,7 @@
03/26/2014 Ben Wojtowicz Using the latest LTE library.
05/04/2014 Ben Wojtowicz Added PCAP support.
06/15/2014 Ben Wojtowicz Omitting path from __FILE__.
08/03/2014 Ben Wojtowicz Added support for limiting PCAP output.
*******************************************************************************/
......@@ -800,6 +801,15 @@ void LTE_fdd_enb_cnfg_db::construct_sys_info(void)
sys_info.si_periodicity_T = liblte_rrc_si_periodicity_num[sys_info.sib1.sched_info[0].si_periodicity];
sys_info.si_win_len = liblte_rrc_si_window_length_num[sys_info.sib1.si_window_length];
// PCAP variables
sys_info.mib_pcap_sent = false;
sys_info.sib1_pcap_sent = false;
sys_info.sib_pcap_sent[0] = false;
sys_info.sib_pcap_sent[1] = false;
sys_info.sib_pcap_sent[2] = false;
sys_info.sib_pcap_sent[3] = false;
sys_info.continuous_sib_pcap = false;
// Update all layers
phy->update_sys_info();
mac->update_sys_info();
......
This diff is collapsed.
......@@ -35,6 +35,7 @@
using the latest LTE library.
07/22/2014 Ben Wojtowicz Added clock source as a configurable
parameter.
08/03/2014 Ben Wojtowicz Added HSS support.
*******************************************************************************/
......@@ -636,6 +637,12 @@ void LTE_fdd_enb_interface::handle_ctrl_msg(std::string msg)
interface->send_ctrl_error_msg(LTE_FDD_ENB_ERROR_NONE, "");
}else if(std::string::npos != msg.find("help")){
interface->handle_help();
}else if(std::string::npos != msg.find("add_user")){
interface->handle_add_user(msg.substr(msg.find("add_user")+sizeof("add_user"), std::string::npos));
}else if(std::string::npos != msg.find("del_user")){
interface->handle_del_user(msg.substr(msg.find("del_user")+sizeof("del_user"), std::string::npos));
}else if(std::string::npos != msg.find("print_users")){
interface->handle_print_users();
}else{
interface->send_ctrl_error_msg(LTE_FDD_ENB_ERROR_INVALID_COMMAND, "");
}
......@@ -1121,11 +1128,14 @@ void LTE_fdd_enb_interface::handle_help(void)
send_ctrl_msg("\tSet parameters using write <param> <value> format");
// Commands
send_ctrl_msg("\tCommands:");
send_ctrl_msg("\t\tstart - Constructs the system information and starts the eNB");
send_ctrl_msg("\t\tstop - Stops the eNB");
send_ctrl_msg("\t\tshutdown - Stops the eNB and exits");
send_ctrl_msg("\t\tconstruct_si - Constructs the new system information");
send_ctrl_msg("\t\thelp - Prints this screen");
send_ctrl_msg("\t\tstart - Constructs the system information and starts the eNB");
send_ctrl_msg("\t\tstop - Stops the eNB");
send_ctrl_msg("\t\tshutdown - Stops the eNB and exits");
send_ctrl_msg("\t\tconstruct_si - Constructs the new system information");
send_ctrl_msg("\t\thelp - Prints this screen");
send_ctrl_msg("\t\tadd_user imsi=<imsi> imei=<imei> k=<k> amf=<amf> - Adds a user user to the HSS (<imsi> and <imei> are 15 decimal digits, <k> is 32 hex digits, and <amf> is 4 hex digits)");
send_ctrl_msg("\t\tdel_user imsi=<imsi> - Deletes a user from the HSS");
send_ctrl_msg("\t\tprint_users - Prints all the users in the HSS");
// Radio Parameters
send_ctrl_msg("\tRadio Parameters:");
......@@ -1248,6 +1258,67 @@ void LTE_fdd_enb_interface::handle_help(void)
send_ctrl_msg(tmp_str);
}
}
void LTE_fdd_enb_interface::handle_add_user(std::string msg)
{
LTE_fdd_enb_hss *hss = LTE_fdd_enb_hss::get_instance();
std::string imsi_str;
std::string imei_str;
std::string k_str;
std::string amf_str;
bool imsi_valid = true;
bool imei_valid = true;
bool k_valid = true;
bool amf_valid = true;
// Extract IMSI and check
imsi_str = msg.substr(msg.find("imsi")+sizeof("imsi"), std::string::npos);
imsi_str = imsi_str.substr(0, imsi_str.find(" "));
imsi_valid = is_string_valid_as_number(imsi_str, 15, 0x9);
// Extract IMEI and check
imei_str = msg.substr(msg.find("imei")+sizeof("imei"), std::string::npos);
imei_str = imei_str.substr(0, imei_str.find(" "));
imei_valid = is_string_valid_as_number(imei_str, 15, 0x9);
// Extract K and check
k_str = msg.substr(msg.find("k")+sizeof("k"), std::string::npos);
k_str = k_str.substr(0, k_str.find(" "));
k_valid = is_string_valid_as_number(k_str, 32, 0xF);
// Extract AMF and check
amf_str = msg.substr(msg.find("amf")+sizeof("amf"), std::string::npos);
amf_str = amf_str.substr(0, amf_str.find(" "));
amf_valid = is_string_valid_as_number(amf_str, 2, 0xF);
if(imsi_valid && imei_valid && k_valid && amf_valid)
{