Dear Ashraf,
I tried to make the script as simple as possible.
When I run the tcl script I fount the following output.
num_nodes is set 2
INITIALIZE THE LIST xListHead
routes not yet computed
routes not yet computed
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Finished simulation.
The when I run the NAM file, It shows the following message
Skipping duplicate node 0 definition.
Skipping duplicate node 1 definition.
And, in the NAM display, it still shows 4 node instead of 2 node. Where, 2
nodes are numbered with 0 and 1. And, another 2 nodes are numbered with Roman
character 'I' and 'II'.
Is it the case for any wireless NAM output? I also ran other wireless example
but did not find any output like this.
And if I do not use a physical link, how can I understand that my code is
working? At least from the NAM file with physical link, I can see the traffic
is moving.
Tcl script is pasted below again.
Thank you,
Abdul Awal.
set ns [new Simulator]
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) Queue/DropTail/PriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(ifqlen) 50 ;#
set val(nn) 2 ;# nb mobiles
set val(rp) DSDV
set val(x) [expr $val(nn) *500.0 + 100.0]
set val(y) 1000
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
set god [create-god $val(nn)]
$ns use-newtrace
set tracefd [open $dirName/unicast.tr w]
$ns trace-all $tracefd
set namtrace [open $dirName/unicast.nam w]
$ns namtrace-all-wireless $namtrace $val(x) $val(y)
$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) \
-channel [new $val(chan)] \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF
set node0 [$ns node]
$node0 random-motion 0
$node0 set X_ 0.0
$node0 set Y_ 400.0
$node0 set Z_ 0.0
$ns initial_node_pos $node0 20
set node2 [$ns node]
$node2 random-motion 0
$node2 set X_ 800.0
$node2 set Y_ 400.0
$node2 set Z_ 0.0
$ns initial_node_pos $node2 20
set sender [new Agent/TCP]
$ns attach-agent $node0 $sender
set ftp [new Application/FTP]
$ftp attach-agent $sender
set receiver [new Agent/TCPSink]
$ns attach-agent $node2 $receiver
$ns connect $sender $receiver
$ns at 0.0 "$ftp start"
proc finishSimulation { } {
global ns node val dirName
$ns flush-trace
# Exit
puts "Finished simulation."
$ns halt
}
proc runSimulation {duration} {
global ns finishSimulation
$ns at $duration "finishSimulation"
$ns run
}
runSimulation 10.0
On Tuesday 14 March 2006 20:03, Ashraf Bourawy wrote:
> hi Mohammad,
> It seems that you have mixed things up,,,,,,,but no rush,,,,,,,actually, in
> wireless networks you DO NOT need to set up any links between wireless
> nodes as you have done in your script when you set a duplex link between
> node0 and node2,,,,,,,,,Also, for this simple scenario I don't know why you
> have used hierarchical addressing instead of flat addressing???,,,,,,,the
> property wiredRoutin ON, is used in wireless-cum-wired type of networks,
> you don't have to use it here,,,,just remove it,,,,you need simply review
> your script and check those scripts in marc's tutorial,,,,,,
> hope this will help,,,,,,,,,
>
> Note: I marked the line which you need to change in your
> script,,,,,,,,,just have a look at them,,,,,,,,,,,,,
> --
> Best regards,
> Ashraf Bourawy
>
> On 3/14/06, Mohammad Abdul Awal <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have started to work in mobile adhoc networks. I have installed the
> > ns-allinone-2.27-oolsr-0.99.15.
> >
> > I wrote one tcl script which tries to connects 2 wireless node using a
> > duplex
> > link. And I attach a ftp application with one now. I ran the routing
> > protocol
> > DSDV or OLSR.
> >
> > Then I run the simulation. It works fine. But when I run the NAM file
> > (.nam)
> > then it shows 4 nodes instead of 2 nodes, where 2 nodes are wireless node
> > and
> > 2 other nodes are connected with a wired link. And when I play the NAM,
> > it displays many warning as below.
> >
> > Warning: Tracefile events are not sorted by time.
> > + -t 0.0978399999999999 -s 0 -d 1 -p tcp -e 1040 -c 0 -i 257 -a 0 -x {
> > 0.0.0.0
> > 1.0.0.0 137 ------- null}
> > The above event should occur at or after -t 0.097840.
> >
> > I have attached my full tcl code here. Appreciate if anyone can help me.
> >
> > Thanks in advance,
> > Abdul Awal.
> >
> >
> > # Load the OOLSR as plugin
> > #load-plugin ../oolsr-plugin --output $dirName/ns2agent.log multicast
> > route
> > #packet-drop
> >
> >
> > #------------------------------------------------------------------------
> >--- # Create a simulation, with wireless support. This is basic (see ns2
> > doc)
> >
> > #------------------------------------------------------------------------
> >--- set ns [new Simulator]
> >
> > set val(chan) Channel/WirelessChannel
> > set val(prop) Propagation/TwoRayGround
> > set val(netif) Phy/WirelessPhy
> > set val(mac) Mac/802_11
> > set val(ifq) Queue/DropTail/PriQueue
> > set val(ll) LL
> > set val(ant) Antenna/OmniAntenna
> > set val(ifqlen) 50 ;#
> > set val(nn) 2 ;# nb mobiles
> > #set val(rp) PLUGINPROTOCOL
> > set val(rp) DSDV
> > set val(x) [expr $val(nn) *500.0 + 100.0]
> > set val(y) 1000
> >
> > set topo [new Topography]
> > $topo load_flatgrid $val(x) $val(y)
> > set god [create-god $val(nn)]
> >
> > $ns use-newtrace
> > set tracefd [open $dirName/unicast.tr w]
> > $ns trace-all $tracefd
> >
> > set namtrace [open $dirName/unicast.nam w]
> > $ns namtrace-all-wireless $namtrace $val(x) $val(y)
>
> $ns node-config -addressType hierarchical ; # you don't need this part
>
> > for this simple scenario !!!!
>
> AddrParams set domain_num_ 2
>
> > lappend cluster_num 1 1
> > AddrParams set cluster_num_ $cluster_num
> > lappend eilastlevel 1 1
> > AddrParams set nodes_num_ $eilastlevel
> >
> > $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) \
> > -channel [new $val(chan)] \
> > -topoInstance $topo \
> > -wiredRouting ON \
> > -agentTrace ON \
> > -routerTrace ON \
> > -macTrace OFF \
> > -movementTrace OFF
> >
> > #$ns node-config -wiredRouting ON
> >
> >
> > #------------------------------------------------------------------------
> >--- # Create nodes with OOLSR agent (group 1)
> >
> > #------------------------------------------------------------------------
> >--- set node0 [$ns node 0.0.0]
> >
> > $node0 random-motion 0
> > $node0 set X_ 0.0
> > $node0 set Y_ 400.0
> > $node0 set Z_ 0.0
> > $ns initial_node_pos $node0 20
> >
> >
> > #------------------------------------------------------------------------
> >--- # Create nodes with OOLSR agent (group 2)
> >
> > #------------------------------------------------------------------------
> >--- set node2 [$ns node 1.0.0]
> >
> > $node2 random-motion 0
> > $node2 set X_ 800.0
> > $node2 set Y_ 400.0
> > $node2 set Z_ 0.0
> > $ns initial_node_pos $node2 20
> >
> > $ns duplex-link $node0 $node2 10Mb 0.1ms DropTail ;# why ?????
> >
> >
> > #------------------------------------------------------------------------
> >--- # Sending traffic
> >
> > #------------------------------------------------------------------------
> >---
> >
> > set sender [new Agent/TCP]
> > $ns attach-agent $node0 $sender
> > set ftp [new Application/FTP]
> > $ftp attach-agent $sender
> >
> > set receiver [new Agent/TCPSink]
> > $ns attach-agent $node2 $receiver
> >
> >
> > $ns connect $sender $receiver
> > $ns at 0.0 "$ftp start"
> >
> >
> > #------------------------------------------------------------------------
> >--- # Finishing procedure
> >
> > #------------------------------------------------------------------------
> >---
> >
> > proc finishSimulation { } {
> > global ns node val dirName
> > $ns flush-trace
> > # Exit
> > puts "Finished simulation."
> > $ns halt
> > }
> >
> >
> > #------------------------------------------------------------------------
> >--- # Run the simulation
> >
> > #------------------------------------------------------------------------
> >---
> >
> > proc runSimulation {duration} {
> > global ns finishSimulation
> > $ns at $duration "finishSimulation"
> > $ns run
> > }
> > runSimulation 10.0
> >
> >
> > #------------------------------------------------------------------------
> >---