TORA Simulation hangs/stops at a point

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

TORA Simulation hangs/stops at a point

Ali Al-Shra'ah.


Hi all,

Whenver I try to simulate TORA in ns2, after some time, the execution hangs/stops at some point and doesnot proceed. There is NO error shown as such, but program doesnot proceed.
The tcl script is also attached below.
If anyone faced similar problem before or knows the solution, please reply. Its urgent for my project.

-------------------------------------------------------
num_nodes is set 20
found DATA
16384 data points read
fm0 = 30.000000 fm = 0.000000  fs = 1000.000000
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
SORTING LISTS ...DONE!
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
node 0 received `QRY` for itself.
node 0 received `QRY` for itself.
node 0 received `QRY` for itself.


EXECUTION STOPS HERE AND DOESNT PROCEED FURTHER.
--------------------------------------

TORA Tcl Script:

proc getopt {argc argv} {
global argv0 seed rate cp sc
if {$argc < 4} {
puts "\nusage: $argv0 seed rate cbr-connection_file node-movement_file\n"
exit
}
set seed [lindex $argv 0]
set rate [lindex $argv 1]
set cp [lindex $argv 2]
set sc [lindex $argv 3]
#puts "\n $seed $rate $cp $sc \n"
}

# ====================================================================
# Define options
# ====================================================================

set val(chan) Channel/WirelessChannel
set val(prop) Propagation/Ricean ;# radio-propagation model
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) Queue/DropTail/PriQueue ;# for aodv
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(x) 500 ;# X dimension of the topography
set val(y) 500 ;# Y dimension of the topography
set val(ifqlen) 50 ;# max packet in ifq
set val(adhocRouting) TORA
set val(nn) 20 ;# how many nodes are simulated
set val(cn) 20 ;# how many connections
set val(stop) 200 ;# simulation time
# unity gain, omni-directional antennas
# set up the antennas to be centered in the node and 1.5 meters above it
Antenna/OmniAntenna set X_ 0
Antenna/OmniAntenna set Y_ 0
Antenna/OmniAntenna set Z_ 1.5
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0
# Initialize the SharedMedia interface with parameters to make
# It works like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 3.652e-10
Phy/WirelessPhy set Rb_ 2*1e6
Phy/WirelessPhy set Pt_ 0.2818
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0

# ====================================================================
# Main Program
# ====================================================================
#
# Initialize Global Variables
#
getopt $argc $argv

# create simulator instance
set ns_ [new Simulator]
$ns_ use-newtrace;

# setup topography object
set topo [new Topography]

# create trace object for ns and nam
set tracefd [open out${sc}_nn${val(nn)}_mc${val(cn)}.tr w]
set namtrace [open out${sc}_nn${val(nn)}_mc${val(cn)}.nam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# define topology
$topo load_flatgrid $val(x) $val(y)

# Create God
set god_ [create-god $val(nn)]

# Create channel #1
set chan_1_ [new $val(chan)]

#global node setting

# Create node "attached" to channel #1
$ns_ node-config -adhocRouting $val(adhocRouting) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan_1_ \
-topoInstance $topo \
-agentTrace ON \
-dsrTrace OFF \
-routerTrace OFF \
-macTrace ON \
-movementTrace OFF \
-toraDebug ON

###############################################
# Set Ricean and Rayleigh fading propagation parameter
## ############################################
set prop_inst [$ns_ set propInstance_]
$prop_inst MaxVelocity 2.5;
$prop_inst RiceanK 0;
$prop_inst LoadRiceFile "rice_table.txt";
#
# Create the specified number of nodes [$val(nn)] and "attach" them
# to the channel.
for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}

#
# Define traffic model
#
source $cp                    #taken as argument
if { $sc != 0} {
source $sc
                   
#taken as argument
}

# Define node initial position in nam
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ initial_node_pos $node_($i) 20
}

#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at $val(stop).0 "$node_($i) reset";
}
$ns_ at $val(stop).0001 "$ns_ nam-end-wireless $val(stop).0001"

puts $tracefd "M 0.0 nn=$val(nn) x=$val(x) y=$val(y) rp=$val(adhocRouting)"
puts $tracefd "M 0.0 sc=$sc cp=$cp seed=$seed"
puts $tracefd "M 0.0 prop=$val(prop) ant=$val(ant)"

