[ns] Post analysis of energy related trace file
Hello ns-users I want to analyse an energy related trace file and i work with AWK. but it doesn't deal with energy. I have a tcl file which i want to caculate the "end to end delay" and "throughput" and "energy consumption" through it. when i set the mac type as 802.11 it works with AWK and give me the "end to end delay"and "thorughput". but when i change the mac type to smac it doesn't work even on calculating "end to end delay"and "throughput". I use the following tcl file. Thanks in advance Samira Niafar # run SMAC in a 5-nodes multihop network with DSR routing set opt(chan) Channel/WirelessChannel set opt(prop) Propagation/TwoRayGround set opt(netif) Phy/WirelessPhy set opt(mac)Mac/802_11 ;# MAC type #set opt(mac)Mac/SMAC set opt(ifq)Queue/DropTail/PriQueue set opt(ifq)CMUPriQueue set opt(ll) LL set opt(ant)Antenna/OmniAntenna set opt(x) 600 ;# X dimension of the topography set opt(y) 600 ;# Y dimension of the topography set opt(ifqlen) 50;# max packet in ifq set opt(seed) 0.0 set opt(tr) smac2.tr ;# trace file set opt(rp) DSR set opt(filters)GradientFilter set opt(nn) 14;# how many nodes are simulated set opt(stop) 300.0;# simulation time set opt(syncFlag) 1 ;# is set to 1 when SMAC uses sleep-wakeup cycle set opt(selfConfigFlag) 1 ;# is set to 0 when SMAC uses user configurable schedule start time set opt(initialenergy) 1000 set opt(energymodel)EnergyModel ; set opt(radiomodel) RadioModel; set opt(receivepower) 0.281838 ;# Receiving Power set opt(transmitpower) 0.281838;# Transmitting Power set opt(idlepower) 0.281838 ;# Idle Power set opt(sleeppower) 2.81838e-4 ;# sleep power set opt(transitionpower) 0.0563676;# transition power set opt(transitiontime) 0.005;# transition time #set interval1.0 #set appTime1 42.0;# in seconds #set appTime2 44.0;# in seconds #set stopTime100;# in seconds # = # Other default settings #LL set mindelay_50us #LL set delay_ 25us #LL set bandwidth_ 0 ; Agent/Null set sport_ 0 Agent/Null set dport_ 0 Agent/CBR set sport_0 Agent/CBR set dport_0 Agent/TCPSink set sport_0 Agent/TCPSink set dport_0 Agent/TCP set sport_0 Agent/TCP set dport_0 Agent/TCP set packetSize_ 512 # Queue/DropTail/PriQueue set Prefer_Routing_Protocols1 # unity gain, omni-directional antennas # set up the antennas to be centered in the node and 1.5 meters above it Antenna/OmniAntenna set X_ 0 Antenna/OmniAntenna set Y_ 0 Antenna/OmniAntenna set Z_ 1.5 Antenna/OmniAntenna set Gt_ 1.0 Antenna/OmniAntenna set Gr_ 1.0 # Initialize the SharedMedia interface with parameters to make # it work like the 914MHz Lucent WaveLAN DSSS radio interface Phy/WirelessPhy set CPThresh_ 10.0 #Phy/WirelessPhy set CSThresh_ 1.50990e-07 #Phy/WirelessPhy set RXThresh_ 4.80696e-07 Phy/WirelessPhy set CSThresh_ 1.559e-10 Phy/WirelessPhy set RXThresh_ 3.652e-10 ;# Receiving Threshold Phy/WirelessPhy set Rb_ 2*1e6 Phy/WirelessPhy set Pt_ 0.2818 Phy/WirelessPhy set freq_ 914e+6 Phy/WirelessPhy set L_ 1.0 # SMAC settings Mac/SMAC set syncFlag_ 1; # sleep wakeup cycles #Mac/SMAC set SMAC_DUTY_CYCLE 50 Mac/SMAC set dutyCycle_ 90 #ErrorModel set rate_ 0.1 #proc UniformError {} { # global #opt # set errObj [new ErrorModel] # $errObj unit packet # return $errObj #} # create simulator instance set ns_[new Simulator] set tracefd [open $opt(tr) w] $ns_ use-newtrace $ns_ trace-all $tracefd set nf [open out03.nam w] $ns_ namtrace-all-wireless $nf 600 600 set f0 [open out03.tr w] set wtopo [new Topography] $wtopo load_flatgrid $opt(x) $opt(y) # $ns_ set WirelessNewTrace_ ON create-god $opt(nn) # define topology # # Create God # # # define how node should be created # # node setting $ns_ node-config -adhocRouting $opt(rp) \ -llType $opt(ll) \ -macType $opt(mac) \ -ifqType $opt(ifq) \ -ifqLen $opt(ifqlen) \ -antType $opt(ant) \ -propType $opt(prop) \ -phyType $opt(netif) \ -channelType $opt(chan) \ -topoInstance $wtopo \
Re: [ns] Introduce delay in passing packet to Link Layer
hi Although there is a field delay_ in the parent class MAC which simulates the MAC computational overhead, it is not used for any simulation in ll or mac-802.11. So if a MAC layer overhead needs to be simulated, the delay_ field needs to be inserted at 2 places: { simulating the send down overhead in transmit(): replacing downtarget_->recv(p->copy(),this) to s.schedule( sometimer ,p->copy(),delay_): the sometimer is a Handler or TimerHandler whose expiring would call the downtarget_->recv(); { simulating the send up overhead in recvDATA(): replacing uptarget_->recv(p,(Handler*)0) to s.schedule( sometimer, p, delay_); above changes will inserted at mac_802.11. ------ Samira Niafar Iran University of Science and Technology -- Sincerely Samira Niafar Iran University of Science and Technology
[ns] inspect installation problem
Hello ns-users I follow these steps to install inspec: 1-uncompress and untar the compressed tar file "inspect-allinone-igd-1.1.1" and copy that to home as "inspect" directory 2- run "simple-wireless.tcl" in ns-2.31 and get "simple.out" such as written in manual 3- install inspect via : cd /home/inspect ./install.sh 4- set the environment variables to: Export LD_LIBRARY_PATH=/home/inspect/lib/gtkglext/lib/:/home/lib/shplib : $LD_LIBRARY_PATH 5-put the "simple.out" and "simple.conf" at < /home/inspect> path 6- run inspect via below command: Inspect –t simple.conf simple.out but at the end i have this error: bash: command not found please tell me if i have a mistake in one of the previous procedure. Thanks samira niafar
[ns] inspect installation problem
Hello ns-users I follow these steps to install inspec: 1-uncompress and untar the compressed tar file "inspect-allinone-igd-1.1.1" and copy that to home as "inspect" directory 2- run "simple-wireless.tcl" in ns-2.31 and get "simple.out" such as written in manual 3- install inspect via : cd /home/inspect ./install.sh 4- set the environment variables to: Export LD_LIBRARY_PATH=/home/inspect/lib/gtkglext/lib/:/home/lib/shplib : $LD_LIBRARY_PATH 5-put the "simple.out" and "simple.conf" at < /home/inspect> path 6- run inspect via below command: Inspect –t simple.conf simple.out but at the end i have this error: bash: command not found please tell me if i have a mistake in one of the previous procedure. Thanks samira niafar
Re: [ns] how to use/install a new protocol???
hello i think this link will be usefull http://nuraini.net/2007/09/09/how-to-running-protocol-on-ns2/ -- Sincerely Samira Niafar