NS & ECLIPSE

54 views
Skip to first unread message

Maher HENI

unread,
Feb 4, 2010, 7:52:18 AM2/4/10
to ns-3-users
Dear colleagues,


I am wondering how to configure Eclipse "Run-configurations" to
simulate OLSR protocol.
If you have a link to the screen printed, please me transmit.


Sincerely,

Maher HENI

unread,
Feb 4, 2010, 5:03:05 AM2/4/10
to ns-3-...@googlegroups.com
--
*************************************************************************
Maher HENI Telecommunication Engineer  & PhD student @ 6'Tel~Supcom                                           
mails:                                                          
maher...@ieee.org                                
heni...@gmail.com                    
tél:                            
GSM:(+216) 97 16 70 34                                        
ENIT, National Engineering School of Tunis : http://www.enit.rnu.tn/fr/home/indexfr.php                                              
SYS'COM Research Lab  @ ENIT.  :http://www.enit.rnu.tn/fr/recherches/details_labos.php?id=10                
SYS'TEL Research Lab    @SUP'COM: http://www.supcom.mincom.tn/~ridha/6tel/home.html                                                                    
**************************************************************************

Rafael Roque

unread,
Feb 4, 2010, 9:26:40 AM2/4/10
to ns-3-...@googlegroups.com
Hi Maher, you could simply follow http://www.nsnam.org/wiki/index.php/HOWTO_configure_eclipse_with_ns-3
It does not make waf work into eclipse for me, but i can see the source code and use auto completion.

You can use eclipse plus prompt to work with ns-3.
If you use updated ns-3-dev (may be it work with other releases)  you can simple go to build directory under eclipse and run application from there. The ns-3 library will be automatically found and you can also debug your experiments.

I would like to go ahead in this discussion and ask why olsr doesnt see any packet in my experiment (not enter in RoutingProtocol::RecvOlsr (Ptr<Socket> socket)). The traces shows that packets are there, but olsr doesnt see then.  Im not starting OLSR at simulation begin. Im tyring to start nodes at different times, so IPv4 address it not available initially, and olsr starts only after it appear. 

How can i solve this? It has something to do with contexts?

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
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.



--
Rafael Roque Aschoff

Researcher at Network and Telecommunication Research Group - www.gprt.ufpe.br
MSc candidate in Computer Science / UFPE - www.cin.ufpe.br
BSc in Computer Science / UFPE

Rafael Roque

unread,
Feb 4, 2010, 10:06:39 AM2/4/10
to ns-3-...@googlegroups.com
I tested with AODV and received the same results, no packets are seen.

For OLSR the starter code that im using is:

    Ptr<Ipv4> ipv4 = GetNode()->GetObject<Ipv4> ();
    OlsrHelper olsr;
    Ptr<Ipv4RoutingProtocol> ipv4Routing = olsr.Create (GetNode());
    ipv4->SetRoutingProtocol (ipv4Routing);



    Ptr<RoutingProtocol> routing = GetNode()->GetObject<RoutingProtocol> ();
    routing->SetMainInterface(ipv4->GetInterfaceForDevice(device));
    routing->Start();



For AODV:
    Ptr<Ipv4> ipv4 = GetNode()->GetObject<Ipv4> ();
    AodvHelper aodv;
    Ptr<Ipv4RoutingProtocol> ipv4Routing = aodv.Create (GetNode());
    ipv4->SetRoutingProtocol (ipv4Routing);

    Ptr<aodv::RoutingProtocol> routing = GetNode()->GetObject<aodv::RoutingProtocol> ();
    routing->NotifyInterfaceUp(ipv4->GetInterfaceForDevice(device));

Rafael Roque

unread,
Feb 4, 2010, 2:28:35 PM2/4/10
to ns-3-...@googlegroups.com
Please guys, nobody can help?

I have done some simulations and checked that there is no Layer 3/4 communications. Every packet sent even if in radio range is not detected by applications.  BUT the trace pcap file still shows the packets.

My Application is started in this way described bellow. I think it can change the contexts with which packet are interpreted.

...

NetDeviceContainer::Iterator i;
UniformVariable uni = UniformVariable(3, 60);
for (i = devices.Begin(); i != devices.End(); ++i) {
        Ptr<NetDevice> device = (*i);
        Ptr<Node> node = device->GetNode();

        Ptr<BngApplication> app = CreateObject<BngApplication> ();
        double startTime = uni .GetValue();

        app -> SetStartTime(Seconds(startTime));
        app -> SetStopTime(Seconds(95.));
        app -> device = device;
        node -> AddApplication(app);

}

...

Rafael Roque

unread,
Feb 4, 2010, 4:13:39 PM2/4/10
to ns-3-...@googlegroups.com
Through the code, a see that in node.cc, specifically in function Node::ReceiveFromDevice the program doesnt pass the check
      if (i->device == 0 ||
          (i->device != 0 && i->device == device))