#Define a 'finish' procedure
proc finish {} {
global ns_ tracefd namtrace val(stop)
$ns_ flush-trace
close $tracefd
close $namtrace
}

$ns_ at $val(stop).0002 "finish"
$ns_ at $val(stop).0004 "$ns_ halt"
puts "Starting Simulation..."
$ns_ run


     
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

Mubashir Rehmani

Hi,

I am sending you the file of tora.cc in which you can see on line number 380
that the error comes in recvQRY() function

http://www-rp.lip6.fr/ns-doc/ns226-doc/html/tora_8cc-source.htm

So, this is the source of the error.

Hope it helps

Regards
Mubashir Husain Rehmani
Lip6, UPMC, Paris, France


2009/10/1 Ali Al-Shra'ah. <[hidden email]>

>
>
> Hi all,
>
> Whenver I try to simulate TORA in ns2, after some time, the execution
> hangs/stops at some point and doesnot proceed. There is NO error shown as
> such, but program doesnot proceed.
> The tcl script is also attached below.
> If anyone faced similar problem before or knows the solution, please reply.
> Its urgent for my project.
>
> -------------------------------------------------------
> num_nodes is set 20
> found DATA
> 16384 data points read
> fm0 = 30.000000 fm = 0.000000  fs = 1000.000000
> INITIALIZE THE LIST xListHead
> Loading connection pattern...
> Loading scenario file...
> Starting Simulation...
> SORTING LISTS ...DONE!
> channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
> highestAntennaZ_ = 1.5,  distCST_ = 550.0
> node 0 received `QRY` for itself.
> node 0 received `QRY` for itself.
> node 0 received `QRY` for itself.
>
>
> EXECUTION STOPS HERE AND DOESNT PROCEED FURTHER.
> --------------------------------------
>
> TORA Tcl Script:
>
> proc getopt {argc argv} {
> global argv0 seed rate cp sc
> if {$argc < 4} {
> puts "\nusage: $argv0 seed rate cbr-connection_file node-movement_file\n"
> exit
> }
> set seed [lindex $argv 0]
> set rate [lindex $argv 1]
> set cp [lindex $argv 2]
> set sc [lindex $argv 3]
> #puts "\n $seed $rate $cp $sc \n"
> }
>
> # ====================================================================
> # Define options
> # ====================================================================
>
> set val(chan) Channel/WirelessChannel
> set val(prop) Propagation/Ricean ;# radio-propagation model
> set val(netif) Phy/WirelessPhy
> set val(mac) Mac/802_11
> set val(ifq) Queue/DropTail/PriQueue ;# for aodv
> set val(ll) LL
> set val(ant) Antenna/OmniAntenna
> set val(x) 500 ;# X dimension of the topography
> set val(y) 500 ;# Y dimension of the topography
> set val(ifqlen) 50 ;# max packet in ifq
> set val(adhocRouting) TORA
> set val(nn) 20 ;# how many nodes are simulated
> set val(cn) 20 ;# how many connections
> set val(stop) 200 ;# simulation time
> # unity gain, omni-directional antennas
> # set up the antennas to be centered in the node and 1.5 meters above it
> Antenna/OmniAntenna set X_ 0
> Antenna/OmniAntenna set Y_ 0
> Antenna/OmniAntenna set Z_ 1.5
> Antenna/OmniAntenna set Gt_ 1.0
> Antenna/OmniAntenna set Gr_ 1.0
> # Initialize the SharedMedia interface with parameters to make
> # It works like the 914MHz Lucent WaveLAN DSSS radio interface
> Phy/WirelessPhy set CPThresh_ 10.0
> Phy/WirelessPhy set CSThresh_ 1.559e-11
> Phy/WirelessPhy set RXThresh_ 3.652e-10
> Phy/WirelessPhy set Rb_ 2*1e6
> Phy/WirelessPhy set Pt_ 0.2818
> Phy/WirelessPhy set freq_ 914e+6
> Phy/WirelessPhy set L_ 1.0
>
> # ====================================================================
> # Main Program
> # ====================================================================
> #
> # Initialize Global Variables
> #
> getopt $argc $argv
>
> # create simulator instance
> set ns_ [new Simulator]
> $ns_ use-newtrace;
>
> # setup topography object
> set topo [new Topography]
>
> # create trace object for ns and nam
> set tracefd [open out${sc}_nn${val(nn)}_mc${val(cn)}.tr w]
> set namtrace [open out${sc}_nn${val(nn)}_mc${val(cn)}.nam w]
> $ns_ trace-all $tracefd
> $ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
> # define topology
> $topo load_flatgrid $val(x) $val(y)
>
> # Create God
> set god_ [create-god $val(nn)]
>
> # Create channel #1
> set chan_1_ [new $val(chan)]
>
> #global node setting
>
> # Create node "attached" to channel #1
> $ns_ node-config -adhocRouting $val(adhocRouting) \
> -llType $val(ll) \
> -macType $val(mac) \
> -ifqType $val(ifq) \
> -ifqLen $val(ifqlen) \
> -antType $val(ant) \
> -propType $val(prop) \
> -phyType $val(netif) \
> -channel $chan_1_ \
> -topoInstance $topo \
> -agentTrace ON \
> -dsrTrace OFF \
> -routerTrace OFF \
> -macTrace ON \
> -movementTrace OFF \
> -toraDebug ON
>
> ###############################################
> # Set Ricean and Rayleigh fading propagation parameter
> ## ############################################
> set prop_inst [$ns_ set propInstance_]
> $prop_inst MaxVelocity 2.5;
> $prop_inst RiceanK 0;
> $prop_inst LoadRiceFile "rice_table.txt";
> #
> # Create the specified number of nodes [$val(nn)] and "attach" them
> # to the channel.
> for {set i 0} {$i < $val(nn) } {incr i} {
> set node_($i) [$ns_ node]
> $node_($i) random-motion 0 ;# disable random motion
> }
>
> #
> # Define traffic model
> #
> source $cp                    #taken as argument
> if { $sc != 0} {
> source $sc
>
> #taken as argument
> }
>
> # Define node initial position in nam
> for {set i 0} {$i < $val(nn)} {incr i} {
> $ns_ initial_node_pos $node_($i) 20
> }
>
> #
> # Tell nodes when the simulation ends
> #
> for {set i 0} {$i < $val(nn) } {incr i} {
> $ns_ at $val(stop).0 "$node_($i) reset";
> }
> $ns_ at $val(stop).0001 "$ns_ nam-end-wireless $val(stop).0001"
>
> puts $tracefd "M 0.0 nn=$val(nn) x=$val(x) y=$val(y) rp=$val(adhocRouting)"
> puts $tracefd "M 0.0 sc=$sc cp=$cp seed=$seed"
> puts $tracefd "M 0.0 prop=$val(prop) ant=$val(ant)"
>
> #Define a 'finish' procedure
> proc finish {} {
> global ns_ tracefd namtrace val(stop)
> $ns_ flush-trace
> close $tracefd
> close $namtrace
> }
>
> $ns_ at $val(stop).0002 "finish"
> $ns_ at $val(stop).0004 "$ns_ halt"
> puts "Starting Simulation..."
> $ns_ run
>
>
>
>


