[Smac-users] SMAC and node mobility

Mark White mark.white at canterbury.ac.nz
Wed Aug 24 20:36:43 PDT 2005


Hello,

I have been having problems with my SMAC simulations when nodes move out
of range of each other. I have a simple script based (below) on the
unicast1 sample in /tcl/test/test-suite-smac.tcl.

I changed the traffic from ping to cbr/udp and limited the transmission
range by setting RXThresh_. I start with the nodes out of range (packets
get dropped) then move them together (works fine) but when they move
away again it continuously sends out RTS packets which don't get replied
to. How do I stop it from doing this?

 

Thanks,

Mark White

 

global opt

 

    set opt(chan)           Channel/WirelessChannel    ;# channel type

    set opt(prop)           Propagation/TwoRayGround   ;#
radio-propagation model

    set opt(netif)          Phy/WirelessPhy            ;# network
interface type

    set opt(mac)            Mac/SMAC                   ;# MAC type

    #set opt(mac)            Mac/802_11                 ;# MAC type

    set opt(ifq)            Queue/DropTail/PriQueue    ;# interface
queue type

    set opt(ll)             LL                         ;# link layer
type

    set opt(ant)            Antenna/OmniAntenna        ;# antenna model

    set opt(ifqlen)         50                         ;# max packet in
ifq

    set opt(x)              800

    set opt(y)              800

    set opt(rp)             DumbAgent               ;# routing protocol

    set opt(tr)             unicast1.tr

    set opt(stop)           75.0

    set opt(seed)           1

 

    set opt(nn)               2

 

proc finish {} {

      global ns_ tracefd_ opt

      $ns_ flush-trace

      close $tracefd_

      exec cat $opt(tr) &

}

 

 

#    if { [lindex $name 1] == "sync" } {

#     Mac/SMAC set syncFlag_ 1

#    }

 

    set ns_         [new Simulator]

    

    puts "Seeding Random number generator with $opt(seed)\n"

    ns-random $opt(seed)

    

    set tracefd_  [open $opt(tr) w]

    $ns_ trace-all $tracefd_

    

    set topo_         [new Topography]

    $topo_ load_flatgrid $opt(x) $opt(y)

    

    create-god $opt(nn)

 

      $opt(netif) set RXThresh_ 7.69113e-06     ;#5m

 

    $ns_ node-config -adhocRouting $opt(rp) \

                         -macType $opt(mac) \

                         -llType $opt(ll) \

                   -ifqType $opt(ifq) \

                   -ifqLen $opt(ifqlen) \

                   -antType $opt(ant) \

                   -propType $opt(prop) \

                   -phyType $opt(netif) \

                   -channelType $opt(chan) \

                   -topoInstance $topo_ \

                   -agentTrace ON \

                   -macTrace ON

 

###   -routerTrace ON \

 

                   

    for {set i 0} {$i < $opt(nn) } {incr i} {

      set node_($i) [$ns_ node]     

      $node_($i) random-motion 0          ;# disable random motion

    }

 

    $node_(0) set X_ 5.0

    $node_(0) set Y_ 2.0

    $node_(0) set Z_ 0.0

 

    $node_(1) set X_ 15.0

    $node_(1) set Y_ 2.0

    $node_(1) set Z_ 0.0

 

#move them

      $ns_ at 40.0 "$node_(1) setdest 10.0 2.0 1.0"

      $ns_ at 70.0 "$node_(1) setdest 15.0 2.0 1.0"

 

 

      set udp0 [new Agent/UDP]

      $ns_ attach-agent $node_(0) $udp0

 

      set null0 [new Agent/Null]

      $ns_ attach-agent $node_(1) $null0

 

      $ns_ connect $udp0 $null0

 

      set cbr0 [new Application/Traffic/CBR]

      $cbr0 set interval_ 5.0

      $cbr0 set packetSize_ 512

      $cbr0 set random_ 1

      $cbr0 attach-agent $udp0

 

      $ns_ at 1.0 "$cbr0 start"

 

    #

    # Tell nodes when the simulation ends

    #

    for {set i 0} {$i < $opt(nn) } {incr i} {

      $ns_ at $opt(stop) "$node_($i) reset";

    }

    

    $ns_ at $opt(stop) "finish"

    $ns_ at $opt(stop) "puts \"NS EXITING...\" ; $ns_ halt"

 

    puts "Starting Simulation..."

    $ns_  run

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.isi.edu/pipermail/smac-users/attachments/20050825/97d35479/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smac.tcl
Type: application/octet-stream
Size: 3250 bytes
Desc: smac.tcl
Url : http://mailman.isi.edu/pipermail/smac-users/attachments/20050825/97d35479/smac-0001.obj


More information about the Smac-users mailing list