But the handler and the device are registered with Ipv4L3Protocol::AddInterface (Ptr<NetDevice> device)

Maher HENI

unread,
Feb 6, 2010, 3:42:35 AM2/6/10
to ns-3-users
Thank you Rafael,

I configured Eclipse with NS, but I could not simulate the protocol in
question OSLR,
I am looking how to configure the Eclipse "RUN-configuration" to
simulate this protocol.
In fact, I have an algortihme to add to this protocol.

Can someone help me.
Sincerely,
Maher HENI.

> > On Thu, Feb 4, 2010 at 12:06 PM, Rafael Roque <roque.raf...@gmail.com>wrote:
>
> >> I tested with AODV and received the same results, no packets are seen.
>
> >> For OLSR the starter code that im using is:
>
> >>     Ptr<Ipv4> ipv4 = GetNode()->GetObject<Ipv4> ();
> >>     OlsrHelper olsr;
> >>     Ptr<Ipv4RoutingProtocol> ipv4Routing = olsr.Create (GetNode());
> >>     ipv4->SetRoutingProtocol (ipv4Routing);
>
> >>     Ptr<RoutingProtocol> routing = GetNode()->GetObject<RoutingProtocol>
> >> ();
> >>     routing->SetMainInterface(ipv4->GetInterfaceForDevice(device));
> >>     routing->Start();
>
> >> For AODV:
> >>     Ptr<Ipv4> ipv4 = GetNode()->GetObject<Ipv4> ();
> >>     AodvHelper aodv;
> >>     Ptr<Ipv4RoutingProtocol> ipv4Routing = aodv.Create (GetNode());
> >>     ipv4->SetRoutingProtocol (ipv4Routing);
>
> >>     Ptr<aodv::RoutingProtocol> routing =
> >> GetNode()->GetObject<aodv::RoutingProtocol> ();
> >>     routing->NotifyInterfaceUp(ipv4->GetInterfaceForDevice(device));
>

> >> On Thu, Feb 4, 2010 at 11:26 AM, Rafael Roque <roque.raf...@gmail.com>wrote:
>
> >>> Hi Maher, you could simply follow
> >>>http://www.nsnam.org/wiki/index.php/HOWTO_configure_eclipse_with_ns-3
> >>> It does not make waf work into eclipse for me, but i can see the source
> >>> code and use auto completion.
>
> >>> You can use eclipse plus prompt to work with ns-3.
> >>> If you use updated ns-3-dev (may be it work with other releases)  you can
> >>> simple go to build directory under eclipse and run application from there.
> >>> The ns-3 library will be automatically found and you can also debug your
> >>> experiments.
>
> >>> I would like to go ahead in this discussion and ask why olsr doesnt see
> >>> any packet in my experiment (not enter in RoutingProtocol::RecvOlsr
> >>> (Ptr<Socket> socket)). The traces shows that packets are there, but olsr
> >>> doesnt see then.  Im not starting OLSR at simulation begin. Im tyring to
> >>> start nodes at different times, so IPv4 address it not available initially,
> >>> and olsr starts only after it appear.
>
> >>> How can i solve this? It has something to do with contexts?
>

> >>> On Thu, Feb 4, 2010 at 7:03 AM, Maher HENI <henima...@gmail.com> wrote:
>
> >>>> Dear colleagues,
>
> >>>>  I am wondering how to configure Eclipse "Run-configurations" to
> >>>> simulate OLSR protocol.
> >>>> If you have a link to the screen printed, please me transmit.
>
> >>>> Sincerely,
>
> >>>> --
>
> >>>> *************************************************************************
> >>>> Maher HENI Telecommunication Engineer  & PhD student @ 6'Tel~Supcom
>
> >>>> mails:

> >>>> maher.h...@ieee.org
> >>>> henima...@gmail.com


> >>>> tél:
> >>>> GSM:(+216) 97 16 70 34
> >>>> ENIT, National Engineering School of Tunis :
> >>>>http://www.enit.rnu.tn/fr/home/indexfr.php
>
> >>>> SYS'COM Research Lab  @ ENIT.  :
> >>>>http://www.enit.rnu.tn/fr/recherches/details_labos.php?id=10
>
> >>>> SYS'TEL Research Lab    @SUP'COM:

> >>>>http://www.supcom.mincom.tn/~ridha/6tel/home.html<http://www.supcom.mincom.tn/%7Eridha/6tel/home.html>


>
> >>>> **************************************************************************
>
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "ns-3-users" group.
> >>>> 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<ns-3-users%2Bunsu...@googlegroups.com>

Rafael Roque

unread,
Feb 6, 2010, 11:37:39 AM2/6/10
to ns-3-...@googlegroups.com
I have used de Debug-configuration tool and set NS_LOG environment variable inside eclipse, and it works. I thing that program variables could work too. Have you try to search for the binary under build/debug, and with the right mouse button: Debug as C/C++ application? It will run the program and also create the Debug-configuration for you.

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.

Reply all
Reply to author
Forward
0 new messages