LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-25-2014, 07:06 AM   #1
Harsh Vaidya
LQ Newbie
 
Registered: Oct 2014
Posts: 14

Rep: Reputation: Disabled
I am trying to run CRCN protocol in ns2.31 but every time i am getting this error,


Hello guys. When ever i tried to run CRCN protocol i am getting following error:
harsh@ubuntu:~/ns3/test$ ns test1.tcl
num_nodes is set 10
missing operator at _@_
in expression "$i < $val(ni) _@_$val(channum) "
(parsing expression "$i < $val(ni) $val(cha...")
invoked from within
"for {set i 0} {$i < $val(ni) $val(channum) } {incr i} {
$ns_ add-channel $i $chan_($i)
}"
(file "test1.tcl" line 48)


Can someone guide me how to correct this error??

Thank you

Last edited by Harsh Vaidya; 12-25-2014 at 07:07 AM.
 
Old 12-25-2014, 08:39 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Welcome to LQ.

»test1.tcl« : Unknown file.
Please attach `test1.tcl´ as test1.tcl.txt
* Attachments : The paper clip tool in the 'Advanced Editor'.

CRCN simulation examples : crcn-examples_05.2014.tar.gz
Link https://drive.google.com/file/d/0B7S...ew?usp=sharing

CRCN info http://www.linuxquestions.org/questions/tags/crcn/


? Any questions ? Then please specify your OS :
a) Please show the reply from the command $ uname -m
b) OS name and version.


P.S. : CRCN isn't going to have full functionality on a contemporary OS.
Oldish OS´s for CRCN : CentOS 6 and may be Ubuntu 10.04 ...
. http://www.linuxquestions.org/questi...-4175503601/#2
. http://www.linuxquestions.org/questi...-4175499622/#7

-
 
1 members found this post helpful.
Old 01-04-2015, 08:50 AM   #3
Harsh Vaidya
LQ Newbie
 
Registered: Oct 2014
Posts: 14

Original Poster
Rep: Reputation: Disabled
CRCN issue

Thank you knudfl for replying on my issue.

Output for uname -m command is i686

And my Test1 file is below:
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(ant) Antenna/OmniAntenna ; #Antenna model
set val(rp) WCETT ;#Routing Protocol
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ifqlen) 50 ;# max packet in ifq
set val(mac) Mac/802_11 ;# MAC type
set val(ll) LL ;# link layer type
set val(nn) 10 ;# number of mobilenodes
set val(ni) 2
set val(channum) 4 ;# number of interfaces
set val(cp) /home/harsh/ns3/test/ranm1.tcl ; # topology traffic file
set val(stop) 50 ;# simulation time
# ==================================================================
# Main Program
# ======================================================================


# Initialize Global Variables
set ns_ [new Simulator]
set tracefd [open /home/harsh/ns3/test/test1.tr w]
$ns_ trace-all $tracefd

# set up topography object
set topo [new Topography]
$topo load_flatgrid 1000 1000

#create nam
set namtrace [open /home/harsh/ns3/test/test1.nam w]
$ns_ namtrace-all-wireless $namtrace 1000 1000

# Create God
set god_ [create-god $val(nn)]
# 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 ON -routerTrace ON -macTrace ON -movementTrace ON


for {set i 0} { $i < $val(ni)} {incr i} {
set chan_($i) [new $val(chan)]
}


#configure for interface and channel
$ns_ node-config -ifNum $val(ni) -channel $chan_(0)


for {set i 0} {$i < $val(ni) $val(channum) } {incr i} {
$ns_ add-channel $i $chan_($i)
}

for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) set recordIfall 1
$node_($i) random-motion 0 ;# disable random motion
}


source $val(cp) ; #source topology and traffic file generated by others

# Tell nodes when the simulation ends
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at $val(stop).0 "$node_($i) reset";
}
$ns_ at $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt "
proc stop {} {
global ns_ tracefd
$ns_ flush-trace
close $tracefd
exec nam /home/harsh/ns3/test/test1.nam &
exit 0
}
puts "Starting Simulation..."
$ns_ run


Sorry knudfl its a big file and i am really appriciated your help.

Thanking you in advance.
Attached Files
File Type: txt test1.tcl.txt (2.5 KB, 18 views)

Last edited by Harsh Vaidya; 01-04-2015 at 08:56 AM. Reason: Attaching a file
 
Old 01-05-2015, 12:06 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Repeat, from post #2 :

" b) OS version ..." please

→ → $ cat /etc/issue


* About test1.tcl : The file `ranm1.tcl´ is missing.
* Please attach as "ranm1.tcl.txt".


