---------- Forwarded message ---------- From: 王辉 <[EMAIL PROTECTED]> Date: 2008/10/29 Subject: simulation problems on 802.11 infrastructure mode To: ns-users@isi.edu
Dear all, I'm doing some simulations on 802.11 infrastructure mode in ns2 using "Phy/WirelessPhy & Mac/802_11" implementations within ns2. When I did a simple simulation which involved 24 clients and 5 APs(all clients are evenly distributed in a 300*300 area and 5 APs are located at the four corners and the center ), everything went well if the CBR data rate is low enough(eg. 256kB). While if the CBR data rate is higher (1MB), there rose a segmentation faults and it cannot be tracked in GDB easily ( the fault is listed below). Because I didn't change any code in NS 2, there may be some bugs in the 802.11 Mac implementation. Could any one give me any advice, pls? I really appreciate it. Best regards, Wang Hui Below is the tcl script and gdb debug information. 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) 29 ;# number of mobilenodes set val(rp) DumbAgent ;# routing protocol set val(x) 300 set val(y) 300 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 tracefd [open asso.tr w] $ns_ trace-all $tracefd # 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 ON \ -routerTrace OFF \ -macTrace OFF \ -movementTrace OFF \ -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 } source ./asso.scn #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_(25) id] $mac_(25) ap $AP_ADDR1 set AP_ADDR2 [$mac_(26) id] $mac_(26) ap $AP_ADDR2 set AP_ADDR3 [$mac_(12) id] $mac_(12) ap $AP_ADDR3 set AP_ADDR4 [$mac_(27) id] $mac_(27) ap $AP_ADDR4 set AP_ADDR5 [$mac_([expr $val(nn) - 1]) id] $mac_([expr $val(nn) - 1]) ap $AP_ADDR5 #$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 #} for {set i 0} {$i < 12} {incr i} { $mac_($i) ScanType PASSIVE } for {set i 13} {$i < 25} {incr i} { $ns_ at 3.0 "$mac_($i) ScanType PASSIVE" } #$ns_ at 3.0 "$mac_(2) ScanType ACTIVE" Application/Traffic/CBR set packetSize_ 2000 Application/Traffic/CBR set rate_ 0.5mB #Application/Traffic/CBR set interval_ 25n for {set i 0} {$i < 25} {incr i} { if {$i != 12} { 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) } } set base0 [new Agent/Null] $ns_ attach-agent $node_(11) $base0 set base1 [new Agent/Null] $ns_ attach-agent $node_(8) $base1 set base2 [new Agent/Null] $ns_ attach-agent $node_(18) $base2 $ns_ connect $udp1(6) $base0 $ns_ connect $udp1(7) $base1 $ns_ connect $udp1(13) $base2 $ns_ at 2.0 "$cbr1(6) start" $ns_ at 4.0 "$cbr1(7) start" $ns_ at 6.0 "$cbr1(13) start" #$ns_ at 10.0 "$node_(4) setdest 300.0 1.0 30.0" $ns_ at 200.0 "stop" $ns_ at 200.0 "puts \"NS EXITING...\" ; $ns_ halt" proc stop {} { global ns_ tracefd $ns_ flush-trace close $tracefd exit 0 } puts "Starting Simulation..." $ns_ run ******************************************************* num_nodes is set 29 INITIALIZE THE LIST xListHead Starting Simulation... channel.cc:sendUp - Calc highestAntennaZ_ and distCST_ highestAntennaZ_ = 1.5, distCST_ = 550.0 SORTING LISTS ...DONE! Program received signal SIGSEGV, Segmentation fault. 0x088c4f73 in ?? () (gdb) bt #0 0x088c4f73 in ?? () #1 0x081a7626 in Scheduler::run (this=0x879ea48) at common/scheduler.cc:129 #2 0x081a78e5 in Scheduler::command (this=0x879ea48, argc=2, argv=0xbf9de050) at common/scheduler.cc:198 #3 0x083cb07a in TclClass::dispatch_cmd () #4 0x083cfdec in OTclDispatch (cd=<value optimized out>, in=0x85d96c0, argc=3, argv=0xbf9de19c) at otcl.c:434 #5 0x083d6bbe in TclInvokeStringCommand () #6 0x083d8716 in TclEvalObjvInternal () #7 0x08402e51 in TclExecuteByteCode () #8 0x0840768c in TclCompEvalObj ()