dispose SRB1 in a separate event rather than in LteUeRrc::DoRecvRrcConnectionReconfiguration

This commit is contained in:
Nicola Baldo
2012-12-18 11:28:48 +01:00
parent c9d6773fda
commit 69d650520e
3 changed files with 21 additions and 1 deletions

View File

@@ -24,6 +24,7 @@
#include <ns3/object-factory.h>
#include <ns3/node-list.h>
#include <ns3/node.h>
#include <ns3/simulator.h>
#include "lte-ue-rrc.h"
#include "lte-enb-rrc.h"
@@ -629,7 +630,15 @@ LteUeRrc::DoRecvRrcConnectionReconfiguration (LteRrcSap::RrcConnectionReconfigur
m_cphySapProvider->SetRnti (m_rnti);
m_lastRrcTransactionIdentifier = msg.rrcTransactionIdentifier;
NS_ASSERT (msg.haveRadioResourceConfigDedicated);
m_srb1 = 0; // dispose SRB1
// we re-establish SRB1 by creating a new entity
// note that we can't dispose the old entity now, because
// it's in the current stack, so we would corrupt the stack
// if we did so. Hence we schedule it for later disposal
m_srb1Old = m_srb1;
Simulator::ScheduleNow (&LteUeRrc::DisposeOldSrb1, this);
m_srb1 = 0; // new instance will be be created within ApplyRadioResourceConfigDedicated
m_drbMap.clear (); // dispose all DRBs
ApplyRadioResourceConfigDedicated (msg.radioResourceConfigDedicated);
// RRC connection reconfiguration completed will be sent
@@ -903,6 +912,12 @@ LteUeRrc::LeaveConnectedMode ()
SwitchToState (IDLE_CAMPED_NORMALLY);
}
void
LteUeRrc::DisposeOldSrb1 ()
{
NS_LOG_FUNCTION (this);
m_srb1Old = 0;
}
uint8_t
LteUeRrc::Bid2Drbid (uint8_t bid)

View File

@@ -260,6 +260,7 @@ private:
void ApplyRadioResourceConfigDedicated (LteRrcSap::RadioResourceConfigDedicated rrcd);
void StartConnection ();
void LeaveConnectedMode ();
void DisposeOldSrb1 ();
uint8_t Bid2Drbid (uint8_t bid);
void SwitchToState (State s);
@@ -288,6 +289,7 @@ private:
Ptr<LteSignalingRadioBearerInfo> m_srb0;
Ptr<LteSignalingRadioBearerInfo> m_srb1;
Ptr<LteSignalingRadioBearerInfo> m_srb1Old;
std::map <uint8_t, Ptr<LteDataRadioBearerInfo> > m_drbMap;
bool m_useRlcSm;

View File

@@ -141,6 +141,7 @@ LteX2HandoverTestCase::DoRun ()
{
NS_LOG_FUNCTION (this << BuildNameString (m_nUes, m_nDedicatedBearers, m_handoverEventListName, m_useUdp, m_schedulerType, m_admitHo, m_useIdealRrc));
Config::Reset ();
Config::SetDefault ("ns3::UdpClient::Interval", TimeValue (MilliSeconds(100)));
Config::SetDefault ("ns3::UdpClient::MaxPackets", UintegerValue(1000000));
Config::SetDefault ("ns3::UdpClient::PacketSize", UintegerValue(100));
@@ -613,6 +614,8 @@ LteX2HandoverTestSuite::LteX2HandoverTestSuite ()
hel7.push_back (ue2fwd);
hel7.push_back (ue2bwd);
AddTestCase (new LteX2HandoverTestCase ( 1, 0, hel1, hel1name, true, "ns3::RrFfMacScheduler", true, false));
std::vector<std::string> schedulers;
schedulers.push_back ("ns3::RrFfMacScheduler");
schedulers.push_back ("ns3::PfrFfMacScheduler");