Remove Ue

861 views
Skip to first unread message

Vincenzo Rea

unread,
Jul 12, 2012, 12:18:07 PM7/12/12
to ns-3-...@googlegroups.com
Hi guys,
 my question is very simple, how can I remove an Ue from my scenario?

I'm using this command                            Simulator::Schedule(Seconds(1.5), DeAttachUe, ueDevs.Get(0)); 

that means at 1.5sec of SimulationTime, the function DeAttachUe will be executed.

The function is

void
DeAttachUe (Ptr<NetDevice> ueDev) 
{
    Ptr<LteUeNetDevice> ueLteDevice = ueDev->GetObject<LteUeNetDevice> ();
   
    uint16_t rnti = ueLteDevice->GetRrc()->GetRnti();
   
    Ptr<LteEnbNetDevice> enbLteDevice = ueLteDevice->GetTargetEnb();
    Ptr<LteEnbRrc> enbRrc = enbLteDevice->GetRrc();

    enbRrc->ReleaseRadioBearer ( rnti , 1);   //where 1 is the LC_id, I assume that there is only 1 LC for each user
    enbRrc->RemoveUe( rnti );

}

but I got this error:
msg="missing RemoveUe method in CMAC SAP", file=../src/lte/model/lte-enb-rrc.cc, line=345
terminate called without an active exception

Can somebody help me, plz?
Message has been deleted

Vincenzo Rea

unread,
Jul 13, 2012, 5:56:48 AM7/13/12
to ns-3-...@googlegroups.com
I updated my function adding a couple of lines

void
DeAttachUe (Ptr<NetDevice> ueDev) //, Ptr<NetDevice> enbDev, Ptr<LteHelper> lteHelper)


{
Ptr<LteUeNetDevice> ueLteDevice = ueDev->GetObject<LteUeNetDevice> ();
uint16_t rnti = ueLteDevice->GetRrc()->GetRnti();
Ptr<LteEnbNetDevice> enbDevice = ueLteDevice->GetTargetEnb();
Ptr<LteEnbRrc> enbRrc = enbDevice->GetRrc();
Ptr<LteEnbMac> enbMac = enbDevice->GetMac();
// Ptr<LteEnbCmacSapUser> LteEnbCmacSapUs =

enbMac-> GetLteEnbCmacSapProvider ()-> ReleaseLc( rnti, 1);


enbRrc->ReleaseRadioBearer ( rnti , 1);
enbRrc->RemoveUe( rnti );
}

Now the error is

msg="not implemented", file=../src/lte/model/lte-enb-mac.cc, line=693


terminate called without an active exception
from the LOG_MESSAGE in this file: lte-enb-mac.cc
void
LteEnbMac::DoReleaseLc (uint16_t rnti, uint8_t lcid)
{
NS_FATAL_ERROR ("not implemented");
}

Other ideas for interrupting the transmission? For example, may I set the the attribute "m_maxTxBufferSize" to zero in the class LteRlcUm? How can I do it, I don't see any pointer to this class..

Jordan Mihaylov

unread,
Jul 20, 2012, 4:26:20 AM7/20/12
to ns-3-...@googlegroups.com
Hi Vincenzo!

Do you have any progress on the UE-deattach procedure?

As I'm very intrested in this feature I'd like to help as much as I can.

I assume you had a look over the LteHelper::Attach(...) method and tried to reverese it. That's what I had in mind too : ) but it doesn't seem trivial at all.

Lets summarize the steps needed to perform. And please correct me when I make a mistake:
  1. get eNB the UE attached to
  2. get RNTI of the UE
  3. get RRC of the eNB
  4. get EnbMac of the eNB
  5. (I guess we can skip reconfiguring the RRC on the UE side, as we are destroying it.)
  6. (Also skip removing the target eNB.)
  7. Invoke ReleaseRadioBearer(...) offered by the RRC
  8. get the EnbCmacSapProvider offered by the EnbMac
  9. Release the logical channel: invoke the ReleaseLc(...) of EnbCmacSapProvider (NOT IMPLEMENTED)! Actually the whole "lte-enb-cmac-sap.cc" is blank, which explains your error...
  10. Invoke RemoveUe offered by the RRC -> seems unimplemented & throws exception (missing RemoveUe method in CMAC SAP)
  11. get PHY of the eNB
  12. remove UE form the PHY channel: Invoke LteEnbPhy::DeleteUePhy(RNTI)
  13. Dispose UE

Let's first discuss and fix/reorder this algorithm. Any input will be highly appreciated!

Kind Regards

Jordan

Nicola Baldo

unread,
Jul 21, 2012, 4:13:25 AM7/21/12
to ns-3-...@googlegroups.com
Hi Jordan,


On Friday, July 20, 2012 10:26:20 AM UTC+2, Jordan Mihaylov wrote:

Release the logical channel: invoke the ReleaseLc(...) of EnbCmacSapProvider (NOT IMPLEMENTED)!

yes it's one of the several missing things, but maybe if you implement RemoveUe properly (i.e., making it remove all active LCs) you don't actually need this.
 

Actually the whole "lte-enb-cmac-sap.cc" is blank, which explains your error...

