Re: [ns] installing ns2.27 on ubuntu 9.10

2010-03-07 Thread

You can try run the following command in terminal.

sudo apt-get install build-essential

sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev

sudo apt-get install libxmu-dev



On Sun, Mar 7, 2010 at 11:35 PM, tarik tarik emtari...@gmail.com wrote:


 I want to install NS2.27 on ubuntu 9.10.
 but it indicate the following problem

 
 * Build tcl8.4.5
 
 loading cache ./config.cache
 checking whether to use symlinks for manpages... no
 checking compression for manpages... no
 checking for gcc... gcc
 checking whether the C compiler (gcc ) works... yes
 checking whether the C compiler (gcc ) is a cross-compiler... no
 checking whether we are using GNU C... yes
 checking whether gcc accepts -g... yes
 checking how to run the C preprocessor... gcc -E
 checking for unistd.h... yes
 checking for limits.h... yes
 checking for building with threads... no (default)
 checking if the compiler understands -pipe... yes
 checking for required early compiler flags... _LARGEFILE64_SOURCE
 checking for 64-bit integer type... long long
 checking for struct dirent64... no
 checking for struct stat64... yes
 checking for off64_t... yes
 checking whether byte ordering is bigendian... no
 checking for getcwd... yes
 checking for opendir... yes
 checking for strstr... yes
 checking for strtol... yes
 checking for strtoll... yes
 checking for strtoull... yes
 checking for tmpnam... yes
 checking for waitpid... yes
 checking for strerror... yes
 checking for getwd... yes
 checking for wait3... yes
 checking for uname... yes
 checking for realpath... yes
 checking dirent.h... yes
 checking for errno.h... yes
 checking for float.h... yes
 checking for values.h... yes
 checking for limits.h... (cached) yes
 checking for stdlib.h... yes
 checking for string.h... yes
 checking for sys/wait.h... yes
 checking for dlfcn.h... yes
 checking for unistd.h... (cached) yes
 checking for sys/param.h... yes
 checking for sys/modem.h... no
 checking termios vs. termio vs. sgtty... termios
 checking for fd_set in sys/types... yes
 checking whether struct tm is in sys/time.h or time.h... time.h
 checking for sys/time.h... yes
 checking whether time.h and sys/time.h may both be included... yes
 checking for tm_zone in struct tm... yes
 checking for gmtime_r... yes
 checking for localtime_r... yes
 checking tm_tzadj in struct tm... no
 checking tm_gmtoff in struct tm... yes
 checking long timezone variable... yes
 checking for st_blksize in struct stat... yes
 checking for fstatfs... yes
 checking for 8-bit clean memcmp... yes
 checking for memmove... yes
 checking proper strstr implementation... yes
 checking for strtoul... yes
 checking for strtod... yes
 checking for strtod... (cached) yes
 checking for Solaris2.4/Tru64 strtod bugs... ok
 checking for ANSI C header files... yes
 checking for mode_t... yes
 checking for pid_t... yes
 checking for size_t... yes
 checking for uid_t in sys/types.h... yes
 checking for socklen_t... yes
 checking for opendir... (cached) yes
 checking union wait... yes
 checking for strncasecmp... yes
 checking for BSDgettimeofday... no
 checking for gettimeofday... yes
 checking for gettimeofday declaration... present
 checking whether char is unsigned... no
 checking signed char declarations... yes
 checking for a putenv() that copies the buffer... no
 checking for langinfo.h... yes
 checking whether to use nl_langinfo... yes
 checking for sin... no
 checking for main in -lieee... yes
 checking for main in -linet... no
 checking for net/errno.h... no
 checking for connect... yes
 checking for gethostbyname... yes
 checking how to build libraries... static
 checking for ranlib... ranlib
 checking if 64bit support is requested... no
 checking if 64bit Sparc VIS support is requested... no
 checking system version (for dynamic loading)... ./configure: 1: Syntax
 error: Unterminated quoted string
 *tcl8.3.2 configuration failed! Exiting ...
 Tcl is not part of the ns project. Please see
 www.Scriptics.comhttp://www.scriptics.com/
 to see if they have a fix for your platform.*





 thanks



