[ns] tcl code
hi all, can u tell me what this line do ? # creation of the MutiFaceNodes $ns node-config -multiIf ON ;#to create MultiFaceNode set multiFaceNode [$ns node 4.0.0] $ns node-config -multiIf OFF $multiFaceNode add-interface-node $iface1 set tcp_(0) [new Agent/TCP/FullTcp] $multiFaceNode attach-agent $tcp_(0) $iface1 ;# the interface is used for sending set app_(0) [new Application/TcpApp $tcp_(0)] puts App0 id=$app_(0) i don't understand the line : $multiFaceNode attach-agent $tcp_(0) $iface1 usually we use $ns attach-agent $tcp(0) $interface No?? best regards .
[ns] ns2 computing the link quality ?
hi all, i want to know how to calculate the link quality of a network (wifi , umts and wimax). my idea is to get the radio link quality of available network and compere between them to get the best access. thanx for help and if there is a tcl code of this it could help me more.
Re: [ns] sample code for wsn
Hi, You should inspect the source file and clean it up for line breaks where it should not be. It is easy, jusr 2-3 places. Split into separate wsn1.scn file where that information is given. When done, the code works perfectly. - Arne - Original Message - From: Habeshawit2God bez2...@hotmail.co.uk To: ns-users@ISI.EDU Sent: Tuesday, March 17, 2009 6:27 PM Subject: Re: [ns] sample code for wsn Dear naveen prabu, As per your advise i tried it however it doesn't work and here is the error message it came up with i went to the line it is referring to and realize that there is actually something wrong with it. Here is the error message: siu06...@sie59a:~/Documents$ ns wsn1.tcl bad option file: must be add, info, remove, variable, vdelete, or vinfo while executing trace file for wpan (special handling needed) (file wsn1.tcl line 47) Dear nabeen, hoping to hear from you soon, i would like to thank you very much in advance. Best regards, Habeshawit2God P.S please do not hesitate to drop me an e-mail using my personal e-mail and I would also appreciate it if you can give me reply between today and tomorrow as i have to hand in my project on Thursday 19thMarch 2009!! naveen prabu wrote: I have pasted sample tcl file and scenario file here... save scn file as wsn1.scn and tcl file as (say)wsn1.tcl and run tcl file... try runnin thisif any bugs then let me know... wsn1.tcl # == # Define options # == set val(chan) Channel/WirelessChannel;# Channel Type set val(prop) Propagation/TwoRayGround ;# radio-propagation model set val(netif) Phy/WirelessPhy/802_15_4 set val(mac)Mac/802_15_4 set val(ifq)Queue/DropTail/PriQueue;# interface queue type set val(ll) LL ;# link layer type set val(ant)Antenna/OmniAntenna;# antenna model set val(ifqlen) 50 ;# max packet in ifq set val(nn) 25 ;# number of mobilenodes set val(rp) AODV ;# routing protocol set val(x) 50 set val(y) 50 set val(nam) wsn1.nam set val(traffic) ftp;# cbr/poisson/ftp #read command line arguments proc getCmdArgu {argc argv} { global val 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 val($name) [lindex $argv [expr $i+1]] } } getCmdArgu $argc $argv set appTime10.0 ;# in seconds set appTime20.3 ;# in seconds set appTime30.7 ;# in seconds set stopTime100 ;# in seconds # Initialize Global Variables set ns_ [new Simulator] set tracefd [open ./wsn1.tr w] $ns_ trace-all $tracefd if { $val(nam) == wsn1.nam } { set namtrace [open ./$val(nam) w] $ns_ namtrace-all-wireless $namtrace $val(x) $val(y) } $ns_ puts-nam-traceall {# nam4wpan #} ;# inform nam that this is a trace file for wpan (special handling needed) Mac/802_15_4 wpanNam namStatus on ;# default = off (should be turned on before other 'wpanNam' commands can work) #Mac/802_15_4 wpanNam ColFlashClr gold ;# default = gold #Mac/802_15_4 wpanNam NodeFailClr grey ;# default = grey # For model 'TwoRayGround' set dist(5m) 7.69113e-06 set dist(9m) 2.37381e-06 set dist(10m) 1.92278e-06 set dist(11m) 1.58908e-06 set dist(12m) 1.33527e-06 set dist(13m) 1.13774e-06 set dist(14m) 9.81011e-07 set dist(15m) 8.54570e-07 set dist(16m) 7.51087e-07 set dist(20m) 4.80696e-07 set dist(25m) 3.07645e-07 set dist(30m) 2.13643e-07 set dist(35m) 1.56962e-07 set dist(40m) 1.20174e-07 Phy/WirelessPhy set CSThresh_ $dist(15m) Phy/WirelessPhy set RXThresh_ $dist(15m) # set up topography object set topo [new Topography] $topo load_flatgrid $val(x) $val(y) # Create God set god_ [create-god $val(nn)] set chan_1_ [new $val(chan)] # 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) \ -topoInstance $topo \ -agentTrace OFF \ -routerTrace OFF \ -macTrace ON \ -movementTrace OFF \ #-energyModel EnergyModel \ #-initialEnergy 1 \ #-rxPower 0.3 \ #-txPower 0.3 \ -channel $chan_1_ for {set i 0} {$i $val(nn) } {incr i} { set node_($i) [$ns_ node] $node_($i) random-motion 0 ;# disable random motion } source ./wsn1.scn # Setup traffic flow between nodes proc cbrtraffic { src dst interval starttime } { global ns_ node_
Re: [ns] Can NS-2 be used to transmit real video sequences? (galaxy-huang)
google Evalvid there is a link in the website about video and ns2! 3. Can NS-2 be used to transmit real video sequences? (galaxy-huang) Message: 3 Date: Mon, 4 May 2009 10:25:44 +0800 (CST) From: galaxy-huang galaxy-hu...@163.com Subject: [ns] Can NS-2 be used to transmit real video sequences? To: ns-users ns-users@ISI.EDU Message-ID: 25628181.351191241403944698.javamail.corem...@bj163app121.163.com Content-Type: text/plain; charset=gbk hi everyone Recently,i am reading one book about streaming over the wireless network,today i come across such a sentence:as well as using real video sequences and transmitting them using an NS-2 simulator-based implementation of the 802.11a/b/g MAC standard. My question is:can NS-2 be used to transmit real video sequences and ,if can, how to achieve this purpose?Could someone tells me about this and recommends me some book or website to refer to? Thanks in advance! Guisong Huang
[ns] pros and cons of cygwin and NS2
Hello friends, Please tell me what is the different between performing network simulations in NS2 in Linux environment and on cygwin in windows systems. Please explain pros and cons of each. Regards
[ns] How to allow the number of TCP users to vary with time?
Hello, I wonder if I can vary the number of active TCP users with time, during simulation. To be exact, I want to vary the number of active TCP users from 30 to 200 and back to 30 again, with one user becoming active or inactive every two seconds. ___ Χρησιμοποιείτε Yahoo!; Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr
[ns] Please help mo for SMCC on NS
hi to all! I am a newer about NS. my interesting is multicast congestion control. I have some problems when I run SMCC[Gu-In Kwon and John W. Byers. Smooth Multirate Multicast Congestion Control.IEEE INFOCOM 2003] I have downloaded SMCC source codes from the writer's websit: http://cs-people.bu.edu/guin/smcc.html. When I run the simulations, there are several problems, maybe the reason is the version I used is 3.2 which is differented from the writer's. Could somebody give me some advice that how to modify the codes in order to run simulations successfully in NS 3.2? The Problems is as follows: 1、If I replace TCP-sink.h and TCP-sink.cc with the website provioded, the error log in make procedure is : tcp/tcp-asym-sink.o:tcp-asym-sink.cc:(.text+0x30d): undefined reference to `Acker::update_ts(int, double, int)' tcp/tcp-asym-sink.o:tcp-asym-sink.cc:(.rdata$_ZTV11TcpAsymSink[vtable for TcpAsymSink]+0x34): undefined reference to `DelAckSink::reset()' collect2: ld returned 1 exit status make: *** [ns] Error 1 So I retain the inherent codes in NS 3.2 instead of raplacing them. 2、I put smcc.h and smcc.cc in the directory \ns-allinone-2.31\ns-2.31\mcast When make it , there are some error information as follows: mcast/smcc.cc: In member function `void SmccAgent::warmup()': mcast/smcc.cc:123: error: ISO C++ forbids initialization in array new mcast/smcc.cc:124: error: ISO C++ forbids initialization in array new mcast/smcc.cc:125: error: ISO C++ forbids initialization in array new So I modified the codes : 123 send_timer_ = new SmccSendTimer[Max_smcc_Layer](this); 124NoFeedbacktimer_ = new SmccNoFeedbackTimer[Max_smcc_Layer](this); 125bcl_timer_ = new BclTimer[Max_Bcl_Layer](this); to: SmccSendTimer *send_timer_[Max_smcc_Layer]; SmccNoFeedbackTimer *NoFeedbacktimer_[Max_smcc_Layer]; for(int kk=0; kkMax_smcc_Layer; kk++) { send_timer_[kk]= new SmccSendTimer(this); NoFeedbacktimer_[kk]= new SmccNoFeedbackTimer(this); } BclTimer *bcl_timer_[Max_Bcl_Layer]; for(int kk=0; kkMax_Bcl_Layer; kk++) { bcl_timer_[kk]= new BclTimer(this); } Then make successfully. 3、I have also modified makefile.in to include the needed .cc and .h files: OBJ_CC = \ ... tcp/tfrc.o tcp/tfrc-sink.o mcast/tfmcc.o mcast/tfmcc-sink.o mcast/smcc.o tcp/formula.o \ ... 4、 When I run smcc.tcl for figure 4 and 5, there is one error log: $ ns smcc.tcl (_o3 cmd line 1) invoked from within _o3 cmd queue-parameter _o17 _o24 2 6 invoked from within catch $self cmd $args ret invoked from within if [catch $self cmd $args ret] { set cls [$self info class] global errorInfo set savedInfo $errorInfo error error when calling class $cls: $args $... (procedure _o3 line 2) (SplitObject unknown line 2) invoked from within $ns queue-parameter $n3 $n4 2 6 (file smcc.tcl line 94) My question is : what's the function of $ns queue-parameter $n3 $n4 2 6? 5、 Then I commented out these two lines: ... #$ns queue-parameter $n3 $n4 2 6 ... #$ns queue-parameter $n3 $n5 2 21 ... Finally, when run it again, it turn another error: $ ns smcc.tcl Scheduler: Event UID not valid! I can't find where the problems, could somebody help me to solve these problems and run the simulations successfully? So appreciated and best regards!