Hi Hongyu,
I did not investigated on the issue further. However the current LTE module supports only RRC connected state (and the ones to reach it), in order to correctly model disconnection an IDLE state should be added (as well as other things as paging for example).
Michele
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/nvbQBGUa0x8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
void deAttach(Ptr<NetDevice> ueDev, Ptr<NetDevice> enbDev)
{
// note: only 1 eNB in this scenario
Ptr<LteUeNetDevice> ueLteDevice = ueDev->GetObject<LteUeNetDevice> ();
Ptr<LteEnbNetDevice> enbDevice = enbDev->GetObject<LteEnbNetDevice>();
// get some info
uint16_t rnti = ueLteDevice->GetRrc()->GetRnti();
std::cout<<"rnti................"<<(uint32_t)rnti<<"\n";
uint16_t cellId = ueLteDevice->GetRrc()->GetCellId();
NS_LOG_UNCOND("The UE rnti is " << rnti << " and the cellId is " << cellId);
uint16_t enb_cellId = enbDevice->GetCellId();
NS_LOG_UNCOND("The ENB cellId is " << enb_cellId);
// remove the user from the eNB
Ptr<LteEnbRrc> enbRrc = enbDevice->GetRrc();
Ptr<LteEnbMac> enbMac = enbDevice->GetMac();
Ptr<UeManager> ueMag = enbRrc-> GetUeManager (rnti);
//enum sta = ueMag->GetState ();
//enbMac-> GetLteEnbCmacSapProvider ()-> ReleaseLc( rnti, 1 );
Ptr<LteUeRrc> ueRrc = ueLteDevice->GetRrc(); // optimize this call
std::cout<<"At time "<< Simulator::Now().GetSeconds() << "s UE start to Disconnect to ENB "<<"\n";
//enbRrc->RemoveUe( rnti );
ueRrc->GetAsSapProvider()->Disconnect(); // now in IDLE_CAMPED_NORMALLY
}