[ns] UML to networks graphs

2010-03-05 Thread

hi,everyone

My question is not directly with ns2.
Is anyone use UML to show some graphs like Fig 4.28 in Computer Networks by
Tanenbaum?

Thank you very much.


[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] tens for ns2.34

2010-02-24 Thread

Hi

Is anyone how to use the following tens for ns2.34.
http://www.cse.iitk.ac.in/users/braman/tens/

I need your help.

Thank you very much.



On Wed, Feb 24, 2010 at 6:53 PM, Shyam Sundar handsomesun...@gmail.comwrote:


 Hi,
 I am trying to modify mannasim files to work on ns-allinone-2.34. For this
 i
 just added few mannasim code into mac-802_11.cc file of ns-allinone-2.34.
 After this modification ns throwing sheduler: UID error. So anyone please
 help me.

 With Regards
 S.Shyam Sundar




-- 
許涛、簡簡単単生活


Re: [ns] Help configuring simple AODV routing example

2010-02-16 Thread

Hi, Bello

I am learning that tutorial now.
I typed the code, and it run well.
If you insert $ns node-config -adhocRouting AODV
after
for {set i 0} {$i  12} {incr i} {
   set n($i) [$ns node]
}

Variable declaration is not needed in Tcl.

Good luck.

On Wed, Feb 17, 2010 at 12:29 AM, Ariel Bello abell...@hotmail.com wrote:



 I am a new user to ns-2 and have read through just about every tutorial
 I could find.  I used the example3.tcl script from Marc Greis' tutorial
 (ring architecture that illustrates the use the of the dynamic routing
 by using $ns rtproto DV command).  This file works fine on its own,
 however when I add the line $ns node-config -adhocRouting AODV right
 before I enter the for loop for instantiating the nodes, I get the
 following error:

 can't read chan: no such variable
while executing
 $node
 add-interface $chan $propInstance_ $llType_ $macType_  $ifqType_
 $ifqlen_ $phyType_ $antType_ $topoInstance_  $inerrProc_ $outerrProc_
 $FECProc_
(procedure _o3 line 77)
(Simulator create-wireless-node line 77)
invoked from within
 _o3 create-wireless-node
(eval body line 1)
invoked from within
 eval $self create-wireless-node $args
(procedure _o3 line 23)
(Simulator node line 23)
invoked from within
 $ns node
(for body line 2)
invoked from within
 for {set i 0} {$i  12} {incr i} {
set n($i) [$ns node]
 }

 I am assuming that ns wants me to instantiate/declare all of the variables
 listed after $node add-interface ... however I do not know how.  I looked
 at the NS-2 AODV tutorial which was sent over the mailing list a couple
 weeks ago, however the example in that tutorial fails to compile as well.
  If I am leaving anything out, please do not hesitate to ask.

 Thanks in advance for any help.

 Ariel Bello

 _
 Hotmail: Free, trusted and rich email service.
 http://clk.atdmt.com/GBL/go/201469228/direct/01/



Re: [ns] Fwd: Calling SystemC code in NS2

2010-02-15 Thread

*Hi

I am reading the ns-tutorial

II.1. Documentation for nsnam

The last line has a link to
*http://www.isi.edu/nsnam/dist/archive/ns-users/

But it is unavailable?

Thanks  Regards.

On Tue, Feb 16, 2010 at 1:38 PM, 許 涛 lxu...@gmail.com wrote:

 hi

 Can anyone download the ns manual *gzip'ed postscript* 
 formathttp://www.isi.edu/nsnam/ns/doc/ns_doc.ps.gzfrom the following URL?

 http://www.isi.edu/nsnam/ns/doc/ns_doc.ps.gz