- Home Page of ProjectGuideline.com ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- help regarding TORA protocol
when i run the following tcl program specifing as TORA it shous error and works well for AODV and DSDV
can some one help to sort it
thanks
puts “The Specfications of the Program are
X-Maximum->200 & Y-Maximum->200(Grid Size)
Number of Nodes are:50
Pause Time : 2s
Max speed : 5m/s
Simulation time : 100s
Output Trace File:project.tr
Output Nam File:project.nam”
# ======================================================================
# Define options
# ======================================================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 50 ;# number of mobilenodes
set val(rp) SWARM ;# routing protocol
# ======================================================================
et AgentTrace ON
set RouterTrace ON
set MacTrace OFF
LL set mindelay_ 50us
LL set delay_ 25us
LL set bandwidth_ 0 ;# not used
Agent/Null set sport_ 0
Agent/Null set dport_ 0
Agent/CBR set sport_ 0
Agent/CBR set dport_ 0
Agent/TCPSink set sport_ 0
Agent/TCPSink set dport_ 0
Agent/TCP set sport_ 0
Agent/TCP set dport_ 0
Agent/TCP set packetSize_ 1460
Queue/DropTail/PriQueue set Prefer_Routing_Protocols 1
# 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 work 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_ 9.8214e-09
Phy/WirelessPhy set Rb_ 2*1e6
Phy/WirelessPhy set Pt_ 0.036
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0
# =====================================================================
# ======================================================================
# Main Program
# ======================================================================
#
# Initialize Global Variables
#
set ns_ [new Simulator]
set tracefd [open project.tr w]
$ns_ trace-all $tracefd
set namfd [open project.nam w]
$ns_ namtrace-all-wireless $namfd 200 200
# set up topography object
set topo [new Topography]
$topo load_flatgrid 200 200
#
# Create God
#
set god_ [create-god $val(nn)]
#
# Create Channel
#
set chan_1_ [new $val(chan)]
#
# Create the specified number of mobilenodes [$val(nn)] and “attach” them
# to the channel.
# Here two nodes are created : node(0) and node(1)
# configure node
$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 ON
-routerTrace ON
-macTrace ON
-movementTrace ON
-channel $chan_1_
-energyModel EnergyModel
-initialEnergy 1.5
-txPower 0.036
-rxPower 0.009
for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns_ node] $node_($i) random-motion 0 ;# disable random motion } source scen-50-2-5-100-200-200 set udp [new Agent/UDP] set sink [new Agent/Null] $ns_ attach-agent $node_(0) $udp $ns_ attach-agent $node_(18) $sink $ns_ connect $udp $sink set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp $cbr set packetSize_ 1024 $cbr set rate_ 0.032768Mb $cbr set random_ false $ns_ at 1.0 “$cbr start” for {set i 0} {$i < $val(nn)} {incr i} { # 20 defines the node size in nam, must adjust it according to your scenario # The function must be called after mobility model is defined $ns_ initial_node_pos $node_($i) 10 } # # Tell nodes when the simulation ends # for {set i 0} {$i < $val(nn) } {incr i} { $ns_ at 100.0 “$node_($i) reset”; } $ns_ at 99.5 “$cbr stop” $ns_ at 100.0 “stop” $ns_ at 100.001 “puts “NS EXITING…” ; $ns_ halt” proc stop {} { global ns_ tracefd namfd $ns_ flush-trace close $tracefd close $namfd } puts “Starting Simulation…” $ns_ run
Kindly post your code using “code tag” Button. Other wise there will be trouble in copy it and test it for you.
Hello Dhaya
Your question and the code were more irrelevant.
You are telling that you are Testing the script for routing agent TORA.
But your script is using SWARM Intelligence related routing agent.
“set val(rp) SWARM ;# routing protocol”