--
Mubashir Husain Rehmani
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

denzil
i am doing a project by implementing leader election algorithm in manet
presently i am doing a simulation of tora algorithm
Am also facing the same problem
before when compiling tora.tcl i was getting the segmentation fault error


[root@localhost ns-allinone-2.34]# ns tora.tcl
num_nodes is set 6
before finish
INITIALIZE THE LIST xListHead
using backward compatible Agent/CBR; use Application/Traffic/CBR instead
record
Start of simulation..
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
Segmentation fault
[root@localhost ns-allinone-2.34]#

Then i changed Queue/DropTail/PriQueue to CMUPriQueue
in the tora.tcl script


# ======================================================================
# Define options
# ======================================================================
 set val(chan)         Channel/WirelessChannel  ;# channel type
 set val(prop)         Propagation/TwoRayGround ;# radio-propagation model
 set val(ant)          Antenna/OmniAntenna      ;# Antenna type
 set val(ll)           LL                       ;# Link layer type
 set val(ifq)          CMUPriQueue              ;# Interface queue type
 set val(ifqlen)       50                       ;# max packet in ifq
 set val(netif)        Phy/WirelessPhy          ;# network interface type
 set val(mac)          Mac/802_11               ;# MAC type
 set val(nn)           6                        ;# number of mobilenodes
 set val(rp)       TORA                     ;# routing protocol
 set val(x)            800
 set val(y)            800

