I went thru the /ns-$ver/tcl/ directory and gone thru the test scripts in
there. I tried the wireless-ap script which is suppose to create an Access
point which will act as a station to allow wireless nodes to communicate.

However, the node that act as the AP is not even visible. Is tere a way of
making the AP visible?

Then I discored i can initiate traffics from a node, eact time  I try to
initiate a traffic from it, the script crashes and says "Event scheduler
with no UID".

What could this mean?

See my script below:

.................
.............

    for {set i 0} {$i < $opt(nn) } {incr i} {
                  set node_($i) [$ns_ node]
                  $node_($i) random-motion 0              ;# enable random
motion
                set mac_($i) [$node_($i) getMac 0]

                $mac_($i) set dataRate_ 54Mb
                $mac_($i) set basicRate_ 24Mb
                $mac_($i) set RTSThreshold_ 3000

              #  $node_($i) set X_ 0.0
              #  $node_($i) set Y_ 0.0
              #  $node_($i) set Z_ 0.0

    }

$node_(0) set X_ 5.0
$node_(0) set Y_ 2.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 50.0
$node_(1) set Y_ 150.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 100.0
$node_(2) set Y_ 80.0
$node_(2) set Z_ 0.0

.....................
....................
# Tell everyone who the AP is
      set AP_ADDR [$mac_(0) id]
      for {set i 0} {$i < $opt(nn) } {incr i} {
            $mac_($i) bss_id $AP_ADDR
      }

# Traffic flow between the two nodes as follows:
# TCP connections between node_(0) and node_(1)

set tcp [new Agent/TCP]
set udp [new Agent/UDP]
set tcp2 [new Agent/TCP]

#$tcp set class_ 2
#$tcp2 set class_ 1
#$udp set class_ 1

set sink [new Agent/TCPSink]
set sink1 [new Agent/Null]
#set sink2 [new Agent/TCPSink]

$ns_ attach-agent $node_(0) $udp
$ns_ attach-agent $node_(2) $tcp
#$ns_ attach-agent $node_(2) $tcp2

$ns_ attach-agent $node_(1) $sink
$ns_ attach-agent $node_(2) $sink1
#$ns_ attach-agent $node_(0) $sink2

$ns_ connect $udp $sink1
$ns_ connect $tcp $sink
#$ns_ connect $tcp2 $sink2 // If I shld leave this uncommented, the error
will occur

set ftp [new Application/FTP]
set VoIP [new Application/Traffic/CBR]
# set ftp2 [new Application/FTP]

$ftp attach-agent $tcp
$VoIP attach-agent $udp
#$ftp2 attach-agent  $tcp2

$ns_ at 0.5 "$ftp start"
$ns_ at 1.0 "$VoIP start"
#$ns_ at 1.5 "$ftp2 start"

puts "Just finished creating traffics"
............................
................

Lekkie.

Reply via email to