no that's not correct. LteEnbCmacSapUser/Provider are just abstract base classes defining the CMAC SAP interface at the eNB. You'll find implementations of these interfaces in lte-enb-rrc.cc and lte-enb-mac.cc, respectively.


Invoke RemoveUe offered by the RRC -> seems unimplemented & throws exception (missing RemoveUe method in CMAC SAP)

this is something you would need to implement.

 
Dispose UE

why? Attach() does not create UEs, so I would suggest that an eventual Detach() should not dispose them.


 

Konstantinos

unread,
Aug 21, 2012, 4:10:20 PM8/21/12
to ns-3-...@googlegroups.com
Hi guys,

Do you have any update on this. I would like to use the DeAttach() method so as to implement a simple handover algorithm. 
Or if you are aware of any other handover implementation it would be nice to have.

With a quick search in the list I read that the LENA should have some handover implemented.

Thanks
Konstantinos

Vincenzo Rea

unread,
Aug 28, 2012, 6:41:06 AM8/28/12
to ns-3-...@googlegroups.com
What I've done is dequeuing the packets in the pdcp, rlc and mac layers using a brute approach. I modified the classes LteUeNetDevice and LteEnbNetDevice and for sure my solution will be never candidated to be a standard solution. I needed a solution that i could realize in a reasonable time and at same time works.

Vincenzo Rea

unread,
Aug 28, 2012, 6:45:02 AM8/28/12
to ns-3-...@googlegroups.com
Also, my code is available and who wants can request it to me.

2012/8/28 Vincenzo Rea <vincen...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/U3vz39allQQJ.

To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.



--
Vincenzo

Yue LI

unread,
Aug 2, 2013, 5:45:14 AM8/2/13
to ns-3-...@googlegroups.com
Hello,

I'm doing the work on controlling to attach a UE to an eNb at a given time and deattach it after several ms. I think your code can help me a lot. I hope that one year later, you still have this available code. Please send it to my gmail and explain a little. It's urgent and important to me. Thank you!!

Vincenzo Rea

unread,
Aug 2, 2013, 1:37:46 PM8/2/13
to ns-3-...@googlegroups.com

Oh, yes, I still have the code. I'm coming back from my vacation on next Monday and I'll be able to send you the code.
Cheers,
VR

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/1BphTA3Y1jY/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 http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rabeb ben amor

unread,
Aug 3, 2013, 9:55:54 AM8/3/13
to ns-3-...@googlegroups.com
Hi
I am working on handover in LTE using ns3 and I need help.  I am beginner with this simulator and I think your code will helpful for me,can you  please send it to my gmail and explain a little. thank you !!

Vincenzo Rea

unread,
Aug 3, 2013, 10:09:50 AM8/3/13
to ns-3-...@googlegroups.com

Since people who need the "handover code" are increasing, i'll share it in a public folder..

--

Vincenzo Rea

unread,
Aug 5, 2013, 10:08:55 AM8/5/13
to ns-3-...@googlegroups.com
Hi guys,
 here my code:


I sincerly hope that my work can help someone. My module, basically, erases a Ue during its movement (and its download) and substitutes it with a new Ue who continues the previous download activity.

Please feedback and let's discuss about improvements ;)
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
Message has been deleted

Rabeb ben amor

unread,
Aug 5, 2013, 12:29:22 PM8/5/13
to ns-3-...@googlegroups.com
Hi,thanks for sharing your work but I have a  little question: I'm using LENA M6 for LTE, so i wonder if it is possible to replace the folders that you mentioned  in your work. thank you 
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Vincenzo Rea

unread,
Aug 5, 2013, 1:18:15 PM8/5/13
to ns-3-...@googlegroups.com
You should try and let us know...


2013/8/5 Rabeb ben amor <rabeb...@gmail.com>



--
Vincenzo Rea

Rabeb ben amor

unread,
Aug 7, 2013, 4:29:10 AM8/7/13
to ns-3-...@googlegroups.com
Hi, I replaced, the files as you explained and I executed this command :./waf --enable-examples --enable-tests --enable-sudo, so I got this msg:
In file included from ./ns3/propagation-loss-model.h:34:0,
                 from ./ns3/lte-ue-net-device.h:37,
                 from ./ns3/animation-interface.h:38,
                 from ./ns3/netanim-module.h:11,
                 from ../examples/tcp/star.cc:20:
./ns3/lte-enb-phy.h:328:18: erreur: ‘PhyTransmissionStatParameters’ was not declared in this scope
./ns3/lte-enb-phy.h:328:47: erreur: patron de l'argument 1 est invalide
In file included from ./ns3/propagation-loss-model.h:34:0,
                 from ./ns3/lte-ue-net-device.h:37,
                 from ./ns3/animation-interface.h:38,
                 from ./ns3/netanim-module.h:11,
                 from ../examples/matrix-topology/matrix-topology.cc:55:
./ns3/lte-enb-phy.h:328:18: erreur: ‘PhyTransmissionStatParameters’ was not declared in this scope
./ns3/lte-enb-phy.h:328:47: erreur: patron de l'argument 1 est invalide
Waf: Leaving directory `/home/user/workspace1/lena/build'
Build failed
 -> task in 'star' failed (exit status 1):
    {task 171975436: cxx star.cc -> star.cc.5.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/i386-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/glib-2.0', '-I/usr/lib/i386-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', '../examples/tcp/star.cc', '-c', '-o', 'examples/tcp/star.cc.5.o']
 -> task in 'matrix-topology' failed (exit status 1):
    {task 171952204: cxx matrix-topology.cc -> matrix-topology.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/i386-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/glib-2.0', '-I/usr/lib/i386-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', '../examples/matrix-topology/matrix-topology.cc', '-c', '-o', 'examples/matrix-topology/matrix-topology.cc.1.o']
I think there is need to modify somthing to make it work :)

Rabeb ben amor

unread,
Sep 9, 2013, 8:04:35 AM9/9/13
to ns-3-...@googlegroups.com
Hi, thanks so much. About the module that you sent to me last time, I tried to understand your code  and I found that some functions are developed already with lena module, so I think I can use them in stead of those in your module, so I will not need to replace the files of source code. It's not simple as I thought but I'll keep trying. thanks a lot for your great help and sorry for my "poor English" .

Best Regards.

Le lundi 9 septembre 2013 12:58:23 UTC+2, Vincenzo Rea a écrit :
I didn't try the improvements of ns3-.18, anyway about my code try this command:


./waf --run "scratch/handover-map --lambda=3.0 --SimulationTime=50 --NumberOfUsers=50 --PrefixStatsFile=50i" > log27.out 2>&1

using the attached files stored in scratch

Vincenzo Rea

unread,
Sep 23, 2013, 4:15:07 AM9/23/13
to ns-3-...@googlegroups.com
Use ns-3.14 only

Nitish Rajoria

unread,
Jun 6, 2014, 1:34:31 PM6/6/14
to ns-3-...@googlegroups.com
Hi Vincenzo Rea ,

Could you please tell me How did you call RemoveUE function and where you called it also If you can send me that code file will be helpful for me. 


Thanks 
Nitish Rajoria
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Vincenzo Rea

unread,
Jun 7, 2014, 12:44:31 PM6/7/14
to ns-3-...@googlegroups.com
Hi Nitish, 

the files are at this link:


Consider that you must use NS-3.13 otherwise my code won't work. Also, please read the Readme file. I want to tell you that NS-3.18 does handover. For further info, please write me again :)

Kind regards,

     Vincenzo REA

Mobile: +353 831792240 (Ireland)
Skype: vincenzo_rea


For more options, visit https://groups.google.com/d/optout.

Nitish Rajoria

unread,
Jun 10, 2014, 6:49:12 PM6/10/14
to ns-3-...@googlegroups.com
Hi Vincenzo REA,

I am working on ns-3.19, basically i just need if I want to de-attach a user after some time who is sending data to RH, and again he will attach to same eNB after some time. For that what should I do. I think you can help me in this.

Thanks
--Nitish Rajoria
 

Vincenzo Rea

unread,
Jun 10, 2014, 7:08:20 PM6/10/14
to ns-3-...@googlegroups.com

Hi Nitish, I think my code can help you a lot, but as I said before, it works only with ns 3.13, replacing the files with the ones you can find in the link. On the other hand, you can still work on ns 3.19, hence using my code to figure out how I did the RemoveUe. It is quite complex, I know, and unluckly there is no futher documentation. I worked on that in July 2012 but I remember deAttaching a Ue affects propagation loss models, mobility models, rlc, mac layers of both enb and ue. What I suggest is look at my code, wherever you read "marker", those are the changes I did. Then, try to understand my methodology, all the classes involved, attibutes and methods I have added  and at the end built your own solution for ns 3.19. I know, it can take a month...

Marios Me

unread,
Apr 20, 2015, 10:21:36 AM4/20/15
to ns-3-...@googlegroups.com
Hi guys ,

I am using ns3 3.21 version and I want to detach a ue from an enb and to attach it to another in my simulation !!! As I'm newbie to ns3 could you give some advice or a tutorial how can I figure out it ?

Kind Regards,

Marios.

Vincenzo Rea

unread,
Sep 9, 2013, 6:58:23 AM9/9/13
to ns-3-...@googlegroups.com
I didn't try the improvements of ns3-.18, anyway about my code try this command:


./waf --run "scratch/handover-map --lambda=3.0 --SimulationTime=50 --NumberOfUsers=50 --PrefixStatsFile=50i" > log27.out 2>&1

using the attached files stored in scratch

handover-map.cc
my-lab-dev.h
readme.txt
Handover_map.jpg

el jari ouarda

unread,
Jun 27, 2018, 8:12:38 AM6/27/18
to ns-3-users


Le lundi 20 avril 2015 16:21:36 UTC+2, Marios Gavriil a écrit :
Hi

I am using ns3 3.19 version and I want to detach a ue from an enb and to re-attach it to another enb  after some time in my simulation .can you help me please,?it's urgent

Kind Regards,

Ouarda
Reply all
Reply to author
Forward
0 new messages