I'm simulating a scence as this:

            ..--------------..
       ..:''                  '':..
     ''                            '.
    |    MANET  running   |
     ..     oolsr-0.99.15    .'
       '':..              +---+ /
          ''---+----------|BS|/ (both wired and wireless)
                         +----+
                              \
                            ++---+        ++--++
                            |wired |       |wired |
                            |node |-------| node |
                            +---++       ++-----+

I've successfully compiled the ns-2.27-allinone-oolsr-0.99.15 on
debian and tested the oolsr in pure wireless environment. But when I
tried to simulate the topology above(with both wired and wireless
environment), I got the NRTE erro in the tr file after simulation:

================= in the tr file ===========================
+ 50 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 0 2603
- 50 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 0 2603
r 50.002205 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 0 2603
d -t 50.002204800 -Hs 2 -Hd -2 -Ni 2 -Nx 1.00 -Ny 2.00 -Nz 0.00 -Ne
-1.000000 -Nl RTR -Nw NRTE -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id
4194354.0 -It cbr -Il 128 -If 0 -Ii 2603 -Iv 30 -Pn cbr -Pi 0 -Pf 0
-Po 0
+ 50.1 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 1 2611
- 50.1 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 1 2611
r 50.102205 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 1 2611
d -t 50.102204800 -Hs 2 -Hd -2 -Ni 2 -Nx 1.00 -Ny 2.00 -Nz 0.00 -Ne
-1.000000 -Nl RTR -Nw NRTE -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id
4194354.0 -It cbr -Il 128 -If 0 -Ii 2611 -Iv 30 -Pn cbr -Pi 1 -Pf 0
-Po 0
+ 50.2 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 2 2639
- 50.2 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 2 2639
r 50.202205 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 2 2639
d -t 50.202204800 -Hs 2 -Hd -2 -Ni 2 -Nx 1.00 -Ny 2.00 -Nz 0.00 -Ne
-1.000000 -Nl RTR -Nw NRTE -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id
4194354.0 -It cbr -Il 128 -If 0 -Ii 2639 -Iv 30 -Pn cbr -Pi 2 -Pf 0
-Po 0
+ 50.3 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 3 2653
- 50.3 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 3 2653
r 50.302205 0 2 cbr 128 ------- 0 0.0.0.0 1.0.50.0 3 2653
d -t 50.302204800 -Hs 2 -Hd -2 -Ni 2 -Nx 1.00 -Ny 2.00 -Nz 0.00 -Ne
-1.000000 -Nl RTR -Nw NRTE -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id
4194354.0 -It cbr -Il 128 -If 0 -Ii 2653 -Iv 30 -Pn cbr -Pi 3 -Pf 0
-Po 0
================= in the tr file ===========================

This is my testing script:
Could anyone give me some tips to solve this problem? Thanks very much

==================  script   ===============================
#---------------------------------------------------------------------------
# Initialization
#---------------------------------------------------------------------------

# (possibly) Remove and create result directory
set dirName "test-unicast-result"
exec sh -c "rm -rf $dirName && mkdir $dirName"

# Default node configuration
set nodeConfig "no-log 0; log-none ; log-route 1"

# 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]

$ns node-config -addressType hierarchical

AddrParams set domain_num_ 2          ;# set two domain: wired, wireless

lappend cluster_num 1 1              ;# 1 clusters for wired domain,1
for wireless

AddrParams set cluster_num_ $cluster_num

lappend eilastlevel 1 51
 domain, cluster 2

AddrParams set nodes_num_ $eilastlevel ; # of each domain

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)     50  ;# nb mobiles
set num_wired_nodes      1           ;# 2 wired nodes
set val(rp) PLUGINPROTOCOL
set val(x) [expr $val(nn) *100.0 + 100.0]
set val(y) 1000

set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
set god [create-god [expr $val(nn) + 1]]

$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)

#set the wired nodes

set temp {0.0.0 }           ;# hierarchical addresses

for {set i 0} {$i < $num_wired_nodes} {incr i} {

   set W($i) [$ns node [lindex $temp $i]]

}

$ns node-config        -mobileIP ON \
   -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 OFF\
   -macTrace OFF \
   -movementTrace OFF

# set HA

set HA [$ns_ node 1.0.0]


$HA set X_ 1.00

$HA set Y_ 2.00

$HA set Z_ 0.00

$ns duplex-link $W(0) $HA 5Mb 2ms DropTail

$ns duplex-link-op $W(0) $HA orient down

# create a mobilenode (in the domain of the HA)

$ns_ node-config -wiredRouting OFF

#---------------------------------------------------------------------------
# Create nodes with OOLSR agent
#---------------------------------------------------------------------------

for {set i 0} {$i < $val(nn)} {incr i} {
   set node($i) [$ns node 1.0.[expr $i + 1]]

   $node($i) random-motion 1
   $node($i) set X_ [expr $i * 100.0]
   $node($i) set Y_ [expr 500.0 + ((($i * 93) % 21) - 10 ) * 10.0]
   $node($i) set Z_ 0.0
   $ns initial_node_pos $node($i) 20

    [$node($i) set ragent_] set-config \
      "$nodeConfig ; log-file-name $dirName/oolsr-node-$i.log"
      set HAaddress [AddrParams addr2id [$HA node-addr]]
      [$node($i) set regagent_] set home_agent_ $HAaddress

#    [$node($i) set ragent_] start
#    [$node($i) set ragent_] config
}

#---------------------------------------------------------------------------
# Sending traffic
#---------------------------------------------------------------------------

set sender [new Agent/UDP]
$ns attach-agent $W(0) $sender
set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 128
$cbr set interval_ 0.1
$cbr attach-agent $sender

set receiver [new Agent/Null]
$ns attach-agent $node([expr $val(nn)-1]) $receiver

$ns connect $sender $receiver
$ns at 0.0 "$cbr start"

#---------------------------------------------------------------------------
# Finishing procedure
#---------------------------------------------------------------------------

proc finishSimulation { } {
   global ns node val dirName

   # Log the final state of all the nodes
   for {set i 0} {$i < $val(nn)} {incr i} {
       [$node($i) set ragent_] state "$dirName/oolsr-node-$i.final-state"
   }

   # Exit
   puts "Finished simulation."
   $ns halt
}

#---------------------------------------------------------------------------
# Run the simulation
#---------------------------------------------------------------------------

proc runSimulation {duration} {
   global ns finishSimulation
   for {set j 1.0} {$j < $duration} {set j [expr $j * 1.3 ]} {
       $ns at $j "puts t=$j"
   }
   $ns at $duration "finishSimulation"
   $ns run
}

runSimulation 305.0

#---------------------------------------------------------------------------


-- 
Thanks & Best Regards,

Zhang Wen Zhi(张文治)
Tel: 086-1358-161-4504

Reply via email to