Commit 2f889b42 authored by Navid Nikaein's avatar Navid Nikaein

add the relay node for a dual stack operation for eMBMS (experimental)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4146 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 20a4013b
...@@ -334,6 +334,9 @@ typedef struct { ...@@ -334,6 +334,9 @@ typedef struct {
#endif #endif
#endif #endif
#define NUMBER_OF_RN_MAX 3
typedef enum {no_relay=0,unicast_relay=1,multicast_relay=2} relaying_mode_t;
typedef struct typedef struct
{ {
......
...@@ -61,6 +61,7 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"}; ...@@ -61,6 +61,7 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
#ifndef OPENAIR2 #ifndef OPENAIR2
unsigned char NB_eNB_INST=0; unsigned char NB_eNB_INST=0;
unsigned char NB_UE_INST=0; unsigned char NB_UE_INST=0;
unsigned char NB_RN_INST=0;
unsigned char NB_INST=0; unsigned char NB_INST=0;
#endif #endif
......
...@@ -125,8 +125,9 @@ void cleanup_dlsch_threads(void); ...@@ -125,8 +125,9 @@ void cleanup_dlsch_threads(void);
@param next_slot Index of next_slot (0-19) @param next_slot Index of next_slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param r_mode indicates the relaying operation: 0: no_relaying, 1: unicast relaying, 2: multicast relaying
*/ */
void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag); void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_mode_t r_mode);
/*! /*!
\brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe. \brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe.
@param last_slot Index of last slot (0-19) @param last_slot Index of last slot (0-19)
...@@ -135,8 +136,9 @@ void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eN ...@@ -135,8 +136,9 @@ void phy_procedures_eNB_lte(u8 last_slot, u8 next_slot,PHY_VARS_eNB *phy_vars_eN
@param eNB_id ID of eNB on which to act @param eNB_id ID of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param mode calibration/debug mode @param mode calibration/debug mode
@param relaying_mode indicates the relaying operation: 0: no_relaying, 1: unicast relaying, 2: multicast relaying
*/ */
void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode); void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for UE TX procedures in normal subframes. \brief Scheduling for UE TX procedures in normal subframes.
...@@ -146,7 +148,7 @@ void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u ...@@ -146,7 +148,7 @@ void phy_procedures_UE_lte(u8 last_slot, u8 next_slot,PHY_VARS_UE *phy_vars_ue,u
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param mode calib/normal mode @param mode calib/normal mode
*/ */
void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode); void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for UE RX procedures in normal subframes. \brief Scheduling for UE RX procedures in normal subframes.
@param last_slot Index of last slot (0-19) @param last_slot Index of last slot (0-19)
...@@ -154,8 +156,9 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs ...@@ -154,8 +156,9 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
@param eNB_id Local id of eNB on which to act @param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param mode calibration/debug mode @param mode calibration/debug mode
@param r_mode instruct PHY to operate as normal (0), unicast relay (1), or multicast relay (2)
*/ */
int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode); int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for UE TX procedures in TDD S-subframes. \brief Scheduling for UE TX procedures in TDD S-subframes.
...@@ -164,7 +167,7 @@ int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abst ...@@ -164,7 +167,7 @@ int phy_procedures_UE_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abst
@param eNB_id Local id of eNB on which to act @param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
*/ */
void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag); void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for UE RX procedures in TDD S-subframes. \brief Scheduling for UE RX procedures in TDD S-subframes.
...@@ -173,15 +176,17 @@ void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 a ...@@ -173,15 +176,17 @@ void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 a
@param eNB_id Local id of eNB on which to act @param eNB_id Local id of eNB on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
*/ */
void phy_procedures_UE_S_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag); void phy_procedures_UE_S_RX(u8 last_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag, relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for eNB TX procedures in normal subframes. \brief Scheduling for eNB TX procedures in normal subframes.
@param next_slot Index of next slot (0-19) @param next_slot Index of next slot (0-19)
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
@param r_mode instruct PHY to operate as normal (0), unicast relay (1), or multicast relay (2),
@note: r_mode could be extended to support other values to indicate the type of relaying AF,DF,QF, and QMF
*/ */
void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag); void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for eNB RX procedures in normal subframes. \brief Scheduling for eNB RX procedures in normal subframes.
...@@ -189,7 +194,7 @@ void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstractio ...@@ -189,7 +194,7 @@ void phy_procedures_eNB_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstractio
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
*/ */
void phy_procedures_eNB_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag); void phy_procedures_eNB_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for eNB TX procedures in TDD S-subframes. \brief Scheduling for eNB TX procedures in TDD S-subframes.
...@@ -197,7 +202,7 @@ void phy_procedures_eNB_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstractio ...@@ -197,7 +202,7 @@ void phy_procedures_eNB_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstractio
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
*/ */
void phy_procedures_eNB_S_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag); void phy_procedures_eNB_S_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
/*! /*!
\brief Scheduling for eNB RX procedures in TDD S-subframes. \brief Scheduling for eNB RX procedures in TDD S-subframes.
...@@ -205,7 +210,7 @@ void phy_procedures_eNB_S_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstract ...@@ -205,7 +210,7 @@ void phy_procedures_eNB_S_TX(u8 next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstract
@param phy_vars_eNB Pointer to eNB variables on which to act @param phy_vars_eNB Pointer to eNB variables on which to act
@param abstraction_flag Indicator of PHY abstraction @param abstraction_flag Indicator of PHY abstraction
*/ */
void phy_procedures_eNB_S_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag); void phy_procedures_eNB_S_RX(u8 last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode);
/*! /*!
\brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
......
...@@ -410,7 +410,7 @@ void phy_procedures_emos_eNB_TX(unsigned char next_slot, PHY_VARS_eNB *phy_vars_ ...@@ -410,7 +410,7 @@ void phy_procedures_emos_eNB_TX(unsigned char next_slot, PHY_VARS_eNB *phy_vars_
} }
*/ */
void phy_procedures_eNB_S_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag) { void phy_procedures_eNB_S_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode) {
unsigned char sect_id=0; unsigned char sect_id=0;
...@@ -885,7 +885,7 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, u8 subframe, PHY_VARS_eNB *phy_vars_eNB) { ...@@ -885,7 +885,7 @@ void fill_dci_emos(DCI_PDU *DCI_pdu, u8 subframe, PHY_VARS_eNB *phy_vars_eNB) {
int QPSK[4]={AMP_OVER_SQRT2|(AMP_OVER_SQRT2<<16),AMP_OVER_SQRT2|((65536-AMP_OVER_SQRT2)<<16),((65536-AMP_OVER_SQRT2)<<16)|AMP_OVER_SQRT2,((65536-AMP_OVER_SQRT2)<<16)|(65536-AMP_OVER_SQRT2)}; int QPSK[4]={AMP_OVER_SQRT2|(AMP_OVER_SQRT2<<16),AMP_OVER_SQRT2|((65536-AMP_OVER_SQRT2)<<16),((65536-AMP_OVER_SQRT2)<<16)|AMP_OVER_SQRT2,((65536-AMP_OVER_SQRT2)<<16)|(65536-AMP_OVER_SQRT2)};
int QPSK2[4]={AMP_OVER_2|(AMP_OVER_2<<16),AMP_OVER_2|((65536-AMP_OVER_2)<<16),((65536-AMP_OVER_2)<<16)|AMP_OVER_2,((65536-AMP_OVER_2)<<16)|(65536-AMP_OVER_2)}; int QPSK2[4]={AMP_OVER_2|(AMP_OVER_2<<16),AMP_OVER_2|((65536-AMP_OVER_2)<<16),((65536-AMP_OVER_2)<<16)|AMP_OVER_2,((65536-AMP_OVER_2)<<16)|(65536-AMP_OVER_2)};
void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag) { void phy_procedures_eNB_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode) {
u8 *pbch_pdu=&phy_vars_eNB->pbch_pdu[0]; u8 *pbch_pdu=&phy_vars_eNB->pbch_pdu[0];
// unsigned int nb_dci_ue_spec = 0, nb_dci_common = 0; // unsigned int nb_dci_ue_spec = 0, nb_dci_common = 0;
u16 input_buffer_length, re_allocated=0; u16 input_buffer_length, re_allocated=0;
...@@ -2397,7 +2397,7 @@ void ulsch_decoding_procedures(unsigned char last_slot, unsigned int i, PHY_VARS ...@@ -2397,7 +2397,7 @@ void ulsch_decoding_procedures(unsigned char last_slot, unsigned int i, PHY_VARS
} }
void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag) { void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag,relaying_mode_t r_mode) {
//RX processing //RX processing
u32 l, ret,i,j; u32 l, ret,i,j;
u32 sect_id=0; u32 sect_id=0;
...@@ -3357,7 +3357,7 @@ void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8 ...@@ -3357,7 +3357,7 @@ void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,u8
#undef DEBUG_PHY_PROC #undef DEBUG_PHY_PROC
void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag) { void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,u8 abstraction_flag, relaying_mode_t r_mode) {
/* /*
if (phy_vars_eNB->frame >= 1000) if (phy_vars_eNB->frame >= 1000)
mac_xface->macphy_exit("Exiting after 1000 Frames\n"); mac_xface->macphy_exit("Exiting after 1000 Frames\n");
...@@ -3372,28 +3372,29 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY ...@@ -3372,28 +3372,29 @@ void phy_procedures_eNB_lte(unsigned char last_slot, unsigned char next_slot,PHY
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_TX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->frame, next_slot); LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_TX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->frame, next_slot);
#endif #endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag);
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_mode);
} }
if (((phy_vars_eNB->lte_frame_parms.frame_type == 1 )&&(subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_UL))|| if (((phy_vars_eNB->lte_frame_parms.frame_type == 1 )&&(subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_UL))||
(phy_vars_eNB->lte_frame_parms.frame_type == 0)){ (phy_vars_eNB->lte_frame_parms.frame_type == 0)){
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot); LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot);
#endif #endif
phy_procedures_eNB_RX(last_slot,phy_vars_eNB,abstraction_flag); phy_procedures_eNB_RX(last_slot,phy_vars_eNB,abstraction_flag,r_mode);
} }
if ((subframe_select(&phy_vars_eNB->lte_frame_parms,next_slot>>1)==SF_S) && if ((subframe_select(&phy_vars_eNB->lte_frame_parms,next_slot>>1)==SF_S) &&
((next_slot&1)==0)) { ((next_slot&1)==0)) {
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_S_TX(%d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame, next_slot); LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_S_TX(%d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->frame, next_slot);
#endif #endif
phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag); phy_procedures_eNB_TX(next_slot,phy_vars_eNB,abstraction_flag,r_mode);
} }
if ((subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_S) && if ((subframe_select(&phy_vars_eNB->lte_frame_parms,last_slot>>1)==SF_S) &&
((last_slot&1)==0)){ ((last_slot&1)==0)){
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot); LOG_D(PHY,"[eNB %d] Frame %d: Calling phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->frame, last_slot);
#endif #endif
phy_procedures_eNB_S_RX(last_slot,phy_vars_eNB,abstraction_flag); phy_procedures_eNB_S_RX(last_slot,phy_vars_eNB,abstraction_flag,r_mode);
} }
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,0); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,0);
......
...@@ -557,7 +557,7 @@ int dummy_tx_buffer[3840*4] __attribute__((aligned(16))); ...@@ -557,7 +557,7 @@ int dummy_tx_buffer[3840*4] __attribute__((aligned(16)));
PRACH_RESOURCES_t prach_resources_local; PRACH_RESOURCES_t prach_resources_local;
#endif #endif
void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode) { void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode) {
// int i_d; // int i_d;
u16 first_rb, nb_rb; u16 first_rb, nb_rb;
...@@ -1292,7 +1292,7 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs ...@@ -1292,7 +1292,7 @@ void phy_procedures_UE_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
} }
void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag) { void phy_procedures_UE_S_TX(u8 next_slot,PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,relaying_mode_t r_mode) {
int aa;//i,aa; int aa;//i,aa;
LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms;
...@@ -2163,7 +2163,7 @@ int lte_ue_pdcch_procedures(u8 eNB_id,u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 ...@@ -2163,7 +2163,7 @@ int lte_ue_pdcch_procedures(u8 eNB_id,u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8
} }
int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode) { int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode,relaying_mode_t r_mode) {
u16 l,m,n_symb; u16 l,m,n_symb;
// int eNB_id = 0, // int eNB_id = 0,
...@@ -3015,7 +3015,7 @@ int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs ...@@ -3015,7 +3015,7 @@ int phy_procedures_UE_RX(u8 last_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abs
return (0); return (0);
} }
void phy_procedures_UE_lte(u8 last_slot, u8 next_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode) { void phy_procedures_UE_lte(u8 last_slot, u8 next_slot, PHY_VARS_UE *phy_vars_ue,u8 eNB_id,u8 abstraction_flag,runmode_t mode, relaying_mode_t r_mode) {
#undef DEBUG_PHY_PROC #undef DEBUG_PHY_PROC
...@@ -3039,22 +3039,22 @@ void phy_procedures_UE_lte(u8 last_slot, u8 next_slot, PHY_VARS_UE *phy_vars_ue, ...@@ -3039,22 +3039,22 @@ void phy_procedures_UE_lte(u8 last_slot, u8 next_slot, PHY_VARS_UE *phy_vars_ue,
if ((subframe_select(&phy_vars_ue->lte_frame_parms,next_slot>>1)==SF_UL)|| if ((subframe_select(&phy_vars_ue->lte_frame_parms,next_slot>>1)==SF_UL)||
(phy_vars_ue->lte_frame_parms.frame_type == 0)){ (phy_vars_ue->lte_frame_parms.frame_type == 0)){
phy_procedures_UE_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag,mode); phy_procedures_UE_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag,mode,r_mode);
} }
if ((subframe_select(&phy_vars_ue->lte_frame_parms,last_slot>>1)==SF_DL) || if ((subframe_select(&phy_vars_ue->lte_frame_parms,last_slot>>1)==SF_DL) ||
(phy_vars_ue->lte_frame_parms.frame_type == 0)){ (phy_vars_ue->lte_frame_parms.frame_type == 0)){
phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode); phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode,r_mode);
#ifdef EMOS #ifdef EMOS
phy_procedures_emos_UE_RX(phy_vars_ue,last_slot,eNB_id); phy_procedures_emos_UE_RX(phy_vars_ue,last_slot,eNB_id);
#endif #endif
} }
if ((subframe_select(&phy_vars_ue->lte_frame_parms,next_slot>>1)==SF_S) && if ((subframe_select(&phy_vars_ue->lte_frame_parms,next_slot>>1)==SF_S) &&
((next_slot&1)==1)) { ((next_slot&1)==1)) {
phy_procedures_UE_S_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag); phy_procedures_UE_S_TX(next_slot,phy_vars_ue,eNB_id,abstraction_flag,r_mode);
} }
if ((subframe_select(&phy_vars_ue->lte_frame_parms,last_slot>>1)==SF_S) && if ((subframe_select(&phy_vars_ue->lte_frame_parms,last_slot>>1)==SF_S) &&
((last_slot&1)==0)) { ((last_slot&1)==0)) {
phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode); phy_procedures_UE_RX(last_slot,phy_vars_ue,eNB_id,abstraction_flag,mode, r_mode);
} }
#ifdef OPENAIR2 #ifdef OPENAIR2
......
...@@ -48,6 +48,7 @@ extern unsigned char NB_INST; ...@@ -48,6 +48,7 @@ extern unsigned char NB_INST;
#endif #endif
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST; extern unsigned char NB_UE_INST;
extern unsigned char NB_RN_INST;
extern unsigned short NODE_ID[1]; extern unsigned short NODE_ID[1];
extern void* bigphys_malloc(int); extern void* bigphys_malloc(int);
#else #else
......
...@@ -330,7 +330,7 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){ ...@@ -330,7 +330,7 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){
int mac_init_global_param(void){ int mac_init_global_param(void){
/***********************************************************************/ /***********************************************************************/
Is_rrc_registered=0;
Mac_rlc_xface = NULL; Mac_rlc_xface = NULL;
LOG_I(MAC,"[MAIN] CALLING RLC_MODULE_INIT...\n"); LOG_I(MAC,"[MAIN] CALLING RLC_MODULE_INIT...\n");
...@@ -376,7 +376,7 @@ int mac_init_global_param(void){ ...@@ -376,7 +376,7 @@ int mac_init_global_param(void){
LOG_I(MAC,"[MAIN] RLC interface setup and init\n"); LOG_I(MAC,"[MAIN] RLC interface setup and init\n");
rrc_init_global_param(); rrc_init_global_param();
Is_rrc_registered=1;
#ifdef USER_MODE #ifdef USER_MODE
pdcp_layer_init (); pdcp_layer_init ();
#else #else
...@@ -410,9 +410,9 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_activ ...@@ -410,9 +410,9 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_activ
// NB_NODE=2; // NB_NODE=2;
// NB_INST=2; // NB_INST=2;
Is_rrc_registered=0;
mac_init_global_param(); mac_init_global_param();
Is_rrc_registered=1;
mac_xface->macphy_init = mac_top_init; mac_xface->macphy_init = mac_top_init;
#ifndef USER_MODE #ifndef USER_MODE
......
...@@ -247,7 +247,7 @@ u32 ue_get_SR(u8 Mod_id,u32 frame,u8 eNB_id,u16 rnti, u8 subframe) { ...@@ -247,7 +247,7 @@ u32 ue_get_SR(u8 Mod_id,u32 frame,u8 eNB_id,u16 rnti, u8 subframe) {
(1<<(2+UE_mac_inst[Mod_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax)), (1<<(2+UE_mac_inst[Mod_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax)),
UE_mac_inst[Mod_id].scheduling_info.SR_pending); UE_mac_inst[Mod_id].scheduling_info.SR_pending);
UE_mac_inst[Mod_id].ul_active =1; //UE_mac_inst[Mod_id].ul_active =1;
return(1); //instruct phy to signal SR return(1); //instruct phy to signal SR
} }
...@@ -1398,14 +1398,12 @@ int use_cba_access(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index){ ...@@ -1398,14 +1398,12 @@ int use_cba_access(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index){
// LOG_D(MAC,"[UE %d] Frame %d Subframe %d: the current CBA backoff is %d \n", Mod_id, frame, subframe, // LOG_D(MAC,"[UE %d] Frame %d Subframe %d: the current CBA backoff is %d \n", Mod_id, frame, subframe,
// UE_mac_inst[Mod_id].cba_last_access[0] ); // UE_mac_inst[Mod_id].cba_last_access[0] );
UE_mac_inst[Mod_id].cba_last_access[0]= round(uniform_rngen(1,30)); UE_mac_inst[Mod_id].cba_last_access[0]= round(uniform_rngen(1,10));
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d UL active state %d \n", Mod_id, frame, subframe, LOG_D(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d UL active state %d \n", Mod_id, frame, subframe,
UE_mac_inst[Mod_id].cba_last_access[0], UE_mac_inst[Mod_id].ul_active); UE_mac_inst[Mod_id].cba_last_access[0], UE_mac_inst[Mod_id].ul_active);
return 1; return 1;
} else { } else if (( ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1]> 0 )) ||
if (( ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1]> 0 )) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2]> 0 )) || ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2]> 0 )) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3]> 0 )) ) ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3]> 0 )) )
// && (UE_mac_inst[Mod_id].ul_active == 0) // check if the ul is acrtive // && (UE_mac_inst[Mod_id].ul_active == 0) // check if the ul is acrtive
...@@ -1415,9 +1413,15 @@ int use_cba_access(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index){ ...@@ -1415,9 +1413,15 @@ int use_cba_access(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index){
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: CBA backoff is decreased by one to %d UL active state %d \n", LOG_D(MAC,"[UE %d] Frame %d Subframe %d: CBA backoff is decreased by one to %d UL active state %d \n",
Mod_id, frame, subframe, Mod_id, frame, subframe,
UE_mac_inst[Mod_id].cba_last_access[0], UE_mac_inst[Mod_id].ul_active); UE_mac_inst[Mod_id].cba_last_access[0], UE_mac_inst[Mod_id].ul_active);
}
} /*else if (( ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1] == 0 )) &&
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2] == 0 )) &&
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3] == 0 )) )
&& (UE_mac_inst[Mod_id].cba_last_access[0]> 0) ){
UE_mac_inst[Mod_id].cba_last_access[0]-=1;
}*/
return 0; return 0;
}
} }
#endif #endif
......
...@@ -78,6 +78,7 @@ u8 Is_rrc_registered; ...@@ -78,6 +78,7 @@ u8 Is_rrc_registered;
#ifdef OPENAIR2 #ifdef OPENAIR2
unsigned char NB_eNB_INST=0; unsigned char NB_eNB_INST=0;
unsigned char NB_UE_INST=0; unsigned char NB_UE_INST=0;
unsigned char NB_RN_INST=0;
unsigned char NB_INST=0; unsigned char NB_INST=0;
#endif #endif
......
...@@ -274,7 +274,9 @@ typedef struct{ ...@@ -274,7 +274,9 @@ typedef struct{
SystemInformationBlockType9_t *sib9[NB_CNX_UE]; SystemInformationBlockType9_t *sib9[NB_CNX_UE];
SystemInformationBlockType10_t *sib10[NB_CNX_UE]; SystemInformationBlockType10_t *sib10[NB_CNX_UE];
SystemInformationBlockType11_t *sib11[NB_CNX_UE]; SystemInformationBlockType11_t *sib11[NB_CNX_UE];
#ifdef Rel10 #ifdef Rel10
uint8_t MBMS_flag;
u8 *MCCH_MESSAGE[NB_CNX_UE]; u8 *MCCH_MESSAGE[NB_CNX_UE];
u8 sizeof_MCCH_MESSAGE[NB_CNX_UE]; u8 sizeof_MCCH_MESSAGE[NB_CNX_UE];
u8 MCCH_MESSAGEStatus[NB_CNX_UE]; u8 MCCH_MESSAGEStatus[NB_CNX_UE];
......
...@@ -1468,6 +1468,9 @@ int decode_SI(u8 Mod_id,u32 frame,u8 eNB_index,u8 si_window) { ...@@ -1468,6 +1468,9 @@ int decode_SI(u8 Mod_id,u32 frame,u8 eNB_index,u8 si_window) {
); );
UE_rrc_inst[Mod_id].Info[eNB_index].SIStatus = 1; UE_rrc_inst[Mod_id].Info[eNB_index].SIStatus = 1;
// After SI is received, prepare RRCConnectionRequest // After SI is received, prepare RRCConnectionRequest
#ifdef Rel10
if (UE_rrc_inst[Mod_id].MBMS_flag < 3) // see -Q option
#endif
rrc_ue_generate_RRCConnectionRequest(Mod_id,frame,eNB_index); rrc_ue_generate_RRCConnectionRequest(Mod_id,frame,eNB_index);
if (UE_rrc_inst[Mod_id].Info[eNB_index].State == RRC_IDLE) { if (UE_rrc_inst[Mod_id].Info[eNB_index].State == RRC_IDLE) {
......
...@@ -232,6 +232,12 @@ void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active){ ...@@ -232,6 +232,12 @@ void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active){
dummy_buffer, dummy_buffer,
0, 0,
0);*/ 0);*/
#ifdef Rel10
LOG_I(RRC,"[UE] eMBMS active state is %d \n", eMBMS_active);
for (i=0;i<NB_eNB_INST;i++) {
UE_rrc_inst[i].MBMS_flag = (uint8_t)eMBMS_active;
}
#endif
} else } else
UE_rrc_inst=NULL; UE_rrc_inst=NULL;
...@@ -240,10 +246,15 @@ void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active){ ...@@ -240,10 +246,15 @@ void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active){
eNB_rrc_inst = (eNB_RRC_INST*)malloc16(NB_eNB_INST*sizeof(eNB_RRC_INST)); eNB_rrc_inst = (eNB_RRC_INST*)malloc16(NB_eNB_INST*sizeof(eNB_RRC_INST));
memset(eNB_rrc_inst,0,NB_eNB_INST*sizeof(eNB_RRC_INST)); memset(eNB_rrc_inst,0,NB_eNB_INST*sizeof(eNB_RRC_INST));
#ifdef Rel10 #ifdef Rel10
eNB_rrc_inst->MBMS_flag = (uint8_t)eMBMS_active; LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
for (i=0;i<NB_eNB_INST;i++) {
eNB_rrc_inst[i].MBMS_flag = (uint8_t)eMBMS_active;
}
#endif #endif
#ifdef CBA #ifdef CBA
eNB_rrc_inst->num_active_cba_groups = cba_group_active; for (i=0;i<NB_eNB_INST;i++) {
eNB_rrc_inst[i].num_active_cba_groups = cba_group_active;
}
#endif #endif
LOG_D(RRC,"ALLOCATE %d Bytes for eNB_RRC_INST @ %p\n",(unsigned int)(NB_eNB_INST*sizeof(eNB_RRC_INST)),eNB_rrc_inst); LOG_D(RRC,"ALLOCATE %d Bytes for eNB_RRC_INST @ %p\n",(unsigned int)(NB_eNB_INST*sizeof(eNB_RRC_INST)),eNB_rrc_inst);
}else }else
......
...@@ -636,7 +636,10 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need ...@@ -636,7 +636,10 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
unsigned char nb_ue_remote; unsigned char nb_ue_remote;
unsigned char nb_enb_local; unsigned char nb_enb_local;
unsigned char nb_enb_remote; unsigned char nb_enb_remote;
unsigned char nb_rn_local;
unsigned char nb_rn_remote;
unsigned char first_enb_local; unsigned char first_enb_local;
unsigned char first_rn_local;
unsigned char first_ue_local; unsigned char first_ue_local;
unsigned short master_id; unsigned short master_id;
unsigned char nb_master; unsigned char nb_master;
...@@ -655,6 +658,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need ...@@ -655,6 +658,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
unsigned char otg_enabled; unsigned char otg_enabled;
unsigned char omv_enabled; unsigned char omv_enabled;
unsigned char vcd_enabled; unsigned char vcd_enabled;
unsigned char eMBMS_active_state;
unsigned char cba_group_active; unsigned char cba_group_active;
char * otg_traffic; char * otg_traffic;
unsigned char otg_bg_traffic_enabled; unsigned char otg_bg_traffic_enabled;
......
...@@ -200,7 +200,7 @@ int adjust_size(int size){ ...@@ -200,7 +200,7 @@ int adjust_size(int size){
unsigned char *packet_gen(int src, int dst, int ctime, int * pkt_size){ // when pdcp, ctime = frame cnt unsigned char *packet_gen(int src, int dst, int app, int ctime, int * pkt_size){ // when pdcp, ctime = frame cnt
//unsigned char *packet=NULL; //unsigned char *packet=NULL;
unsigned int size=0; unsigned int size=0;
...@@ -213,12 +213,16 @@ unsigned char *packet_gen(int src, int dst, int ctime, int * pkt_size){ // when ...@@ -213,12 +213,16 @@ unsigned char *packet_gen(int src, int dst, int ctime, int * pkt_size){ // when
char *header=NULL; char *header=NULL;
int header_size; int header_size;
LOG_T(OTG,"[src %d] [dst %d ]MY_CTIME %d, MAX_FRAME %d\n",src, dst, ctime, g_otg->max_nb_frames);
// check if the app is configured
if (app >= g_otg->application_idx[src][dst]){
return NULL;
}
LOG_T(OTG,"[src %d] [dst %d ][APP %d] current time %d\n",src, dst, app, ctime);
*pkt_size=0; *pkt_size=0;
init_packet_gen(src, dst,ctime); init_packet_gen(src, dst,ctime);
size=check_data_transmit(src,dst,ctime); size=check_data_transmit(src,dst,app,ctime);
/* /*
Send Packets when: Send Packets when:
...@@ -304,6 +308,7 @@ unsigned char *packet_gen_multicast(int src, int dst, int ctime, int * pkt_size) ...@@ -304,6 +308,7 @@ unsigned char *packet_gen_multicast(int src, int dst, int ctime, int * pkt_size)
int app,seq_num=0; int app,seq_num=0;
int otg_hdr_size= + sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t); int otg_hdr_size= + sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t);
set_ctime(ctime); // fixme: this should be done separetly from packet_gen and packet_gen_multicast
//for (app=0; app<MAX_NUM_APPLICATION; app++){ //for (app=0; app<MAX_NUM_APPLICATION; app++){
for (app=0; app<1; app++){ for (app=0; app<1; app++){
if ( (g_otg_multicast->idt_dist[src][dst][app]> 0) && if ( (g_otg_multicast->idt_dist[src][dst][app]> 0) &&
...@@ -379,51 +384,51 @@ void check_ctime(int ctime){ ...@@ -379,51 +384,51 @@ void check_ctime(int ctime){
ptime=ctime; ptime=ctime;
} }
int check_data_transmit(int src,int dst, int ctime){ int check_data_transmit(int src,int dst, int app, int ctime){
unsigned int size=0; unsigned int size=0;
for (application=0; application<g_otg->application_idx[src][dst]; application++){ // for (application=0; application<g_otg->application_idx[src][dst]; application++){
otg_info->gen_pkts=0; otg_info->gen_pkts=0;
LOG_T(OTG,"FLOW_INFO [src %d][dst %d] [IDX %d] [APPLICATION TYPE %d] MAX %d [M2M %d ]\n", src, dst, application , g_otg->application_type[src][dst][application],g_otg->application_idx[src][dst], g_otg->m2m[src][dst][application]); LOG_T(OTG,"FLOW_INFO [src %d][dst %d] [IDX %d] [APPLICATION TYPE %d] MAX %d [M2M %d ]\n", src, dst, app, g_otg->application_type[src][dst][app],g_otg->application_idx[src][dst], g_otg->m2m[src][dst][app]);
// do not generate packet for this pair of src, dst : no app type and/or no idt are defined // do not generate packet for this pair of src, dst : no app type and/or no idt are defined
if (g_otg->duration[src][dst][application] > ctime){ if (g_otg->duration[src][dst][app] > ctime){
LOG_T(OTG,"Do not generate packet for this pair of src=%d, dst =%d, duration %d < ctime %d \n", src, dst,g_otg->duration[src][dst][application], ctime); LOG_T(OTG,"Do not generate packet for this pair of src=%d, dst =%d, duration %d < ctime %d \n", src, dst,g_otg->duration[src][dst][app], ctime);
size+=0; size+=0;
}else if ((g_otg->application_type[src][dst][application]==0)&&(g_otg->idt_dist[src][dst][application][PE_STATE]==0)){ }else if ((g_otg->application_type[src][dst][app]==0)&&(g_otg->idt_dist[src][dst][app][PE_STATE]==0)){
LOG_D(OTG,"Do not generate packet for this pair of src=%d, dst =%d, IDT zero and app not specificed\n", src, dst); LOG_D(OTG,"Do not generate packet for this pair of src=%d, dst =%d, IDT zero and app %d not specificed\n", src, dst, app);
size+=0; size+=0;
} }
else if ((g_otg->application_type[src][dst][application] >0) || (g_otg->idt_dist[src][dst][application][PE_STATE] > 0)) { else if ((g_otg->application_type[src][dst][app] >0) || (g_otg->idt_dist[src][dst][app][PE_STATE] > 0)) {
state = get_application_state(src, dst, application, ctime); state = get_application_state(src, dst, app, ctime);
#ifdef STANDALONE #ifdef STANDALONE
//pre-config for the standalone //pre-config for the standalone
if (ctime<otg_info->ptime[src][dst][application]) //it happends when the emulation was finished if (ctime<otg_info->ptime[src][dst][app]) //it happends when the emulation was finished
otg_info->ptime[src][dst][application]=ctime; otg_info->ptime[src][dst][app]=ctime;
if (ctime==0) if (ctime==0)
otg_info->idt[src][dst][application]=0; //for the standalone mode: the emulation is run several times, we need to initialise the idt to 0 when ctime=0 otg_info->idt[src][dst][app]=0; //for the standalone mode: the emulation is run several times, we need to initialise the idt to 0 when ctime=0
//end pre-config //end pre-config
#endif #endif
//LOG_D(OTG,"MY_STATE %d \n", state); //LOG_D(OTG,"MY_STATE %d \n", state);
if (state!=OFF_STATE) { if (state!=OFF_STATE) {
if (((state==PU_STATE)||(state==ED_STATE))|| (otg_info->idt[src][dst][application]==0) || (( (ctime-otg_info->ptime[src][dst][application]) >= otg_info->idt[src][dst][application] ) )) { if (((state==PU_STATE)||(state==ED_STATE))|| (otg_info->idt[src][dst][app]==0) || (( (ctime-otg_info->ptime[src][dst][app]) >= otg_info->idt[src][dst][app] ) )) {
LOG_D(OTG,"[TX] OTG packet: Time To Transmit::OK (Source= %d, Destination= %d, Application %d, State= %d) , (IDT= %d ,ctime= %d, ptime= %d) \n", LOG_D(OTG,"[TX] OTG packet: Time To Transmit::OK (Source= %d, Destination= %d, Application %d, State= %d) , (IDT= %d ,ctime= %d, ptime= %d) \n",
src, dst ,application, state, otg_info->idt[src][dst][application], ctime, otg_info->ptime[src][dst][application]); src, dst ,app, state, otg_info->idt[src][dst][app], ctime, otg_info->ptime[src][dst][app]);
otg_info->ptime[src][dst][application]=ctime; otg_info->ptime[src][dst][app]=ctime;
if (state==PE_STATE) //compute the IDT only for PE STATE if (state==PE_STATE) //compute the IDT only for PE STATE
tarmaUpdateInputSample(otg_info->tarma_stream[src][dst][application]); tarmaUpdateInputSample(otg_info->tarma_stream[src][dst][app]);
otg_info->idt[src][dst][application]=time_dist(src, dst, application,state); otg_info->idt[src][dst][app]=time_dist(src, dst, app,state);
otg_info->gen_pkts=1; otg_info->gen_pkts=1;
header_size_gen(src,dst, application); header_size_gen(src,dst, app);
//for(i=1;i<=g_otg->aggregation_level[src][dst][application];i++) //for(i=1;i<=g_otg->aggregation_level[src][dst][application];i++)
/* if (g_otg->m2m[src][dst][application]==M2M){ //TO FIX FOR M2M /* if (g_otg->m2m[src][dst][application]==M2M){ //TO FIX FOR M2M
size+=size_dist(src, dst, application,state); size+=size_dist(src, dst, application,state);
...@@ -436,10 +441,10 @@ int check_data_transmit(int src,int dst, int ctime){ ...@@ -436,10 +441,10 @@ int check_data_transmit(int src,int dst, int ctime){
else{ */ else{ */
/* For the case of non M2M traffic: when more than one flows transmit data in the same time /* For the case of non M2M traffic: when more than one flows transmit data in the same time
--> the second flow transmit (because of non data aggragation) */ --> the second flow transmit (because of non data aggragation) */
size=size_dist(src, dst, application,state); size=size_dist(src, dst, app,state);
otg_info->header_size[src][dst]=otg_info->header_size_app[src][dst][application]; otg_info->header_size[src][dst]=otg_info->header_size_app[src][dst][app];
otg_info->flow_id[src][dst]=application; otg_info->flow_id[src][dst]=app;
otg_info->traffic_type[src][dst]=g_otg->application_type[src][dst][application]; otg_info->traffic_type[src][dst]=g_otg->application_type[src][dst][app];
/*} */ /*} */
...@@ -450,18 +455,18 @@ int check_data_transmit(int src,int dst, int ctime){ ...@@ -450,18 +455,18 @@ int check_data_transmit(int src,int dst, int ctime){
} }
} //check if there is background traffic to generate } //check if there is background traffic to generate
else if ((otg_info->gen_pkts==0) && (g_otg->background[src][dst][application]==1)&&(background_gen(src, dst, ctime)!=0)){ // the gen_pkts condition could be relaxed here else if ((otg_info->gen_pkts==0) && (g_otg->background[src][dst][app]==1)&&(background_gen(src, dst, ctime)!=0)){ // the gen_pkts condition could be relaxed here
otg_info->traffic_type_background[src][dst]=1; otg_info->traffic_type_background[src][dst]=1;
if (g_otg->m2m[src][dst][application]==M2M) if (g_otg->m2m[src][dst][app]==M2M)
otg_info->traffic_type[src][dst]=M2M; otg_info->traffic_type[src][dst]=M2M;
LOG_D(OTG,"[BACKGROUND=%d] Time To Transmit [SRC %d][DST %d][APPLI %d] \n", otg_info->traffic_type_background[src][dst], src, dst, application); LOG_D(OTG,"[BACKGROUND=%d] Time To Transmit [SRC %d][DST %d][APPLI %d] \n", otg_info->traffic_type_background[src][dst], src, dst, app);
} }
} }
} }
} // }
return size; return size;
} }
......
...@@ -89,11 +89,13 @@ char * random_string(int size, ALPHABET_GEN mode, ALPHABET_TYPE data_type); ...@@ -89,11 +89,13 @@ char * random_string(int size, ALPHABET_GEN mode, ALPHABET_TYPE data_type);
* \brief return int= 1 if the packet is generated: OTG header + header + payload, else 0 * \brief return int= 1 if the packet is generated: OTG header + header + payload, else 0
* \param[in] src source identity * \param[in] src source identity
* \param[in] dst destination id * \param[in] dst destination id
* \param[in] application id that might generate the packet
* \param[out] final packet size
* \param[out] packet_t: the generated packet: otg_header + header + payload * \param[out] packet_t: the generated packet: otg_header + header + payload
* \note * \note
* @ingroup _otg * @ingroup _otg
*/ */
unsigned char *packet_gen(int src, int dst, int ctime, int *pkt_size); unsigned char *packet_gen(int src, int dst, int app, int ctime, int *pkt_size);
/*! \fn char *header_gen(int hdr_size); /*! \fn char *header_gen(int hdr_size);
...@@ -185,7 +187,7 @@ int otg_hdr_size(int src, int dst); ...@@ -185,7 +187,7 @@ int otg_hdr_size(int src, int dst);
void init_packet_gen(int src, int dst, int ctime); void init_packet_gen(int src, int dst, int ctime);
int check_data_transmit(int src,int dst, int ctime); int check_data_transmit(int src,int dst, int app, int ctime);
unsigned int get_application_state(int src, int dst, int application, int ctime); unsigned int get_application_state(int src, int dst, int application, int ctime);
......
...@@ -559,7 +559,7 @@ static void *eNB_thread(void *arg) ...@@ -559,7 +559,7 @@ static void *eNB_thread(void *arg)
if (fs4_test==0) if (fs4_test==0)
{ {
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0); phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0, 0);
#ifndef IFFT_FPGA #ifndef IFFT_FPGA
slot_offset_F = (next_slot)* slot_offset_F = (next_slot)*
(PHY_vars_eNB_g[0]->lte_frame_parms.ofdm_symbol_size)* (PHY_vars_eNB_g[0]->lte_frame_parms.ofdm_symbol_size)*
...@@ -781,7 +781,7 @@ static void *UE_thread(void *arg) ...@@ -781,7 +781,7 @@ static void *UE_thread(void *arg)
*/ */
in = rt_get_time_ns(); in = rt_get_time_ns();
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[0], 0, 0,mode); phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[0], 0, 0,mode,0);
out = rt_get_time_ns(); out = rt_get_time_ns();
diff = out-in; diff = out-in;
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<OWD_RADIO_ACCESS>enable</OWD_RADIO_ACCESS> <!-- option: enable, disable. If enable owd curve shows the one way radio access delay, else it shows end to end owd --> <OWD_RADIO_ACCESS>enable</OWD_RADIO_ACCESS> <!-- option: enable, disable. If enable owd curve shows the one way radio access delay, else it shows end to end owd -->
</PERFORMANCE_METRICS> </PERFORMANCE_METRICS>
<LOG> <!-- set the global log level --> <LOG> <!-- set the global log level -->
<LEVEL>trace</LEVEL> <LEVEL>debug</LEVEL>
<INTERVAL>1</INTERVAL> <INTERVAL>1</INTERVAL>
</LOG> </LOG>
<SEED_VALUE>1234</SEED_VALUE> <!-- value 0 means randomly generated by OAI --> <SEED_VALUE>1234</SEED_VALUE> <!-- value 0 means randomly generated by OAI -->
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<UE_MOBILITY> <UE_MOBILITY>
<UE_INITIAL_DISTRIBUTION>random</UE_INITIAL_DISTRIBUTION> <UE_INITIAL_DISTRIBUTION>random</UE_INITIAL_DISTRIBUTION>
<RANDOM_UE_DISTRIBUTION> <RANDOM_UE_DISTRIBUTION>
<NUMBER_OF_NODES>3</NUMBER_OF_NODES> <NUMBER_OF_NODES>1</NUMBER_OF_NODES>
</RANDOM_UE_DISTRIBUTION> </RANDOM_UE_DISTRIBUTION>
<UE_MOBILITY_TYPE>RWP</UE_MOBILITY_TYPE> <UE_MOBILITY_TYPE>RWP</UE_MOBILITY_TYPE>
</UE_MOBILITY> </UE_MOBILITY>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</TOPOLOGY_CONFIG> </TOPOLOGY_CONFIG>
<EMULATION_CONFIG> <EMULATION_CONFIG>
<EMULATION_TIME_ms>5000</EMULATION_TIME_ms> <EMULATION_TIME_ms>0</EMULATION_TIME_ms>
<LOG> <!-- set the global log level --> <LOG> <!-- set the global log level -->
<LEVEL>debug</LEVEL> <LEVEL>debug</LEVEL>
</LOG> </LOG>
......
...@@ -50,17 +50,18 @@ ...@@ -50,17 +50,18 @@
</TOPOLOGY_CONFIG> </TOPOLOGY_CONFIG>
<APPLICATION_CONFIG> <APPLICATION_CONFIG>
<!-- DL --> <!-- DL
<PREDEFINED_TRAFFIC> <PREDEFINED_TRAFFIC>
<SOURCE_ID>0</SOURCE_ID> <!-- valid formats are "n:m" and "n,m" and "n" --> <SOURCE_ID>0</SOURCE_ID>
<DURATION_ms>5000</DURATION_ms> <!-- start at -->
<APPLICATION_TYPE>scbr</APPLICATION_TYPE> <APPLICATION_TYPE>scbr</APPLICATION_TYPE>
<DESTINATION_ID>1:9</DESTINATION_ID> <!-- valid formats are "n:m" and "n,m" and "n" --> <DESTINATION_ID>1:9</DESTINATION_ID>
</PREDEFINED_TRAFFIC> </PREDEFINED_TRAFFIC>
-->
<!-- UL --> <!-- UL -->
<PREDEFINED_TRAFFIC> <PREDEFINED_TRAFFIC>
<SOURCE_ID>1:9</SOURCE_ID> <!-- valid formats are "n:m" and "n,m" and "n" --> <SOURCE_ID>1:9</SOURCE_ID> <!-- valid formats are "n:m" and "n,m" and "n" -->
<DURATION_ms>5000</DURATION_ms> <!-- start at --> <DURATION_ms>5000</DURATION_ms>
<APPLICATION_TYPE>scbr</APPLICATION_TYPE> <APPLICATION_TYPE>scbr</APPLICATION_TYPE>
<DESTINATION_ID>0</DESTINATION_ID> <!-- valid formats are "n:m" and "n,m" and "n" --> <DESTINATION_ID>0</DESTINATION_ID> <!-- valid formats are "n:m" and "n,m" and "n" -->
</PREDEFINED_TRAFFIC> </PREDEFINED_TRAFFIC>
...@@ -68,6 +69,7 @@ ...@@ -68,6 +69,7 @@
<EMULATION_CONFIG> <EMULATION_CONFIG>
<EMULATION_TIME_ms>10000</EMULATION_TIME_ms> <!--set to infinity--> <EMULATION_TIME_ms>10000</EMULATION_TIME_ms> <!--set to infinity-->
<CURVE>disable</CURVE>
<PERFORMANCE_METRICS> <PERFORMANCE_METRICS>
<THROUGHPUT>1</THROUGHPUT> <THROUGHPUT>1</THROUGHPUT>
<LATENCY>1</LATENCY> <LATENCY>1</LATENCY>
...@@ -76,7 +78,7 @@ ...@@ -76,7 +78,7 @@
<LEVEL>debug</LEVEL> <LEVEL>debug</LEVEL>
<VERBOSITY>low</VERBOSITY> <VERBOSITY>low</VERBOSITY>
</LOG> </LOG>
<SEED_VALUE>0</SEED_VALUE> <!-- value 0 means randomly generated by OAI --> <SEED_VALUE>2013</SEED_VALUE> <!-- value 0 means randomly generated by OAI -->
</EMULATION_CONFIG> </EMULATION_CONFIG>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<UE_MOBILITY> <UE_MOBILITY>
<UE_INITIAL_DISTRIBUTION>random</UE_INITIAL_DISTRIBUTION> <UE_INITIAL_DISTRIBUTION>random</UE_INITIAL_DISTRIBUTION>
<RANDOM_UE_DISTRIBUTION> <RANDOM_UE_DISTRIBUTION>
<NUMBER_OF_NODES>1</NUMBER_OF_NODES> <!-- num UE --> <NUMBER_OF_NODES>2</NUMBER_OF_NODES> <!-- num UE -->
</RANDOM_UE_DISTRIBUTION> </RANDOM_UE_DISTRIBUTION>
<UE_MOBILITY_TYPE>STATIC</UE_MOBILITY_TYPE> <UE_MOBILITY_TYPE>STATIC</UE_MOBILITY_TYPE>
<!-- <UE_MOVING_DYNAMICS> <!-- <UE_MOVING_DYNAMICS>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<eNB_MOBILITY> <eNB_MOBILITY>
<eNB_INITIAL_DISTRIBUTION>random</eNB_INITIAL_DISTRIBUTION> <eNB_INITIAL_DISTRIBUTION>random</eNB_INITIAL_DISTRIBUTION>
<RANDOM_eNB_DISTRIBUTION> <RANDOM_eNB_DISTRIBUTION>
<NUMBER_OF_CELLS>1</NUMBER_OF_CELLS> <!-- num eNB --> <NUMBER_OF_CELLS>2</NUMBER_OF_CELLS> <!-- num eNB -->
</RANDOM_eNB_DISTRIBUTION> </RANDOM_eNB_DISTRIBUTION>
<eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE> <eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<!-- DL --> <!-- DL -->
<CUSTOMIZED_TRAFFIC> <CUSTOMIZED_TRAFFIC>
<SOURCE_ID>0</SOURCE_ID> <SOURCE_ID>0</SOURCE_ID>
<DESTINATION_ID>1</DESTINATION_ID> <DESTINATION_ID>2</DESTINATION_ID>
<IDT_DIST>fixed</IDT_DIST> <!-- option: no_customized_traffic, uniform, gaussian, exponential, poisson, fixed, weibull, pareto, gamma, cauchy, log_normal --> <IDT_DIST>fixed</IDT_DIST> <!-- option: no_customized_traffic, uniform, gaussian, exponential, poisson, fixed, weibull, pareto, gamma, cauchy, log_normal -->
<IDT_MIN_ms>10</IDT_MIN_ms> <IDT_MIN_ms>10</IDT_MIN_ms>
<SIZE_DIST>fixed</SIZE_DIST> <!-- option: no_customized_traffic, uniform, gaussian, exponential, poisson, fixed, weibull, pareto, gamma, cauchy, log_normal --> <SIZE_DIST>fixed</SIZE_DIST> <!-- option: no_customized_traffic, uniform, gaussian, exponential, poisson, fixed, weibull, pareto, gamma, cauchy, log_normal -->
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</CUSTOMIZED_TRAFFIC> </CUSTOMIZED_TRAFFIC>
<!-- UL --> <!-- UL -->
<CUSTOMIZED_TRAFFIC> <CUSTOMIZED_TRAFFIC>
<SOURCE_ID>1</SOURCE_ID> <SOURCE_ID>2</SOURCE_ID>
<DESTINATION_ID>0</DESTINATION_ID> <DESTINATION_ID>0</DESTINATION_ID>
<IDT_DIST>fixed</IDT_DIST> <!-- option: no_customized_traffic, uniform, gaussian, exponential, poisson, fixed, weibull, pareto, gamma, cauchy, log_normal --> <IDT_DIST>fixed</IDT_DIST> <!-- option: no_customized_traffic, uniform, gaussian, exponential, poisson, fixed, weibull, pareto, gamma, cauchy, log_normal -->
<IDT_MIN_ms>10</IDT_MIN_ms> <IDT_MIN_ms>10</IDT_MIN_ms>
......
...@@ -523,7 +523,7 @@ else ...@@ -523,7 +523,7 @@ else
$OPENAIR_TARGETS/SIMU/USER/oaisim -a -u $1 > /tmp/lte_log.txt $OPENAIR_TARGETS/SIMU/USER/oaisim -a -u $1 > /tmp/lte_log.txt
chmod 777 /tmp/lte_log.txt chmod 777 /tmp/lte_log.txt
else else
$OPENAIR_TARGETS/SIMU/USER/oaisim -a -u $1 -F > /tmp/lte_log.txt $OPENAIR_TARGETS/SIMU/USER/oaisim -a -u $1 -F -P wireshark > /tmp/lte_log.txt
fi fi
echo "End of emulation" echo "End of emulation"
fi fi
......
...@@ -102,7 +102,7 @@ char smbv_ip[16]; ...@@ -102,7 +102,7 @@ char smbv_ip[16];
//u8 NB_INST = 2; //u8 NB_INST = 2;
//#endif //OPENAIR2 //#endif //OPENAIR2
u32 frame=0; u32 frame=0;
int eMBMS_active = 0; //int eMBMS_active = 0;
char stats_buffer[16384]; char stats_buffer[16384];
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX]; channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
...@@ -201,7 +201,7 @@ help (void) { ...@@ -201,7 +201,7 @@ help (void) {
printf (" - wireshark: Enable tracing of layers above PHY using an UDP socket\n"); printf (" - wireshark: Enable tracing of layers above PHY using an UDP socket\n");
printf (" - pcap: Enable tracing of layers above PHY to a pcap file\n"); printf (" - pcap: Enable tracing of layers above PHY to a pcap file\n");
printf (" - tshark: Not implemented yet\n"); printf (" - tshark: Not implemented yet\n");
printf ("-Q Activate the MBMS service\n"); printf ("-Q Activate and set the MBMS service: 0 : not used (default eMBMS disabled), 1: eMBMS and RRC enabled, 2: eMBMS relaying and RRC enabled, 3: eMBMS enabled, RRC disabled, 4: eMBMS relaying enabled, RRC disabled\n");
printf ("-R [6,15,25,50,75,100] Sets N_RB_DL\n"); printf ("-R [6,15,25,50,75,100] Sets N_RB_DL\n");
printf ("-r Activates rate adaptation (DL for now)\n"); printf ("-r Activates rate adaptation (DL for now)\n");
printf ("-s snr_dB set a fixed (average) SNR, this deactivates the openair channel model generator (OCM)\n"); printf ("-s snr_dB set a fixed (average) SNR, this deactivates the openair channel model generator (OCM)\n");
...@@ -366,8 +366,9 @@ int ...@@ -366,8 +366,9 @@ int
strcpy(smbv_ip,DEFAULT_SMBV_IP); strcpy(smbv_ip,DEFAULT_SMBV_IP);
#endif #endif
s32 UE_id, eNB_id; s32 UE_id=0, eNB_id=0, RN_id=0;
relaying_mode_t r_mode=no_relay; // no relaying
// time calibration for soft realtime mode // time calibration for soft realtime mode
lte_subframe_t direction; lte_subframe_t direction;
...@@ -450,8 +451,8 @@ int ...@@ -450,8 +451,8 @@ int
#ifdef OPENAIR2 #ifdef OPENAIR2
init_omv(); init_omv();
#endif #endif
//Before this call, NB_UE_INST and NB_eNB_INST are not set correctly
check_and_adjust_params(); //Before this call, NB_UE_INST and NB_eNB_INST are not set correctly check_and_adjust_params();
init_otg_pdcp_buffer(); init_otg_pdcp_buffer();
...@@ -487,8 +488,25 @@ int ...@@ -487,8 +488,25 @@ int
#endif #endif
LOG_I(EMU,"total number of UE %d (local %d, remote %d) mobility %s \n", NB_UE_INST,oai_emulation.info.nb_ue_local,oai_emulation.info.nb_ue_remote, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option); if (NB_RN_INST > 0 ) {
LOG_I(EMU,"Total number of eNB %d (local %d, remote %d) mobility %s \n", NB_eNB_INST,oai_emulation.info.nb_enb_local,oai_emulation.info.nb_enb_remote, oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option); LOG_N(EMU,"Total number of RN %d (local %d, remote %d) mobility (the same as eNB) %s \n", NB_RN_INST,oai_emulation.info.nb_rn_local,oai_emulation.info.nb_rn_remote, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_N(EMU,"Adjust the number of eNB inst (%d->%d) and UE inst (%d->%d)\n ",
NB_eNB_INST, NB_eNB_INST+NB_RN_INST,
NB_UE_INST, NB_UE_INST+NB_RN_INST);
NB_eNB_INST+=NB_RN_INST;
NB_UE_INST+=NB_RN_INST;
}
LOG_I(EMU,"Total number of UE %d (local %d, remote %d, relay %d) mobility %s \n",
NB_UE_INST,oai_emulation.info.nb_ue_local,oai_emulation.info.nb_ue_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_I(EMU,"Total number of eNB %d (local %d, remote %d, relay %d) mobility %s \n",
NB_eNB_INST,oai_emulation.info.nb_enb_local,oai_emulation.info.nb_enb_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option);
LOG_I(OCM,"Running with frame_type %d, Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n", LOG_I(OCM,"Running with frame_type %d, Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n",
oai_emulation.info.frame_type, Nid_cell, oai_emulation.info.N_RB_DL, oai_emulation.info.extended_prefix_flag, oai_emulation.info.transmission_mode,target_dl_mcs,rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option); oai_emulation.info.frame_type, Nid_cell, oai_emulation.info.N_RB_DL, oai_emulation.info.extended_prefix_flag, oai_emulation.info.transmission_mode,target_dl_mcs,rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option);
...@@ -531,17 +549,11 @@ int ...@@ -531,17 +549,11 @@ int
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0]->lte_frame_parms); smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0]->lte_frame_parms);
#endif #endif
printf ("before L2 init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell);
printf ("before L2 init: frame_type %d,tdd_config %d\n",
PHY_vars_eNB_g[0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[0]->lte_frame_parms.tdd_config);
init_time(); init_time();
LOG_I(EMU,">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); LOG_I(EMU,">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
printf ("after init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell); LOG_I (EMU,"after init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell);
printf ("after init: frame_type %d,tdd_config %d\n", LOG_I(EMU,"after init: frame_type %d,tdd_config %d\n",
PHY_vars_eNB_g[0]->lte_frame_parms.frame_type, PHY_vars_eNB_g[0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[0]->lte_frame_parms.tdd_config); PHY_vars_eNB_g[0]->lte_frame_parms.tdd_config);
...@@ -618,6 +630,8 @@ int ...@@ -618,6 +630,8 @@ int
oai_emulation.info.time_ms = frame * 10 + (slot>>1) ; oai_emulation.info.time_ms = frame * 10 + (slot>>1) ;
direction = subframe_select(frame_parms,next_slot>>1); direction = subframe_select(frame_parms,next_slot>>1);
r_mode = no_relay;
#ifdef PROC #ifdef PROC
if(Channel_Flag==1) if(Channel_Flag==1)
Channel_Func(s_re2,s_im2,r_re2,r_im2,r_re02,r_im02,r_re0_d,r_im0_d,r_re0_u,r_im0_u,eNB2UE,UE2eNB,enb_data,ue_data,abstraction_flag,frame_parms,slot); Channel_Func(s_re2,s_im2,r_re2,r_im2,r_re02,r_im02,r_re0_d,r_im0_d,r_re0_u,r_im0_u,eNB2UE,UE2eNB,enb_data,ue_data,abstraction_flag,frame_parms,slot);
...@@ -633,8 +647,8 @@ int ...@@ -633,8 +647,8 @@ int
eNB_id++) { eNB_id++) {
//printf ("debug: Nid_cell %d\n", PHY_vars_eNB_g[eNB_id]->lte_frame_parms.Nid_cell); //printf ("debug: Nid_cell %d\n", PHY_vars_eNB_g[eNB_id]->lte_frame_parms.Nid_cell);
//printf ("debug: frame_type %d,tdd_config %d\n", PHY_vars_eNB_g[eNB_id]->lte_frame_parms.frame_type,PHY_vars_eNB_g[eNB_id]->lte_frame_parms.tdd_config); //printf ("debug: frame_type %d,tdd_config %d\n", PHY_vars_eNB_g[eNB_id]->lte_frame_parms.frame_type,PHY_vars_eNB_g[eNB_id]->lte_frame_parms.tdd_config);
LOG_D(EMU,"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n", LOG_D(EMU,"PHY procedures eNB %d mode %s for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n",
eNB_id, frame, slot, next_slot >> 1,last_slot>>1, eNB_id, (r_mode == 0)?"Normal":"Relaying", frame, slot, next_slot >> 1,last_slot>>1,
PHY_vars_eNB_g[eNB_id]->lte_frame_parms.frame_type, PHY_vars_eNB_g[eNB_id]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[eNB_id]->lte_frame_parms.tdd_config,PHY_vars_eNB_g[eNB_id]->lte_frame_parms.Nid_cell); PHY_vars_eNB_g[eNB_id]->lte_frame_parms.tdd_config,PHY_vars_eNB_g[eNB_id]->lte_frame_parms.Nid_cell);
...@@ -644,8 +658,8 @@ int ...@@ -644,8 +658,8 @@ int
//IP/OTG to PDCP and PDCP to IP operation //IP/OTG to PDCP and PDCP to IP operation
pdcp_run(frame, 1, 0, eNB_id);//PHY_vars_eNB_g[eNB_id]->Mod_id pdcp_run(frame, 1, 0, eNB_id);//PHY_vars_eNB_g[eNB_id]->Mod_id
//PHY_vars_eNB_g[eNB_id]->frame = frame; // PHY_vars_eNB_g[eNB_id]->frame = frame;
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag); phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag, r_mode);
#ifdef PRINT_STATS #ifdef PRINT_STATS
if(last_slot==9 && frame%10==0) if(last_slot==9 && frame%10==0)
...@@ -675,11 +689,11 @@ int ...@@ -675,11 +689,11 @@ int
for (UE_id = oai_emulation.info.first_ue_local; for (UE_id = oai_emulation.info.first_ue_local;
(UE_id < (oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local)) && (oai_emulation.info.cli_start_ue[UE_id]==1); (UE_id < (oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local)) && (oai_emulation.info.cli_start_ue[UE_id]==1);
UE_id++) UE_id++){
if (frame >= (UE_id * 20)) { // activate UE only after 20*UE_id frames so that different UEs turn on separately if (frame >= (UE_id * 20)) { // activate UE only after 20*UE_id frames so that different UEs turn on separately
LOG_D(EMU,"PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", LOG_D(EMU,"PHY procedures UE %d mode %s for frame %d, slot %d (subframe TX %d, RX %d)\n",
UE_id, frame, slot, next_slot >> 1,last_slot>>1); UE_id, (r_mode == 0)?"Normal":"Relaying", frame, slot, next_slot >> 1,last_slot>>1);
if (PHY_vars_UE_g[UE_id]->UE_mode[0] != NOT_SYNCHED) { if (PHY_vars_UE_g[UE_id]->UE_mode[0] != NOT_SYNCHED) {
if (frame>0) { if (frame>0) {
...@@ -691,7 +705,7 @@ int ...@@ -691,7 +705,7 @@ int
//Access layer //Access layer
pdcp_run(frame, 0, UE_id, 0); pdcp_run(frame, 0, UE_id, 0);
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx); phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx, r_mode);
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id]->tx_power_dBm; ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id]->tx_power_dBm;
} }
} }
...@@ -730,6 +744,48 @@ int ...@@ -730,6 +744,48 @@ int
} }
#endif #endif
} }
}
#ifdef Rel10
for (RN_id=oai_emulation.info.first_rn_local;
RN_id<oai_emulation.info.first_rn_local+oai_emulation.info.nb_rn_local;
RN_id++) {
// UE id and eNB id of the RN
UE_id= oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local + RN_id; // NB_UE_INST + RN_id
eNB_id= oai_emulation.info.first_enb_local+oai_emulation.info.nb_enb_local + RN_id; // NB_eNB_INST + RN_id
// currently only works in FDD
if (oai_emulation.info.eMBMS_active_state == 3){
r_mode = multicast_relay;
LOG_I(EMU,"Activating the multicast relaying\n");
}else {
LOG_E(EMU,"Not supported option when relaying is enabled %d\n", r_mode);
exit(-1);
}
if ( oai_emulation.info.frame_type == 0) {
// RN == UE, do RX as in UE for SF0-SF5
// we could add another arg, such as operation, to call the top func phy_procedures_UE_lte
if (frame>0) {
if (PHY_vars_UE_g[UE_id]->UE_mode[0] != NOT_SYNCHED) {
LOG_D(EMU,"PHY procedures UE %d mode %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
UE_id, (r_mode == 0)?"Normal":"Relaying", frame, slot, next_slot >> 1,last_slot>>1);
PHY_vars_UE_g[UE_id]->frame = frame;
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx, r_mode);
} else if (last_slot == (LTE_SLOTS_PER_FRAME-2)) {
initial_sync(PHY_vars_UE_g[UE_id],normal_txrx);
}
}
// RN == eNB, do Tx as in eNB for SF6-SF9
LOG_D(EMU,"PHY procedures eNB %d mode %s for frame %d, slot %d (subframe TX %d, RX %d)\n",
eNB_id, (r_mode == 0)?"Normal":"Relaying", frame, slot, next_slot >> 1,last_slot>>1);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag, r_mode);
}
else{
LOG_E(EMU,"TDD is not supported for multicast relaying %d\n", r_mode);
exit(-1);
}
}
#endif
emu_transport (frame, last_slot, next_slot,direction, oai_emulation.info.frame_type, ethernet_flag); emu_transport (frame, last_slot, next_slot,direction, oai_emulation.info.frame_type, ethernet_flag);
if ((direction == SF_DL)|| (frame_parms->frame_type==0)){ if ((direction == SF_DL)|| (frame_parms->frame_type==0)){
// consider only sec id 0 // consider only sec id 0
......
...@@ -300,11 +300,14 @@ void init_oai_emulation() { ...@@ -300,11 +300,14 @@ void init_oai_emulation() {
oai_emulation.info.master_list=0; oai_emulation.info.master_list=0;
oai_emulation.info.nb_ue_remote=0; oai_emulation.info.nb_ue_remote=0;
oai_emulation.info.nb_enb_remote=0; oai_emulation.info.nb_enb_remote=0;
oai_emulation.info.nb_rn_remote=0;
oai_emulation.info.first_ue_local=0; oai_emulation.info.first_ue_local=0;
oai_emulation.info.first_enb_local=0; oai_emulation.info.first_enb_local=0;
oai_emulation.info.first_rn_local=0;
oai_emulation.info.master_id=0; oai_emulation.info.master_id=0;
oai_emulation.info.nb_ue_local= 1;//default 1 UE oai_emulation.info.nb_ue_local= 1;//default 1 UE
oai_emulation.info.nb_enb_local= 1;//default 1 eNB oai_emulation.info.nb_enb_local= 1;//default 1 eNB
oai_emulation.info.nb_rn_local= 0;//default 0 RN : currently only applicable for eMBMS
oai_emulation.info.ethernet_flag=0; oai_emulation.info.ethernet_flag=0;
oai_emulation.info.ocm_enabled=1;// flag ? oai_emulation.info.ocm_enabled=1;// flag ?
oai_emulation.info.ocg_enabled=0;// flag c oai_emulation.info.ocg_enabled=0;// flag c
...@@ -315,6 +318,7 @@ void init_oai_emulation() { ...@@ -315,6 +318,7 @@ void init_oai_emulation() {
oai_emulation.info.omv_enabled =0; // v flag oai_emulation.info.omv_enabled =0; // v flag
oai_emulation.info.vcd_enabled=0; oai_emulation.info.vcd_enabled=0;
oai_emulation.info.cba_group_active=0; oai_emulation.info.cba_group_active=0;
oai_emulation.info.eMBMS_active_state=0;
oai_emulation.info.omg_model_enb=STATIC; //default to static mobility model oai_emulation.info.omg_model_enb=STATIC; //default to static mobility model
oai_emulation.info.omg_model_ue=STATIC; //default to static mobility model oai_emulation.info.omg_model_ue=STATIC; //default to static mobility model
oai_emulation.info.omg_model_ue_current=STATIC; //default to static mobility model oai_emulation.info.omg_model_ue_current=STATIC; //default to static mobility model
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "UTIL/OCG/OCG_extern.h" #include "UTIL/OCG/OCG_extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h" #include "UTIL/OPT/opt.h"
#include "UTIL/OTG/otg_config.h"
#include "cor_SF_sim.h" #include "cor_SF_sim.h"
...@@ -96,7 +97,7 @@ extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX]; ...@@ -96,7 +97,7 @@ extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
extern mapping small_scale_names[]; extern mapping small_scale_names[];
extern pdcp_mbms_t pdcp_mbms_array[MAX_MODULES][16*29]; extern pdcp_mbms_t pdcp_mbms_array[MAX_MODULES][16*29];
extern int eMBMS_active; //extern int eMBMS_active;
extern void help (void); extern void help (void);
...@@ -109,7 +110,7 @@ void get_simulation_options(int argc, char *argv[]) { ...@@ -109,7 +110,7 @@ void get_simulation_options(int argc, char *argv[]) {
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hi:IJ:k:l:m:M:n:N:oO:p:P:rR:s:S:t:T:u:U:vVx:y:w:W:X:z:Z:", long_options, &option_index)) != -1) { while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hi:j:IJ:k:l:m:M:n:N:oO:p:P:rR:s:S:Q:t:T:u:U:vVx:y:w:W:X:z:Z:", long_options, &option_index)) != -1) {
switch (c) { switch (c) {
case 0: case 0:
...@@ -140,7 +141,9 @@ void get_simulation_options(int argc, char *argv[]) { ...@@ -140,7 +141,9 @@ void get_simulation_options(int argc, char *argv[]) {
} }
break; break;
case 'Q': case 'Q':
eMBMS_active=1; //eMBMS_active=1;
// 0 : not used (default), 1: eMBMS and RRC enabled, 2: eMBMS relaying and RRC enabled, 3: eMBMS enabled, RRC disabled, 3: eMBMS relaying enabled, RRC disabled
oai_emulation.info.eMBMS_active_state = atoi (optarg);
break; break;
case 'R': case 'R':
oai_emulation.info.N_RB_DL = atoi (optarg); oai_emulation.info.N_RB_DL = atoi (optarg);
...@@ -194,6 +197,10 @@ void get_simulation_options(int argc, char *argv[]) { ...@@ -194,6 +197,10 @@ void get_simulation_options(int argc, char *argv[]) {
set_sinr = 1; set_sinr = 1;
oai_emulation.info.ocm_enabled=0; oai_emulation.info.ocm_enabled=0;
break; break;
case 'j' :
// number of relay nodes: currently only applicable to eMBMS
oai_emulation.info.nb_rn_local = atoi (optarg);
break;
case 'J': case 'J':
ue_connection_test=1; ue_connection_test=1;
oai_emulation.info.ocm_enabled=0; oai_emulation.info.ocm_enabled=0;
...@@ -380,6 +387,10 @@ void check_and_adjust_params() { ...@@ -380,6 +387,10 @@ void check_and_adjust_params() {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (oai_emulation.info.nb_rn_local > NUMBER_OF_RN_MAX) {
LOG_E(EMU,"Enter fewer than %d RNs for the moment or change the NUMBER_OF_RN_MAX\n", NUMBER_OF_RN_MAX);
exit(EXIT_FAILURE);
}
// fix ethernet and abstraction with RRC_CELLULAR Flag // fix ethernet and abstraction with RRC_CELLULAR Flag
#ifdef RRC_CELLULAR #ifdef RRC_CELLULAR
abstraction_flag = 1; abstraction_flag = 1;
...@@ -421,6 +432,8 @@ void check_and_adjust_params() { ...@@ -421,6 +432,8 @@ void check_and_adjust_params() {
NB_UE_INST = oai_emulation.info.nb_ue_local + oai_emulation.info.nb_ue_remote; NB_UE_INST = oai_emulation.info.nb_ue_local + oai_emulation.info.nb_ue_remote;
NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote; NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote;
NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote;
} }
void init_omv() { void init_omv() {
...@@ -533,7 +546,7 @@ void init_openair2() { ...@@ -533,7 +546,7 @@ void init_openair2() {
#ifdef OPENAIR2 #ifdef OPENAIR2
s32 i; s32 i;
s32 UE_id; s32 UE_id;
l2_init (&PHY_vars_eNB_g[0]->lte_frame_parms,eMBMS_active, oai_emulation.info.cba_group_active); l2_init (&PHY_vars_eNB_g[0]->lte_frame_parms,oai_emulation.info.eMBMS_active_state, oai_emulation.info.cba_group_active);
printf ("after L2 init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell); printf ("after L2 init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell);
printf ("after L2 init: frame_type %d,tdd_config %d\n", printf ("after L2 init: frame_type %d,tdd_config %d\n",
PHY_vars_eNB_g[0]->lte_frame_parms.frame_type, PHY_vars_eNB_g[0]->lte_frame_parms.frame_type,
...@@ -736,7 +749,7 @@ void update_otg_eNB(int module_id, unsigned int ctime) { ...@@ -736,7 +749,7 @@ void update_otg_eNB(int module_id, unsigned int ctime) {
#if defined(USER_MODE) && defined(OAI_EMU) #if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled ==1 ) { if (oai_emulation.info.otg_enabled ==1 ) {
int dst_id; int dst_id, app_id;
Packet_otg_elt *otg_pkt; Packet_otg_elt *otg_pkt;
...@@ -744,28 +757,33 @@ void update_otg_eNB(int module_id, unsigned int ctime) { ...@@ -744,28 +757,33 @@ void update_otg_eNB(int module_id, unsigned int ctime) {
for_times += 1; for_times += 1;
// generate traffic if the ue is rrc reconfigured state // generate traffic if the ue is rrc reconfigured state
if (mac_get_rrc_status(module_id, 1/*eNB_flag*/, dst_id) > 2 /*RRC_CONNECTED*/ ) { if (mac_get_rrc_status(module_id, 1/*eNB_flag*/, dst_id) > 2 /*RRC_CONNECTED*/ ) {
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++){
otg_pkt = malloc (sizeof(Packet_otg_elt)); otg_pkt = malloc (sizeof(Packet_otg_elt));
if_times += 1; if_times += 1;
(otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen(module_id, dst_id + NB_eNB_INST, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size)); (otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen(module_id, dst_id + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) { if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
otg_times += 1; otg_times += 1;
(otg_pkt->otg_pkt).rb_id = dst_id * NB_RB_MAX + DTCH; (otg_pkt->otg_pkt).rb_id = dst_id * NB_RB_MAX + DTCH; // app could be binded to a given DRB
(otg_pkt->otg_pkt).module_id = module_id; (otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).dst_id = dst_id; (otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU; (otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
//Adding the packet to the OTG-PDCP buffer //Adding the packet to the OTG-PDCP buffer
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id])); pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id]));
LOG_I(EMU, "[eNB %d] ADD pkt to OTG buffer for dst %d on rb_id %d\n", (otg_pkt->otg_pkt).module_id, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id); LOG_I(EMU, "[eNB %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d for app id %d \n",
(otg_pkt->otg_pkt).module_id, otg_pkt->otg_pkt.sdu_buffer_size, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id, app_id);
} else { } else {
//LOG_I(EMU, "OTG returns null \n"); //LOG_I(EMU, "OTG returns null \n");
free(otg_pkt); free(otg_pkt);
otg_pkt=NULL; otg_pkt=NULL;
} }
} }
LOG_T(EMU,"[eNB %d] UE mod id %d is not connected\n", module_id, dst_id); //LOG_T(EMU,"[eNB %d] UE mod id %d is not connected\n", module_id, dst_id);
//LOG_I(EMU,"HEAD of otg_pdcp_buffer[%d] is %p\n", module_id, pkt_list_get_head(&(otg_pdcp_buffer[module_id]))); //LOG_I(EMU,"HEAD of otg_pdcp_buffer[%d] is %p\n", module_id, pkt_list_get_head(&(otg_pdcp_buffer[module_id])));
}
} }
#ifdef Rel10 #ifdef Rel10
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#***************************************************************************** #*****************************************************************************
# \file case01.py # \file case01.py
# \brief test case 01 for OAI # \brief test case 01 for OAI: compilations
# \author Navid Nikaein # \author Navid Nikaein
# \date 2013 # \date 2013
# \version 0.1 # \version 0.1
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#***************************************************************************** #*****************************************************************************
# \file case02.py # \file case02.py
# \brief test case 02 for OAI # \brief test case 02 for OAI: executions
# \author Navid Nikaein # \author Navid Nikaein
# \date 2013 # \date 2013
# \version 0.1 # \version 0.1
......
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