Commit a1de57d1 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.18.0: Added IP packet support to LTE_fdd_enodeb. Specifically,...

Version 0.18.0: Added IP packet support to LTE_fdd_enodeb.  Specifically, added the liblte prefix to value_2_bits and bits_2_value, converted everything except PHY and RRC to byte message struct, added more MME decoding and encoding, added PDCP user plane support, added RLC UMD support, and fixed a bug in RRC connection reesablishment pack and unpack (thanks to Paul Sutton for tracking this down) in the LTE library. Added regeneration of eNodeB security data in HSS, service request, service reject, and activate dedicated EPS bearer context request support in MME, timer reset, and IP gateway support, using the latest LTE library, and refactored C-RNTI assignement and release in LTE_fdd_enodeb.
parent bc489db8
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.17.1)
set(openLTE_version 0.18.0)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -135,6 +135,17 @@ v00.17.00 Added more MME and RRC decoding and encoding and integrity protect
and user file support, PDCP security, RRC security mode command,
SRB2 setup, RRC connection reconfiguration, MME EMM attach, MME
ESM default bearer setup, and M-TMSI assignment to LTE_fdd_enodeb.
v00.18.00 Added SIB13 packing and printing for LTE_fdd_dl_file_scan and
v00.17.01 Added SIB13 packing and printing for LTE_fdd_dl_file_scan and
pulled in a patch from Andrew Murphy to add SIB13 unpacking and
printing for LTE_fdd_dl_scan.
v00.18.00 Added IP packet support to LTE_fdd_enodeb. Specifically, added the
liblte prefix to value_2_bits and bits_2_value, converted everything
except PHY and RRC to byte message struct, added more MME decoding
and encoding, added PDCP user plane support, added RLC UMD support,
and fixed a bug in RRC connection reesablishment pack and unpack
(thanks to Paul Sutton for tracking this down) in the LTE library.
Added regeneration of eNodeB security data in HSS, service request,
service reject, and activate dedicated EPS bearer context request
support in MME, timer reset, and IP gateway support, using the
latest LTE library, and refactored C-RNTI assignement and release
in LTE_fdd_enodeb.
......@@ -22,6 +22,9 @@ add_executable(LTE_fdd_enodeb
src/LTE_fdd_enb_pdcp.cc
src/LTE_fdd_enb_rrc.cc
src/LTE_fdd_enb_mme.cc
src/LTE_fdd_enb_gw.cc
)
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)
install(CODE "execute_process(COMMAND chmod +x ${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh)")
install(CODE "execute_process(COMMAND ${CMAKE_SOURCE_DIR}/enodeb_nat_script.sh)")
\ No newline at end of file
/*******************************************************************************
Copyright 2014 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_gw.h
Description: Contains all the definitions for the LTE FDD eNodeB
IP gateway.
Revision History
---------- ------------- --------------------------------------------
11/29/2014 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_GW_H__
#define __LTE_FDD_ENB_GW_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_msgq.h"
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_enb_gw
{
public:
// Singleton
static LTE_fdd_enb_gw* get_instance(void);
static void cleanup(void);
// Start/Stop
bool is_started(void);
LTE_FDD_ENB_ERROR_ENUM start(char *err_str);
void stop(void);
private:
// Singleton
static LTE_fdd_enb_gw *instance;
LTE_fdd_enb_gw();
~LTE_fdd_enb_gw();
// Start/Stop
boost::mutex start_mutex;
bool started;
// Communication
void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *pdcp_comm_msgq;
boost::interprocess::message_queue *gw_pdcp_mq;
// PDCP Message Handlers
void handle_gw_data(LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT *gw_data);
// GW Receive
static void* receive_thread(void *inputs);
pthread_t rx_thread;
// TUN device
int32 tun_fd;
};
#endif /* __LTE_FDD_ENB_GW_H__ */
......@@ -28,6 +28,8 @@
08/03/2014 Ben Wojtowicz Added authentication vector support.
09/03/2014 Ben Wojtowicz Added sequence number resynch.
11/01/2014 Ben Wojtowicz Added user file support.
11/29/2014 Ben Wojtowicz Added support for regenerating eNodeB
security data.
*******************************************************************************/
......@@ -104,6 +106,7 @@ public:
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);
void security_resynch(LTE_FDD_ENB_USER_ID_STRUCT *id, uint16 mcc, uint16 mnc, uint8 *auts);
LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* regenerate_enb_security_data(LTE_FDD_ENB_USER_ID_STRUCT *id, uint32 nas_count_ul);
LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* get_auth_vec(LTE_FDD_ENB_USER_ID_STRUCT *id);
// User File
......
......@@ -39,6 +39,7 @@
DL center frequency and UL center frequency.
11/01/2014 Ben Wojtowicz Added parameters for IP address assignment,
DNS address, config file, and user file.
11/29/2014 Ben Wojtowicz Added support for the IP gateway.
*******************************************************************************/
......@@ -140,6 +141,7 @@ typedef enum{
LTE_FDD_ENB_DEBUG_LEVEL_PDCP,
LTE_FDD_ENB_DEBUG_LEVEL_RRC,
LTE_FDD_ENB_DEBUG_LEVEL_MME,
LTE_FDD_ENB_DEBUG_LEVEL_GW,
LTE_FDD_ENB_DEBUG_LEVEL_USER,
LTE_FDD_ENB_DEBUG_LEVEL_RB,
LTE_FDD_ENB_DEBUG_LEVEL_TIMER,
......@@ -153,6 +155,7 @@ static const char LTE_fdd_enb_debug_level_text[LTE_FDD_ENB_DEBUG_LEVEL_N_ITEMS][
"pdcp",
"rrc",
"mme",
"gw",
"user",
"rb",
"timer",
......
......@@ -29,6 +29,7 @@
05/04/2014 Ben Wojtowicz Added ULSCH handling.
06/15/2014 Ben Wojtowicz Added uplink scheduling and changed fn_combo
to current_tti.
11/29/2014 Ben Wojtowicz Using the byte message struct for SDUs.
*******************************************************************************/
......@@ -128,8 +129,8 @@ private:
void handle_sdu_ready(LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT *sdu_ready);
// MAC PDU Handlers
void handle_ulsch_ccch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_BIT_MSG_STRUCT *sdu);
void handle_ulsch_dcch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_BIT_MSG_STRUCT *sdu);
void handle_ulsch_ccch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_BYTE_MSG_STRUCT *sdu);
void handle_ulsch_dcch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_BYTE_MSG_STRUCT *sdu);
void handle_ulsch_ext_power_headroom_report(LTE_fdd_enb_user *user, LIBLTE_MAC_EXT_POWER_HEADROOM_CE_STRUCT *ext_power_headroom);
void handle_ulsch_power_headroom_report(LTE_fdd_enb_user *user, LIBLTE_MAC_POWER_HEADROOM_CE_STRUCT *power_headroom);
void handle_ulsch_c_rnti(LTE_fdd_enb_user **user, LIBLTE_MAC_C_RNTI_CE_STRUCT *c_rnti);
......
......@@ -32,6 +32,9 @@
09/03/2014 Ben Wojtowicz Added authentication and security support.
11/01/2014 Ben Wojtowicz Added attach accept/complete, ESM info
transfer, and default bearer setup support.
11/29/2014 Ben Wojtowicz Added service request, service reject, and
activate dedicated EPS bearer context
request support.
*******************************************************************************/
......@@ -101,18 +104,20 @@ private:
// Message Parsers
void parse_attach_complete(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_attach_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user **user, LTE_fdd_enb_rb *rb);
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_authentication_response(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);
void parse_security_mode_complete(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_security_mode_reject(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_service_request(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_activate_default_eps_bearer_context_accept(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_esm_information_response(LIBLTE_BYTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_pdn_connectivity_request(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);
void service_req_sm(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Senders
void send_attach_accept(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
......@@ -121,6 +126,8 @@ private:
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);
void send_security_mode_command(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_service_reject(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, uint8 cause);
void send_activate_dedicated_eps_bearer_context_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_esm_information_request(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void send_rrc_command(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb, LTE_FDD_ENB_RRC_CMD_ENUM cmd);
......
......@@ -33,6 +33,7 @@
08/03/2014 Ben Wojtowicz Added RRC command messages.
11/01/2014 Ben Wojtowicz Added RRC security command, RRC SRB2 setup
command, and RRC command response messages.
11/29/2014 Ben Wojtowicz Added IP gateway communication messages.
*******************************************************************************/
......@@ -104,6 +105,12 @@ typedef enum{
LTE_FDD_ENB_MESSAGE_TYPE_MME_NAS_MSG_READY,
LTE_FDD_ENB_MESSAGE_TYPE_MME_RRC_CMD_RESP,
// GW -> PDCP Messages
LTE_FDD_ENB_MESSAGE_TYPE_PDCP_DATA_SDU_READY,
// PDCP -> GW Messages
LTE_FDD_ENB_MESSAGE_TYPE_GW_DATA_READY,
LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS,
}LTE_FDD_ENB_MESSAGE_TYPE_ENUM;
static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS][100] = {"Kill",
......@@ -122,7 +129,9 @@ static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS
"RRC NAS message ready",
"RRC command ready",
"MME NAS message ready",
"MME RRC command response"};
"MME RRC command response",
"PDCP data sdu ready",
"GW data ready"};
typedef enum{
LTE_FDD_ENB_DEST_LAYER_PHY = 0,
......@@ -131,6 +140,7 @@ typedef enum{
LTE_FDD_ENB_DEST_LAYER_PDCP,
LTE_FDD_ENB_DEST_LAYER_RRC,
LTE_FDD_ENB_DEST_LAYER_MME,
LTE_FDD_ENB_DEST_LAYER_GW,
LTE_FDD_ENB_DEST_LAYER_ANY,
LTE_FDD_ENB_DEST_LAYER_N_ITEMS,
}LTE_FDD_ENB_DEST_LAYER_ENUM;
......@@ -140,6 +150,7 @@ static const char LTE_fdd_enb_dest_layer_text[LTE_FDD_ENB_DEST_LAYER_N_ITEMS][10
"PDCP",
"RRC",
"MME",
"GW",
"ANY"};
// Generic Messages
......@@ -224,12 +235,14 @@ typedef struct{
typedef enum{
LTE_FDD_ENB_RRC_CMD_RELEASE = 0,
LTE_FDD_ENB_RRC_CMD_SECURITY,
LTE_FDD_ENB_RRC_CMD_SETUP_SRB2,
LTE_FDD_ENB_RRC_CMD_SETUP_DEF_DRB,
LTE_FDD_ENB_RRC_CMD_SETUP_DED_DRB,
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",
"Security",
"Setup SRB2"};
"Setup Default DRB",
"Setup Dedicated DRB"};
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
......@@ -252,6 +265,18 @@ typedef struct{
LTE_FDD_ENB_MME_RRC_CMD_RESP_ENUM cmd_resp;
}LTE_FDD_ENB_MME_RRC_CMD_RESP_MSG_STRUCT;
// GW -> PDCP Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_PDCP_DATA_SDU_READY_MSG_STRUCT;
// PDCP -> GW Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT;
typedef union{
// Generic Messages
......@@ -290,6 +315,12 @@ typedef union{
// RRC -> MME Messages
LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT mme_nas_msg_ready;
LTE_FDD_ENB_MME_RRC_CMD_RESP_MSG_STRUCT mme_rrc_cmd_resp;
// GW -> PDCP Messages
LTE_FDD_ENB_PDCP_DATA_SDU_READY_MSG_STRUCT pdcp_data_sdu_ready;
// PDCP -> GW Messages
LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT gw_data_ready;
}LTE_FDD_ENB_MESSAGE_UNION;
typedef struct{
......
......@@ -26,6 +26,7 @@
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added communication to RLC and RRC.
11/29/2014 Ben Wojtowicz Added communication to IP gateway.
*******************************************************************************/
......@@ -87,10 +88,13 @@ private:
// Communication
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void handle_gw_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *rlc_comm_msgq;
LTE_fdd_enb_msgq *rrc_comm_msgq;
LTE_fdd_enb_msgq *gw_comm_msgq;
boost::interprocess::message_queue *pdcp_rlc_mq;
boost::interprocess::message_queue *pdcp_rrc_mq;
boost::interprocess::message_queue *pdcp_gw_mq;
// RLC Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT *pdu_ready);
......@@ -98,6 +102,9 @@ private:
// RRC Message Handlers
void handle_sdu_ready(LTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT *sdu_ready);
// GW Message Handlers
void handle_data_sdu_ready(LTE_FDD_ENB_PDCP_DATA_SDU_READY_MSG_STRUCT *data_sdu_ready);
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
......
This diff is collapsed.
......@@ -28,6 +28,7 @@
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.
11/29/2014 Ben Wojtowicz Using the byte message structure.
*******************************************************************************/
......@@ -97,16 +98,16 @@ private:
// MAC Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT *pdu_ready);
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);
void handle_tm_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_um_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_am_pdu(LIBLTE_BYTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_status_pdu(LIBLTE_BYTE_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);
void handle_tm_sdu(LIBLTE_BIT_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
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);
void handle_tm_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_um_sdu(LIBLTE_BYTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_am_sdu(LIBLTE_BYTE_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);
......
......@@ -33,6 +33,8 @@
connection release.
11/01/2014 Ben Wojtowicz Added RRC connection reconfiguration and
security mode command messages.
11/29/2014 Ben Wojtowicz Added user and rb update to
parse_ul_ccch_message.
*******************************************************************************/
......@@ -112,7 +114,7 @@ private:
void dcch_sm(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Parsers
void parse_ul_ccch_message(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void parse_ul_ccch_message(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user **user, LTE_fdd_enb_rb **rb);
void parse_ul_dcch_message(LIBLTE_BIT_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Senders
......
......@@ -27,6 +27,7 @@
05/04/2014 Ben Wojtowicz Created file
06/15/2014 Ben Wojtowicz Added millisecond resolution and seperated
the callback calling functionality.
11/29/2014 Ben Wojtowicz Added timer reset support.
*******************************************************************************/
......@@ -84,6 +85,7 @@ public:
~LTE_fdd_enb_timer();
// External interface
void reset(void);
void increment(void);
bool expired(void);
void call_callback(void);
......
......@@ -27,6 +27,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.
11/29/2014 Ben Wojtowicz Added timer reset support.
*******************************************************************************/
......@@ -71,6 +72,7 @@ public:
// External Interface
LTE_FDD_ENB_ERROR_ENUM start_timer(uint32 m_seconds, LTE_fdd_enb_timer_cb cb, uint32 *timer_id);
LTE_FDD_ENB_ERROR_ENUM stop_timer(uint32 timer_id);
LTE_FDD_ENB_ERROR_ENUM reset_timer(uint32 timer_id);
void handle_tick(void);
private:
......
......@@ -31,6 +31,8 @@
09/03/2014 Ben Wojtowicz Added ciphering and integrity algorithm
storing.
11/01/2014 Ben Wojtowicz Added more MME support and RRC key storage.
11/29/2014 Ben Wojtowicz Added DRB setup/teardown and C-RNTI release
timer support.
*******************************************************************************/
......@@ -89,7 +91,7 @@ class LTE_fdd_enb_user
{
public:
// Constructor/Destructor
LTE_fdd_enb_user(uint16 _c_rnti);
LTE_fdd_enb_user();
~LTE_fdd_enb_user();
// Initialize
......@@ -111,6 +113,7 @@ public:
void set_c_rnti(uint16 _c_rnti);
uint16 get_c_rnti(void);
bool is_c_rnti_set(void);
void start_c_rnti_release_timer(void);
void set_ip_addr(uint32 addr);
uint32 get_ip_addr(void);
bool is_ip_addr_set(void);
......@@ -145,6 +148,10 @@ public:
LTE_FDD_ENB_ERROR_ENUM setup_srb2(LTE_fdd_enb_rb **rb);
LTE_FDD_ENB_ERROR_ENUM teardown_srb2(void);
LTE_FDD_ENB_ERROR_ENUM get_srb2(LTE_fdd_enb_rb **rb);
LTE_FDD_ENB_ERROR_ENUM setup_drb(LTE_FDD_ENB_RB_ENUM drb_id, LTE_fdd_enb_rb **rb);
LTE_FDD_ENB_ERROR_ENUM teardown_drb(LTE_FDD_ENB_RB_ENUM drb_id);
LTE_FDD_ENB_ERROR_ENUM get_drb(LTE_FDD_ENB_RB_ENUM drb_id, LTE_fdd_enb_rb **rb);
void copy_rb(LTE_fdd_enb_rb *rb);
// MME
void set_emm_cause(uint8 cause);
......@@ -179,6 +186,7 @@ private:
LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT guti;
uint64 temp_id;
uint32 c_rnti;
uint32 c_rnti_timer_id;
uint32 ip_addr;
bool id_set;
bool guti_set;
......@@ -203,7 +211,7 @@ private:
LTE_fdd_enb_rb *srb0;
LTE_fdd_enb_rb *srb1;
LTE_fdd_enb_rb *srb2;
LTE_fdd_enb_rb *drb[8];
LTE_fdd_enb_rb *drb[31];
// MME
LIBLTE_MME_PROTOCOL_CONFIG_OPTIONS_STRUCT protocol_cnfg_opts;
......@@ -219,6 +227,7 @@ private:
bool ul_ndi;
// Generic
void handle_timer_expiry(uint32 timer_id);
bool delete_at_idle;
};
......
......@@ -28,6 +28,9 @@
05/04/2014 Ben Wojtowicz Added C-RNTI timeout timers.
08/03/2014 Ben Wojtowicz Refactored add_user.
11/01/2014 Ben Wojtowicz Added M-TMSI assignment.
11/29/2014 Ben Wojtowicz Refactored C-RNTI assign/release, added
C-RNTI transfer, added more ways to add,
delete, and find users.
*******************************************************************************/
......@@ -70,16 +73,21 @@ public:
static void cleanup(void);
// External interface
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 assign_c_rnti(LTE_fdd_enb_user *user, uint16 *c_rnti);
LTE_FDD_ENB_ERROR_ENUM release_c_rnti(uint16 c_rnti);
LTE_FDD_ENB_ERROR_ENUM transfer_c_rnti(LTE_fdd_enb_user *old_user, LTE_fdd_enb_user *new_user);
LTE_FDD_ENB_ERROR_ENUM reset_c_rnti_timer(uint16 c_rnti);
uint32 get_next_m_tmsi(void);
LTE_FDD_ENB_ERROR_ENUM add_user(uint16 c_rnti);
LTE_FDD_ENB_ERROR_ENUM add_user(LTE_fdd_enb_user **user);
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);
LTE_FDD_ENB_ERROR_ENUM find_user(LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT *guti, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM find_user(LIBLTE_RRC_S_TMSI_STRUCT *s_tmsi, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM find_user(uint32 ip_addr, LTE_fdd_enb_user **user);
LTE_FDD_ENB_ERROR_ENUM del_user(LTE_fdd_enb_user *user);
LTE_FDD_ENB_ERROR_ENUM del_user(std::string imsi);
LTE_FDD_ENB_ERROR_ENUM del_user(uint16 c_rnti);
LTE_FDD_ENB_ERROR_ENUM del_user(LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT *guti);
private:
// Singleton
......@@ -91,9 +99,10 @@ private:
void handle_c_rnti_timer_expiry(uint32 timer_id);
// User storage
std::map<uint64, LTE_fdd_enb_user*> user_map;
std::list<LTE_fdd_enb_user*> user_list;
std::map<uint16, LTE_fdd_enb_user*> c_rnti_map;
std::map<uint32, uint16> timer_id_map;
std::map<uint32, uint16> timer_id_map_forward;
std::map<uint16, uint32> timer_id_map_reverse;
boost::mutex user_mutex;
boost::mutex c_rnti_mutex;
boost::mutex timer_id_mutex;
......
This diff is collapsed.
......@@ -30,6 +30,8 @@
09/03/2014 Ben Wojtowicz Added sequence number resynch and key
generation.
11/01/2014 Ben Wojtowicz Added user file support.
11/29/2014 Ben Wojtowicz Added support for regenerating eNodeB
security data.
*******************************************************************************/
......@@ -457,6 +459,45 @@ void LTE_fdd_enb_hss::security_resynch(LTE_FDD_ENB_USER_ID_STRUCT *id,
}
}
}
LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* LTE_fdd_enb_hss::regenerate_enb_security_data(LTE_FDD_ENB_USER_ID_STRUCT *id,
uint32 nas_count_ul)
{
boost::mutex::scoped_lock lock(user_mutex);
std::list<LTE_FDD_ENB_HSS_USER_STRUCT *>::iterator iter;
LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT *auth_vec = NULL;
for(iter=user_list.begin(); iter!=user_list.end(); iter++)
{
if(id->imei == (*iter)->id.imei &&
id->imsi == (*iter)->id.imsi)
{
// Generate K_enb
liblte_security_generate_k_enb((*iter)->generated_data.k_asme,
nas_count_ul,
(*iter)->generated_data.k_enb);
// Generate K_rrc_enc and K_rrc_int
liblte_security_generate_k_rrc((*iter)->generated_data.k_enb,
LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_EEA0,
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA2,
(*iter)->generated_data.auth_vec.k_rrc_enc,
(*iter)->generated_data.auth_vec.k_rrc_int);
// Generate K_up_enc and K_up_int
liblte_security_generate_k_up((*iter)->generated_data.k_enb,
LIBLTE_SECURITY_CIPHERING_ALGORITHM_ID_EEA0,
LIBLTE_SECURITY_INTEGRITY_ALGORITHM_ID_128_EIA2,
(*iter)->generated_data.k_up_enc,
(*iter)->generated_data.k_up_int);
auth_vec = &(*iter)->generated_data.auth_vec;
break;
}
}
return(auth_vec);
}
LTE_FDD_ENB_AUTHENTICATION_VECTOR_STRUCT* LTE_fdd_enb_hss::get_auth_vec(LTE_FDD_ENB_USER_ID_STRUCT *id)
{
boost::mutex::scoped_lock lock(user_mutex);
......
......@@ -40,6 +40,7 @@
DL center frequency and UL center frequency.
11/01/2014 Ben Wojtowicz Added parameters for IP address assignment,
DNS address, config file, and user file.
11/29/2014 Ben Wojtowicz Added support for the IP gateway.
*******************************************************************************/
......@@ -50,6 +51,7 @@
#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_hss.h"
#include "LTE_fdd_enb_gw.h"
#include "LTE_fdd_enb_mme.h"
#include "LTE_fdd_enb_rrc.h"
#include "LTE_fdd_enb_pdcp.h"
......@@ -918,9 +920,11 @@ void LTE_fdd_enb_interface::handle_start(void)
LTE_fdd_enb_pdcp *pdcp = LTE_fdd_enb_pdcp::get_instance();
LTE_fdd_enb_rrc *rrc = LTE_fdd_enb_rrc::get_instance();
LTE_fdd_enb_mme *mme = LTE_fdd_enb_mme::get_instance();
LTE_fdd_enb_gw *gw = LTE_fdd_enb_gw::get_instance();
LTE_fdd_enb_phy *phy = LTE_fdd_enb_phy::get_instance();
LTE_fdd_enb_radio *radio = LTE_fdd_enb_radio::get_instance();
LTE_FDD_ENB_ERROR_ENUM err;
char err_str[LTE_FDD_ENB_MAX_LINE_SIZE];
if(!started)
{
......@@ -941,6 +945,8 @@ void LTE_fdd_enb_interface::handle_start(void)
boost::interprocess::message_queue::remove("rrc_pdcp_mq");
boost::interprocess::message_queue::remove("rrc_mme_mq");
boost::interprocess::message_queue::remove("mme_rrc_mq");
boost::interprocess::message_queue::remove("pdcp_gw_mq");
boost::interprocess::message_queue::remove("gw_pdcp_mq");
boost::interprocess::message_queue phy_mac_mq(boost::interprocess::create_only,
"phy_mac_mq",
100,
......@@ -981,31 +987,45 @@ void LTE_fdd_enb_interface::handle_start(void)
"mme_rrc_mq",
100,
sizeof(LTE_FDD_ENB_MESSAGE_STRUCT *));
boost::interprocess::message_queue pdcp_gw_mq(boost::interprocess::create_only,
"pdcp_gw_mq",
100,
sizeof(LTE_FDD_ENB_MESSAGE_STRUCT *));
boost::interprocess::message_queue gw_pdcp_mq(boost::interprocess::create_only,
"gw_pdcp_mq",
100,
sizeof(LTE_FDD_ENB_MESSAGE_STRUCT *));
// Start layers
phy->start(this);
mac->start(this);
rlc->start();
pdcp->start();
rrc->start();
mme->start();
err = radio->start();
err = gw->start(err_str);
if(LTE_FDD_ENB_ERROR_NONE == err)
{
send_ctrl_error_msg(err, "");
phy->start(this);
mac->start(this);
rlc->start();
pdcp->start();
rrc->start();
mme->start();
err = radio->start();
if(LTE_FDD_ENB_ERROR_NONE == err)
{
send_ctrl_error_msg(err, "");
}else{
start_mutex.lock();
started = false;
start_mutex.unlock();
phy->stop();
mac->stop();
rlc->stop();
pdcp->stop();
rrc->stop();
mme->stop();
send_ctrl_error_msg(err, "");
}
}else{
start_mutex.lock();
started = false;
start_mutex.unlock();
phy->stop();
mac->stop();
rlc->stop();
pdcp->stop();
rrc->stop();
mme->stop();
send_ctrl_error_msg(err, "");
send_ctrl_error_msg(err, err_str);
}
}else{
send_ctrl_error_msg(LTE