LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-24-2009, 01:03 PM   #1
Cataj
LQ Newbie
 
Registered: May 2009
Posts: 12

Rep: Reputation: 0
Cannot create CBR traffic in ns2


I am unable to create CBR traffic in ns-2.33 or ns-2.34 following the ns tutorial http://www.isi.edu/nsnam/ns/tutorial/ as per below I keep getting the error "invalid command name cbr"

#############################################

[root@localhost Desktop]# ns
% set ns [new Simulator]
_o4
% set nf [open out.nam w]
file3
% ns namtrace-all $nf
warning: using backward compatibility mode
file3
% proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}
% set n0 [$ns node]
_o18
% set n1 [$ns node]
_o21
% ns duplex-link $n0 $n1 1Mb 10ms DropTail
% #Create a UDP agent and attach it to node n0
% set udp0 [new Agent/UDP]
_o44
% ns attach-agent $n0 $udp0
% #Create a CBR traffic source and attach it to udp0
% set cbr0 [new Application/Traffic/CBR]
_o46
% cbr0 set packetSize_ 500
invalid command name "cbr0"
% cbr0 set interval_ 0.005
invalid command name "cbr0"
% cbr attach-agent $udp0
invalid command name "cbr"
%
###################################################

I had this problem in ns-2.33 after installing and therefore installed ns-2.34 to see if it rectified, I installed each version following the instructions from http://www.edaboard.com/ftopic297674.html and validated each installation which came back successful.

If anyone has any ideas please help me as I have no idea what is wrong.
 
Old 06-24-2009, 02:51 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,688

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
Welcome to LQ.

Please use 'code tags' :
Just type [ code ] where the code starts ....
and [ /code ] at the end, but without <space>
inside the square parentheses.
http://www.linuxquestions.org/questi....php?do=bbcode

Unkown error : Not knowing your native language, and your keybord ...
Or is your browser displaying % % ?
But, anyway, % (percent) is to be replaced with $ (dollar) sign's, and typo's corrected.
Template.tcl : Section "IV. The first Tcl script"
http://www.isi.edu/nsnam/ns/tutorial/nsscript1.html
Code:
# start with these lines :

set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf

proc finish {} {
        global ns nf
        $ns flush-trace
        close $nf
        exec nam out.nam &
        exit 0
}

#######################
# end with :

$ns at 5.0 "finish"
$ns run
and "traffic.tcl" .. please click the 'Play' button in 'nam', and wait a minute.
Code:
set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

proc finish {} {
        global ns nf
        $ns flush-trace
        close $nf
        exec nam out.nam &
        exit 0
}

set n0 [$ns node]
set n1 [$ns node]

$ns duplex-link $n0 $n1 1Mb 10ms DropTail

#Create a UDP agent and attach it to node n0
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0

# Create a CBR traffic source and attach it to udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0

set null0 [new Agent/Null] 
$ns attach-agent $n1 $null0

$ns connect $udp0 $null0

$ns at 0.5 "$cbr0 start"
$ns at 4.5 "$cbr0 stop"


$ns at 5.0 "finish"

$ns run

Last edited by knudfl; 06-24-2009 at 03:22 PM.
 
Old 06-27-2009, 02:41 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,688

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
The code must be saved as a file
.. and then please run it with : ns <filename>.tcl

Links to "ready to run files"
http://www.isi.edu/nsnam/ns/tutorial.../example1b.tcl
http://www.isi.edu/nsnam/ns/tutorial...s/example2.tcl
http://www.isi.edu/nsnam/ns/tutorial...s/example3.tcl
.....
 
Old 08-02-2009, 03:16 PM   #4
asmahan
LQ Newbie
 
Registered: Jul 2009
Posts: 15

Rep: Reputation: 0
ns2

hi all
i am using ns-allinone 2.33 on fedora 8
but i do not know from where i can change the transmission range ,bandwidth and packet size!
any help
 
Old 08-03-2009, 02:45 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,688

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
@ asmahan
Please have a look at this .. and may be find an answer ..

Google, keyword : .. transmission range bandwidth and packet size ..

http://www.google.com/search?hl=en&q...earch&aq=f&oq=

http://mailman.isi.edu/pipermail/ns-...ne/043128.html
.....

ns-mailing-lists, etc.

http://www.isi.edu/nsnam/ns/ns-lists.html
http://www.isi.edu/nsnam/archive/ns-users/webarch/
http://mailman.isi.edu/mailman/listinfo/ns-users

.....

Documentation
http://nsnam.isi.edu/nsnam/index.php/User_Information
http://nsnam.isi.edu/nsnam/index.php...#Documentation
http://nsnam.isi.edu/nsnam/index.php/NS_manual
.....
Good luck !
.....
 
Old 08-03-2009, 10:24 AM   #6
asmahan
LQ Newbie
 
Registered: Jul 2009
Posts: 15

Rep: Reputation: 0
making scenarios in ns2 v2.33

hi
i tried to make scenarios by running:
./make-scen.csh
but i got this
bash: ./make-scen.csh: /bin/csh: bad interpreter: No such file or directory
even the file exists

