[ns] questions about wireless.tcl

dinesh nagare dineshnagare at gmail.com
Wed Jul 1 00:16:40 PDT 2009


Hi all  ns users,
I want to ask questions about the procedures used in wireless.tcl file of
ns2.

1) What is the use of following commands?

LL set mindelay_        50us
LL set delay_            25us
LL set bandwidth_        0    ;# not used

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_    1460

Queue/DropTail/PriQueue set Prefer_Routing_Protocols    1


2) Is it necessary to define the antenna configurations
          # 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.559e-11
Phy/WirelessPhy set RXThresh_ 3.652e-10
Phy/WirelessPhy set Rb_ 2*1e6
Phy/WirelessPhy set Pt_ 0.2818
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0

3) what is the use of following procedures?

proc usage { argv0 }  {
    puts "Usage: $argv0"
    puts "\tmandatory arguments:"
    puts "\t\t\[-x MAXX\] \[-y MAXY\]"
    puts "\toptional arguments:"
    puts "\t\t\[-cp conn pattern\] \[-sc scenario\] \[-nn nodes\]"
    puts "\t\t\[-seed seed\] \[-stop sec\] \[-tr tracefile\]\n"
}


proc getopt {argc argv} {
    global opt
    lappend optlist cp nn seed sc stop tr x y

    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]]
    }
}


4) what is the use of the following portion ? Is it necessary to include
external tcl files? what is the use of those files?


getopt $argc $argv

#
# Source External TCL Scripts
#
source ../lib/ns-bsnode.tcl
source ../mobility/com.tcl

# do the get opt again incase the routing protocol file added some more
# options to look for
getopt $argc $argv

if { $val(x) == 0 || $val(y) == 0 } {
    usage $argv0
    exit 1
}

if {$opt(seed) > 0} {
    puts "Seeding Random number generator with $opt(seed)\n"
    ns-random $opt(seed)
}

5) What is the seed?


Please help me .

Regards
Dinesh.


More information about the Ns-users mailing list