Hi Marco, Thanks for your reply and suggestions. I have tried what you have suggested but the problem still remains as I don't get any throughput still. I have a feeling that I am not doing it right. I have added the script to attach one traffic source and one traffic sink to each node but it is not helping. I will be grateful if you can check the way I am trying to do this in the script below.
I am using the old trace. If I reduce it to two nodes I can see the RTS and CTS being send even without setting the RTSthreshold to 0. I have set the values of CWmin to 31 and Cwmax to 255 and want to get the saturation throughput when all nodes are contending. For saturation I am generating the packets at 0.005 sec and also set the CBR rate to 1Mbps as suggested by you. I have doubt at places: 1. The way I generate the topology using random number generator and making connections i.e. attaching udp and sink to each of the nodes is wrong. I have seen people using cbrgen.tcl for this but I am not familiar with tha. I want to generate this for 10, 20 ,30 40 and 50 nodes so because of this scaling I cannot do the connections for all individually. If you can tell me some other way to generate the topology for higher no. of nodes and making connections? 2. The other issue is that I am using a packet size of 1024 bytes but the trace file shows it broken into two i.e. one packet 1000 and the other 24 and that is because of fragmentation I tried to set the udp packet size to 2000 but I am not sure if this is the right way to counter this as it is not working. How to fix this? 3. This same script works if I use any routing protocol instead of DumbAgent ? but I want to make it work with DumbAgent first and then see what routing can bring up 4. I cannot see any data being transmitted in the trace file? where as all other events are taking place i.e. at RTR and AGT level and even MAC but it either collides or is dropped at the queue. Looking forward for your help. Thanking you in advance. Best Regards, Riz # Script to reproduce the results of Bianchi's paper # ====================================================================== # Define options # ====================================================================== set val(chan) Channel/WirelessChannel ;# channel type set val(prop) Propagation/FreeSpace ;# radio-propagationmodel set val(netif) Phy/WirelessPhy ;# network interface type set val(mac) Mac/802_11 ;# MAC type set val(ifq) Queue/DropTail/PriQueue ;# 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) 10 ;# default number of mobilenodes set val(rp) DumbAgent ;# routing protocol DumbAgent set val(x) 100.0 ; set val(y) 100.0 ; set val(simtime) 30.0 ; #sim time 600 # ====================================================================== # Main Program # ====================================================================== set ns_ [new Simulator] set tracefd [open bianchi.tr w] $ns_ trace-all $tracefd set namtrace [open bianchi.nam w] ;# for nam tracing $ns_ namtrace-all-wireless $namtrace $val(x) $val(y) # set up topography object set topo [new Topography] $topo load_flatgrid $val(x) $val(y) # # Create God # set god_ [ create-god $val(nn) ] $val(mac) set SlotTime_ 0.000050 $val(mac) set SIFS_ 0.000028 $val(mac) set PreambleLength_ 0 $val(mac) set PLCPHeaderLength_ 128 $val(mac) set PLCPDataRate_ 1.0e6 $val(mac) set DIFS_ 0.000128 $val(mac) set dataRate_ 1.0e6 $val(mac) set basicRate_ 1.0e6 $val(mac) set CWMin_ 31 $val(mac) set CWMax_ 255 $val(mac) set RTShreshold_ 0 set chan_1_ [new $val(chan)] $chan_1_ set delay_ 1us set rng [new RNG] $rng seed 0 set rand1 [new RandomVariable/Uniform] $rand1 use-rng $rng $rand1 set min_ -50.0 $rand1 set max_ 50.0 # # Create the specified number of mobilenodes [$val(nn)] and "attach" them # to the channel. # configure node $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) \ -channel $chan_1_ \ -topoInstance $topo \ -agentTrace ON \ -routerTrace ON \ -macTrace ON \ -movementTrace OFF for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns_ node] $node_($i) random-motion 0 ;# disable random motion set x [expr 250+[$rand1 value]] set y [expr 150+[$rand1 value]] $node_($i) set X_ $x $node_($i) set Y_ $y $node_($i) set Z_ 0.0 $ns_ initial_node_pos $node_($i) 20 } #================================================= # Agents #================================================= for {set i 0} {$i < $val(nn)} {incr i 2} { set udp($i) [new Agent/UDP] Agent/UDP set packetSize_ 2000 $ns_ attach-agent $node_($i) $udp($i) set udp([expr $i +1]) [new Agent/UDP] Agent/UDP set packetSize_ 2000 $ns_ attach-agent $node_([expr $i +1]) $udp([expr $i +1]) set sink($i) [new Agent/Null] $ns_ attach-agent $node_([expr $i +1]) $sink($i) $ns_ connect $udp($i) $sink($i) set sink([expr $i +1]) [new Agent/Null] $ns_ attach-agent $node_($i) $sink([expr $i +1]) $ns_ connect $udp([expr $i +1]) $sink([expr $i +1]) set cbr($i) [new Application/Traffic/CBR] $cbr($i) set packetSize_ 1024 $cbr($i) set interval_ 0.005 # 0.01 $cbr($i) set rate_ 1e6 $cbr($i) attach-agent $udp($i) set cbr([expr $i +1]) [new Application/Traffic/CBR] $cbr([expr $i +1]) set packetSize_ 500 $cbr([expr $i +1]) set interval_ 0.005 # 0.01 $cbr([expr $i +1]) set rate_ 1e6 $cbr([expr $i +1]) attach-agent $udp([expr $i +1]) $ns_ at 0.0 "$cbr($i) start" $ns_ at $val(simtime) "$cbr($i) stop" $ns_ at 0.0 "$cbr([expr $i +1]) start" $ns_ at $val(simtime) "$cbr([expr $i +1]) stop" } # define different colors for nam data flows $ns_ color 0 Green $ns_ at $val(simtime).1 "stop" $ns_ at $val(simtime).2 "puts \"NS EXITING...\" ; $ns_ halt" proc stop {} { global ns_ tracefd $ns_ flush-trace close $tracefd puts "Finishing ns.." } puts "Starting Simulation..." $ns_ run _---------------------------------------------- -----Original Message----- From: Marco Fiore [mailto:[EMAIL PROTECTED] Sent: Friday, 13 April 2007 2:26 AM To: [EMAIL PROTECTED]; isi Subject: R: [ns] Help in simulating Bianchi's results Hi Riz, >1. I am not sure about how to generate a scenario where all the >nodes are contending as in my case of 10 nodes only 0 2 4 6 8 are >contending and the other 1 3 5 7 9 are the sink or them so how can I >come with a scenario where all nodes are coteding as in Bianchi's paper attach one traffic source and one traffic sink to each node. >2. whether cbr interval 0.005 can meet the saturation requirement you are in saturation conditions when each node generates more traffic than it can send. Broadly, it depends on the bandwidth you are using and one the number of contending nodes, but you can choose a very high value, so that even a single source would saturate the channel (e.g. if you are using 11Mbps as MAC datarate, you can set the CBR rate to 11Mbps, and you're sure your nodes are backlogged). >3. I cannot see any RTS and CTS in the trace file why? because they are off. RTSthreshold_ controls the RTS/CTS (frames smaller than this value go without RTS/CTS, frames bigger require RTS/CTS, defualt is 3000 - i.e. never use it), so the try adding the line $val(mac) set RTSthreshold_ 0 bye, Marco