set ns [new Simulator]
#ns-random 0

set f [open 1_out.tr w]
$ns trace-all $f
set namtrace [open hari_out.nam w]
$ns namtrace-all-wireless $namtrace $val(x) $val(y)
set f0 [open proj_out0.tr w]
set f1 [open proj_out1.tr w]
set f2 [open proj_out2.tr w]
set f3 [open proj_out3.tr w]

set topo [new Topography]
$topo load_flatgrid 800 800

create-god $val(nn)

set chan_1 [new $val(chan)]
set chan_2 [new $val(chan)]
set chan_3 [new $val(chan)]
set chan_4 [new $val(chan)]
set chan_5 [new $val(chan)]
set chan_6 [new $val(chan)]

# CONFIGURE AND CREATE NODES

$ns node-config  -adhocRouting $val(rp) \
  -llType $val(ll) \
                 -macType $val(mac) \
                 -ifqType $val(ifq) \
                 -ifqLen $val(ifqlen) \
                 -antType $val(ant) \
                 -propType $val(prop) \
                 -phyType $val(netif) \
                 #-channelType $val(chan) \
                 -topoInstance $topo \
                 -agentTrace OFF \
                 -routerTrace ON \
                 -macTrace ON \
                 -movementTrace OFF \
                 -channel $chan_1  # \
                 #-channel $chan_2   \
                 #-channel $chan_3   \
                 #-channel $chan_4   \  
                 #-channel $chan_5   \
                 #-channel $chan_6  
puts "before finish"

proc finish {} {
        global ns f f0 f1 f2 f3 namtrace
        $ns flush-trace
        close $namtrace  
        close $f0
        close $f1
  close $f2
        close $f3
       # exec xgraph proj_out0.tr proj_out1.tr
                                     # proj_out2.tr proj_out3.tr
        exec nam -r 5m 1_out.nam &
        exit 0
}

proc record {} {
  global sink0 sink1 sink2 sink3 sink4 sink5 f0 f1 f2 f3
   #Get An Instance Of The Simulator
   set ns [Simulator instance]
   
   #Set The Time After Which The Procedure Should Be Called Again
   set time 0.05
   #How Many Bytes Have Been Received By The Traffic Sinks?
   set bw0 [$sink5 set npkts_]
   set bw1 [$sink5 set nlost_]
   #set bw2 [$sink2 set npkts_]
   #set bw3 [$sink3 set npkts_]
   
   #Get The Current Time
   set now [$ns now]
   
   #Save Data To The Files
   puts $f0 "$now [expr $bw0]"
   puts $f1 "$now [expr $bw1]"
   #puts $f2 "$now [expr $bw2]"
   #puts $f3 "$now [expr $bw3]"

   #Re-Schedule The Procedure
   $ns at [expr $now+$time] "record"
  }
 
# define color index
$ns color 0 blue
$ns color 1 red
$ns color 2 chocolate
$ns color 3 red
$ns color 4 brown
$ns color 5 tan
$ns color 6 gold
$ns color 7 black
                       
set n(0) [$ns node]
#$ns at 0.0 "$n(0) color red"
$n(0) color "0"
$n(0) shape "circle"
set n(1) [$ns node]
$n(1) color "blue"
$n(1) shape "circle"
set n(2) [$ns node]
$n(2) color "tan"
$n(2) shape "circle"
set n(3) [$ns node]
$n(3) color "red"
$n(3) shape "circle"
set n(4) [$ns node]
$n(4) color "tan"
$n(4) shape "circle"
set n(5) [$ns node]
$n(5) color "red"
$n(5) shape "circle"






for {set i 0} {$i < $val(nn)} {incr i} {
        $ns initial_node_pos $n($i) 30+i*100
}

$n(0) set X_ 0.0
$n(0) set Y_ 0.0
$n(0) set Z_ 0.0

$n(1) set X_ 0.0
$n(1) set Y_ 0.0
$n(1) set Z_ 0.0

$n(2) set X_ 0.0
$n(2) set Y_ 0.0
$n(2) set Z_ 0.0

$n(3) set X_ 0.0
$n(3) set Y_ 0.0
$n(3) set Z_ 0.0

$n(4) set X_ 0.0
$n(4) set Y_ 0.0
$n(4) set Z_ 0.0

$n(5) set X_ 0.0
$n(5) set Y_ 0.0
$n(5) set Z_ 0.0

