Reverted changes from parent revision 9974
This commit is contained in:
@@ -328,9 +328,6 @@ LteHelper::InstallSingleEnbDevice (Ptr<Node> n)
|
||||
Ptr<LteSpectrumPhy> dlPhy = CreateObject<LteSpectrumPhy> ();
|
||||
Ptr<LteSpectrumPhy> ulPhy = CreateObject<LteSpectrumPhy> ();
|
||||
|
||||
dlPhy->SetChannel (m_downlinkChannel);
|
||||
ulPhy->SetChannel (m_uplinkChannel);
|
||||
|
||||
Ptr<LteEnbPhy> phy = CreateObject<LteEnbPhy> (dlPhy, ulPhy);
|
||||
|
||||
Ptr<LteHarqPhy> harq = Create<LteHarqPhy> ();
|
||||
@@ -347,6 +344,9 @@ LteHelper::InstallSingleEnbDevice (Ptr<Node> n)
|
||||
Ptr<LteInterferencePowerChunkProcessor> pInterf = Create<LteInterferencePowerChunkProcessor> (phy);
|
||||
ulPhy->AddInterferenceDataChunkProcessor (pInterf); // for interference power tracing
|
||||
|
||||
dlPhy->SetChannel (m_downlinkChannel);
|
||||
ulPhy->SetChannel (m_uplinkChannel);
|
||||
|
||||
Ptr<MobilityModel> mm = n->GetObject<MobilityModel> ();
|
||||
NS_ASSERT_MSG (mm, "MobilityModel needs to be set on node before calling LteHelper::InstallUeDevice ()");
|
||||
dlPhy->SetMobility (mm);
|
||||
@@ -472,9 +472,6 @@ LteHelper::InstallSingleUeDevice (Ptr<Node> n)
|
||||
Ptr<LteSpectrumPhy> dlPhy = CreateObject<LteSpectrumPhy> ();
|
||||
Ptr<LteSpectrumPhy> ulPhy = CreateObject<LteSpectrumPhy> ();
|
||||
|
||||
dlPhy->SetChannel (m_downlinkChannel);
|
||||
ulPhy->SetChannel (m_uplinkChannel);
|
||||
|
||||
Ptr<LteUePhy> phy = CreateObject<LteUePhy> (dlPhy, ulPhy);
|
||||
|
||||
Ptr<LteHarqPhy> harq = Create<LteHarqPhy> ();
|
||||
@@ -494,6 +491,9 @@ LteHelper::InstallSingleUeDevice (Ptr<Node> n)
|
||||
Ptr<LteDataSinrChunkProcessor> pData = Create<LteDataSinrChunkProcessor> (dlPhy);
|
||||
dlPhy->AddDataSinrChunkProcessor (pData);
|
||||
|
||||
dlPhy->SetChannel (m_downlinkChannel);
|
||||
ulPhy->SetChannel (m_uplinkChannel);
|
||||
|
||||
Ptr<MobilityModel> mm = n->GetObject<MobilityModel> ();
|
||||
NS_ASSERT_MSG (mm, "MobilityModel needs to be set on node before calling LteHelper::InstallUeDevice ()");
|
||||
dlPhy->SetMobility (mm);
|
||||
@@ -555,7 +555,6 @@ LteHelper::InstallSingleUeDevice (Ptr<Node> n)
|
||||
dlPhy->SetLtePhyRxDataEndOkCallback (MakeCallback (&LteUePhy::PhyPduReceived, phy));
|
||||
dlPhy->SetLtePhyRxCtrlEndOkCallback (MakeCallback (&LteUePhy::ReceiveLteControlMessageList, phy));
|
||||
dlPhy->SetLtePhyRxPssCallback (MakeCallback (&LteUePhy::ReceivePss, phy));
|
||||
dlPhy->SetLtePhyRxMibCallback (MakeCallback (&LteUePhy::ReceiveMib, phy));
|
||||
dlPhy->SetLtePhyDlHarqFeedbackCallback (MakeCallback (&LteUePhy::ReceiveLteDlHarqFeedback, phy));
|
||||
nas->SetForwardUpCallback (MakeCallback (&LteUeNetDevice::Receive, dev));
|
||||
|
||||
|
||||
@@ -509,6 +509,12 @@ LteEnbPhy::StartFrame (void)
|
||||
NS_LOG_INFO ("-----frame " << m_nrFrames << "-----");
|
||||
m_nrSubFrames = 0;
|
||||
|
||||
// send MIB at beginning of every frame
|
||||
m_mib.systemFrameNumber = m_nrSubFrames;
|
||||
Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> ();
|
||||
mibMsg->SetMib (m_mib);
|
||||
m_controlMessagesQueue.at (0).push_back (mibMsg);
|
||||
|
||||
StartSubFrame ();
|
||||
}
|
||||
|
||||
@@ -682,18 +688,8 @@ LteEnbPhy::SendControlChannels (std::list<Ptr<LteControlMessage> > ctrlMsgList)
|
||||
{
|
||||
pss = true;
|
||||
}
|
||||
// send MIB at beginning of every frame
|
||||
bool mib = false;
|
||||
if (m_nrSubFrames == 1)
|
||||
{
|
||||
m_mib.systemFrameNumber = m_nrFrames;
|
||||
Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> ();
|
||||
mibMsg->SetMib (m_mib);
|
||||
ctrlMsgList.push_back (mibMsg);
|
||||
mib = true;
|
||||
}
|
||||
m_downlinkSpectrumPhy->StartTxDlCtrlFrame (ctrlMsgList, pss, mib, false);
|
||||
|
||||
m_downlinkSpectrumPhy->StartTxDlCtrlFrame (ctrlMsgList, pss);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -114,7 +114,6 @@ NS_OBJECT_ENSURE_REGISTERED (LteSpectrumPhy);
|
||||
|
||||
LteSpectrumPhy::LteSpectrumPhy ()
|
||||
: m_state (IDLE),
|
||||
m_cellId (0),
|
||||
m_transmissionMode (0),
|
||||
m_layersNum (1)
|
||||
{
|
||||
@@ -157,7 +156,6 @@ void LteSpectrumPhy::DoDispose ()
|
||||
m_ltePhyDlHarqFeedbackCallback = MakeNullCallback< void, DlInfoListElement_s > ();
|
||||
m_ltePhyUlHarqFeedbackCallback = MakeNullCallback< void, UlInfoListElement_s > ();
|
||||
m_ltePhyRxPssCallback = MakeNullCallback< void, uint16_t, Ptr<SpectrumValue> > ();
|
||||
m_ltePhyRxMibCallback = MakeNullCallback< void, uint16_t, std::list<Ptr<LteControlMessage> > > ();
|
||||
SpectrumPhy::DoDispose ();
|
||||
}
|
||||
|
||||
@@ -365,13 +363,6 @@ LteSpectrumPhy::SetLtePhyRxPssCallback (LtePhyRxPssCallback c)
|
||||
m_ltePhyRxPssCallback = c;
|
||||
}
|
||||
|
||||
void
|
||||
LteSpectrumPhy::SetLtePhyRxMibCallback (LtePhyRxMibCallback c)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_ltePhyRxMibCallback = c;
|
||||
}
|
||||
|
||||
void
|
||||
LteSpectrumPhy::SetLtePhyDlHarqFeedbackCallback (LtePhyDlHarqFeedbackCallback c)
|
||||
{
|
||||
@@ -481,15 +472,13 @@ LteSpectrumPhy::StartTxDataFrame (Ptr<PacketBurst> pb, std::list<Ptr<LteControlM
|
||||
}
|
||||
|
||||
bool
|
||||
LteSpectrumPhy::StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgList,
|
||||
bool pss, bool mib, bool sib1)
|
||||
LteSpectrumPhy::StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgList, bool pss)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << " PSS " << (uint16_t) pss
|
||||
<< " MIB " << (uint16_t) mib
|
||||
<< " SIB1 " << (uint16_t) sib1);
|
||||
NS_LOG_FUNCTION (this << " PSS " << (uint16_t)pss);
|
||||
NS_LOG_LOGIC (this << " state: " << m_state);
|
||||
|
||||
// m_phyTxStartTrace (pb);
|
||||
|
||||
|
||||
// m_phyTxStartTrace (pb);
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
@@ -525,8 +514,6 @@ LteSpectrumPhy::StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgLi
|
||||
txParams->psd = m_txPsd;
|
||||
txParams->cellId = m_cellId;
|
||||
txParams->pss = pss;
|
||||
txParams->mib = mib;
|
||||
txParams->sib1 = sib1;
|
||||
txParams->ctrlMsgList = ctrlMsgList;
|
||||
m_channel->StartTx (txParams);
|
||||
m_endTxEvent = Simulator::Schedule (DL_CTRL_DURATION, &LteSpectrumPhy::EndTx, this);
|
||||
@@ -745,7 +732,7 @@ LteSpectrumPhy::StartRxCtrl (Ptr<SpectrumSignalParameters> params)
|
||||
NS_FATAL_ERROR ("cannot RX while TX: according to FDD channel access, the physical layer for transmission cannot be used for reception");
|
||||
break;
|
||||
case RX_DATA:
|
||||
NS_FATAL_ERROR ("cannot RX control while receiving data");
|
||||
NS_FATAL_ERROR ("cannot RX data while receing control");
|
||||
break;
|
||||
case IDLE:
|
||||
case RX_CTRL:
|
||||
@@ -770,8 +757,19 @@ LteSpectrumPhy::StartRxCtrl (Ptr<SpectrumSignalParameters> params)
|
||||
cellId = lteUlSrsRxParams->cellId;
|
||||
dl = false;
|
||||
}
|
||||
|
||||
if (cellId == m_cellId)
|
||||
if (dl)
|
||||
{
|
||||
// check presence of PSS for UE measuerements
|
||||
if (lteDlCtrlRxParams->pss == true)
|
||||
{
|
||||
SpectrumValue pssPsd = *params->psd;
|
||||
if (!m_ltePhyRxPssCallback.IsNull ())
|
||||
{
|
||||
m_ltePhyRxPssCallback (cellId, params->psd);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cellId == m_cellId)
|
||||
{
|
||||
NS_LOG_LOGIC (this << " synchronized with this signal (cellId=" << cellId << ")");
|
||||
if (m_state == IDLE)
|
||||
@@ -799,67 +797,27 @@ LteSpectrumPhy::StartRxCtrl (Ptr<SpectrumSignalParameters> params)
|
||||
// should occur at the same time and have the same
|
||||
// duration, otherwise the interference calculation
|
||||
// won't be correct
|
||||
NS_ASSERT ((m_firstRxStart == Simulator::Now ())
|
||||
NS_ASSERT ((m_firstRxStart == Simulator::Now ())
|
||||
&& (m_firstRxDuration == params->duration));
|
||||
}
|
||||
|
||||
|
||||
ChangeState (RX_CTRL);
|
||||
m_interferenceCtrl->StartRx (params->psd);
|
||||
|
||||
// NS_LOG_LOGIC (this << " numSimultaneousRxEvents = " << m_rxPacketBurstList.size ());
|
||||
|
||||
} // end of if (m_state == IDLE)
|
||||
|
||||
// NS_LOG_LOGIC (this << " numSimultaneousRxEvents = " << m_rxPacketBurstList.size ());
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_LOGIC (this << " not in sync with this signal (cellId="
|
||||
<< cellId << ", m_cellId=" << m_cellId << ")");
|
||||
NS_LOG_LOGIC (this << " not in sync with this signal (cellId="
|
||||
<< cellId << ", m_cellId=" << m_cellId << ")");
|
||||
}
|
||||
|
||||
if (dl)
|
||||
{
|
||||
// check the presence of PSS for UE measurements
|
||||
if (lteDlCtrlRxParams->pss == true)
|
||||
{
|
||||
SpectrumValue pssPsd = *params->psd;
|
||||
if (!m_ltePhyRxPssCallback.IsNull ())
|
||||
{
|
||||
m_ltePhyRxPssCallback (cellId, params->psd);
|
||||
}
|
||||
}
|
||||
|
||||
// check the presence of MIB
|
||||
if ((lteDlCtrlRxParams->mib == true)
|
||||
&& !m_ltePhyRxMibCallback.IsNull ()
|
||||
&& ((m_cellId == cellId) || (m_cellId == 0)))
|
||||
{
|
||||
/*
|
||||
* i.e. if UE is attached, then only consider MIB which comes
|
||||
* from the serving cell. Else if UE is NOT attached, then
|
||||
* MIB from any cell is considered.
|
||||
*/
|
||||
Simulator::Schedule (params->duration,
|
||||
&LteSpectrumPhy::m_ltePhyRxMibCallback,
|
||||
this, cellId,
|
||||
lteDlCtrlRxParams->ctrlMsgList);
|
||||
/*
|
||||
* The upper layer will enforce a bandwidth change upon
|
||||
* receiving MIB, which will disturb the currently running RX
|
||||
* and interference calculation. That's why the above callback
|
||||
* is scheduled here, so that it will run after EndRxDlCtrl.
|
||||
*/
|
||||
}
|
||||
|
||||
} // end of if (dl)
|
||||
|
||||
} // end of case IDLE or RX_CTRL
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_FATAL_ERROR ("unknown state");
|
||||
break;
|
||||
|
||||
} // end of switch (m_state)
|
||||
default:
|
||||
NS_FATAL_ERROR ("unknown state");
|
||||
break;
|
||||
}
|
||||
|
||||
NS_LOG_LOGIC (this << " state: " << m_state);
|
||||
}
|
||||
|
||||
@@ -127,12 +127,6 @@ typedef Callback< void > LtePhyRxCtrlEndErrorCallback;
|
||||
*/
|
||||
typedef Callback< void, uint16_t, Ptr<SpectrumValue> > LtePhyRxPssCallback;
|
||||
|
||||
/**
|
||||
* This method is used by the LteSpectrumPhy to notify the UE PHY that an
|
||||
* MIB has been received
|
||||
*/
|
||||
typedef Callback< void, uint16_t, std::list<Ptr<LteControlMessage> > > LtePhyRxMibCallback;
|
||||
|
||||
|
||||
/**
|
||||
* This method is used by the LteSpectrumPhy to notify the PHY about
|
||||
@@ -234,15 +228,12 @@ public:
|
||||
*
|
||||
*
|
||||
* @param ctrlMsgList the burst of contrl messages to be transmitted
|
||||
* @param pss the flag for transmitting the Primary Synchronization Signal
|
||||
* @param mib the flag for transmitting the Master Information Block
|
||||
* @param sib1 the flag for transmitting the System Information Block Type 1
|
||||
* @param pss the flag for transmitting the primary synchronization signal
|
||||
*
|
||||
* @return true if an error occurred and the transmission was not
|
||||
* started, false otherwise.
|
||||
*/
|
||||
bool StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgList,
|
||||
bool pss, bool mib, bool sib1);
|
||||
bool StartTxDlCtrlFrame (std::list<Ptr<LteControlMessage> > ctrlMsgList, bool pss);
|
||||
|
||||
|
||||
/**
|
||||
@@ -280,7 +271,7 @@ public:
|
||||
* @param c the callback
|
||||
*/
|
||||
void SetLtePhyRxDataEndOkCallback (LtePhyRxDataEndOkCallback c);
|
||||
|
||||
|
||||
/**
|
||||
* set the callback for the successful end of a RX ctrl frame, as part
|
||||
* of the interconnections betweenthe LteSpectrumPhy and the PHY
|
||||
@@ -288,7 +279,7 @@ public:
|
||||
* @param c the callback
|
||||
*/
|
||||
void SetLtePhyRxCtrlEndOkCallback (LtePhyRxCtrlEndOkCallback c);
|
||||
|
||||
|
||||
/**
|
||||
* set the callback for the erroneous end of a RX ctrl frame, as part
|
||||
* of the interconnections betweenthe LteSpectrumPhy and the PHY
|
||||
@@ -305,14 +296,6 @@ public:
|
||||
*/
|
||||
void SetLtePhyRxPssCallback (LtePhyRxPssCallback c);
|
||||
|
||||
/**
|
||||
* set the callback for the reception of the MIB as part
|
||||
* of the interconnections between the LteSpectrumPhy and the UE PHY
|
||||
*
|
||||
* @param c the callback
|
||||
*/
|
||||
void SetLtePhyRxMibCallback (LtePhyRxMibCallback c);
|
||||
|
||||
/**
|
||||
* set the callback for the DL HARQ feedback as part of the
|
||||
* interconnections betweenthe LteSpectrumPhy and the PHY
|
||||
@@ -472,7 +455,6 @@ private:
|
||||
LtePhyRxCtrlEndOkCallback m_ltePhyRxCtrlEndOkCallback;
|
||||
LtePhyRxCtrlEndErrorCallback m_ltePhyRxCtrlEndErrorCallback;
|
||||
LtePhyRxPssCallback m_ltePhyRxPssCallback;
|
||||
LtePhyRxMibCallback m_ltePhyRxMibCallback;
|
||||
|
||||
Ptr<LteInterference> m_interferenceData;
|
||||
Ptr<LteInterference> m_interferenceCtrl;
|
||||
|
||||
@@ -97,13 +97,11 @@ LteSpectrumSignalParametersDlCtrlFrame::LteSpectrumSignalParametersDlCtrlFrame (
|
||||
}
|
||||
|
||||
LteSpectrumSignalParametersDlCtrlFrame::LteSpectrumSignalParametersDlCtrlFrame (const LteSpectrumSignalParametersDlCtrlFrame& p)
|
||||
: SpectrumSignalParameters (p)
|
||||
: SpectrumSignalParameters (p)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << &p);
|
||||
cellId = p.cellId;
|
||||
pss = p.pss;
|
||||
mib = p.mib;
|
||||
sib1 = p.sib1;
|
||||
ctrlMsgList = p.ctrlMsgList;
|
||||
}
|
||||
|
||||
@@ -117,7 +115,7 @@ LteSpectrumSignalParametersDlCtrlFrame::Copy ()
|
||||
// return Copy<LteSpectrumSignalParametersDlCtrlFrame> (this);
|
||||
// but it causes a double creation of the object, hence it is less efficient.
|
||||
// The solution below is copied from the implementation of Copy<> (Ptr<>) in ptr.h
|
||||
Ptr<LteSpectrumSignalParametersDlCtrlFrame> lssp (new LteSpectrumSignalParametersDlCtrlFrame (*this), false);
|
||||
Ptr<LteSpectrumSignalParametersDlCtrlFrame> lssp (new LteSpectrumSignalParametersDlCtrlFrame (*this), false);
|
||||
return lssp;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,27 +100,25 @@ struct LteSpectrumSignalParametersDataFrame : public SpectrumSignalParameters
|
||||
*/
|
||||
struct LteSpectrumSignalParametersDlCtrlFrame : public SpectrumSignalParameters
|
||||
{
|
||||
|
||||
|
||||
// inherited from SpectrumSignalParameters
|
||||
virtual Ptr<SpectrumSignalParameters> Copy ();
|
||||
|
||||
|
||||
/**
|
||||
* default constructor
|
||||
*/
|
||||
LteSpectrumSignalParametersDlCtrlFrame ();
|
||||
|
||||
|
||||
/**
|
||||
* copy constructor
|
||||
*/
|
||||
LteSpectrumSignalParametersDlCtrlFrame (const LteSpectrumSignalParametersDlCtrlFrame& p);
|
||||
|
||||
|
||||
std::list<Ptr<LteControlMessage> > ctrlMsgList; ///< control message list
|
||||
|
||||
uint16_t cellId; ///< cell ID of the eNodeB where the signal originates from
|
||||
bool pss; ///< true when this signal contains Primary Synchronization Signal
|
||||
bool mib; ///< true when the control message list contains Master Information Block
|
||||
bool sib1; ///< true when the control message list contains System Information Block Type 1
|
||||
std::list<Ptr<LteControlMessage> > ctrlMsgList;
|
||||
|
||||
uint16_t cellId;
|
||||
bool pss; // primary synchronization signal
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -825,9 +825,11 @@ LteUePhy::ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> > msgLi
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (msg->GetMessageType () == LteControlMessage::MIB)
|
||||
else if (msg->GetMessageType () == LteControlMessage::MIB)
|
||||
{
|
||||
// ignore
|
||||
NS_LOG_INFO ("received MIB");
|
||||
Ptr<MibLteControlMessage> msg2 = DynamicCast<MibLteControlMessage> (msg);
|
||||
m_ueCphySapUser->RecvMasterInformationBlock (msg2->GetMib ());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -869,22 +871,6 @@ LteUePhy::ReceivePss (uint16_t cellId, Ptr<SpectrumValue> p)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteUePhy::ReceiveMib (uint16_t cellId, std::list<Ptr<LteControlMessage> > ctrlMsgList)
|
||||
{
|
||||
std::list<Ptr<LteControlMessage> >::const_iterator it;
|
||||
for (it = ctrlMsgList.begin (); it != ctrlMsgList.end (); ++it)
|
||||
{
|
||||
if ((*it)->GetMessageType () == LteControlMessage::MIB)
|
||||
{
|
||||
NS_LOG_INFO ("received MIB from cellId=" << cellId);
|
||||
Ptr<MibLteControlMessage> msg = DynamicCast<MibLteControlMessage> (*it);
|
||||
m_ueCphySapUser->RecvMasterInformationBlock (msg->GetMib ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteUePhy::QueueSubChannelsForTransmission (std::vector <int> rbMap)
|
||||
{
|
||||
@@ -898,7 +884,7 @@ LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
NS_LOG_FUNCTION (this << frameNo << subframeNo);
|
||||
|
||||
NS_ASSERT_MSG (frameNo > 0, "the SRS index check code assumes that frameNo starts at 1");
|
||||
|
||||
|
||||
// refresh internal variables
|
||||
m_rsReceivedPowerUpdated = false;
|
||||
m_rsInterferencePowerUpdated = false;
|
||||
@@ -1019,20 +1005,6 @@ LteUePhy::DoReset ()
|
||||
m_sendSrsEvent.Cancel ();
|
||||
m_downlinkSpectrumPhy->Reset ();
|
||||
m_uplinkSpectrumPhy->Reset ();
|
||||
|
||||
// configure DL for receiving the BCH with the minimum bandwidth
|
||||
m_dlEarfcn = 100;
|
||||
m_dlBandwidth = 6;
|
||||
m_noiseFigure = 9.0;
|
||||
// TODO any better way to define those default values?
|
||||
Ptr<SpectrumValue> noisePsd =
|
||||
LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_dlEarfcn,
|
||||
m_dlBandwidth,
|
||||
m_noiseFigure);
|
||||
m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
|
||||
NS_ASSERT (m_downlinkSpectrumPhy->GetChannel () != 0);
|
||||
m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1044,11 +1016,11 @@ LteUePhy::DoSyncronizeWithEnb (uint16_t cellId, uint16_t dlEarfcn)
|
||||
m_downlinkSpectrumPhy->SetCellId (cellId);
|
||||
m_uplinkSpectrumPhy->SetCellId (cellId);
|
||||
|
||||
// configure DL for receiving the BCH with the minimum bandwidth
|
||||
// configure DL for receing the BCH with the minimum bandwith
|
||||
m_dlBandwidth = 6;
|
||||
Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_dlEarfcn, m_dlBandwidth, m_noiseFigure);
|
||||
m_downlinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
|
||||
m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy);
|
||||
m_downlinkSpectrumPhy->GetChannel ()->AddRx (m_downlinkSpectrumPhy);
|
||||
|
||||
m_dlConfigured = false;
|
||||
m_ulConfigured = false;
|
||||
|
||||
@@ -179,7 +179,8 @@ public:
|
||||
// callbacks for LteSpectrumPhy
|
||||
virtual void ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> >);
|
||||
virtual void ReceivePss (uint16_t cellId, Ptr<SpectrumValue> p);
|
||||
virtual void ReceiveMib (uint16_t cellId, std::list<Ptr<LteControlMessage> > ctrlMsgList);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -187,9 +187,6 @@ LteUeRrc::GetTypeId (void)
|
||||
UintegerValue (0), // unused, read-only attribute
|
||||
MakeUintegerAccessor (&LteUeRrc::GetRnti),
|
||||
MakeUintegerChecker<uint16_t> ())
|
||||
.AddTraceSource ("MasterInformationBlockReceived",
|
||||
"trace fired upon reception of MIB (typically every 10 ms)",
|
||||
MakeTraceSourceAccessor (&LteUeRrc::m_mibReceivedTrace))
|
||||
.AddTraceSource ("StateTransition",
|
||||
"trace fired upon every UE RRC state transition",
|
||||
MakeTraceSourceAccessor (&LteUeRrc::m_stateTransitionTrace))
|
||||
@@ -208,7 +205,7 @@ LteUeRrc::GetTypeId (void)
|
||||
.AddTraceSource ("HandoverEndOk",
|
||||
"trace fired upon successful termination of a handover procedure",
|
||||
MakeTraceSourceAccessor (&LteUeRrc::m_handoverEndOkTrace))
|
||||
;
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
|
||||
@@ -358,7 +355,7 @@ LteUeRrc::DoInitialize (void)
|
||||
rlc->SetRnti (m_rnti);
|
||||
rlc->SetLcId (lcid);
|
||||
|
||||
m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
|
||||
m_srb0 = CreateObject<LteSignalingRadioBearerInfo> ();
|
||||
m_srb0->m_rlc = rlc;
|
||||
m_srb0->m_srbIdentity = 0;
|
||||
LteUeRrcSapUser::SetupParameters ueParams;
|
||||
@@ -538,11 +535,9 @@ void
|
||||
LteUeRrc::DoRecvMasterInformationBlock (LteRrcSap::MasterInformationBlock msg)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
// TODO may speed up a bit if only execute the following when bandwidth changes?
|
||||
m_dlBandwidth = msg.dlBandwidth;
|
||||
m_cphySapProvider->SetDlBandwidth (msg.dlBandwidth);
|
||||
m_receivedMib = true;
|
||||
m_mibReceivedTrace (m_imsi, m_cellId, m_rnti);
|
||||
if (m_state == IDLE_WAIT_SYSTEM_INFO && m_receivedMib && m_receivedSib2)
|
||||
{
|
||||
SwitchToState (IDLE_CAMPED_NORMALLY);
|
||||
|
||||
@@ -332,8 +332,6 @@ private:
|
||||
uint16_t m_dlEarfcn; /**< downlink carrier frequency */
|
||||
uint16_t m_ulEarfcn; /**< uplink carrier frequency */
|
||||
|
||||
// imsi cellid rnti
|
||||
TracedCallback<uint64_t, uint16_t, uint16_t> m_mibReceivedTrace;
|
||||
// imsi cellid rnti
|
||||
TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
|
||||
// imsi cellid rnti
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 University of Jyväskylä
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Budiarto Herman <buherman@student.jyu.fi>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lte-test-cell-selection.h"
|
||||
|
||||
#include <ns3/simulator.h>
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/boolean.h>
|
||||
|
||||
#include <ns3/mobility-helper.h>
|
||||
#include <ns3/lte-helper.h>
|
||||
#include <ns3/epc-helper.h>
|
||||
#include <ns3/internet-stack-helper.h>
|
||||
#include <ns3/point-to-point-helper.h>
|
||||
#include <ns3/ipv4-address-helper.h>
|
||||
#include <ns3/ipv4-static-routing-helper.h>
|
||||
|
||||
#include <ns3/node-container.h>
|
||||
#include <ns3/net-device-container.h>
|
||||
#include <ns3/ipv4-interface-container.h>
|
||||
|
||||
#include <ns3/lte-enb-net-device.h>
|
||||
#include <ns3/lte-ue-net-device.h>
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("LteCellSelectionTest");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
/*
|
||||
* Test Suite
|
||||
*/
|
||||
|
||||
|
||||
LteCellSelectionTestSuite::LteCellSelectionTestSuite ()
|
||||
: TestSuite ("lte-cell-selection", SYSTEM)
|
||||
{
|
||||
LogComponentEnableAll (LOG_PREFIX_ALL);
|
||||
LogComponentEnable ("LteCellSelectionTest", LOG_FUNCTION);
|
||||
// LogComponentEnable ("LteUePhy", LOG_INFO);
|
||||
// LogComponentEnable ("LteEnbPhy", LOG_FUNCTION);
|
||||
// LogComponentEnable ("LteSpectrumPhy", LOG_FUNCTION);
|
||||
|
||||
std::vector<LteCellSelectionTestCase::UeSetup_t> x;
|
||||
|
||||
x.clear ();
|
||||
x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (0, 0, 0), 0, 0, 1));
|
||||
AddTestCase (new LteCellSelectionTestCase ("First test with EPC", true, x),
|
||||
TestCase::QUICK);
|
||||
|
||||
x.clear ();
|
||||
x.push_back (LteCellSelectionTestCase::UeSetup_t (Vector (0, 0, 0), 0, 0, 1));
|
||||
AddTestCase (new LteCellSelectionTestCase ("First test without EPC", false, x),
|
||||
TestCase::QUICK);
|
||||
|
||||
} // end of LteCellSelectionTestSuite::LteCellSelectionTestSuite ()
|
||||
|
||||
|
||||
static LteCellSelectionTestSuite g_lteCellSelectionTestSuite;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Test Case
|
||||
*/
|
||||
|
||||
|
||||
LteCellSelectionTestCase::UeSetup_t::UeSetup_t (Vector position,
|
||||
uint32_t plmnIdentity,
|
||||
uint32_t csgIdentity,
|
||||
uint16_t expectedCellId)
|
||||
: position (position), plmnIdentity (plmnIdentity), csgIdentity (csgIdentity),
|
||||
expectedCellId (expectedCellId)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LteCellSelectionTestCase::LteCellSelectionTestCase (
|
||||
std::string name, bool isEpcMode, std::vector<UeSetup_t> ueSetupList)
|
||||
: TestCase (name), m_isEpcMode (isEpcMode), m_ueSetupList (ueSetupList)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << GetName ());
|
||||
}
|
||||
|
||||
|
||||
LteCellSelectionTestCase::~LteCellSelectionTestCase ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this << GetName ());
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteCellSelectionTestCase::DoRun ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this << GetName ());
|
||||
|
||||
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
|
||||
lteHelper->SetAttribute ("PathlossModel",
|
||||
StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (true));
|
||||
|
||||
/*
|
||||
* The topology is the following:
|
||||
*
|
||||
* <--x eNodeB 2 - Both cells are separated by 10 m
|
||||
* | - Parabolic antenna model is used
|
||||
* | 10 m - eNodeB 1 at (0, 10, 0) is facing east
|
||||
* | - eNodeB 2 at (0, 20, 0) is facing west
|
||||
* eNodeB 1 x--> - UEs are placed according to input
|
||||
* - UEs do not move during simulation
|
||||
*/
|
||||
|
||||
// Create Nodes: eNodeB
|
||||
NodeContainer enbNodes;
|
||||
enbNodes.Create (2);
|
||||
|
||||
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
|
||||
positionAlloc->Add (Vector (0.0, 10.0, 0.0));
|
||||
positionAlloc->Add (Vector (0.0, 20.0, 0.0));
|
||||
|
||||
MobilityHelper mobility;
|
||||
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
|
||||
mobility.SetPositionAllocator (positionAlloc);
|
||||
mobility.Install (enbNodes);
|
||||
|
||||
// Create Nodes: UE
|
||||
NodeContainer ueNodes;
|
||||
uint16_t nUe = m_ueSetupList.size ();
|
||||
ueNodes.Create (nUe);
|
||||
|
||||
std::vector<UeSetup_t>::const_iterator it;
|
||||
for (it = m_ueSetupList.begin (); it != m_ueSetupList.end (); it++)
|
||||
{
|
||||
positionAlloc->Add (it->position);
|
||||
}
|
||||
|
||||
mobility.Install (ueNodes);
|
||||
|
||||
// Create Devices and install them in the Nodes (eNB and UE)
|
||||
NetDeviceContainer enbDevs;
|
||||
NetDeviceContainer ueDevs;
|
||||
enbDevs = lteHelper->InstallEnbDevice (enbNodes);
|
||||
ueDevs = lteHelper->InstallUeDevice (ueNodes);
|
||||
|
||||
// Set the PLMN and CSG ID
|
||||
for (it = m_ueSetupList.begin (); it != m_ueSetupList.end (); it++)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
if (m_isEpcMode)
|
||||
{
|
||||
Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
|
||||
lteHelper->SetEpcHelper (epcHelper);
|
||||
|
||||
// Create P-GW node
|
||||
Ptr<Node> pgw = epcHelper->GetPgwNode ();
|
||||
|
||||
// Create a single RemoteHost
|
||||
NodeContainer remoteHostContainer;
|
||||
remoteHostContainer.Create (1);
|
||||
Ptr<Node> remoteHost = remoteHostContainer.Get (0);
|
||||
InternetStackHelper internet;
|
||||
internet.Install (remoteHostContainer);
|
||||
|
||||
// Create the Internet
|
||||
PointToPointHelper p2ph;
|
||||
p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
|
||||
p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
|
||||
p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
|
||||
NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
|
||||
Ipv4AddressHelper ipv4h;
|
||||
ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
|
||||
Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
|
||||
|
||||
// Routing of the Internet Host (towards the LTE network)
|
||||
Ipv4StaticRoutingHelper ipv4RoutingHelper;
|
||||
Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
|
||||
remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
|
||||
|
||||
// Install the IP stack on the UEs
|
||||
internet.Install (ueNodes);
|
||||
Ipv4InterfaceContainer ueIpIfaces;
|
||||
ueIpIfaces = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueDevs));
|
||||
|
||||
// Assign IP address to UEs
|
||||
for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
|
||||
{
|
||||
Ptr<Node> ueNode = ueNodes.Get (u);
|
||||
// Set the default gateway for the UE
|
||||
Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
|
||||
ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
|
||||
}
|
||||
|
||||
} // end of if (m_isEpcMode)
|
||||
else
|
||||
{
|
||||
// // TODO remove this
|
||||
// lteHelper->Attach (ueDevs, enbDevs.Get (0));
|
||||
//
|
||||
// // Activate an EPS bearer
|
||||
// enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
|
||||
// EpsBearer bearer (q);
|
||||
// lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
|
||||
}
|
||||
|
||||
// Connect to trace sources in UEs
|
||||
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/MasterInformationBlockReceived",
|
||||
MakeCallback (&LteCellSelectionTestCase::MasterInformationBlockReceivedCallback,
|
||||
this));
|
||||
|
||||
// Run simulation
|
||||
Simulator::Stop (MilliSeconds (20));
|
||||
Simulator::Run ();
|
||||
Simulator::Destroy ();
|
||||
|
||||
// Tests
|
||||
|
||||
// TODO
|
||||
|
||||
} // end of void LteCellSelectionTestCase::DoRun ()
|
||||
|
||||
|
||||
void
|
||||
LteCellSelectionTestCase::MasterInformationBlockReceivedCallback (
|
||||
std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << context << imsi << cellId << rnti);
|
||||
}
|
||||
|
||||
|
||||
} // end of namespace ns3
|
||||
@@ -1,104 +0,0 @@
|
||||
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2013 University of Jyväskylä
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Budiarto Herman <buherman@student.jyu.fi>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LTE_TEST_CELL_SELECTION_H
|
||||
#define LTE_TEST_CELL_SELECTION_H
|
||||
|
||||
#include <ns3/test.h>
|
||||
#include <ns3/node-container.h>
|
||||
#include <ns3/vector.h>
|
||||
#include <vector>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Test suite for executing the cell selection test cases in without-EPC
|
||||
* and with-EPC scenarios.
|
||||
*
|
||||
* \sa ns3::LteCellSelectionTestCase
|
||||
*/
|
||||
class LteCellSelectionTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
LteCellSelectionTestSuite ();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Testing the initial cell selection procedure by UE at IDLE state in
|
||||
* the beginning of simulation.
|
||||
*/
|
||||
class LteCellSelectionTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief A set of input parameters for setting up a UE in the simulation.
|
||||
*/
|
||||
struct UeSetup_t
|
||||
{
|
||||
Vector position; ///< The position where the UE will be spawned in the simulation.
|
||||
uint32_t plmnIdentity; ///< Public Land Mobile Network identity of the UE.
|
||||
uint32_t csgIdentity; ///< Closed Subscriber Group identity of the UE.
|
||||
uint16_t expectedCellId; ///< The cell ID that the UE is expected to attach to (0 means that the UE should not attach to any cell).
|
||||
UeSetup_t (Vector position, uint32_t plmnIdentity, uint32_t csgIdentity,
|
||||
uint16_t expectedCellId);
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Creates an instance of the initial cell selection test case.
|
||||
* \param name name of this test
|
||||
* \param isEpcMode set to true for setting up simulation with EPC enabled
|
||||
* \param ueSetupList an array of UE setup parameters
|
||||
*/
|
||||
LteCellSelectionTestCase (std::string name, bool isEpcMode,
|
||||
std::vector<UeSetup_t> ueSetupList);
|
||||
|
||||
virtual ~LteCellSelectionTestCase ();
|
||||
|
||||
private:
|
||||
/**
|
||||
* \brief Setup the simulation according to the configuration set by the
|
||||
* class constructor, run it, and verify the result.
|
||||
*/
|
||||
virtual void DoRun ();
|
||||
|
||||
void MasterInformationBlockReceivedCallback (std::string context,
|
||||
uint64_t imsi, uint16_t cellId,
|
||||
uint16_t rnti);
|
||||
|
||||
/**
|
||||
* \brief If true, then the simulation should be set up with EPC enabled.
|
||||
*/
|
||||
bool m_isEpcMode;
|
||||
|
||||
/**
|
||||
* \brief The list of UE setups to be used during the test execution.
|
||||
*/
|
||||
std::vector<UeSetup_t> m_ueSetupList;
|
||||
|
||||
}; // end of class LteCellSelectionTestCase
|
||||
|
||||
|
||||
} // end of namespace ns3
|
||||
|
||||
|
||||
#endif /* LTE_TEST_CELL_SELECTION_H */
|
||||
@@ -142,7 +142,6 @@ def build(bld):
|
||||
'test/test-lte-x2-handover-measures.cc',
|
||||
'test/test-asn1-encoding.cc',
|
||||
'test/lte-test-ue-measurements.cc',
|
||||
'test/lte-test-cell-selection.cc',
|
||||
'test/test-lte-handover-delay.cc',
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user