[ns] Directional antenna -reg.

2012-02-08 Thread Munivenkatesh K

Dear all,

if any one has directional antenna sample scripts pl send me. And kindly
tell me the execution process also if it is different from normal one.

-- 
Thanks  Regards,
Muni
Research Scholar,


[ns] directional antenna

2012-02-04 Thread Munivenkatesh


try the following modified code of u r program...it will work. b4 that you
just verfiy whether u have set environment varible in .bashrc or not. all
the beast.

#
#
#This is a sample Tcl script file for using with TeNs
#


set val(chan)   Channel/WirelessChannel ;# channel type
set val(prop)   Propagation/Shadowing  ;# radio-propagation
model
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/DirAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 4  ;# number of mobilenodes

#One can use AODV also , all other wireless protocols currently don't work
set val(rp) AODV  ;# routing protocol

set val(ni) 1

#This type of modulation is a new addition 
set opt(mod)Modulation/BPSK

# ==
# Main Program
# ==


#
# Initialize Global Variables
#

set ns_ [new Simulator]
set tracefd [open simple.tr w]
#set par[open param.tr w]
$ns_ trace-all $tracefd
$ns_ use-newtrace
# set up topography object
set topo   [new Topography]

$topo load_flatgrid 1 1

#$val(nn)

#
#  Create the specified number of mobilenodes [$val(nn)] and attach them
#  to the channel. 
#  Here two nodes are created : node(0) and node(1)

# 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 [new $val(chan)] \
 -topoInstance $topo \
 -agentTrace ON \
 -routerTrace ON \
 -macTrace ON \
 -numif  $val(ni) \ 

create-god 6

proc create_node { x y z } {
global ns_
#Mac/802_11 MAC_RTSThreshold 2000
#Mac/802_11 MAC_FragmentationThreshold 2500
#Mac/802_11 DSSS_AirPropagationTime 0.03
Mac/802_11 set dataRate_11mb
Mac/802_11 set basicRate_   1mb

# This statement can be used to enable BPSK Modulation scheme
# If one does not want to use this then it can be set to zero.
# By default it is set to zero.
Phy/WirelessPhy set modulationscheme_   1

set newnode [$ns_ node]
$newnode random-motion 0
$newnode set X_ $x
$newnode set Y_ $y
$newnode set Z_ $z

return $newnode
}

proc create_cbr_connection { from to startTime interval packetSize } {
global ns_
set udp0 [new Agent/UDP]
set src [new Application/Traffic/CBR]
$udp0 set packetSize_ $packetSize
$src set packetSize_ $packetSize
$src set interval_ $interval

set sink [new Agent/Null]

$ns_ attach-agent $from $udp0
$src attach-agent $udp0
$ns_ attach-agent $to $sink

$ns_ connect $udp0 $sink
$ns_ at $startTime $src start
return $udp0
}

proc create_tcp_connection { from to startTime } {
#global ns_ par
set tcp [new Agent/TCP]
$tcp set packetSize_ 1500
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns_ attach-agent $from $tcp
$ns_ attach-agent $to $sink
$ns_ connect $tcp $sink
set ftp [new Application/FTP]
$ftp set packetSize_ 1500
$ftp attach-agent $tcp
$ns_ at  $startTime $ftp start 
$tcp attach $par

  $tcp trace cwnd_
  $tcp trace maxseq_
  $tcp trace rtt_
  $tcp trace dupacks_
  $tcp trace ack_
  $tcp trace ndatabytes_
  $tcp trace ndatapack_
  $tcp trace nrexmit_
  $tcp trace nrexmitpack_
return $tcp
}


$ns_ node-config  -numif 1
set node_(0) [create_node 1010  0]

[$node_(0) set netif_(0)] set channel_number_ 1

[$node_(0) set netif_(0)] set Pt_  0.1
 
set a [new Antenna/DirAntenna]
$a setType  1   
$a setAngle 90
#$a setWidth10

[$node_(0) set netif_(0)] dir-antenna $a

#This is to set the number of interfaces in one node, in this case the no.
of 
#interfaces in node is set to 1 
$ns_ node-config  -numif 2

#This is the way a node is created (situated at 

[ns] Directional antenna support in ns-2.34

2010-11-24 Thread SuhailYousaf Yousaf



Hi all,

Is there any support for Directional Antenna in ns2 2.34? Please guide.

Thanks in advance

- Suhail
  


[ns] directional antenna

2010-04-21 Thread kage hydera

dear all,

is there a way to get  directional antenna  code in NS2 package,  as i need
directional antenna instead of omnidirectional antenna one. If any body used
directional antenna before, please reply to this mail? Any help is
appreciated


kage

Thanks in advance


[ns] Directional Antenna support in ns2.34?

2010-03-21 Thread The Learner


Hi all.
I would like to know if ns-allinone-2.34 (2.34 version) provides support for
Directional Antenna?
Which file I should check for the in ns2 directory?

Regards,
The Learner.
-- 
View this message in context: 
http://old.nabble.com/Directional-Antenna-support-in-ns2.34--tp27975754p27975754.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] directional antenna

2010-02-28 Thread 許 涛

Is anyone using directional antenna?

I patch the source given in the following url to ns-2.34.
http://cbg.me/2009/02/adding-directional-antenna-and-multiple-interface-support-to-ns-233/comment-page-1/#comment-143

And I download the sample from tens
http://www.cse.iitk.ac.in/users/braman/tens/scripts/sample_long.tcl
Changed the sample code to the following.
It is runned, but while visualizing the nam file, “node 0 is not defined”.

#
#This is a sample Tcl script file for using with TeNs
#

set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
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/DirAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 4 ;# number of mobilenodes
set val(x) 1
set val(y) 1

#One can use AODV also , all other wireless protocols currently don’t work
set val(rp) AODV ;# routing protocol WLSTATIC

set val(ni) 1

#This type of modulation is a new addition
set opt(mod) Modulation/BPSK

# ==
# Main Program
# ==

#
# Initialize Global Variables
#

set ns_ [new Simulator]
set tracefd [open test.tr w]
$ns_ trace-all $tracefd

set namtrace [open test.nam w]
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)

# set up topography object
set topo [new Topography]

$topo load_flatgrid $val(x) $val(y)

#$val(nn)

create-god 6
set chan_1_ [new $val(chan)]

#
# Create the specified number of mobilenodes [$val(nn)] and “attach” them
# to the channel.
# Here two nodes are created : node(0) and node(1)

# 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 [new $val(chan)] \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace OFF \
-channel $chan_1_ \
-numif $val(ni) \

proc create_node { x y z } {
global ns_
#Mac/802_11 MAC_RTSThreshold 2000
#Mac/802_11 MAC_FragmentationThreshold 2500
#Mac/802_11 DSSS_AirPropagationTime 0.03
Mac/802_11 set dataRate_ 11mb
Mac/802_11 set basicRate_ 1mb

# This statement can be used to enable BPSK Modulation scheme
# If one does not want to use this then it can be set to zero.
# By default it is set to zero.
Phy/WirelessPhy set modulationscheme_ 1

set newnode [$ns_ node]
$newnode random-motion 0
$newnode set X_ $x
$newnode set Y_ $y
$newnode set Z_ $z

return $newnode
}

proc create_cbr_connection { from to startTime interval packetSize } {
global ns_
set udp0 [new Agent/UDP]
set src [new Application/Traffic/CBR]
$udp0 set packetSize_ $packetSize
$src set packetSize_ $packetSize
$src set interval_ $interval

set sink [new Agent/Null]

$ns_ attach-agent $from $udp0
$src attach-agent $udp0
$ns_ attach-agent $to $sink

$ns_ connect $udp0 $sink
$ns_ at $startTime “$src start”
return $udp0
}

proc create_tcp_connection { from to startTime } {
global ns_ par
set tcp [new Agent/TCP]
$tcp set packetSize_ 1500
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns_ attach-agent $from $tcp
$ns_ attach-agent $to $sink
$ns_ connect $tcp $sink
set ftp [new Application/FTP]
$ftp set packetSize_ 1500
$ftp attach-agent $tcp
$ns_ at $startTime “$ftp start”
$tcp attach $par

$tcp trace cwnd_
$tcp trace maxseq_
$tcp trace rtt_
$tcp trace dupacks_
$tcp trace ack_
$tcp trace ndatabytes_
$tcp trace ndatapack_
$tcp trace nrexmit_
$tcp trace nrexmitpack_
return $tcp
}

$ns_ node-config -numif 1
set node_(0) [create_node 10 10 0]

[$node_(0) set netif_(0)] set channel_number_ 1

[$node_(0) set netif_(0)] set Pt_ 0.1

set a [new Antenna/DirAntenna]
$a setType 1
$a setAngle 90
#$a setWidth 10

[$node_(0) set netif_(0)] dir-antenna $a

#This is to set the number of interfaces in one node, in this case the no.
of
#interfaces in node is set to 1
$ns_ node-config -numif 2

#This is the way a node is created (situated at 10,60,0)
set node_(1) [create_node 10 60 0]

#This is the method of setting the power at which a particular network
interface of a node
# will transmit at. For eg. in this case the interface no.0 of node no 1
will work at 0.005W
[$node_(1) set netif_(0)] set Pt_ 0.1

#This is the method of setting the channel at which a particular network
interface of a node
#will work at. For eg. in this case the interface no.0 of node no 1 will
work at channel 1
[$node_(1) set netif_(0)] set channel_number_ 1

#This is the method of setting the power at which a particular network
interface of a
#node will transmit at. For eg. in this case the interface no.1 of node no 1
will work at 0.005W

[$node_(1) set 

[ns] Directional Antenna (smart antenna)

2009-01-30 Thread Green Tea

Hi,

Is there any Directional Antenna (or smart antenna) implementation publicly 
available?
I read several papers saying that they have implemented their ideas in NS2 but 
all I could find is a few outdated and broken links.
I am trying to implement my ideas on directional antenna (for Mesh or MANET 
type network). 

Any information would be highly appreciated.

- Greene  


  


[ns] Directional Antenna Support

2007-03-14 Thread Goutham B

Hi All

I am working on the implementation of directional antenna support over some
MAC protocols.

I have come across a lot of references in the mail archive (mostly related
to TeNS).. but the links are either void or outdated. I would like to know
if anyone has implemented directional antenna models and wireless MAC
protocols that support directional antennas.

It would be of great help if any example/tutorial/code is suggested.

Thank you.

Goutham