Commit e18fc7c3 authored by gauthier's avatar gauthier

Work better (ue connect/disconnect/reconnect...) but more work needed

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7663 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 358850d2
...@@ -518,7 +518,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "Otherwise it is UM, confi ...@@ -518,7 +518,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "Otherwise it is UM, confi
########################## ##########################
# S1AP LAYER OPTIONS # S1AP LAYER OPTIONS
########################## ##########################
add_boolean_option(S1AP_LIMIT_STREAM_ID_TO_1 True "FIXME: Despite Eurecom has implemented the spec concerning management of stream ids, there are always issues with other EPCs than EURECOM") # none
########################## ##########################
# PROJECTS (IST, FRENCH COLL., etc) # PROJECTS (IST, FRENCH COLL., etc)
......
...@@ -67,8 +67,8 @@ MME : ...@@ -67,8 +67,8 @@ MME :
SCTP : SCTP :
{ {
# Number of streams to use in input/output # Number of streams to use in input/output
SCTP_INSTREAMS = 32; SCTP_INSTREAMS = 8;
SCTP_OUTSTREAMS = 32; SCTP_OUTSTREAMS = 8;
}; };
# ------- S1AP definitions # ------- S1AP definitions
......
...@@ -34,8 +34,8 @@ MME : ...@@ -34,8 +34,8 @@ MME :
SCTP : SCTP :
{ {
# Number of streams to use in input/output # Number of streams to use in input/output
SCTP_INSTREAMS = 32; SCTP_INSTREAMS = 8;
SCTP_OUTSTREAMS = 32; SCTP_OUTSTREAMS = 8;
}; };
# ------- S1AP definitions # ------- S1AP definitions
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
################################ ################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper source $THIS_SCRIPT_PATH/build_helper
declare -i g_run_msc_gen=0
declare g_msc_dir="/tmp"
function help() function help()
...@@ -57,6 +59,7 @@ function help() ...@@ -57,6 +59,7 @@ function help()
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)" echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS." echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot." echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS." echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format." echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
...@@ -68,13 +71,40 @@ function help() ...@@ -68,13 +71,40 @@ function help()
} }
function do_msc_gen()
{
cd $g_msc_dir
last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py
sync
last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
if [ x"$last_created_file" != x"$last_created_file2" ]; then
if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
fi
fi
}
function control_c()
# run if user hits control-c
{
echo_warning "\nExiting by ctrl+c\n"
if [ $g_run_msc_gen -eq 1 ]; then
do_msc_gen
fi
exit $?
}
function main() function main()
{ {
local -i run_gdb=0 local -i run_gdb=0
local -i run_mscgen=0 local -i show_stdout=0
local exe_arguments="" local exe_arguments=""
local MSC_DIR="/tmp" local itti_dump_file=""
until [ -z "$1" ] until [ -z "$1" ]
do do
...@@ -99,7 +129,7 @@ function main() ...@@ -99,7 +129,7 @@ function main()
;; ;;
-g | --gdb) -g | --gdb)
run_gdb=1 run_gdb=1
echo "setting GDB flag to: $GDB" echo "setting GDB flag to: $run_gdb"
shift; shift;
;; ;;
-h | --help) -h | --help)
...@@ -108,23 +138,23 @@ function main() ...@@ -108,23 +138,23 @@ function main()
exit 0 exit 0
;; ;;
-K | --itti-dump-file) -K | --itti-dump-file)
ITTI_DUMP_FILE=$2 itti_dump_file=$2
# can omit file name if last arg on the line # can omit file name if last arg on the line
if [ "x$ITTI_DUMP_FILE" = "x" ]; then if [ "x$itti_dump_file" = "x" ]; then
ITTI_DUMP_FILE="/tmp/enb_s1_usrp_itti.log" itti_dump_file="/tmp/enb_s1_usrp_itti.log"
shift 1; shift 1;
else else
shift 2; shift 2;
fi fi
echo "setting ITTI dump file to: $ITTI_DUMP_FILE" echo "setting ITTI dump file to: $itti_dump_file"
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE" exe_arguments="$exe_arguments -K $itti_dump_file"
;; ;;
-m | --mscgen) -m | --mscgen)
MSC_DIR=$2 g_msc_dir=$2
# can omit file name if last arg on the line # can omit file name if last arg on the line
if [ -d "$MSC_DIR" ]; then if [ -d "$g_msc_dir" ]; then
echo "setting mscgen log files to dir: $MSC_DIR" echo "setting mscgen log files to dir: $g_msc_dir"
run_mscgen=1 g_run_msc_gen=1
shift 2; shift 2;
else else
echo_error "Mscgen log dir does not exist" echo_error "Mscgen log dir does not exist"
...@@ -141,6 +171,11 @@ function main() ...@@ -141,6 +171,11 @@ function main()
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd" exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ; shift ;
;; ;;
-s | --show-stdout)
echo "setting show stdout"
show_stdout=1
shift ;
;;
-S | --enable-missed-slot) -S | --enable-missed-slot)
echo "setting continue even if missed slot" echo "setting continue even if missed slot"
exe_arguments="$exe_arguments -S" exe_arguments="$exe_arguments -S"
...@@ -151,14 +186,14 @@ function main() ...@@ -151,14 +186,14 @@ function main()
exe_arguments="$exe_arguments -t $2" exe_arguments="$exe_arguments -t $2"
shift 2; shift 2;
;; ;;
-W | ----wireshark-l2) -W | --wireshark-l2)
echo "setting l2 pcap dump output" echo "setting l2 pcap dump output"
exe_arguments="$exe_arguments -W" exe_arguments="$exe_arguments -W"
shift ; shift ;
;; ;;
-x | --xforms) -x | --xforms)
exe_arguments="$exe_arguments -d" exe_arguments="$exe_arguments -d"
echo "setting xforms to: $XFORMS" echo "setting xforms"
shift; shift;
;; ;;
*) *)
...@@ -180,32 +215,32 @@ function main() ...@@ -180,32 +215,32 @@ function main()
if [ $run_gdb -eq 0 ]; then if [ $run_gdb -eq 0 ]; then
exec $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 `echo $exe_arguments` 2>&1 > /tmp/lte_softmodem.stdout.txt # trap keyboard interrupt (control-c)
trap control_c SIGINT
if [ $show_stdout -eq 0 ]; then
echo_warning "stdout/sderr of lte-softmodem executable redirected to /tmp/lte_softmodem.stdout.txt"
exec $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 `echo $exe_arguments` 2>&1 > /tmp/lte_softmodem.stdout.txt
else
exec $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10 `echo $exe_arguments`
fi
else else
# trap keyboard interrupt (control-c) is done by gdb
touch ~/.gdb_lte_softmodem touch ~/.gdb_lte_softmodem
chmod 777 ~/.gdb_lte_softmodem chmod 777 ~/.gdb_lte_softmodem
echo "file $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10" > ~/.gdb_lte_softmodem echo "file $OPENAIR_DIR/targets/bin/lte-softmodem.Rel10" > ~/.gdb_lte_softmodem
echo "set args $exe_arguments" >> ~/.gdb_lte_softmodem echo "set args $exe_arguments" >> ~/.gdb_lte_softmodem
echo "run" >> ~/.gdb_lte_softmodem echo "run" >> ~/.gdb_lte_softmodem
cat ~/.gdb_lte_softmodem cat ~/.gdb_lte_softmodem
gdb -n -x ~/.gdb_lte_softmodem 2>&1 if [ $show_stdout -eq 0 ]; then
#> /tmp/gdb_lte_softmodem.stdout.txt echo_warning "stdout/sderr of lte-softmodem executable redirected to /tmp/gdb_lte_softmodem.stdout.txt"
gdb -n -x ~/.gdb_lte_softmodem 2>&1 > /tmp/gdb_lte_softmodem.stdout.txt
else
gdb -n -x ~/.gdb_lte_softmodem
fi
if [ $g_run_msc_gen -eq 1 ]; then
do_msc_gen
fi
fi fi
if [ $run_mscgen -eq 1 ]; then
cd $MSC_DIR
last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
$OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN
sync
last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
if [ x"$last_created_file" != x"$last_created_file2" ]; then
if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
fi
fi
fi
} }
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
################################ ################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper source $THIS_SCRIPT_PATH/build_helper
global -i g_run_msc_gen=0 declare -i g_run_msc_gen=0
global g_msc_dir="/tmp" declare g_msc_dir="/tmp"
set_openair_env set_openair_env
...@@ -128,11 +128,9 @@ function main() ...@@ -128,11 +128,9 @@ function main()
;; ;;
-m | --mscgen) -m | --mscgen)
g_msc_dir=$2 g_msc_dir=$2
# can omit file name if last arg on the line
if [ -d "$g_msc_dir" ]; then if [ -d "$g_msc_dir" ]; then
echo "setting mscgen log files to dir: $g_msc_dir" echo "setting mscgen log files to dir: $g_msc_dir"
g_run_msc_gen=1 g_run_msc_gen=1
exe_arguments="-m $exe_arguments"
shift 2; shift 2;
else else
echo_error "Mscgen log dir does not exist" echo_error "Mscgen log dir does not exist"
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include "s6a_defs.h" #include "s6a_defs.h"
#include "oai_epc.h" #include "oai_epc.h"
#include "msc.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
...@@ -73,6 +74,7 @@ int main(int argc, char *argv[]) ...@@ -73,6 +74,7 @@ int main(int argc, char *argv[])
mme_config.itti_config.log_file)); mme_config.itti_config.log_file));
/* Parse the command line for options and set the mme_config accordingly. */ /* Parse the command line for options and set the mme_config accordingly. */
CHECK_INIT_RETURN(config_parse_opt_line(argc, argv, &mme_config) < 0); CHECK_INIT_RETURN(config_parse_opt_line(argc, argv, &mme_config) < 0);
MSC_INIT(MSC_MME_GW, THREAD_MAX+TASK_MAX);
/* Calling each layer init function */ /* Calling each layer init function */
CHECK_INIT_RETURN(log_init(&mme_config, oai_epc_log_specific)); CHECK_INIT_RETURN(log_init(&mme_config, oai_epc_log_specific));
......
...@@ -98,7 +98,9 @@ uint32_t s1ap_generate_eNB_id(void) ...@@ -98,7 +98,9 @@ uint32_t s1ap_generate_eNB_id(void)
static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
net_ip_address_t *mme_ip_address, net_ip_address_t *mme_ip_address,
net_ip_address_t *local_ip_addr) net_ip_address_t *local_ip_addr,
uint16_t in_streams,
uint16_t out_streams)
{ {
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL; sctp_new_association_req_t *sctp_new_association_req_p = NULL;
...@@ -114,6 +116,9 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, ...@@ -114,6 +116,9 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
sctp_new_association_req_p->port = S1AP_PORT_NUMBER; sctp_new_association_req_p->port = S1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID; sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = in_streams;
sctp_new_association_req_p->out_streams = out_streams;
memcpy(&sctp_new_association_req_p->remote_address, memcpy(&sctp_new_association_req_p->remote_address,
mme_ip_address, mme_ip_address,
sizeof(*mme_ip_address)); sizeof(*mme_ip_address));
...@@ -197,8 +202,11 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t * ...@@ -197,8 +202,11 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
/* Trying to connect to provided list of MME ip address */ /* Trying to connect to provided list of MME ip address */
for (index = 0; index < s1ap_register_eNB->nb_mme; index++) { for (index = 0; index < s1ap_register_eNB->nb_mme; index++) {
s1ap_eNB_register_mme(new_instance, &s1ap_register_eNB->mme_ip_address[index], s1ap_eNB_register_mme(new_instance,
&s1ap_register_eNB->enb_ip_address); &s1ap_register_eNB->mme_ip_address[index],
&s1ap_register_eNB->enb_ip_address,
s1ap_register_eNB->sctp_in_streams,
s1ap_register_eNB->sctp_out_streams);
} }
} }
......
...@@ -224,13 +224,6 @@ int s1ap_eNB_handle_nas_first_req( ...@@ -224,13 +224,6 @@ int s1ap_eNB_handle_nas_first_req(
mme_desc_p->nextstream += 1; mme_desc_p->nextstream += 1;
} }
#if defined(S1AP_LIMIT_STREAM_ID_TO_0)
mme_desc_p->nextstream = 0;
#else
# if defined(S1AP_LIMIT_STREAM_ID_TO_1)
mme_desc_p->nextstream = 1;
# endif
#endif
ue_desc_p->stream = mme_desc_p->nextstream; ue_desc_p->stream = mme_desc_p->nextstream;
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#ifndef SCTP_DEFAULT_VALUES_H_ #ifndef SCTP_DEFAULT_VALUES_H_
#define SCTP_DEFAULT_VALUES_H_ #define SCTP_DEFAULT_VALUES_H_
#define SCTP_OUT_STREAMS (64) #define SCTP_OUT_STREAMS (16)
#define SCTP_IN_STREAMS (64) #define SCTP_IN_STREAMS (16)
#define SCTP_MAX_ATTEMPTS (2) #define SCTP_MAX_ATTEMPTS (2)
#define SCTP_TIMEOUT (5) #define SCTP_TIMEOUT (5)
#define SCTP_RECV_BUFFER_SIZE (1024) #define SCTP_RECV_BUFFER_SIZE (1024)
......
...@@ -125,7 +125,7 @@ sctp_handle_new_association_req( ...@@ -125,7 +125,7 @@ sctp_handle_new_association_req(
const task_id_t requestor, const task_id_t requestor,
const sctp_new_association_req_t * const sctp_new_association_req_p) const sctp_new_association_req_t * const sctp_new_association_req_p)
{ {
int sd; int sd = 0;
int32_t assoc_id = 0; int32_t assoc_id = 0;
struct sctp_event_subscribe events; struct sctp_event_subscribe events;
...@@ -134,8 +134,10 @@ sctp_handle_new_association_req( ...@@ -134,8 +134,10 @@ sctp_handle_new_association_req(
enum sctp_connection_type_e connection_type = SCTP_TYPE_CLIENT; enum sctp_connection_type_e connection_type = SCTP_TYPE_CLIENT;
struct ifreq ifr; struct ifreq ifr;
struct ifaddrs *ifaddr, *ifa; struct ifaddrs *ifaddr = NULL;
int family, s; struct ifaddrs *ifa = NULL;
int family = 0;
int s = 0;
struct in_addr in; struct in_addr in;
struct in6_addr in6; struct in6_addr in6;
/* Prepare a new SCTP association as requested by upper layer and try to connect /* Prepare a new SCTP association as requested by upper layer and try to connect
...@@ -144,6 +146,7 @@ sctp_handle_new_association_req( ...@@ -144,6 +146,7 @@ sctp_handle_new_association_req(
DevAssert(sctp_new_association_req_p != NULL); DevAssert(sctp_new_association_req_p != NULL);
/* Create new socket with IPv6 affinity */ /* Create new socket with IPv6 affinity */
#warning "SCTP may Force IPv4 only, here"
#ifdef NO_VIRTUAL_MACHINE #ifdef NO_VIRTUAL_MACHINE
// in init chunk appears a list of host addresses, IPv4 and IPv4 in an arbitrary (unsorted) order // in init chunk appears a list of host addresses, IPv4 and IPv4 in an arbitrary (unsorted) order
...@@ -162,8 +165,10 @@ sctp_handle_new_association_req( ...@@ -162,8 +165,10 @@ sctp_handle_new_association_req(
/* Add the socket to list of fd monitored by ITTI */ /* Add the socket to list of fd monitored by ITTI */
itti_subscribe_event_fd(TASK_SCTP, sd); itti_subscribe_event_fd(TASK_SCTP, sd);
if (sctp_set_init_opt(sd, SCTP_IN_STREAMS, SCTP_OUT_STREAMS, if (sctp_set_init_opt(sd,
SCTP_MAX_ATTEMPTS, SCTP_TIMEOUT) != 0) { sctp_new_association_req_p->in_streams,
sctp_new_association_req_p->out_streams,
SCTP_MAX_ATTEMPTS, SCTP_TIMEOUT) != 0) {
SCTP_ERROR("Setsockopt IPPROTO_SCTP_INITMSG failed: %s\n", SCTP_ERROR("Setsockopt IPPROTO_SCTP_INITMSG failed: %s\n",
strerror(errno)); strerror(errno));
itti_unsubscribe_event_fd(TASK_SCTP, sd); itti_unsubscribe_event_fd(TASK_SCTP, sd);
......
...@@ -55,6 +55,8 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa ...@@ -55,6 +55,8 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
net_ip_address_t *mme_ip_address, net_ip_address_t *mme_ip_address,
net_ip_address_t *local_ip_addr); net_ip_address_t *local_ip_addr,
uint16_t in_streams,
uint16_t out_streams);
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB);
void *s1ap_eNB_task(void *arg); void *s1ap_eNB_task(void *arg);
...@@ -653,10 +653,6 @@ static void usage(void) ...@@ -653,10 +653,6 @@ static void usage(void)
fprintf(stdout, "Usage: oaisim_mme [options]\n\n"); fprintf(stdout, "Usage: oaisim_mme [options]\n\n");
fprintf(stdout, "Available options:\n"); fprintf(stdout, "Available options:\n");
fprintf(stdout, "-h Print this help and return\n"); fprintf(stdout, "-h Print this help and return\n");
fprintf(stdout, "-i<interface name>\n");
fprintf(stdout, " Set the network card to use for IPv4 forwarding\n");
fprintf(stdout, "-m\n");
fprintf(stdout, " Use mscgen dump trace tool\n");
fprintf(stdout, "-c<path>\n"); fprintf(stdout, "-c<path>\n");
fprintf(stdout, " Set the configuration file for mme\n"); fprintf(stdout, " Set the configuration file for mme\n");
fprintf(stdout, " See template in UTILS/CONF\n"); fprintf(stdout, " See template in UTILS/CONF\n");
...@@ -677,7 +673,7 @@ int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config_p) ...@@ -677,7 +673,7 @@ int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config_p)
mme_config_init(mme_config_p); mme_config_init(mme_config_p);
/* Parsing command line */ /* Parsing command line */
while ((c = getopt (argc, argv, "O:c:hi:K:mv:V")) != -1) { while ((c = getopt (argc, argv, "O:c:hi:K:v:V")) != -1) {
switch (c) { switch (c) {
case 'O': case 'O':
case 'c': { case 'c': {
...@@ -692,21 +688,6 @@ int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config_p) ...@@ -692,21 +688,6 @@ int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config_p)
} }
break; break;
case 'm': {
fprintf(stdout, "Logging Message chart(mscgen)\n");
MSC_INIT(MSC_MME_GW, THREAD_MAX+TASK_MAX);
}
break;
/*case 'i': {
int interface_len = 0;
// Copying provided interface name to use for ipv4 forwarding
interface_len = strlen(optarg);
mme_config_p->ipv4.sgw_interface_name_for_S1u_S12_S4_up = calloc(interface_len + 1, sizeof(char));
memcpy(mme_config_p->ipv4.sgw_interface_name_for_S1u_S12_S4_up, optarg, interface_len);
mme_config_p->ipv4.sgw_interface_name_for_S1u_S12_S4_up[interface_len] = '\0';
} break;*/
case 'v': { case 'v': {
mme_config_p->verbosity_level = atoi(optarg); mme_config_p->verbosity_level = atoi(optarg);
} }
......
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
******************************************************************************/ ******************************************************************************/
#define SCTP_RECV_BUFFER_SIZE (1 << 16) #define SCTP_RECV_BUFFER_SIZE (1 << 16)
#define SCTP_OUT_STREAMS (64) #define SCTP_OUT_STREAMS (32)
#define SCTP_IN_STREAMS (64) #define SCTP_IN_STREAMS (32)
#define SCTP_MAX_ATTEMPTS (5) #define SCTP_MAX_ATTEMPTS (5)
/******************************************************************************* /*******************************************************************************
......
...@@ -317,6 +317,10 @@ typedef struct s1ap_register_enb_req_s { ...@@ -317,6 +317,10 @@ typedef struct s1ap_register_enb_req_s {
uint8_t nb_mme; uint8_t nb_mme;
/* List of MME to connect to */ /* List of MME to connect to */
net_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; net_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
} s1ap_register_enb_req_t; } s1ap_register_enb_req_t;
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
......
...@@ -54,6 +54,10 @@ typedef struct sctp_new_association_req_s { ...@@ -54,6 +54,10 @@ typedef struct sctp_new_association_req_s {
/* Payload Protocol Identifier to use */ /* Payload Protocol Identifier to use */
uint32_t ppid; uint32_t ppid;
/* Number of streams used for this association */
uint16_t in_streams;
uint16_t out_streams;
/* Local address to bind to */ /* Local address to bind to */
net_ip_address_t local_address; net_ip_address_t local_address;
/* Remote address to connect to */ /* Remote address to connect to */
......
...@@ -245,6 +245,10 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con ...@@ -245,6 +245,10 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address)); sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address));
} }
s1ap_register_eNB->sctp_in_streams = enb_properties->properties[enb_id]->sctp_in_streams;
s1ap_register_eNB->sctp_out_streams = enb_properties->properties[enb_id]->sctp_out_streams;
s1ap_register_eNB->enb_ip_address.ipv6 = 0; s1ap_register_eNB->enb_ip_address.ipv6 = 0;
s1ap_register_eNB->enb_ip_address.ipv4 = 1; s1ap_register_eNB->enb_ip_address.ipv4 = 1;
addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME; addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME;
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
# include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# endif # endif
#endif #endif
#include "sctp_default_values.h"
#include "SystemInformationBlockType2.h" #include "SystemInformationBlockType2.h"
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
...@@ -158,6 +159,10 @@ ...@@ -158,6 +159,10 @@
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" #define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference"
#define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP"
#define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS"
#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS"
#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" #define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES"
#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME" #define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME"
#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME" #define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME"
...@@ -166,16 +171,16 @@ ...@@ -166,16 +171,16 @@
#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity" #define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none" #define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying" #define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info" #define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info"
// OTG config per ENB-UE DL // OTG config per ENB-UE DL
#define ENB_CONF_STRING_OTG_CONFIG "otg_config" #define ENB_CONF_STRING_OTG_CONFIG "otg_config"
#define ENB_CONF_STRING_OTG_UE_ID "ue_id" #define ENB_CONF_STRING_OTG_UE_ID "ue_id"
#define ENB_CONF_STRING_OTG_APP_TYPE "app_type" #define ENB_CONF_STRING_OTG_APP_TYPE "app_type"
#define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic" #define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic"
// per eNB configuration // per eNB configuration
#define ENB_CONFIG_STRING_LOG_CONFIG "log_config" #define ENB_CONFIG_STRING_LOG_CONFIG "log_config"
...@@ -551,6 +556,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -551,6 +556,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
libconfig_int srb1_poll_byte = 0; libconfig_int srb1_poll_byte = 0;
libconfig_int srb1_max_retx_threshold = 0; libconfig_int srb1_max_retx_threshold = 0;
libconfig_int my_int;
char* ipv4 = NULL; char* ipv4 = NULL;
char* ipv6 = NULL; char* ipv6 = NULL;
char* active = NULL; char* active = NULL;
...@@ -593,9 +600,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -593,9 +600,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
config_init(&cfg); config_init(&cfg);
if(lib_config_file_name_pP != NULL) { if (lib_config_file_name_pP != NULL) {
/* Read the file. If there is an error, report it and exit. */ /* Read the file. If there is an error, report it and exit. */
if(! config_read_file(&cfg, lib_config_file_name_pP)) { if (! config_read_file(&cfg, lib_config_file_name_pP)) {
config_destroy(&cfg); config_destroy(&cfg);
AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP); AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
} }
...@@ -606,7 +613,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -606,7 +613,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) #if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) { if ( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) {
if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0; asn_debug = 0;
asn1_xer_print = 0; asn1_xer_print = 0;
...@@ -626,7 +633,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -626,7 +633,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
// Get list of active eNBs, (only these will be configured) // Get list of active eNBs, (only these will be configured)
setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS);
if(setting != NULL) { if (setting != NULL) {
num_enbs = config_setting_length(setting); num_enbs = config_setting_length(setting);
for (i = 0; i < num_enbs; i++) {