Running TORA in ns-2.34 on Ubuntu 10.04

First, patch the ns-2.34 code using the patch and recipe from http://wpage.unina.it/marcello.caleffi/ns2/tora.html.

Then, to avoid eternal loops making the simulation never ending, fix the line 504 (ns-2.34) in imep/imep.cc which reads

rexmitTimer.start(rexat - CURRENT_TIME);

If rexat – CURRENT_TIME is 0, then the same function is called immediately without increasing the simulation time, creating an eternal loop. I would have replaced the line with the following lines:

if (rexat-CURRENT_TIME<0.000001) // Preventing eternal loop.
   rexmitTimer.start(0.000001);
else
   rexmitTimer.start(rexat - CURRENT_TIME);

Then recompile with make, and enjoy. :-)

13 thoughts on “Running TORA in ns-2.34 on Ubuntu 10.04

  1. [...] endless loops Hi, I think I have a solution for your problem, at http://erl1.wordpress.com/2010/08/10…-ubuntu-10-04/ Good [...]

  2. Banano says:

    Hi, thanks for this solution, i have finally managed tora to run with ns-2.34. However, the simulation of TORA last much longer (like 100 times) compared to AODV and DSR. Do you have any idea what may be causing this isue?

    • Erlend says:

      I would guess it’s due to the number of nodes you are simulating. If you run TORA in a proactive mode, it generates control traffic periodically, while reactive protocols like AODV only generate control traffic on route generation and maintenance. ns-2 uses most of its processing time checking which nodes that are affected by a transmission, and if you use the Shadowing radio propagation model, there is no easily defined cutoff distance from the sender node where ns-2 can disregard impact. Thus it must traverse a high number of nodes to check if the signal strength was high enough for a packet to be received or collisions to occur, etc.

      • Emy says:

        Hi erland,
        I have same problem about time of simulation of tora, i read your explanation about the reason, but i want to know is there any solution for this problem? i’m working with 40 nodes with a simulation time of 1000s .
        thanks

      • Erlend says:

        I’m not aware of any solution as such, but to reduce the simulation time I see some alternatives, like reducing the number of TORA control packets per time, reducing the number of nodes, reducing the simulation time or employing a different radio propagation model. Another alternative is to try optimizing the code for TORA in ns-2 as there probably is much potential for reducing the processing load here. However, changing the code may introduce bugs, so stay alert. :)

      • subhash says:

        Dear Erlend

        I am getting the problem while simulating TORA in NS-2.34. i have replaced Tora.cc, Tora.h and imep.cc but i am getting the same problem, plz help me that how can i simulate TORA in ns-2.34 on fedora.

        Thanks in advance

  3. ShaymoL says:

    Hello!
    I followed your instructions to solve the looping problem. but still i am getting the same problem after recompiling using make.

    Any idea why is this happening again ?

    • Erlend says:

      Hi!

      I don’t know what simulator script you are running, but a first solution attempt would be to run make clean before make in the ns-2 subfolder, to make sure that all edited files are recompiled:
      …/ns-2.xx$ make clean
      …/ns-2.xx$ make

  4. ShaymoL says:

    Hello!

    I add a debug code in the imep.cc just to see what is happening there.

    The change code is as follows

    // rexmitTimer.start(rexat – CURRENT_TIME); // line # 504

    printf(” \n T %.9f _%d_ rexmit trigger again for %d at %.9f (in %.9f)”,
    CURRENT_TIME, ipaddr, ch->uid(), rexat, rexat – CURRENT_TIME );
    if (rexat-CURRENT_TIME<0.000001) // Preventing eternal loop.
    {
    printf(" \n preventing eternal loop …");
    rexmitTimer.start(0.000001);
    }else
    rexmitTimer.start(rexat – CURRENT_TIME);

    after saving it I did following

    ..ns2.34# make clean
    ..ns2.34# make

    after recompiling successfully when i run a wireless tcl script using rp as tora i see it shows those string with infinite loop,

    here is some of strings

    T 35.567367999 _8_ rexmit trigger again for 1424 at 35.300000000 (in -0.267367999)
    preventing eternal loop …
    T 35.567368999 _8_ rexmit trigger again for 1424 at 35.300000000 (in -0.267368999)
    preventing eternal loop …
    T 35.567369999 _8_ rexmit trigger again for 1424 at 35.300000000 (in -0.267369999)
    preventing eternal loop …

    Any idea why is this happening in my case ?

    Thanks

    • Erlend says:

      I think it’s a strange behavior. You could try increasing the new timer start and if-check from 0.000001 to 0.001 (or higher) for example, to see if this can get you out of the loop?

      • amith khandakar says:

        Dear Mr Erland

        I am trying to simulate in ns2-2.34 a tcl script which takes wireless scenario from a file generated using Setdest for 15 nodes.When i try to simulate it in it simulates but does not finish (see below for details ).

        Can you please give me your email address so that i can send you the file sot hat you can try it .Please do let me know how i can rectify it.

        Thank you in advance

        Amith khandakar

        num_nodes is set 15
        INITIALIZE THE LIST xListHead
        SORTING LISTS …DONE!
        channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
        highestAntennaZ_ = 1.5, distCST_ = 550.0
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 6649502 received `UPD` from non-neighbor 13
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `UPD` from non-neighbor 13
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for itself.
        node 0 received `QRY` for itself.
        node 572548193 received `QRY` for i

  5. mahi says:

    hello,
    im facing prob in TORA simulation.i hav made changes in .cc & .h file.may b i dont knw xctly where to made these changes. also im confuse how .cc & .h files are called from the tora.tcl script or is there any change needed in tora.tcl aftr .cc & .h being changed?

    plz hlp me. my thesis is hang on,though it has to b submitted within 1 week. :(

    mahi
    mahi.nstu@gmail.com

  6. ABC says:

    Even after making changes in tora.cc, tora.h, imep.cc and running ‘make’ again, my protocol runs into infinite loop. No of nodes is set to be 50. Is it because of large number of nodes? or what can be the reason?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.