$ns at 0.0 "$n(0) setdest 100.0 100.0 3000.0"
$ns at 0.0 "$n(1) setdest 200.0 200.0 3000.0"
$ns at 0.0 "$n(2) setdest 300.0 200.0 3000.0"
$ns at 0.0 "$n(3) setdest 400.0 300.0 3000.0"
$ns at 0.0 "$n(4) setdest 500.0 300.0 3000.0"
$ns at 0.0 "$n(5) setdest 600.0 400.0 3000.0"

$ns at 2.0 "$n(5) setdest 100.0 400.0 500.0"
#$ns at 1.5 "$n(3) setdest 450.0 150.0 500.0"


# CONFIGURE AND SET UP A FLOW


set sink0 [new Agent/LossMonitor]
set sink1 [new Agent/LossMonitor]
set sink2 [new Agent/LossMonitor]
set sink3 [new Agent/LossMonitor]
set sink4 [new Agent/LossMonitor]
set sink5 [new Agent/LossMonitor]
$ns attach-agent $n(0) $sink0
$ns attach-agent $n(1) $sink1
$ns attach-agent $n(2) $sink2
$ns attach-agent $n(3) $sink3
$ns attach-agent $n(4) $sink4
$ns attach-agent $n(5) $sink5

#$ns attach-agent $sink2 $sink3
set tcp0 [new Agent/TCP]
$ns attach-agent $n(0) $tcp0
set tcp1 [new Agent/TCP]
$ns attach-agent $n(1) $tcp1
set tcp2 [new Agent/TCP]
$ns attach-agent $n(2) $tcp2
set tcp3 [new Agent/TCP]
$ns attach-agent $n(3) $tcp3
set tcp4 [new Agent/TCP]
$ns attach-agent $n(4) $tcp4
set tcp5 [new Agent/TCP]
$ns attach-agent $n(5) $tcp5


proc attach-CBR-traffic { node sink size interval } {
   #Get an instance of the simulator
   set ns [Simulator instance]
   #Create a CBR  agent and attach it to the node
   set cbr [new Agent/CBR]
   $ns attach-agent $node $cbr
   $cbr set packetSize_ $size
   $cbr set interval_ $interval

   #Attach CBR source to sink;
   $ns connect $cbr $sink
   return $cbr
  }

set cbr0 [attach-CBR-traffic $n(0) $sink5 1000 .015]
#set cbr1 [attach-CBR-traffic $n(1) $sink2 1000 .015]
#set cbr2 [attach-CBR-traffic $n(2) $sink3 1000 .015]
#set cbr3 [attach-CBR-traffic $n(3) $sink0 1000 .015]
#set cbr4 [attach-CBR-traffic $n(4) $sink3 1000 .015]
#set cbr5 [attach-CBR-traffic $n(5) $sink0 1000 .015]

 puts "record"

$ns at 0.0 "record"
#$ns at 0.5 "$cbr0 start"
#$ns at 0.5 "$cbr2 start"
#$ns at 2.0 "$cbr0 stop"
#$ns at 2.0 "$cbr2 stop"
$ns at 1.0 "$cbr0 start"
#$ns at 4.0 "$cbr3 stop"

$ns at 10.0 "finish"

puts "Start of simulation.."
$ns run


Now it hangs but is not giving segmentation fault error

[root@localhost ns-allinone-2.34]# ns tora.tcl
num_nodes is set 6
before finish
INITIALIZE THE LIST xListHead
using backward compatible Agent/CBR; use Application/Traffic/CBR instead
record
Start of simulation..
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
-------simulation hangs----------------------


But i am not getting like yours
node 0 received query for itself

In the tora.h file we are using something like
PriQueue *ifqueue;

and in the tora.tcl  i have changed
Queue/DropTail/PriQueue to CMUPriQueue

May be this be the problem
please help if anybody has found the solution
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

denzil
In reply to this post by Ali Al-Shra'ah.
TORA simulation hangs or stops

just check this if you can in tora.cc file

else if(strcmp(argv[1], "if-queue") == 0) {
                        ifqueue = (PriQueue*) TclObject::lookup(argv[2]);
                        if(ifqueue == 0)
                                return TCL_ERROR;
                        return TCL_OK;
                }


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

