hi,
i'm trying the same wat u have posted here.... if u have got output pls send me the corrected script to my mail id... mine s [email protected].. it will be so very nice of u if u provide me with it... thank u in advance.. Regards vivek annibel wrote: > > > Hi every body; > > I have to do a scnerio for infrastructure mode with one AP with two STA. > > I use for that infra.tcl as a reference. > > when runnig the tcl below, i have a problem "erreur de segmentation" > > > --------tcl script------------ > > 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 ;# 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) 4 ;# number of mobilenodes > set val(rp) DumbAgent ;# routing protocol > set val(x) 600 > set val(y) 600 > > Mac/802_11 set dataRate_ 11Mb > > #Phy/WirelessPhy set CSThresh_ 10.00e-12 > #Phy/WirelessPhy set RXThresh_ 10.00e-11 > #Phy/WirelessPhy set Pt_ 0.1 > #Phy/WirelessPhy set Pt_ 7.214e-3 > > # Initialize Global Variables > set ns [new Simulator] > set tracefile [open infra.tr w] > set namtrace [open infra.nam w] > $ns trace-all $tracefile > $ns namtrace-all-wireless $namtrace $val(x) $val(y) > > #Open the output files > set f0 [open out0.tr w] > > > #Define a 'finish' procedure > proc stop {} { > global ns tracefile namtrace > $ns flush-trace > close $tracefile > close $namtrace > exec infra.nam & > > #exec xgraph out0.tr -geometry 800x400 & > exit 0 > } > > > # set up topography object > set topo [new Topography] > > $topo load_flatgrid $val(x) $val(y) > > # Create God > create-god $val(nn) > > # Create channel > set chan_1_ [new $val(chan)] > > > $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) \ > -topoInstance $topo \ > -agentTrace OFF \ > -routerTrace OFF \ > -macTrace ON \ > -movementTrace ON \ > -channel $chan_1_ > > > for {set i 0} {$i < [expr $val(nn)]} {incr i} { > set node_($i) [$ns node] > > $node_($i) random-motion 0 ;# disable random > motion > set mac_($i) [$node_($i) getMac 0] > > > $mac_($i) set RTSThreshold_ 3000 > > $node_($i) set X_ $i > $node_($i) set Y_ 0 ;# Horizontal arrangement of nodes > $node_($i) set Z_ 0.0 > > } > > #Set Node 0 and Node $val(nn) as the APs. Thus the APs are the ends of the > horizontal line. Each STA receives different power levels. > > > set AP_ADDR1 [$mac_(0) id] > $mac_(0) ap $AP_ADDR1 > > #$mac_([expr $val(nn) - 1]) set BeaconInterval_ 0.2 > > > $mac_(1) ScanType ACTIVE > > for {set i 3} {$i < [expr $val(nn) - 1]} {incr i} { > $mac_($i) ScanType PASSIVE ;#Passive > } > > > #$ns at 1.0 "$mac_(2) ScanType ACTIVE" > > Application/Traffic/CBR set packetSize_ 1023 > Application/Traffic/CBR set rate_ 256Kb > > > for {set i 1} {$i < [expr $val(nn) - 1]} {incr i} { > set udp1($i) [new Agent/UDP] > > $ns attach-agent $node_($i) $udp1($i) > set cbr1_($i) [new Application/Traffic/CBR] > $cbr1_($i) attach-agent $udp1($i) > $ns at 2.0 "$cbr1_($i) start" > } > > > set base0 [new Agent/Null] > > $ns attach-agent $node_(1) $base0 > > set base1 [new Agent/Null] > > $ns attach-agent $node_(2) $base1 > > > $ns at 20.0 "stop" > $ns at 20.0 "puts \"NS EXITING...\" ; $ns halt" > > > > puts "Starting Simulation..." > $ns run > > --------end of script > > why the problem of "erreur de segmentation"? > > Please some help? > it is so urgent > > > > > > > -- View this message in context: http://old.nabble.com/%22erreur-de-segmentation%22-when-running-a-tcl-script-for-infrastructure-mode-tp28293081p31240795.html Sent from the ns-users mailing list archive at Nabble.com.