any help please
 
Old 08-03-2009, 12:38 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,688

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
ns-2.33/indep-utils/cmu-scen-gen/setdest/make-scen.csh

'make-scen.csh' is a script :
cat make-scen.csh
... and see, that line one is : #!/bin/csh

'/bin/csh' is usually provided by the package 'tcsh'.
Please install 'tcsh' to know if 'make-scen.csh'
works at all. ( I get no result, running it, but
" META_CLASS: Undefined variable. ")
.....
.....
Other examples ( see the README files )

ns-2.33/indep-utils/cmu-scen-gen/setdest
./setdest -v 1 -n 20 -p 2.0 -s 10.0 -t 200 -x 500 -y 500 > scen-20-test

ns-2.33/indep-utils/cmu-scen-gen/
ns cbrgen.tcl -type cbr -nn 10 -seed 1 -mc 8 -rate 10.00

And
http://winet.ece.ufl.edu/~wen/setdest_para.html
./setdest -v 1 -n 20 -p 2.0 -M 10.0 -t 200 -x 500 -y 500 > scen-20_v1.tcl
.....

Last edited by knudfl; 08-03-2009 at 01:30 PM.
 
Old 08-03-2009, 02:20 PM   #8
asmahan
LQ Newbie
 
Registered: Jul 2009
Posts: 15

Rep: Reputation: 0
hi
how can i install tcsh and how i can know that make-scen.csh works or not from tcsh
i works on ns2 for monthes but this the first time i faced this problem and i do not know why?
 
Old 08-03-2009, 04:01 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,688

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
A very few scripts use 'csh' ...
( ns2 is a mix of files created by a lot of contributors.)
... so by coincidence, you are first meeting it now.

Package install, Fedora 8 :
1) su , password
2) yum install <package>

so ...
'yum install tcsh'
will do ( Or use the Package Manager, 'Add Remove Software'.)
.....
 
Old 08-03-2009, 05:48 PM   #10
asmahan
LQ Newbie
 
Registered: Jul 2009
Posts: 15

Rep: Reputation: 0
thanks a lot
 
Old 08-04-2009, 03:41 PM   #11
asmahan
LQ Newbie
 
Registered: Jul 2009
Posts: 15

Rep: Reputation: 0
hello,
i almost read all files in ns 2.33 but i did not find the implementation of random way point model
any help
 
Old 08-05-2009, 07:38 AM   #12
Cataj
LQ Newbie
 
Registered: May 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks very much for the advice I shall give it a go.
 
Old 08-05-2009, 08:35 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,688

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
@ asmahan
Quote:
... ns 2.33 .... implementation of random way point model.
Google .. random way point model ..
( or .. random waypoint model .. ) :
http://www.tct.hut.fi/~esa/java/rwp/index.shtml

... and much more :
http://www.google.com/search?hl=en&q...Search&aq=&oq=
.....
.....
Google .. ns2 random waypoint model ..
User Manual for IMPORTANT Mobility Tool Generators in ns-2 Simulator :
http://www.google.com/url?sa=t&sourc...toER9MJQ4EUR0A
Quote : " the 'baseline' mobility model to evaluate the
protocols in Ad Hoc Network. The Random Waypoint model is
provided by the setdest tool in the standard ns-2 ... "

... much more here
http://www.google.com/search?hl=en&q...&aq=f&oq=&aqi=

Good luck !
.....
 
Old 08-05-2009, 04:33 PM   #14
asmahan
LQ Newbie
 
Registered: Jul 2009
Posts: 15

Rep: Reputation: 0
Hi all
i put a comment in aodv.cc but this error appear
even after i deleted it the error remains



aodv/aodv.cc:1: error: stray ‘\357’ in program
aodv/aodv.cc:1: error: stray ‘\273’ in program
aodv/aodv.cc:1: error: stray ‘\277’ in program
aodv/aodv.cc:1388:2: warning: no newline at end of file
make: *** [aodv/aodv.o] Error 1

any help
 
Old 08-05-2009, 05:52 PM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,688

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
# 14

1) Unpack ns-2.33 to a new directory.
2) And use 'cp -a' to replace aodv.cc with a new one.

... Next time ... and before you edit a file :
Please make a backup of it. Some invisible keystrokes
can make it difficult to come back to the original ...
.....
 
  


Reply

Tags
nam


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create 2 pppoe connections and routing traffic through each one squirrelza Linux - Networking 0 07-13-2007 10:53 AM
Software to batch convert CBR, CBZ files to PDF format JTAL604622 Linux - Software 1 06-11-2007 06:33 PM
How to create p2p traffic inside private lab? sharon179 Linux - Networking 1 03-13-2007 09:54 PM
Application to view Comic Book files (*.cbr) ZaphyR Linux - Software 5 05-12-2005 12:48 PM
howto open and view CBR comic book files instead of cbview ? cccc Linux - Software 0 08-22-2004 04:34 PM


All times are GMT -5. The time now is 03:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration