I am trying to run CRCN protocol in ns2.31 but every time i am getting this error,
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 06:07 AM.
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.
Last edited by Harsh Vaidya; 01-04-2015 at 07:56 AM.
Reason: Attaching a file
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← #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
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← #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.
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
-
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← #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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← #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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.