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, ...@@ -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_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; 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); 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 ) if (eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].cntl.pmch_flag == 1 )
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/*! \file bypass_session_layer.h /*! \file bypass_session_layer.h
* \brief implementation of emultor tx and rx * \brief implementation of emultor tx and rx
* \author Navid Nikaein and Raymond Knopp * \author Navid Nikaein and Raymond Knopp
* \date 2011 * \date 2011 - 2014
* \version 1.0 * \version 1.0
* \company Eurecom * \company Eurecom
* \email: navid.nikaein@eurecom.fr * \email: navid.nikaein@eurecom.fr
...@@ -246,7 +246,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, ...@@ -246,7 +246,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
int bytes_read) int bytes_read)
{ {
UE_transport_info_t *UE_info; 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; int total_tbs = 0, total_header = 0, ue_info_ix =0;
DevAssert(bytes_read >= 0); DevAssert(bytes_read >= 0);
...@@ -277,7 +277,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, ...@@ -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", 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); 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); memcpy(&UE_transport_info[n_ue][CC_id], UE_info, total_header + total_tbs);
/* Go to the next UE info */ /* Go to the next UE info */
...@@ -357,8 +357,9 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot, ...@@ -357,8 +357,9 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot,
#if defined(ENABLE_PGM_TRANSPORT) #if defined(ENABLE_PGM_TRANSPORT)
if (messg->Message_type != EMU_TRANSPORT_NACK) if (messg->Message_type != EMU_TRANSPORT_NACK)
#endif #endif
DevCheck4((messg->frame == frame) && (messg->subframe == (next_slot>>1)), DevCheck4((messg->frame == frame) && (messg->subframe == (next_slot>>1)),
messg->frame, frame, messg->subframe, next_slot>>1); messg->frame, frame, messg->subframe, next_slot>>1);
#else #else
if ((messg->frame != frame) || (messg->subframe != next_slot>>1)) if ((messg->frame != frame) || (messg->subframe != next_slot>>1))
LOG_W(EMU, LOG_W(EMU,
...@@ -589,7 +590,7 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int ...@@ -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); sleep(oai_emulation.info.master_id+1);
LOG_T(EMU,"[TX_DATA] SYNC TRANSPORT\n"); LOG_T(EMU,"[TX_DATA] SYNC TRANSPORT\n");
} else if(Type==ENB_TRANSPORT) { } else if(Type==ENB_TRANSPORT) {
LOG_D(EMU,"[TX_DATA] ENB TRANSPORT\n");
messg->Message_type = EMU_TRANSPORT_INFO_ENB; messg->Message_type = EMU_TRANSPORT_INFO_ENB;
total_size=0; total_size=0;
total_tbs=0; total_tbs=0;
...@@ -598,6 +599,11 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int ...@@ -598,6 +599,11 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
n_enb++) n_enb++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
total_tbs=0; 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 + 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_ue_spec_dci +
eNB_transport_info[n_enb][CC_id].num_common_dci); eNB_transport_info[n_enb][CC_id].num_common_dci);
...@@ -624,7 +630,8 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int ...@@ -624,7 +630,8 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
for (n_ue = oai_emulation.info.first_ue_local; 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 < (oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local);
n_ue++) { n_ue++) {
for (n_enb=0; n_enb<UE_transport_info[n_ue][CC_id].num_eNB; n_enb++) { 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]; total_tbs+=UE_transport_info[n_ue][CC_id].tbs[n_enb];
} }
if (total_tbs <= MAX_TRANSPORT_BLOCKS_BUFFER_SIZE) { if (total_tbs <= MAX_TRANSPORT_BLOCKS_BUFFER_SIZE) {
...@@ -635,10 +642,15 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int ...@@ -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", "[UE]running out of memory for the UE emulation transport buffer of size %d\n",
MAX_TRANSPORT_BLOCKS_BUFFER_SIZE); 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], memcpy(&bypass_tx_buffer[byte_tx_count], (char *)&UE_transport_info[n_ue][CC_id],
total_size); total_size);
byte_tx_count += total_size; byte_tx_count += total_size;
} }
}
} else if (Type == RELEASE_TRANSPORT) { } else if (Type == RELEASE_TRANSPORT) {
messg->Message_type = EMU_TRANSPORT_INFO_RELEASE; messg->Message_type = EMU_TRANSPORT_INFO_RELEASE;
} else { } else {
...@@ -656,8 +668,8 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int ...@@ -656,8 +668,8 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
bypass_tx_buffer, byte_tx_count); bypass_tx_buffer, byte_tx_count);
#endif #endif
LOG_D(EMU, "Sent %d bytes [%s] with master_id %d and seq %"PRIuMAX"\n", LOG_D(EMU, "Frame %d, subframe %d (%d): Sent %d bytes [%s] with master_id %d and seq %"PRIuMAX"\n",
byte_tx_count, map_int_to_str(transport_names, Type), frame, next_slot>>1, next_slot,byte_tx_count, map_int_to_str(transport_names, Type),
messg->master_id, messg->seq_num); messg->master_id, messg->seq_num);
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/*! \file phy_emulation.c /*! \file phy_emulation.c
* \brief implements the underlying protocol for emulated data exchange over Ethernet using IP multicast * \brief implements the underlying protocol for emulated data exchange over Ethernet using IP multicast
* \author Navid Nikaein * \author Navid Nikaein
* \date 2011 * \date 2011 - 2014
* \version 1.1 * \version 1.1
* \company Eurecom * \company Eurecom
* \email: navid.nikaein@eurecom.fr * \email: navid.nikaein@eurecom.fr
...@@ -148,7 +148,7 @@ void emu_transport(unsigned int frame, unsigned int last_slot, ...@@ -148,7 +148,7 @@ void emu_transport(unsigned int frame, unsigned int last_slot,
} }
// UL // UL
if (((frame_type == 1) && (direction == SF_UL)) || (frame_type == 0) ) { if (((frame_type == 1) && (direction == SF_UL)) || (frame_type == 0) ) {
emu_transport_UL(frame, last_slot, next_slot); emu_transport_UL(frame, last_slot, next_slot);
} }
} }
#if defined(ENABLE_PGM_TRANSPORT) #if defined(ENABLE_PGM_TRANSPORT)
...@@ -206,8 +206,8 @@ void emu_transport_UL(unsigned int frame, unsigned int last_slot, ...@@ -206,8 +206,8 @@ void emu_transport_UL(unsigned int frame, unsigned int last_slot,
bypass_rx_data(frame, last_slot, next_slot, 1); bypass_rx_data(frame, last_slot, next_slot, 1);
bypass_tx_data(UE_TRANSPORT, frame, next_slot); bypass_tx_data(UE_TRANSPORT, frame, next_slot);
} else { } else {
bypass_rx_data(frame,last_slot, next_slot, 0); bypass_rx_data(frame,last_slot, next_slot, 0);
bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot); bypass_tx_data(WAIT_SM_TRANSPORT, frame, next_slot);
} }
} }
...@@ -253,7 +253,9 @@ void clear_eNB_transport_info(uint8_t nb_eNB) ...@@ -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; 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) void clear_UE_transport_info(uint8_t nb_UE)
...@@ -265,7 +267,9 @@ 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; UE_transport_info_TB_index[UE_id][CC_id]=0;
memset((void *)&UE_transport_info[UE_id][CC_id].cntl,0,sizeof(UE_cntl)); 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) 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 ...@@ -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; uint8_t nb_total_dci;
int i; 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 // eNB
// PBCH : copy payload // PBCH : copy payload
...@@ -309,7 +309,10 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot ...@@ -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; 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] = 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; 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) { if (nb_total_dci >0) {
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dci_alloc[(next_slot>>1)&1], 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) ...@@ -423,9 +426,9 @@ void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot)
#ifdef DEBUG_EMU #ifdef DEBUG_EMU
LOG_D(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_transport_info[ue_id][CC_id].cntl.prach_flag,
ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag, ue_cntl_delay[ue_id][CC_id][last_slot%2].prach_flag,
UE_transport_info[ue_id][CC_id].cntl.prach_id, 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) ...@@ -276,7 +276,7 @@ int multicast_link_read_data_from_sock(uint8_t is_master)
multicast_link_build_select_list (); multicast_link_build_select_list ();
LOG_D(EMU, "Stuck on select with timeout %s\n", 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); readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
if (readsocks < 0) { if (readsocks < 0) {
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not, included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>. see <http://www.gnu.org/licenses/>.
Contact Information Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr OpenAirInterface Admin: openair_admin@eurecom.fr
...@@ -26,6 +26,15 @@ ...@@ -26,6 +26,15 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE 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 <pthread.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
......
...@@ -18,6 +18,7 @@ First, you must have all four openair SW directories, openair1, openair2, openai ...@@ -18,6 +18,7 @@ First, you must have all four openair SW directories, openair1, openair2, openai
- libblas and libblas-dev - libblas and libblas-dev
- libconfig++8-dev - libconfig++8-dev
- libgtk-3-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 - libxml2 and libxml2-dev and gccxml
- libforms-bin libforms-dev - libforms-bin libforms-dev
- nettle-dev nettle-bin openssl libssl-dev - nettle-dev nettle-bin openssl libssl-dev
......
all: oaisim nasmesh all: oaisim nasmesh
oaisim: oaisim:
(cd $(OPENAIR_TARGETS)/SIMU/USER && make oaisim NAS=1) (cd $(OPENAIR_TARGETS)/SIMU/USER && make NAS=1 -j2 )
nasmesh: nasmesh:
(cd $(OPENAIR2_DIR) && make nasmesh_netlink.ko) (cd $(OPENAIR2_DIR) && make nasmesh_netlink.ko)
(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL/ && make) (cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL/ && make)
...@@ -11,4 +11,4 @@ one_eNB_one_UE: oaisim nasmesh ...@@ -11,4 +11,4 @@ one_eNB_one_UE: oaisim nasmesh
userclean: clean oaisim nasmesh userclean: clean oaisim nasmesh
clean: 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) { ...@@ -689,7 +689,8 @@ void *l2l1_task(void *args_p) {
log_set_instance_type (LOG_INSTANCE_ENB); log_set_instance_type (LOG_INSTANCE_ENB);
#endif #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); 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++) { 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) { ...@@ -750,6 +751,7 @@ void *l2l1_task(void *args_p) {
#endif #endif
if ((next_slot % 2) == 0) if ((next_slot % 2) == 0)
// if ((slot&1) == 0)
clear_UE_transport_info (oai_emulation.info.nb_ue_local); clear_UE_transport_info (oai_emulation.info.nb_ue_local);
for (UE_inst = oai_emulation.info.first_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++) { (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