Commit 6d190e84 authored by Navid Nikaein's avatar Navid Nikaein

* fixing few issues with distributed emulation over Ethernet or other mediums



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5758 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 524d1b4c
......@@ -2314,7 +2314,8 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].num_ue_spec_dci = num_ue_spec_dci;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].num_common_dci = num_common_dci;
LOG_D(PHY,"[eNB %d][DCI][EMUL] num spec dci %d num comm dci %d num PMCH %d \n", phy_vars_eNB->Mod_id, num_ue_spec_dci,num_common_dci,
LOG_D(PHY,"[eNB %d][DCI][EMUL] CC id %d: num spec dci %d num comm dci %d num PMCH %d \n",
phy_vars_eNB->Mod_id, phy_vars_eNB->CC_id, num_ue_spec_dci,num_common_dci,
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].num_pmch);
if (eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].cntl.pmch_flag == 1 )
......
......@@ -29,7 +29,7 @@
/*! \file bypass_session_layer.h
* \brief implementation of emultor tx and rx
* \author Navid Nikaein and Raymond Knopp
* \date 2011
* \date 2011 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
......@@ -246,7 +246,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
int bytes_read)
{
UE_transport_info_t *UE_info;
int n_ue, n_enb,CC_id;
int n_ue, n_enb,CC_id=0;
int total_tbs = 0, total_header = 0, ue_info_ix =0;
DevAssert(bytes_read >= 0);
......@@ -277,7 +277,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
LOG_W(EMU,"RX [UE %d] Total size of buffer is %d (header%d,tbs %d) \n",
n_ue, total_header+total_tbs,total_header,total_tbs);
}
#warning "CC id should be adjusted, set to zero for the moment"
memcpy(&UE_transport_info[n_ue][CC_id], UE_info, total_header + total_tbs);
/* Go to the next UE info */
......@@ -359,6 +359,7 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot,
#endif
DevCheck4((messg->frame == frame) && (messg->subframe == (next_slot>>1)),
messg->frame, frame, messg->subframe, next_slot>>1);
#else
if ((messg->frame != frame) || (messg->subframe != next_slot>>1))
LOG_W(EMU,
......@@ -589,7 +590,7 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
sleep(oai_emulation.info.master_id+1);
LOG_T(EMU,"[TX_DATA] SYNC TRANSPORT\n");
} else if(Type==ENB_TRANSPORT) {
LOG_D(EMU,"[TX_DATA] ENB TRANSPORT\n");
messg->Message_type = EMU_TRANSPORT_INFO_ENB;
total_size=0;
total_tbs=0;
......@@ -598,6 +599,11 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
n_enb++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
total_tbs=0;
LOG_D(EMU,"[TX_DATA] Frame %d subframe %d CC id %d : ENB TRANSPORT: num dci %d \n",
frame, next_slot>>1, CC_id,
eNB_transport_info[n_enb][CC_id].num_pmch +
eNB_transport_info[n_enb][CC_id].num_ue_spec_dci +
eNB_transport_info[n_enb][CC_id].num_common_dci );
for (n_dci = 0; n_dci < (eNB_transport_info[n_enb][CC_id].num_pmch +
eNB_transport_info[n_enb][CC_id].num_ue_spec_dci +
eNB_transport_info[n_enb][CC_id].num_common_dci);
......@@ -624,6 +630,7 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
for (n_ue = oai_emulation.info.first_ue_local;
n_ue < (oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local);
n_ue++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
for (n_enb=0; n_enb<UE_transport_info[n_ue][CC_id].num_eNB; n_enb++) {
total_tbs+=UE_transport_info[n_ue][CC_id].tbs[n_enb];
}
......@@ -635,10 +642,15 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
"[UE]running out of memory for the UE emulation transport buffer of size %d\n",
MAX_TRANSPORT_BLOCKS_BUFFER_SIZE);
}
#ifdef DEBUG_EMU
LOG_D(EMU,"[UE %d][eNB %d][CC %d] total size %d\n",
n_ue, n_enb, CC_id,total_size);
#endif
memcpy(&bypass_tx_buffer[byte_tx_count], (char *)&UE_transport_info[n_ue][CC_id],
total_size);
byte_tx_count += total_size;
}
}
} else if (Type == RELEASE_TRANSPORT) {
messg->Message_type = EMU_TRANSPORT_INFO_RELEASE;
} else {
......@@ -656,8 +668,8 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
bypass_tx_buffer, byte_tx_count);
#endif
LOG_D(EMU, "Sent %d bytes [%s] with master_id %d and seq %"PRIuMAX"\n",
byte_tx_count, map_int_to_str(transport_names, Type),
LOG_D(EMU, "Frame %d, subframe %d (%d): Sent %d bytes [%s] with master_id %d and seq %"PRIuMAX"\n",
frame, next_slot>>1, next_slot,byte_tx_count, map_int_to_str(transport_names, Type),
messg->master_id, messg->seq_num);
}
......
......@@ -29,7 +29,7 @@
/*! \file phy_emulation.c
* \brief implements the underlying protocol for emulated data exchange over Ethernet using IP multicast
* \author Navid Nikaein
* \date 2011
* \date 2011 - 2014
* \version 1.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
......@@ -253,7 +253,9 @@ void clear_eNB_transport_info(uint8_t nb_eNB)
eNB_transport_info[eNB_id][CC_id].num_ue_spec_dci=0;
}
}
// LOG_T(EMU, "EMUL clear_eNB_transport_info\n");
#ifdef DEBUG_EMU
LOG_D(EMU, "EMUL clear_eNB_transport_info\n");
#endif
}
void clear_UE_transport_info(uint8_t nb_UE)
......@@ -265,7 +267,9 @@ void clear_UE_transport_info(uint8_t nb_UE)
UE_transport_info_TB_index[UE_id][CC_id]=0;
memset((void *)&UE_transport_info[UE_id][CC_id].cntl,0,sizeof(UE_cntl));
}
// LOG_T(EMU, "EMUL clear_UE_transport_info\n");
#ifdef DEBUG_EMU
LOG_D(EMU, "EMUL clear_UE_transport_info\n");
#endif
}
void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot)
......@@ -278,10 +282,6 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
uint8_t nb_total_dci;
int i;
#ifdef DEBUG_EMU
LOG_D(EMU, " pbch fill phy eNB %d vars for slot %d fault %d\n",
enb_id, next_slot, network_fault);
#endif
// eNB
// PBCH : copy payload
......@@ -309,7 +309,10 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
eNB_transport_info[enb_id][CC_id].num_ue_spec_dci;
PHY_vars_eNB_g[enb_id][CC_id]->num_common_dci[(next_slot>>1)&1] =
eNB_transport_info[enb_id][CC_id].num_common_dci;
#ifdef DEBUG_EMU
LOG_D(EMU, "Fill phy vars eNB %d for slot %d, DCI found %d \n",
enb_id, next_slot, nb_total_dci);
#endif
if (nb_total_dci >0) {
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dci_alloc[(next_slot>>1)&1],
......@@ -423,9 +426,9 @@ void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot)
#ifdef DEBUG_EMU
LOG_D(EMU,
"Last slot %d subframe %d Fill phy UE %d vars PRACH is (%d,%d) preamble (%d,%d) SR (%d,%d), pucch_sel (%d, %d)\n",
"Last slot %d subframe %d CC_id %d: Fill phy vars UE %d : PRACH is (%d,%d) preamble (%d,%d) SR (%d,%d), pucch_sel (%d, %d)\n",
last_slot,subframe,ue_id,
last_slot,subframe,CC_id, ue_id,
UE_transport_info[ue_id][CC_id].cntl.prach_flag,
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag,
UE_transport_info[ue_id][CC_id].cntl.prach_id,
......
......@@ -276,7 +276,7 @@ int multicast_link_read_data_from_sock(uint8_t is_master)
multicast_link_build_select_list ();
LOG_D(EMU, "Stuck on select with timeout %s\n",
timeout_p == NULL ? "infinite" : "1000 usecs");
timeout_p == NULL ? "infinite" : "15000 usecs");
readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
if (readsocks < 0) {
......
......@@ -26,6 +26,15 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file pgm_link.c
* \brief implementation a warpper for openpgm for reliable multicast transmission
* \author Navid Nikaein and S. Roux
* \date 2013 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
#include <pthread.h>
#include <stdint.h>
#include <string.h>
......
......@@ -18,6 +18,7 @@ First, you must have all four openair SW directories, openair1, openair2, openai
- libblas and libblas-dev
- libconfig++8-dev
- libgtk-3-dev
- libpgm-5.1 and libpgm-5.1-dev for distributed simulation with reliable multicast transmport
- libxml2 and libxml2-dev and gccxml
- libforms-bin libforms-dev
- nettle-dev nettle-bin openssl libssl-dev
......
all: oaisim nasmesh
oaisim:
(cd $(OPENAIR_TARGETS)/SIMU/USER && make oaisim NAS=1)
(cd $(OPENAIR_TARGETS)/SIMU/USER && make NAS=1 -j2 )
nasmesh:
(cd $(OPENAIR2_DIR) && make nasmesh_netlink.ko)
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL/ && make)
......@@ -11,4 +11,4 @@ one_eNB_one_UE: oaisim nasmesh
userclean: clean oaisim nasmesh
clean:
(cd $(OPENAIR_TARGETS)/SIMU/USER && make clean)
(cd $(OPENAIR_TARGETS)/SIMU/USER && make cleanall)
......@@ -689,7 +689,8 @@ void *l2l1_task(void *args_p) {
log_set_instance_type (LOG_INSTANCE_ENB);
#endif
if ((next_slot % 2) == 0)
// if ((next_slot % 2) == 0)
if ((slot&1) == 0)
clear_eNB_transport_info (oai_emulation.info.nb_enb_local);
for (eNB_inst = oai_emulation.info.first_enb_local; (eNB_inst < (oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local)); eNB_inst++) {
......@@ -750,6 +751,7 @@ void *l2l1_task(void *args_p) {
#endif
if ((next_slot % 2) == 0)
// if ((slot&1) == 0)
clear_UE_transport_info (oai_emulation.info.nb_ue_local);
for (UE_inst = oai_emulation.info.first_ue_local;
(UE_inst < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local)); UE_inst++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment