[ns] Got error when run example of 4node.tcl

2011-10-19 Thread Bety Barreto Soares

# ==
# Define options
# ===

set val(chan)                        Channel/WirelessChannel        ;# channel 
type
set val(prop)                        Propagation/TwoRayGround    ;# 
radio-propagation model
set val(ant)                        Antenna/OmniAntenna            ;# Antenna 
type
set val(ll)                            LL                            ;# Link 
Layer type
set val(ifq)                        Queue/DropTail/PriQueue        ;# Interface 
queue type
set val(ifqlen)                        50                            ;# max 
packet in ifq
set val(netif)                        Phy/WirelessPhy                ;# network 
interface type
set val(mac)                        Mac/802_11                    ;# MAC type
set val(nn)                            4                            ;# number 
of mobilenodes
set val(rp)                            AODV                        ;# routing 
protocol
set val(x)                            800                            
set val(y)                            800

set ns [new Simulator]
#ns-random 0

set f [open 1_out.tr w]
$ns trace-all $f
set namtrace [open 1_out.nam w]
$ns namtrace-all-wireless $namtrace $val(x) $val(y)
set f0 [open proj_out0.tr w]
set f1 [open proj_out1.tr w]
set f2 [open proj_out2.tr w]
set f3 [open proj_out3.tr w]

set topo [new Topography]
$topo load_flatgrid 800 800

create-god $val(nn)

set chan_1 [new $val(chan)]
set chan_2 [new $val(chan)]
set chan_3 [new $val(chan)]
set chan_4 [new $val(chan)]

# Configure and create nodes

$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) \
                #-channelType $val(chan) \
                -topoInstance $topo \
                -agentTrace OFF \
                -routeTrace ON \
                -macTrace ON \
                -movementTrace OFF \
                -channel $chan_1 \
                -channel $chan_2 \
                -channel $chan_3 \
                -channel $chan_4 
proc finish {} {
        global ns f f0 f1 f2 f3 namtrace
        $ns flush-trace
        close $namtrace
        close $f0
        close $f1
        close $f2
        close $f3
        #exec xgraph proj_out0.tr proj_out1.tr proj_out2.tr proj_out3.tr
        exec nam -r 5m 1_out.nam 
        exit 0
}

proc record {} {
    global sink0 sink1 sink2 sink3 f0 f1 f2 f3
    # Get AN instance of the simulator
    
    set ns [Simulator instance]
    #set the Time after which the procedure should be called again
    set time 0.05
    # How Many Bytes have been received by the traffic sinks?
    set bw0 [$sink2 set npkts_]
    set bw1 [$sink2 set nlost_]
    set bw2 [$sink0 set npkts_]
    set bw3 [$sink0 set nlost_]

# Get the current time
set now [$ns now]

#save data to the files
puts $f0 $now [expr $bw0]
puts $f1 $now [expr $bw1]
puts $f2 $now [expr $bw2]
puts $f3 $now [expr $bw3]

# Re-schedule the procudere
$ns at [expr $now+$time] record
}

#define color index
$ns color 0 blue
$ns color 1 red
$ns color 2 chocolate
$ns color 3 red
$ns color 4 brown
$ns color 5 tan
$ns color 6 gold
$ns color 7 black

set n(0) [$ns node]
#$ns at 0.0 $n(0) color red
$n(0) color 0
$n(0) shape circle
set n(1) [$ns node]
$n(1) color blue
$n(1) shape circle
set n(2) [$ns node]
$n(2) color tan
$n(2) shape circle
set n(3) [$ns node]
$n(3) color red
$n(3) shape circle

for {set i 0} {$i  $val(nn)} {incr i} {
    $ns intial_node_pos $n($i) 30+i*100
}
$n(0) set X_ 0.0
$n(0) set Y_ 0.0
$n(0) set Z_ 0.0

$n(1) set X_ 0.0
$n(1) set Y_ 0.0
$n(1) set Z_ 0.0

$n(2) set X_ 0.0
$n(2) set Y_ 0.0
$n(2) set Z_ 0.0

$n(3) set X_ 0.0
$n(3) set Y_ 0.0
$n(3) set Z_ 0.0

$ns at 0.0 $n(0) setdest 100.0 200.0 3000.0
$ns at 0.0 $n(1) setdest 250.0 200.0 3000.0
$ns at 0.0 $n(2) setdest 400.0 200.0 3000.0
$ns at 0.0 $n(3) setdest 550.0 200.0 3000.0

#$ns at 1.5 $n(2) setdest 100.0 150.0 500.0
#$ns at 1.5 $n(3) setdest 450.0 150.0 500.0

# Configure and set up a flow

set sink0 [new Agent/LossMonitor]
set sink1 [new Agent/LossMonitor]
set sink2 [new Agent/LossMonitor]
set sink3 [new Agent/LossMonitor]
$ns attach-agent $n(0) $sink0
$ns attach-agent $n(1) $sink1
$ns attach-agent $n(2) $sink2
$ns attach-agent $n(3) $sink3

#$ns attach-agent $sink2 $sink3
set tcp0 [new Agent/TCP]
$ns attach-agent $n(0) $tcp0
set tcp1 [new Agent/TCP]
$ns attach-agent $n(1) $tcp1
set tcp2 [new Agent/TCP]
$ns attach-agent $n(2) $tcp2
set tcp3 [new Agent/TCP]
$ns attach-agent $n(3) $tcp3

proc attach-CBR-traffic {node sink size interval} {
#Get an instance of the simulator
set ns [Simulator instance]
#create a CBR agent and attach it to the node
set cbr [new Agent/CBR]
$ns attach-agent $node $cbr
$cbr set packetSize $size
$cbr set 

[ns] mobile/tworayground.cc: TwoRayGround propagation model assume flat ground

2011-10-19 Thread manishsingh chaudhary

hi to all
 any body please tell me how to sort out the following
as it come during running of program.

mobile/tworayground.cc: TwoRayGround propagation model assume flat ground


thanks

with regard
manish


[ns] Help regarding MANETS Protocol simulation in NS-2.34

2011-10-19 Thread Azizur Rahim

Hi every one!

I am new to ns-2. I have just installed ns-2.34 and working properly,
tested for some example scripts. Please give me some tcl scripts for
simulation of AODV, DSDV, DSR, TORA and any other if you can.

Secondly please guide me how to modify these files

Third: How we can simulate wireless sensor Networks in ns-2 please
just an example Tcl script plzz.

4th: What are the recommended patches to use for ns-2

Seeking for you kind response

Regards
Aziz


[ns] Bloom Filters

2011-10-19 Thread Ederval Pablo Ferreira

Hi everyone.

Did Anyone here already work with Bloom Filters in NS2??? Does Anyone
here have some Bloom Filters code for NS2 to share


Best Regards

-- 
*Ederval Pablo Ferreira da Cruz
Professor de Informática (Instituto Federal do Espírito Santo (IFES) -
Campus Itapina)
Mestrando em Informática (Universidade Federal do Estado do Rio de Janeiro -
UNIRIO)
MCP (Microsoft Certified Professional) -  Windows Server 2003 / ISA SERVER
2004 / Windows XP
FCP (Furukawa Certified Professional) - Fundamental
E-mail: ederval.c...@ifes.edu.br
Skype: edervall.cruz
27 9229-0685*



Re: [ns] how to enhance existing aodv protocol

2011-10-19 Thread manishsingh chaudhary

hi to all

 somebody tell me


difference between Mac/802_15_4 Vs Mac/802_11

   

  Mac/802_15_4  can be apply in ad-hoc network or not what are their benefit
in using manet




 please help me in this matter *thanks*

 with regards
 manish