Commit 1ca500d2 authored by nikaeinn's avatar nikaeinn

* update the Openair mobility generator, add steadystatefor RWP, trace-driven...

* update the Openair mobility generator, add steadystatefor RWP, trace-driven mobility, two grid-based mobility models (restricted RWP, and connected domains)


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5576 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent a1f4f1e5
......@@ -53,6 +53,8 @@ typedef enum {
/* decomposition of node functions into jobs for a given event */
typedef enum Job_type_e { JT_OTG, JT_PDCP, JT_PHY_MAC, JT_INIT_SYNC, JT_DL, JT_UL, RN_DL, RN_UL, JT_END} Job_Type_t;
typedef enum Operation_Type_e { READ, WRITE, RESET} Operation_Type_t;
typedef struct Job_s {
enum Job_type_e type;
int exe_time; /* execution time at the worker*/
......@@ -87,9 +89,12 @@ typedef struct Packet_otg_s {
typedef struct {
Event_Type_t type;
enum Operation_Type_e optype; //op
char *key;
void *value;
frame_t frame;
int ue;
int lcid;
} Event_t;
/*typedef struct Global_Time {
......@@ -101,6 +106,8 @@ typedef struct {
double time_ms;
};*/
typedef struct Packet_otg_elt_s {
struct Packet_otg_elt_s *next;
struct Packet_otg_elt_s *previous;
......
......@@ -178,7 +178,7 @@ int logInit (void)
g_log->log_component[OMG].interval = 1;
g_log->log_component[OMG].fd = 0;
g_log->log_component[OMG].filelog = 0;
g_log->log_component[OMG].filelog_name = "";
g_log->log_component[OMG].filelog_name = "/tmp/omg.csv";
g_log->log_component[OTG].name = "OTG";
g_log->log_component[OTG].level = LOG_EMERG;
......
......@@ -50,7 +50,7 @@ OMG_OBJS += $(OMG_DIR)/job.o
OMG_OBJS += $(OMG_DIR)/static.o
OMG_OBJS += $(OMG_DIR)/rwp.o
OMG_OBJS += $(OMG_DIR)/rwalk.o
OMG_OBJS += $(OMG_DIR)/omg_hashtable.o
#OMG_OBJS += $(OMG_DIR)/omg_hashtable.o
OMG_OBJS += $(OMG_DIR)/mobility_parser.o
OMG_OBJS += $(OMG_DIR)/trace.o
OMG_OBJS += $(OMG_DIR)/sumo.o
......@@ -58,6 +58,10 @@ OMG_OBJS += $(OMG_DIR)/id_manager.o
OMG_OBJS += $(OMG_DIR)/client_traci_OMG.o
OMG_OBJS += $(OMG_DIR)/storage_traci_OMG.o
OMG_OBJS += $(OMG_DIR)/socket_traci_OMG.o
OMG_OBJS += $(OMG_DIR)/steadystaterwp.o
OMG_OBJS += $(OMG_DIR)/grid.o
OMG_OBJS += $(OMG_DIR)/trace_hashtable.o
OTG_OBJS = $(OTG_DIR)/otg_tx.o
OTG_OBJS += $(OTG_DIR)/otg.o
......
......@@ -295,6 +295,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
////// options of UE_Mobility_Type
typedef struct
{
char *selected_option;
int horizontal_grid;
int vertical_grid;
} Grid_Map;
......@@ -464,6 +465,32 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
/* @}*/
typedef struct
{
uint16_t priority[11];//pas possible d'acceder au MAX_NUM_LCID
//
uint8_t DCI_aggregation_min;
uint8_t DLSCH_dci_size_bits;
//UL transmission bandwidth in RBs
uint8_t ul_bandwidth[11];
//DL transmission bandwidth in RBs
uint8_t dl_bandwidth[11];
//UL transmission bandwidth in RBs
uint8_t min_ul_bandwidth[11];
//DL transmission bandwidth in RBs
uint8_t min_dl_bandwidth[11];
//aggregated bit rate of non-gbr bearer per UE
uint64_t ue_AggregatedMaximumBitrateDL;
//aggregated bit rate of non-gbr bearer per UE
uint64_t ue_AggregatedMaximumBitrateUL;
//CQI scheduling interval in subframes.
uint16_t cqiSchedInterval;
//Contention resolution timer used during random access
uint8_t mac_ContentionResolutionTimer;
uint16_t max_allowed_rbs[11];
uint8_t max_mcs[11];
} Mac_config;
/** @defgroup _Predefined_traffic Configuration
* @ingroup _OSD_basic
* @brief Including Application type, Source, destination, background, etc
......@@ -684,7 +711,8 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
unsigned char otg_bg_traffic_enabled;
unsigned char omg_model_rn;
unsigned char omg_model_enb;
unsigned char omg_model_ue;
unsigned char omg_model_ue;
unsigned char omg_rwp_type;
unsigned char omg_model_ue_current; // when mixed mbility is used
// control eNB/UE instance through CLI
unsigned char cli_enabled;
......@@ -733,6 +761,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
* @{*/
typedef struct
{
Mac_config mac_config[NUMBER_OF_UE_MAX];
Environment_System_Config environment_system_config; /*!< \brief Evironment configuration */
Topology_Config topology_config; /*!< \brief Topology configuration */
Application_Config application_config; /*!< \brief Applications configuration */
......
......@@ -1015,14 +1015,18 @@ void characters(void *user_data, const xmlChar *xmlch, int xmllen) { // called o
} else if (mobility_) {
if (UE_mobility_) {
if (UE_mobility_type_) {
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option = strndup(ch, len);
} else if (grid_walk_) {
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option = strndup(ch, len);
}else if (grid_walk_) {
if (grid_map_) {
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.selected_option = strndup(ch, len);
/*
if (horizontal_grid_) {
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid = atoi(ch);
} else if (vertical_grid_) {
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid = atoi(ch);
}
*/
} else if (grid_trip_type_) {
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_trip_type.selected_option = strndup(ch, len);
}
......@@ -1087,6 +1091,7 @@ void characters(void *user_data, const xmlChar *xmlch, int xmllen) { // called o
} else if (eNB_mobility_) {
if (eNB_mobility_type_) {
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option = strndup(ch, len);
} else if (eNB_initial_distribution_) {
oai_emulation.topology_config.mobility.eNB_mobility.eNB_initial_distribution.selected_option = strndup(ch, len);
} else if (eNB_initial_coordinates_) {
......
......@@ -105,12 +105,12 @@ void init(int max_sim_time) {
sendExact(storageLength(storageStart));
extractCommandStatus(receiveExact(), CMD_SUBSCRIBE_SIM_VARIABLE, description);
if (departed == NULL) {
departed = (String_list)malloc(sizeof(String_list)); // departed MUST point to HEAD
departed = (string_list*) malloc(sizeof(string_list)); // departed MUST point to HEAD
departed->string = NULL;
departed->next = NULL;
}
if (arrived == NULL) {
arrived = (String_list)malloc(sizeof(String_list)); // arrived MUST point to HEAD
arrived = (string_list*) malloc(sizeof(string_list)); // arrived MUST point to HEAD
arrived->string = NULL;
arrived->next = NULL;
}
......@@ -123,8 +123,8 @@ void init(int max_sim_time) {
void processSubscriptions() {
int noSubscriptions = readInt();
String_list tmp_departed = departed;
String_list tmp_arrived = arrived;
string_list* tmp_departed = departed;
string_list* tmp_arrived = arrived;
int s;
for (s = 0; s<noSubscriptions; ++s) {
......@@ -240,12 +240,12 @@ void commandSimulationStep(double time)
extractCommandStatus(receiveExact(), CMD_SIMSTEP2, description);
if (departed == NULL) {
departed = (String_list)malloc(sizeof(String_list)); // departed MUST point to HEAD
departed = (string_list*) malloc(sizeof(string_list)); // departed MUST point to HEAD
departed->string = NULL;
departed->next = NULL;
}
if (arrived == NULL) {
arrived = (String_list)malloc(sizeof(String_list)); // arrived MUST point to HEAD
arrived = (string_list*) malloc(sizeof(string_list)); // arrived MUST point to HEAD
arrived->string = NULL;
arrived->next = NULL;
}
......@@ -402,14 +402,14 @@ int commandGetMaxSUMONodesVariable()
void GetSpeed(NodePtr node, char * sumo_id)
void GetSpeed(node_struct* node, char * sumo_id)
{
commandGetVehicleVariable(sumo_id, VAR_SPEED);
double speed_double = readDouble();
node->mob->speed = speed_double;
}
void GetPosition(NodePtr node, char * sumo_id)
void GetPosition(node_struct* node, char * sumo_id)
{
commandGetVehicleVariable(sumo_id, VAR_POSITION);
double x_double = readDouble();
......@@ -420,6 +420,6 @@ void GetPosition(NodePtr node, char * sumo_id)
if (y_double < 0.0)
y_double = 0.0;
node->X_pos = x_double;
node->Y_pos = y_double;
node->x_pos = x_double;
node->y_pos = y_double;
}
......@@ -56,8 +56,8 @@ int targetTime;
char *description;
String_list departed; // string list of all vehicles appearing in SUMO at the current time step
String_list arrived; // string list of all vehicles leaving SUMO at the current time step
string_list* departed; // string list of all vehicles appearing in SUMO at the current time step
string_list* arrived; // string list of all vehicles leaving SUMO at the current time step
/**
* Global parameters defined in storage_traci_OMG.h
......@@ -89,10 +89,10 @@ int extractCommandStatus(storage *, unsigned char , char *);
void commandSimulationStep(double);
/**
* \fn commandClose();
* \fn commandClose(void);
* \brief Send termination command to SUMO
*/
void commandClose();
void commandClose(void);
/**
* \fn commandGetVehicleVariable(char *vehID, int varID)
......@@ -103,10 +103,10 @@ void commandGetVehicleVariable(char *vehID, int varID);
/**
* \fn get_num_sumo_nodes()
* \fn get_num_sumo_nodes(void)
* \brief Return the total number of nodes to be simulated in SUMO
*/
int commandGetMaxSUMONodesVariable();
int commandGetMaxSUMONodesVariable(void);
/**
* \fn init(int max_sim_time)
......@@ -126,7 +126,7 @@ void processSubscriptions(void);
* \param NodePtr node the pointer to the OAISim node
* \param char *sumo_id the SUMO ID of the target node
*/
void GetSpeed(NodePtr node, char * sumo_id);
void GetSpeed(node_struct* node, char * sumo_id);
/**
* \fn void Position(NodePtr node, char * sumo_id);
......@@ -134,7 +134,7 @@ void GetSpeed(NodePtr node, char * sumo_id);
* \param NodePtr node the pointer to the OAISim node
* \param char *sumo_id the SUMO ID of the target node
*/
void GetPosition(NodePtr node, char * sumo_id);
void GetPosition(node_struct* node, char * sumo_id);
#endif
......
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2011 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.frm
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/*! \file grid.c
* \brief
* \author S. Gashaw, N. Nikaein, J. Harri
* \date 2014
* \version 0.1
* \company Eurecom
* \email:
* \note
* \warning
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include "grid.h"
#define LEFT 0
#define RIGHT 1
#define UPPER 2
#define LOWER 3
int
max_vertices_ongrid (omg_global_param omg_param)
{
return ((int) (omg_param.max_x / xloc_div + 1.0) *
(int) (omg_param.max_y / yloc_div + 1.0)) - 1;
}
int
max_connecteddomains_ongrid (omg_global_param omg_param)
{
return ((int) (omg_param.max_x / xloc_div) *
(int) (omg_param.max_y / yloc_div)) - 1;
}
double
vertice_xpos (int loc_num, omg_global_param omg_param)
{
int div, mod;
double x_pos;
div = (int) (omg_param.max_x / xloc_div + 1.0);
mod = (loc_num % div) * xloc_div;
x_pos = omg_param.min_x + (double) mod;
//LOG_D(OMG,"mod %d div %d x pos %.2f \n\n",mod,div,x_pos);
return x_pos;
}
double
vertice_ypos (int loc_num, omg_global_param omg_param)
{
//LOG_D(OMG,"y pos %.2f \n\n",omg_param.min_y + (double)yloc_div * (int)( loc_num / (int)(omg_param.max_x/xloc_div + 1.0) ));
return omg_param.min_y +
(double) yloc_div *(int) (loc_num /
(int) (omg_param.max_x / xloc_div + 1.0));
}
double
area_minx (int block_num, omg_global_param omg_param)
{
return omg_param.min_x +
xloc_div * (block_num % (int) (omg_param.max_x / xloc_div));
}
double
area_miny (int block_num, omg_global_param omg_param)
{
return omg_param.min_y +
yloc_div * (int) (block_num / (int) (omg_param.max_x / xloc_div));
}
/*for connected domain that only move to the neighbor domains */
unsigned int
next_block (int current_bn, omg_global_param omg_param)
{
double rnd = randomgen (0, 1);
unsigned int blk;
int div = (int) (omg_param.max_x / xloc_div);
/*left border blocks*/
if ((current_bn % div) == 0)
{
/*case 1 for left upper and lower corners(only 2 neighbors) */
if ((int) (current_bn / div) == 0)
{
if (rnd <= 0.5)
blk = selected_blockn (current_bn, RIGHT, div);
else
blk = selected_blockn (current_bn, UPPER, div);
}
else if ((int) (current_bn / div) ==
(int) (omg_param.max_y / yloc_div) - 1)
{
if (rnd <= 0.5)
blk = selected_blockn (current_bn, RIGHT, div);
else
blk = selected_blockn (current_bn, LOWER, div);
}
/*for 3 neighbor blocks */
else
{
if (rnd <= 0.33)
blk = selected_blockn (current_bn, RIGHT, div);
else if (rnd > 0.33 && rnd <= 0.66)
blk = selected_blockn (current_bn, UPPER, div);
else
blk = selected_blockn (current_bn, LOWER, div);
}
}
/*right boredr blocks*/
else if ((current_bn % (int) (omg_param.max_x / xloc_div)) == div - 1)
{
/*case 1 for right upper and lower corners(only 2 neighbors) */
if ((int) (current_bn / div) == 0)
{
if (rnd <= 0.5)
blk = selected_blockn (current_bn, LEFT, div);
else
blk = selected_blockn (current_bn, UPPER, div);
}
else if ((int) (current_bn / div) ==
(int) (omg_param.max_y / yloc_div) - 1)
{
if (rnd <= 0.5)
blk = selected_blockn (current_bn, LEFT, div);
else
blk = selected_blockn (current_bn, LOWER, div);
}
/*for 3 neighbor blocks */
else
{
if (rnd <= 0.33)
blk = selected_blockn (current_bn, LEFT, div);
else if (rnd > 0.33 && rnd <= 0.66)
blk = selected_blockn (current_bn, UPPER, div);
else
blk = selected_blockn (current_bn, LOWER, div);
}
}
/*for 3 neighbor uper and lower borders*/
else if ((int) (current_bn / div) == 0
|| (int) (current_bn / div) ==
(int) (omg_param.max_y / yloc_div) - 1)
{
if ((int) (current_bn / div) == 0)
{
if (rnd <= 0.33)
blk = selected_blockn (current_bn, LEFT, div);
else if (rnd > 0.33 && rnd <= 0.66)
blk = selected_blockn (current_bn, RIGHT, div);
else
blk = selected_blockn (current_bn, UPPER, div);
}
else
{
if (rnd <= 0.33)
blk = selected_blockn (current_bn, LEFT, div);
else if (rnd > 0.33 && rnd <= 0.66)
blk = selected_blockn (current_bn, RIGHT, div);
else
blk = selected_blockn (current_bn, LOWER, div);
}
}
else
{
if (rnd <= 0.25)
blk = selected_blockn (current_bn, LEFT, div);
else if (rnd > 0.25 && rnd <= 0.50)
blk = selected_blockn (current_bn, RIGHT, div);
else if (rnd > 0.50 && rnd <= 0.75)
blk = selected_blockn (current_bn, UPPER, div);
else
blk = selected_blockn (current_bn, LOWER, div);
}
return blk;
}
/*retun the block number of neighbor selected for next move */
unsigned int
selected_blockn (int block_n, int type, int div)
{
unsigned int next_blk = 0;
switch (type)
{
case LEFT:
next_blk = block_n - 1;
break;
case RIGHT:
next_blk = block_n + 1;
break;
case UPPER:
next_blk = block_n + div;
break;
case LOWER:
next_blk = block_n - div;
break;
default:
LOG_E (OMG, "wrong type input\n");
}
return next_blk;
}
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2011 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/**
* \file grid.h **/
#ifndef GRID_H_
#define GRID_H_
#include "omg.h"
int max_vertices_ongrid(omg_global_param omg_param);
int max_connecteddomains_ongrid(omg_global_param omg_param);
double vertice_xpos(int loc_num, omg_global_param omg_param);
double vertice_ypos(int loc_num, omg_global_param omg_param);
double area_minx(int block_num, omg_global_param omg_param);
double area_miny(int block_num, omg_global_param omg_param);
unsigned int next_block(int current_bn, omg_global_param omg_param);
unsigned int selected_blockn(int block_n,int type,int div);
#endif
......@@ -29,8 +29,8 @@
/*! \file job.c
* \brief handle jobs for future nodes' update
* \author M. Mahersi, J. Harri, N. Nikaein,
* \date 2011
* \author S. Gashaw, M. Mahersi, J. Harri, N. Nikaein,
* \date 2014
* \version 0.1
* \company Eurecom
* \email:
......@@ -44,127 +44,172 @@
#include "omg.h"
Job_list add_job(Pair job, Job_list Job_Vector){
Job_list entry = malloc(sizeof(Job_list));
entry->pair = job;
//LOG_D(OMG, " Job_Vector_len %d", Job_Vector_len);
entry->next = NULL;
if (Job_Vector == NULL) {
//LOG_D(OMG, "empty Job_Vector\n");
//LOG_D(OMG, "added elmt ID %d\n", entry->pair->b->ID);
return entry;
}
else {
Job_list tmp = Job_Vector;
while (tmp->next != NULL){
tmp = tmp->next;
}
tmp->next = entry;
//LOG_D(OMG, "non empty Job_Vector\n");
//LOG_D(OMG, "dded elmt ID %d\n", entry->pair->b->ID);
return Job_Vector;
job_list *
add_job (pair_struct * job, job_list * job_vector)
{
job_list *tmp;
job_list *entry = (job_list *) malloc (sizeof (struct job_list_struct));
entry->pair = job;
entry->next = NULL;
if (job_vector != NULL)
{
tmp = job_vector;
tmp->next = entry;
}
return entry;
}
//add_job2
job_list *
addjob (pair_struct * job, job_list * job_vector)
{
job_list *tmp;
job_list *entry = (job_list *) malloc (sizeof (struct job_list_struct));
entry->pair = job;
entry->next = NULL;
if (job_vector == NULL)
{
return entry;
}
else
{
tmp = job_vector;
while (tmp->next != NULL)
{
tmp = tmp->next;
}
tmp->next = entry;
}
return job_vector;
}
// display list of jobs
void display_job_list(Job_list Job_Vector){
void
display_job_list (double curr_t, job_list * job_vector)
{
job_list *tmp = job_vector;
if (tmp == NULL)
{
LOG_D (OMG, "Empty Job_list\n");
}
else
{
//LOG_D(OMG, "first_Job_time in Job_Vector %f\n", Job_Vector->pair->a);
while (tmp != NULL)
{
if ((tmp->pair != NULL) /*&& tmp->pair->b->id==0 */ )
//LOG_D(OMG, "%.2f %.2f \n",tmp->pair->b->x_pos, tmp->pair->b->y_pos);
LOG_D (OMG, "%.2f %d %d %.2f %.2f %.2f\n", curr_t, tmp->pair->b->id,tmp->pair->b->gid,
tmp->pair->b->x_pos, tmp->pair->b->y_pos,
tmp->pair->b->mob->speed);
Job_list tmp = Job_Vector;
if (tmp == NULL){LOG_D(OMG, "Empty Job_list\n");}
else{
//LOG_D(OMG, "first_Job_time in Job_Vector %f\n", Job_Vector->pair->a);
while (tmp != NULL){
if ((tmp->pair != NULL))
LOG_D(OMG, "node %d \ttime %.2f\n", tmp->pair->b->ID, tmp->pair->a);
tmp = tmp->next;
tmp = tmp->next;
}
}
}
}
//average nodes speed for each mobility type
unsigned int
nodes_avgspeed (job_list * job_vector)
{
job_list *tmp = job_vector;
unsigned int avg = 0, cnt = 0;
if (tmp == NULL)
{
LOG_D (OMG, "Empty Job_list\n");
return 0;
}
else
{
while (tmp != NULL)
{
if ((tmp->pair != NULL))
{
avg += tmp->pair->b->mob->speed;
cnt++;
}
tmp = tmp->next;
}
}
return avg / cnt;
}