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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
11-22-2014, 04:01 AM
|
#1
|
LQ Newbie
Registered: Nov 2014
Location: UP
Posts: 1
Rep:
|
Zrp integration
Hiii.. i am going to integrate the zrp in ns2.35 and facing the error.... plz help me to remove this error....
trace/cmu-trace.o: In function `hdr_zrp::access(Packet const*)':
cmu-trace.cc .text._ZN7hdr_zrp6accessEPK6Packet[hdr_zrp::access(Packet const*)]+0x7): undefined reference to `hdr_zrp: ffset_'
collect2: ld returned 1 exit status
make: *** [ns] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
|
|
|
03-27-2015, 03:08 AM
|
#3
|
LQ Newbie
Registered: Mar 2015
Posts: 12
Rep:
|
hai knudfl i've been following your step to patch zrp in ns2.35 ubuntu 14.04 32 bit
every step that i've followed sucessfully
but when i run the tcl from the links that you gave all of them were failed
agustus@agustus-Presario-CQ42-Notebook-PC:~/agustus/ns-allinone-2.35/ns-2.35$ ns235-zrp test_zrp.txt
invalid command name "Agent/ZRP"
while executing
"Agent/ZRP set radius_ 2"
(file "test_zrp.txt" line 15)
can you help me to solve the error?
because i've been looking for the solution but when i run it again the error keeps showing.
thank you for your attention
|
|
|
03-27-2015, 09:28 AM
|
#4
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Post #3, @Mellia : Welcome to LQ.
I guess you mean test_zrp.tcl, and not test_zrp.txt.
? How about $ ns235-zrp zrp-Demo2-1.tcl
About your error ( invalid command name "Agent/ZRP" ) :
Looks like you have a failed build.
There is a line missing in post #2 : $ cd ns-allinone-2.35/ >>>
>> Ubuntu >>>
$ tar xvf ns-allinone-2.35_gcc482.tar.gz
$ cd ns-allinone-2.35/
$ patch -p0 < zrp-ns235.patch
$ ./install
$ cd ns-2.35/
$ cp ns ns235-zrp2
$ sudo cp ns235-zrp2 /usr/local/bin/
$ ns235-zrp example-zrp.tcl
$ ns235-zrp zrp-Demo2-1.tcl
-
Last edited by knudfl; 03-27-2015 at 09:29 AM.
|
|
1 members found this post helpful.
|
03-30-2015, 01:21 AM
|
#5
|
LQ Newbie
Registered: Mar 2015
Posts: 12
Rep:
|
thanks knudfl it works
|
|
|
09-28-2015, 04:23 AM
|
#6
|
Member
Registered: Nov 2013
Posts: 30
Rep:
|
zrp
$ns235-zrp example-zrp.tcl
ns235-zrp: command not found
Please tell me how to resolve this error and run ZRP.
|
|
|
09-28-2015, 05:52 AM
|
#8
|
Member
Registered: Nov 2013
Posts: 30
Rep:
|
thank you how to execute a nam file to visualise the simulation in ns2.35?
|
|
|
09-28-2015, 07:59 AM
|
#9
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Re #8.
NAM :
$ cd ns-allinone-2.35/nam-1.15/
$ sudo make install
('make install' will copy the executable 'nam' to /usr/local/bin/).
Using : 'ns235-zrp zrp-Demo1-1.tcl' will create the file `scatternet10.nam'.
( And scatternet10.tr ).
NAM : $ nam scatternet10.nam &
... the nam window will open. Hit the "play button" to watch the animation.
And $ ns235-zrp example-zrp.tcl : Will create `pktdemo.nam'.
-
|
|
1 members found this post helpful.
|
09-29-2015, 03:49 AM
|
#10
|
Member
Registered: Nov 2013
Posts: 30
Rep:
|
awk scripts
Thank You I need awk scripts for finding routing traffic received,throughput,reachability ratio,route discovery delay,broadcast retransmission,energy consumption for ZRP. Also while trying your steps, the installation of nam has failed stating 'no such file found error'.What to do now?
|
|
|
09-29-2015, 04:53 AM
|
#11
|
Member
Registered: Nov 2013
Posts: 30
Rep:
|
awk and trave
do awk scripts to calculate throughput and other such parameters vary for different trace files?
|
|
|
09-29-2015, 04:57 AM
|
#12
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Re #10.
""I need awk scripts"" :
Well, then have a look into awk#perl#python__scripts-09.2015.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
If no luck finding a usable script, you can edit a script to your requirements.
Or you can write your own awk or perl code.
----
NAM : If the './install' failed with nam-1.15 : Use ns-allinone-2.35_gcc482.tar.gz .
Or use a tested package :
http://www.linuxquestions.org/questi...-4175524760/#2
.. Download the package, click the downloaded package, and it will be installed.
Or do : $ sudo dpkg -i nam***.deb
Note : The Ubuntu nam packages cannot be used. Ref. the one year old bug report.
-
Last edited by knudfl; 09-29-2015 at 04:59 AM.
|
|
1 members found this post helpful.
|
09-29-2015, 05:07 AM
|
#13
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Re #11.
Depends what you are doing. And why not test that yourself ?
|
|
|
09-29-2015, 05:12 AM
|
#14
|
Member
Registered: Nov 2013
Posts: 30
Rep:
|
the initialised values in awk scripts are getting printed as such.how to get the actual data from the trace files?
|
|
|
09-29-2015, 05:22 AM
|
#15
|
Member
Registered: Nov 2013
Posts: 30
Rep:
|
Code:
# ======================================================================
# Define options
# ======================================================================
Mac/802_11 set dataRate_ 11Mb ;#Rate for Data Frames
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(ant) Antenna/OmniAntenna ;# Antenna type
set val(ll) LL ;# Link layer type
set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type
set val(ifqlen) 50 ;# max packet in ifq
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(nn) 100 ;# number of mobilenodes
set val(rp) ZRP ;# routing protocol
set val(x) 10000
set val(y) 10000
set val(stop) 10 ;
Agent/ZRP set radius_ 9 ;
set ns [new Simulator]
#ns-random 0
set tracefd [open zrp_9.tr w]
#set windowVsTime2 [open win.tr w]
set namtrace [open zrp_9.nam w]
$ns use-newtrace
$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)
#set f0 [open So_Goi_Da_Gui.tr w]
#set f1 [open So_Goi_Mat.tr w]
#set f2 [open proj_out2.tr w]
#set f3 [open proj_out3.tr w]
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
set chan_1 [new $val(chan)]
# CONFIGURE AND CREATE NODES
$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) \
#-channelType $val(chan) \
-topoInstance $topo \
-agentTrace OFF \
-routerTrace ON \
-macTrace ON \
-movementTrace OFF \
-channel $chan_1 # \
proc finish {} {
global ns f f0 f1 f2 f3 namtrace
$ns flush-trace
close $namtrace
exec nam -r 5m zrp_9 &
exit 0
}
proc record {} {
global sink0 sink1 sink2 sink3 sink4 sink5 sink6 sink7 sink8 sink9 f0 f1 f2 f3
#Get An Instance Of The Simulator
set ns [Simulator instance]
#Set The Time After Which The Procedure Should Be Called Again
set time 0.05
#How Many Bytes Have Been Received By The Traffic Sinks?
set bw0 [$sink9 set npkts_]
set bw1 [$sink9 set nlost_]
#set bw2 [$sink2 set npkts_]
#set bw3 [$sink3 set npkts_]
#Get The Current Time
set now [$ns now]
#Save Data To The Files
puts $f0 "$now [expr $bw0]"
puts $f1 "$now [expr $bw1]"
#puts $f2 "$now [expr $bw2]"
#puts $f3 "$now [expr $bw3]"
#Re-Schedule The Procedure
$ns at [expr $now+$time] "record"
}
for {set i 0} {$i < $val(nn)} {incr i} {
set n_($i) [$ns node]
#$n_($i) random-motion 0
$ns initial_node_pos $n_($i) 20
}
for {set i 0} {[expr $i < $val(nn)/10]} {incr i} {
for {set j 0} {$j < 10} {incr j} {
set id [expr $i*10 + $j]
$n_($id) set X_ [expr $j*100+120]
$n_($id) set Y_ [expr $i*100+120]
$n_($id) set Z_ 0.0
}
}
for {set i 0} {$i < $val(nn)} {incr i} {
if {$i3 == 0} {
$ns at 0.0 "$n_($i) setdest [expr $i7*1040+20] [expr $i3*3000+20] 5.0"
}
if {$i3 == 1} {
$ns at 0.0 "$n_($i) setdest [expr $i%6+20] [expr $i%3*3000+20] 5.0"
}
if {$i%3 == 2} {
$ns at 0.0 "$n_($i) setdest [expr $i%7*1040+20] [expr $i%3+10] 5.0"
}
}
# CONFIGURE AND SET UP A FLOW
for {set i 0} {$i < $val(nn)} {incr i} {
set sink_($i) [new Agent/LossMonitor]
$ns attach-agent $n_($i) $sink_($i)
set tcp_($i) [new Agent/TCP]
$ns attach-agent $n_(0) $tcp_($i)
}
proc attach-CBR-traffic { node sink size interval } {
#Get an instance of the simulator
set ns [Simulator instance]
#Create a CBR agent and attach it to the node
set cbr [new Agent/CBR]
$ns attach-agent $node $cbr
$cbr set packetSize_ $size
$cbr set interval_ $interval
#Attach CBR source to sink;
$ns connect $cbr $sink
return $cbr
}
set cbr0 [attach-CBR-traffic $n_(0) $sink_([expr $val(nn)-1]) 512 0.25]
set cbr1 [attach-CBR-traffic $n_(1) $sink_([expr $val(nn)-1]) 512 0.25]
$ns at 0.0 "$cbr0 start"
$ns at $val(stop) "$cbr0 stop"
$ns at 0.0 "$cbr1 start"
$ns at $val(stop) "$cbr1 stop"
$ns at $val(stop) "finish"
puts "Start of simulation.."
$ns run
Code:
BEGIN {
recvdSize = 0
txsize=0
drpSize=0
startTime = 400
stopTime = 0
thru=0
}
{
event = $1
time = $2
node_id = $3
pkt_size = $8
level = $4
# Store start time
if (level == "AGT" && event =="s" ) {
if (time < startTime) {
startTime = time
}
# hdr_size = pkt_size % 400
# pkt_size -= hdr_size
# Store transmitted packet's size
txsize++;
}
# Update total received packets' size and store packets arrival time
if (level == "AGT" && event =="r" ) {
if (time > stopTime) {
stopTime = time
}
# Rip off the header
# hdr_size = pkt_size % 400
# pkt_size -= hdr_size
# Store received packet's size
recvdSize++
# thru=(recvdSize/txsize)
# printf(" %.2f %.2f \n" ,time,thru)>"tru2.tr"
}
if (level == "AGT" && event == "D" ) {
# hdr_size = pkt_size % 400
# pkt_size -= hdr_size
# Store received packets size
drpSize++
}
}
END {
printf("Average Throughput[kbps] = %.2f\t\ts=%.2f\td=%.2f\tr=%.2fStartTime=%.2f\tStopTime=%.2f\n",(recvdSize/(stopTime-startTime)),txsize,drpSize,recvdSize,startTime,stopTime)
}
Result:
Average Throughput[kbps] = -0.00 StartTime=400.00 StopTime=0.00
Please tell me how to modify the script to get appropriate results!
Last edited by shivee; 09-29-2015 at 06:51 AM.
|
|
|
All times are GMT -5. The time now is 12:47 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|