[ns] Measure utilization of access point transmission buffer

2009-03-31 Thread Amr Ramadan


Dear All

I need to know how can i measure the utilization of access point transmission 
buffer ,as i am simulating voip in wireless lan 802.11 and i need to measure 
the utilization of the access point transmission buffer and included in the 
mail the tcl script i use it.

BR

[ns] Measure utilization of access point transmission buffer

2009-03-31 Thread Amr Ramadan


Dear All

I need to know how can i measure the utilization of access point transmission 
buffer ,as i am simulating voip in wireless lan 802.11 and i need to measure 
the utilization of the access point transmission buffer and included in the 
mail the tcl script i use it.

BR

Re: [ns] Measure utilization of access point transmission buffer

2009-03-31 Thread Amr Ramadan

Dear All

I need to know how can i measure the utilization of access point transmission 
buffer ,as i am simulating voip in wireless lan 802.11 and i need to measure 
the utilization of the access point transmission buffer and included in the 
mail the tcl script i use it.

# vim: syntax=tcl

#

 

##

#   CONFIGURATION OF PARAMETERS  #

##

 

#

# Simulation environment

#

set opt(run)0 ;# replic ID

set opt(duration)   100.0 ;# run duration, in seconds

set opt(warm)   0   ;# run duration, in seconds

set opt(out)out ;# statistics output file

set opt(debug)  ;# debug configuration file,  = no debug

set opt(startdebug) 100.0 ;# start time of debug output

 

# VoIP modules parameters

 

set opt(aggregate) 1

set opt(tagrand)   uniform

set opt(tagmean)0.130

set opt(tagvar) 0.01

set opt(tagper) 0

set opt(decoder)   optimal

#set opt(codec)GSM.AMR ;# G.711, G.723.1, G.729A, GSM.EFR, GSM.AMR, 

set opt(codec) G.711 ;# G.711, G.723.1, G.729A, GSM.EFR, GSM.AMR, 

 

# static decoder parameters

set opt(static-buffer)  20

set opt(static-delay)   0.08

global opt

 

set opt(chan)   Channel/WirelessChannel

set opt(prop)   Propagation/TwoRayGround

set opt(netif)  Phy/WirelessPhy

set opt(mac)Mac/802_11

set opt(ifq)Queue/DropTail/PriQueue

set opt(ll) LL

set opt(ant)Antenna/OmniAntenna

set opt(x) 670   

set opt(y)  670   

set opt(ifqlen) 50  

set opt(tr)  wired-and-wireless2.tr

set opt(namtr)   wired-and-wireless2.nam

set opt(nn) 120   

set opt(rp)DSDV 

set opt(cp) 

set opt(sc) ../mobility/scene/scen-3-test   

set opt(stop)   120  

set num_bs_nodes 1

 

 

##

#   DEFINITION OF PROCEDURES #

##

 

#

# parse command-line options_ and store values into the $opt(.) hash

#

proc getopt {argc argv} {

global opt

 

for {set i 0} {$i  $argc} {incr i} {

set arg [lindex $argv $i]

if {[string range $arg 0 0] != -} continue

 

set name [string range $arg 1 end]

set opt($name) [lindex $argv [expr $i+1]]

}

}

 

#

# print out options

#

proc printopt { } {

global opt

 

foreach x [lsort [array names opt]] {

puts $x = $opt($x)

}

}

 

#

# die function

#

proc die { x } {

puts $x

exit 1

}

 

#

# alive function

#

proc alive { } {

global ns_ opt

 

if { [$ns_ now] != 0 } {

puts -nonewline \

 [format elapsed %.0f s (remaining %.0f s) completed %.f%% \

 [$ns_ now] \

 [expr $opt(duration) - [$ns_ now]] \

 [expr 100 * [$ns_ now] / $opt(duration)]]

if { [$ns_ now] = $opt(warm) } {

puts  stat collection ON

} else {

puts 

}

}

$ns_ at [expr [$ns_ now] + $opt(duration) / 10.0] alive

}

 

#

# collect statistics at the end of the simulation

#

proc finish {} {

global ns_ simtime

 

# print statistics to output file

$ns_ stat print

 

# print out the simulation time

set simtime [expr [clock seconds] - $simtime]

puts run duration: $simtime s

 

exit 0

}

 

#

# initialize simulation

#

proc init {} {

global opt defaultRNG ns_ simtime

set t 1

set f [expr $opt(nn) + $t]  

set ns_   [new Simulator]

# set up for hierarchical routing

 $ns_ node-config -addressType hierarchical

 AddrParams set domain_num_ 1  

 lappend cluster_num 1

 AddrParams set cluster_num_ $cluster_num

 lappend eilastlevel $f

 AddrParams set nodes_num_ $eilastlevel 

#  set tracefd  [open $opt(tr) w]

#  $ns_ trace-all $tracefd

  set namtracefd [open $opt(namtr) w]

  $ns_ namtrace-all $namtracefd

set num_bs_nodes 1

 

 

 

  set topo   [new Topography]

  $topo load_flatgrid $opt(x) $opt(y)

  # god needs to know the number of all wireless interfaces

  create-god [expr $opt(nn) + $num_bs_nodes]

 

  

  $ns_ node-config -adhocRouting $opt(rp) \

 -llType $opt(ll) \

 -macType $opt(mac) \

 -ifqType $opt(ifq) \

 -ifqLen $opt(ifqlen) \

 -antType 

Re: [ns] Measure utilization of access point transmission buffer

2009-03-31 Thread Amr Ramadan

Dear All

I need to know how can i measure the utilization of access point transmission 
buffer ,as i am simulating voip in wireless lan 802.11 and i need to measure 
the utilization of the access point transmission buffer and included in the 
mail the tcl script i use it.

# vim: syntax=tcl

#

 

##

#   CONFIGURATION OF PARAMETERS  #

##

 

#

# Simulation environment

#

set opt(run)0 ;# replic ID

set opt(duration)   100.0 ;# run duration, in seconds

set opt(warm)   0   ;# run duration, in seconds

set opt(out)out ;# statistics output file

set opt(debug)  ;# debug configuration file,  = no debug

set opt(startdebug) 100.0 ;# start time of debug output

 

# VoIP modules parameters

 

set opt(aggregate) 1

set opt(tagrand)   uniform

set opt(tagmean)0.130

set opt(tagvar) 0.01

set opt(tagper) 0

set opt(decoder)   optimal

#set opt(codec)GSM.AMR ;# G.711, G.723.1, G.729A, GSM.EFR, GSM.AMR, 

set opt(codec) G.711 ;# G.711, G.723.1, G.729A, GSM.EFR, GSM.AMR, 

 

# static decoder parameters

set opt(static-buffer)  20

set opt(static-delay)   0.08

global opt

 

set opt(chan)   Channel/WirelessChannel

set opt(prop)   Propagation/TwoRayGround

set opt(netif)  Phy/WirelessPhy

set opt(mac)Mac/802_11

set opt(ifq)Queue/DropTail/PriQueue

set opt(ll) LL

set opt(ant)Antenna/OmniAntenna

set opt(x) 670   

set opt(y)  670   

set opt(ifqlen) 50  

set opt(tr)  wired-and-wireless2.tr

set opt(namtr)   wired-and-wireless2.nam

set opt(nn) 120   

set opt(rp)DSDV 

set opt(cp) 

set opt(sc) ../mobility/scene/scen-3-test   

set opt(stop)   120  

set num_bs_nodes 1

 

 

##

#   DEFINITION OF PROCEDURES #

##

 

#

# parse command-line options_ and store values into the $opt(.) hash

#

proc getopt {argc argv} {

global opt

 

for {set i 0} {$i  $argc} {incr i} {

set arg [lindex $argv $i]

if {[string range $arg 0 0] != -} continue

 

set name [string range $arg 1 end]

set opt($name) [lindex $argv [expr $i+1]]

}

}

 

#

# print out options

#

proc printopt { } {

global opt

 

foreach x [lsort [array names opt]] {

puts $x = $opt($x)

}

}

 

#

# die function

#

proc die { x } {

puts $x

exit 1

}

 

#

# alive function

#

proc alive { } {

global ns_ opt

 

if { [$ns_ now] != 0 } {

puts -nonewline \

 [format elapsed %.0f s (remaining %.0f s) completed %.f%% \

 [$ns_ now] \

 [expr $opt(duration) - [$ns_ now]] \

 [expr 100 * [$ns_ now] / $opt(duration)]]

if { [$ns_ now] = $opt(warm) } {

puts  stat collection ON

} else {

puts 

}

}

$ns_ at [expr [$ns_ now] + $opt(duration) / 10.0] alive

}

 

#

# collect statistics at the end of the simulation

#

proc finish {} {

global ns_ simtime

 

# print statistics to output file

$ns_ stat print

 

# print out the simulation time

set simtime [expr [clock seconds] - $simtime]

puts run duration: $simtime s

 

exit 0

}

 

#

# initialize simulation

#

proc init {} {

global opt defaultRNG ns_ simtime

set t 1

set f [expr $opt(nn) + $t]  

set ns_   [new Simulator]

# set up for hierarchical routing

 $ns_ node-config -addressType hierarchical

 AddrParams set domain_num_ 1  

 lappend cluster_num 1

 AddrParams set cluster_num_ $cluster_num

 lappend eilastlevel $f

 AddrParams set nodes_num_ $eilastlevel 

#  set tracefd  [open $opt(tr) w]

#  $ns_ trace-all $tracefd

  set namtracefd [open $opt(namtr) w]

  $ns_ namtrace-all $namtracefd

set num_bs_nodes 1

 

 

 

  set topo   [new Topography]

  $topo load_flatgrid $opt(x) $opt(y)

  # god needs to know the number of all wireless interfaces

  create-god [expr $opt(nn) + $num_bs_nodes]

 

  

  $ns_ node-config -adhocRouting $opt(rp) \

 -llType $opt(ll) \

 -macType $opt(mac) \

 -ifqType $opt(ifq) \

 -ifqLen $opt(ifqlen) \

 -antType