black
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by Ali Al-Shra'ah.
Please, someone found the problem? i have the same here!!!
when i run the ns  with a tcl using tora i have this... i can't solve yet!
help  me please  :D


SORTING LISTS ...DONE!
node 0 received `QRY` for itself.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

black
This post has NOT been accepted by the mailing list yet.
In reply to this post by Mubashir Rehmani
i can't see the code... but, what i have to do to solve that problem???
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

black
This post has NOT been accepted by the mailing list yet.
In reply to this post by Ali Al-Shra'ah.
Please, someone found the problem? i have the same here!!!
when i run the ns  with a tcl using tora i have this... i can't solve yet!
help  me please  :D


SORTING LISTS ...DONE!
node 0 received `QRY` for itself.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

Shabeer_15
This post has NOT been accepted by the mailing list yet.
TORA Protocol in NS-2.35 (NS2)
This post tells you how to enable the TORA (Temporally ordered routing Algorithm) protocol in Network Simulator 2 (ns-2.35)

TORA is a protocol in wireless adhoc networks that works with timing parameters. NS-2.35 comes with the TORA protocol by default but it has to be tweaked manually to make it run.
This post will help you to do that.
Three files have to be modified
• ~ns-2.35/tora/tora.cc
• ~ns-2.35/tora/tora.h
• ~ns-2.35/imep/imep.cc
There are various websites that tells you how to configure TORA by making changes to the above three files.
Change 1: tora.h
In the tora.h file, go to the end of the File before the agent completes, include these two lines
protected:
 PortClassifier *dmux_;

 
Tora.h Change

Change 2: tora.cc
Open the tora.cc and include the following lines in the "int toraAgent::command(int argc, const char*const* argv) " function as indicated in the figure below.
 else if (strcmp(argv[1], "port-dmux") == 0) {
                 dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
            if (dmux_ == 0) {
               fprintf (stderr, "%s: %s lookup of %s failed\n", __FILE__, argv[1], argv[2]);
                return TCL_ERROR;
            }
            return TCL_OK;
            }
 
Tora.cc Change

Change 3: imep.cc
In the file imep.cc, change the following line


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

 
IMEP Change
Once the changes are made, Open the Terminal and go to ~ns-2.35 and execute the command  
prompt$] make

I am using it on ubuntu 14.04 with NS-2.35
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

knudfl
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by black
> @black
> TORA

The patch "tora_ns235-1.patch" will edit  { imep.cc, tora.cc, tora.h }
https://drive.google.com/file/d/0B7S255p3kFXNWXc4UnRYcGVHZXc/view?usp=sharing

tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing
cd ns-allinone-2.35/
patch -p0 < tora_ns235-1.patch
./install

Simulation examples, Tora-examples_09.2015.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNMnFqLU9wTWhPcUU/view?usp=sharing

-
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

black
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by Shabeer_15
Thanks bro... but i did that, to enable TORA... Because that i have that error heeh

SORTING LISTS ...DONE!
node 0 received `QRY` for itself.

:/ still with problem!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

black
This post has NOT been accepted by the mailing list yet.
In reply to this post by knudfl
thank you for the help!

1-my files are edited.. and ok..  but how can i use that patch?
2- i'm running Ns2 on Ubunto. what can i do that ? sorry i did not understand
i just understand to extract...   could you describe for me that part? :

patch -p0 < tora_ns235-1.patch
./install


thanks one more time!!! i'm running against the time heeh to finish my project.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

knudfl
This post has NOT been accepted by the mailing list yet.
This post was updated on .
> @black
> apply a patch

A patch is a text file. Please read the file.
The patch = a text file ... cannot be extracted.
Can be applied with the 'patch' command.

Using : Make a copy of the patch to a new unpacked ns-allinone-2.35/
$ cd ns-allinone-2.35/
$ patch -p0 < tora_ns235-1.patch
$ ./install
$ cd ns-2.35/
$ cp ns ns-tora
$ sudo cp ns-tora /usr/local/bin/

Simulation : $ ns-tora tora-ipsit.tcl
... etc. etc. examples from  "Tora-examples_09.2015.tar.gz".

-
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TORA Simulation hangs/stops at a point

knudfl
This post has NOT been accepted by the mailing list yet.
> tora

~ 20 TORA simulation examples : Tora-examples_2017.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNdUFiT1dmREtFaGM/view?usp=sharing

-
Loading...