-

Last edited by knudfl; 01-05-2015 at 12:15 AM.
 
1 members found this post helpful.
Old 01-05-2015, 03:36 PM   #5
Harsh Vaidya
LQ Newbie
 
Registered: Oct 2014
Posts: 14

Original Poster
Rep: Reputation: Disabled
CRCN issue

Sorry i miss that second thing you asked.

uname: i686
Version: Ubuntu 14.04.1 LTS \n \l

Test and random file i have attached with this. These files are new files which i created just few hours ago.

Here Test file is executing properply but when i am trying to run random file it is generating error.

I am really appriciating your help knudfl.

Thank you so much
Attached Files
File Type: txt random.tcl.txt (4.8 KB, 17 views)
File Type: txt test.tcl.txt (2.3 KB, 19 views)

Last edited by Harsh Vaidya; 01-05-2015 at 03:41 PM. Reason: Few leftout details
 
Old 01-05-2015, 06:51 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
← #5 .

The attached random.tcl.txt is a copy of the original CRCN random.tcl.
"random.tcl" is not a simulation tcl file.
Is a "movement file" to be used by a CRCN <simulation>.tcl file.


Quote:
... trying to run random file it is generating error
A movement file cannot be run.

$ ns-crcn test.tcl.txt : No issues here.


-

Last edited by knudfl; 01-12-2015 at 07:35 AM.
 
1 members found this post helpful.
Old 01-06-2015, 12:57 AM   #7
Harsh Vaidya
LQ Newbie
 
Registered: Oct 2014
Posts: 14

Original Poster
Rep: Reputation: Disabled
CRCN Issue

Thank you for reply,

But i want a graphical representation of Throughput and interference measurement.

How can i get that??

Is TEXT.tr file working fine ??


Thanking you
Harsh Vaidya
 
Old 01-06-2015, 07:51 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
← #7 .
Quote:
I want a graphical representation of Throughput
and interference measurement
OK, that's a new topic.

Please test and read some examples which can generate graphical output :
1) xgraph_ns2-files-tcl_11.2014.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
.... and read the included documentation → example4.tcl →
Marc Greis, VIII. Creating Output Files for Xgraph.

2) crcn-wcett Xgraph examples : crcn-wcett.tar.bz2

3) ns-allinone-2.3x/ns-2.3x/tcl/ex/red-pd/ → $ ./runall.sh
... which will show how to generate formats other than xgraph.
* Required : $ sudo apt-get install csh gnuplot
-
Attached Files
File Type: txt crcn-wcett.tar.bz2.txt (5.5 KB, 23 views)
 
1 members found this post helpful.
Old 01-12-2015, 02:30 AM   #9
Harsh Vaidya
LQ Newbie
 
Registered: Oct 2014
Posts: 14

Original Poster
Rep: Reputation: Disabled
Continue Error

Hi kundlf,

Now try this program. When i am trying to add interface and channel, it is giving me the same error.

I attaching necessary programs. please help me with this.

I am running low on my deadlines.

I really appreciate your help.



Thanking you,
Harsh
Attached Files
File Type: txt CRCN.tcl.txt (2.6 KB, 21 views)
File Type: txt random.tcl.txt (4.8 KB, 8 views)
 
Old 01-12-2015, 04:44 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
← #9 .

