Nano-sim by telematics

454 views
Skip to first unread message

Kemal Kilic

unread,
Oct 15, 2016, 6:41:51 AM10/15/16
to ns-3-users
Hello Folks,

Having trouble with nano-sim package.
I tried to follow the compiling instructions on http://telematics.poliba.it/index.php/en/nano-sim
I also tried to compile it with ns-3.25 and ns-3.26 getting errors (I attached the text file for full messages):

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[1751/1816] Compiling src/nanonetworks/model/nano-l3-header.cc
../src/nanonetworks/model/message-process-unit.cc: In static member function ‘static ns3::TypeId ns3::MessageProcessUnit::GetTypeId()’:
../src/nanonetworks/model/message-process-unit.cc:45:96: warning: ‘ns3::TypeId ns3::TypeId::AddTraceSource(std::__cxx11::string, std::__cxx11::string, ns3::Ptr<const ns3::TraceSourceAccessor>)’ is deprecated [-Wdeprecated-declarations]
     .AddTraceSource ("outTX",  "outTX",  MakeTraceSourceAccessor (&MessageProcessUnit::m_outTX))
                                                                                                ^
In file included from ./ns3/object-base.h:23:0,
                 from ./ns3/object.h:29,
                 from ../src/nanonetworks/model/message-process-unit.h:24,
                 from ../src/nanonetworks/model/message-process-unit.cc:22:
./ns3/type-id.h:439:10: note: declared here
   TypeId AddTraceSource (std::string name,
          ^~~~~~~~~~~~~~
../src/nanonetworks/model/message-process-unit.cc:46:96: warning: ‘ns3::TypeId ns3::TypeId::AddTraceSource(std::__cxx11::string, std::__cxx11::string, ns3::Ptr<const ns3::TraceSourceAccessor>)’ is deprecated [-Wdeprecated-declarations]
     .AddTraceSource ("outRX",  "outRX",  MakeTraceSourceAccessor (&MessageProcessUnit::m_outRX));
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I am using 64 bit openSUSE linux and gcc version 6.2.1
Do not know what is the problem: gcc version? 64-32 bit OS issue? ns-3 version?
Anybody who was able to compile nano-sim package?

If so please send me the version of gcc, your system, and the version of the ns-3 you have used.


All the best...

Kemal



nn-compile-problem.txt

Tommaso Pecorella

unread,
Oct 15, 2016, 7:09:58 AM10/15/16
to ns-3-users
Hi,

it's a "simple" problem of using an outdated API.
In the code (everywhere), stuff like
    .AddTraceSource ("outTX",  "outTX",  MakeTraceSourceAccessor (&MessageProcessUnit::m_outTX))

should look more like
    .AddTraceSource ("outTX",  "outTX",  MakeTraceSourceAccessor (&MessageProcessUnit::m_outTX), "ns3::Whatever::Something")

where ns3::Whatever::Something is a typedef defining the type of the callback.

As an example

TypeId
UdpSocketImpl::GetTypeId (void)
{
 
static TypeId tid = TypeId ("ns3::UdpSocketImpl")
   
.SetParent<UdpSocket> ()
   
.SetGroupName ("Internet")
   
.AddConstructor<UdpSocketImpl> ()
   
.AddTraceSource ("Drop",
                     
"Drop UDP packet due to receive buffer overflow",
                     
MakeTraceSourceAccessor (&UdpSocketImpl::m_dropTrace),
                     
"ns3::Packet::TracedCallback")
   
.AddAttribute ("IcmpCallback", "Callback invoked whenever an icmp error is received on this socket.",
                   
CallbackValue (),
                   
MakeCallbackAccessor (&UdpSocketImpl::m_icmpCallback),
                   
MakeCallbackChecker ())
   
.AddAttribute ("IcmpCallback6", "Callback invoked whenever an icmpv6 error is received on this socket.",
                   
CallbackValue (),
                   
MakeCallbackAccessor (&UdpSocketImpl::m_icmpCallback6),
                   
MakeCallbackChecker ())
 
;
 
return tid;
}

and in packet.h there is

  /**
   * TracedCallback signature for Ptr<Packet>
   *
   * \param [in] packet The packet.
   */

 
typedef void (* TracedCallback) (Ptr<const Packet> packet);

The signature is used to check the consistency between callbacks.

I'd also suggest to get in touch with the module authors and ask them to upgrade their module.

Cheers,

T.

Kemal Kilic

unread,
Oct 20, 2016, 4:08:04 AM10/20/16
to ns-3-...@googlegroups.com
   How can you find that it should be  "ns3::Packet::TracedCallback"?
   I mean what was the clue in the code above that you have chosen packet.h?
   Did you use any special tool to find out class hierarchies?

   If my questions sound stupid, sorry, I am not a great C++ expert :(



--
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/h5OhwdUNR2w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@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.



--
Kemal

If you only at least one time today, you have made God smile, then the day is a gain for you.
Otherwise keep on smiling, tomorrow is another day, another chance!!!
 
Pax et Bonum

pdbarnes

unread,
Oct 20, 2016, 8:35:26 AM10/20/16
to ns-3-users
Tommaso is pointing out that nanosim needs to be updated to work with newer ns-3 versions. The example he gave, UdpSocketImpl, shows illustrates the use of the callback typedef string.

To discover the signature required for any callback, just look at the API docs, for example
https://www.nsnam.org/doxygen/classns3_1_1_udp_socket_impl.html#details

Look at the TraceSources section.

In general to see the inheritance tree open the Inheritance Diagram at the top of API docs page for the class.

Peter

Kemal Kilic

unread,
Oct 22, 2016, 4:40:21 PM10/22/16
to ns-3-users
Hello Folks,

Finally I was able to compile and try examples of nano-sim.
I used ns-3 version 3.19 and used 

CXXFLAGS="-Wall" ./waf configure


other wise by default every warning was breaking compile.


Now it remains to see what was bad in 3.19.
same trick does not work 3.26 (current release.)

Hope that some body will fix nano-sim soon...

Cheers...

kga

unread,
Apr 3, 2017, 2:03:23 AM4/3/17
to ns-3-users
Hello,
    Can you please suggest how to run the healthcare.cc file in netanim3.104.
I am able to run the code in ns3.19 but I'm not aware of how to link it to the netanim.
Please help
kga.

Konstantinos

unread,
Apr 3, 2017, 3:33:37 AM4/3/17
to ns-3-users
Have you studied how NetAnim works? 

Regards,
K

Tanzila Choudhury

unread,
May 21, 2017, 9:56:17 PM5/21/17
to ns-3-users
Thank you so much for your post and the solution. I was having the same trouble because of using ns-3.25. struggled so long with no working solution. using 3.19 worked for me too. Thanks a lot again.

jeje omar

unread,
Nov 17, 2017, 12:03:47 PM11/17/17
to ns-3-users
Hi everyone,
Can any one contact with module author because is not good idea to work with older version of ns3 even it is the solution.
I have already send an email but I didn't get any reply yet and I am beginner ,if I have the experience I will edit it.
May be the editing in the module will make it work with the newest version of ns3.
If any one have the ability and the experience to help please help.

Kemal Kilic

unread,
Nov 17, 2017, 5:56:55 PM11/17/17
to ns-3-...@googlegroups.com
Hello there!
Yes the nanosim package is troublesome and the author does not respond!
It is already dead now!
But if you think it is worth the effort:
I was able to use it with ns3 version 3.20
Editing the module for new ns3 can be the best but I guess need so much expertise.

Attached are the instructions for Ubuntu linux
Also the patch for gccxml (just for Ubuntu).
I tried it for 16.04
At that time gccxml needed to be patched.

I personally use it under openSUSE. 
without patching the gccxml
Please note that you need max version NS3 version 3.20  (some cases 3.21)
I guess they designed it for 3.19

All the best...


--
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/h5OhwdUNR2w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@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.
gccxml-patch.txt
how-to.txt

jeje omar

unread,
Nov 19, 2017, 6:28:22 AM11/19/17
to ns-3-users
Hi,
thank you for your cooperation but I need to use the newest version of ns3 with this module if you and anyone have the time and ability to help please help ;(
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.

jeje omar

unread,
Nov 20, 2017, 8:50:43 AM11/20/17
to ns-3-users
this is the solution for using nanosim on ns3.27
https://groups.google.com/forum/#!topic/ns-3-users/YYxyzvcPT8U


On Saturday, November 18, 2017 at 1:56:55 AM UTC+3, Kemal Kilic wrote:
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.
Reply all
Reply to author
Forward
0 new messages