The file attached to post #9 works OK here :
$ ns-crcn CRCN.tcl
.. the files CRCN.nam 41.7 MB, CRCN.tr 33.5 MB are created.
 
1 members found this post helpful.
Old 01-12-2015, 04:51 AM   #11
Harsh Vaidya
LQ Newbie
 
Registered: Oct 2014
Posts: 14

Original Poster
Rep: Reputation: Disabled
what is the command :
Is it $ns CRCN.tcl or
$ns-crcn CRCN.tcl
 
Old 01-12-2015, 04:55 AM   #12
Harsh Vaidya
LQ Newbie
 
Registered: Oct 2014
Posts: 14

Original Poster
Rep: Reputation: Disabled
And what system you are using ??

It is giving me the same error that i've pasted in first post.
 
Old 01-12-2015, 05:21 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
← #12 .

$ ns-crcn :
That's the [ns-2.31 + crcn] executable built with Ubuntu 10.10 - 32bits.
Can be installed as a package, crcn-ns-2.31-ubuntu10_i386.deb
https://drive.google.com/file/d/0B7S...ew?usp=sharing
* Will work OK with most 32bits (i686) OS. ( Not WCETT on Ubuntu 14.04).

Or $ ns231-crcn : Also OK with your `CRCN.tcl´
Output files : Same sizes, 41.7 MB and 33.5 MB.
The executable was built with a contemporary OS, 27 Aug 2014.
OS = PCLinuxOS, probably version 2014.08 .

I will test if a build of [ns-2.31 + crcn] is OK with Ubuntu 14.04 - 32.
... Later.

-

Last edited by knudfl; 01-12-2015 at 09:33 AM.
 
Old 01-12-2015, 07:02 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
← #12, #13.

Ubuntu 14.04.01 - i686 with CRCN.
$ tar xvf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.31/
$ patch -p0 crcn_ns231.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ export CC=gcc41 CXX=g++41 && ./install
$ cd ns-2.31/
$ cp ns ns-crcn1404
$ sudo cp ns-crcn1404 /usr/local/bin/
.. Then only use 'ns-crcn1404' for the simulation.
I.e. plain $ ns is not to be used.
I.e. i.e. you may have another executable 'ns' on your OS.

$ ns-crcn1404 CRCN.tcl : OK.
The default examples https://drive.google.com/file/d/0B7S...ew?usp=sharing
The WCETT examples cannot be used. ( Example 5-*, 7-* ).
! And as your "test1.tcl" is WCETT : No good : the reply is →
Code:
$ ns-crcn2014 test1.tcl 
num_nodes is set 10
INITIALIZE THE LIST xListHead
INITIALIZE THE LIST xListHead
Starting Simulation...                                                                                               
format_wcett: invalid WCETT packet type
About gcc41, g++41 : Post #47 here →
http://www.linuxquestions.org/questi...532/page4.html

-
 
Old 01-12-2015, 07:15 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Conclusion : You will have to use another OS to achieve full crcn functionality.

Even the 'ns-crcn' from "crcn-ns-2.31-ubuntu10_i386.deb"
isn't working fully with Ubuntu 14.04 :
$ ns-crcn test1.tcl → → Segmentation fault.

Please read post #2 about recommended OS´s.
 
  


Reply

Tags
crcn, ns2


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
[SOLVED] to run TCL script on ns2 for udp lite protocol sakibamu Linux - Software 2 01-03-2014 02:30 AM
[SOLVED] Can anyone tell how to run SPIN protocol in ns2 lintreesa Linux - Software 3 05-26-2013 03:04 PM
I need a professional one who can guide me to run GPSR routing protocol in Ns2.34 ste sowmyabs Linux - Software 1 03-03-2013 04:08 AM
NS2 S-MAC Protocol Sleep Time Query ulyssues.fam Linux - Newbie 0 04-14-2012 10:01 AM
weight throwing protocol using ns2 code,diffusion based protocol using ns2 code rajrupa Linux - Networking 1 05-27-2010 04:39 AM


All times are GMT -5. The time now is 06:23 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration