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 11-22-2014, 05:01 AM   #1
Apsingh111
LQ Newbie
 
Registered: Nov 2014
Location: UP
Posts: 1

Rep: Reputation: Disabled
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
 
Old 11-23-2014, 09:55 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,314

Rep: Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576
Welcome to LQ.

How to avoid errors : Use the right commands.
* But : We don't know which commands you have used.

HOWTO zrp, ns-2.35 :
$ tar xvf ns-allinone-2.35_gcc482.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ patch -p0 < zrp-ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ ./install
$ cd ns-2.35/
$ cp ns ns235-zrp
# cp ns235-zrp /usr/local/bin/
..... Then you can do $ ns235-zrp example-zrp.tcl
.. and $ ns235-zrp zrp-Demo2-1.tcl
.. from the examples, zrp-examples-2012.tar.bz2
https://drive.google.com/file/d/0B7S...ew?usp=sharing

-
 
1 members found this post helpful.
Old 03-27-2015, 04:08 AM   #3
Mellia
LQ Newbie
 
Registered: Mar 2015
Posts: 12

Rep: Reputation: Disabled
Smile

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
 
Old 03-27-2015, 10:28 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,314

Rep: Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576
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 10:29 AM.
 
1 members found this post helpful.
Old 03-30-2015, 02:21 AM   #5
Mellia
LQ Newbie
 
Registered: Mar 2015
Posts: 12

Rep: Reputation: Disabled
thanks knudfl it works
 
Old 09-28-2015, 05:23 AM   #6
shivee
Member
 
Registered: Nov 2013
Posts: 30

Rep: Reputation: Disabled
zrp

$ns235-zrp example-zrp.tcl
ns235-zrp: command not found

Please tell me how to resolve this error and run ZRP.
 
Old 09-28-2015, 06:29 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,314

Rep: Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576
Re #6, @shivee
Quote:
ns235-zrp: command not found
The file "ns235-zrp" is one that you create when building ns-2.35 + ZRP.

ZRP info :
. http://www.linuxquestions.org/questions/tags/zrp/
. https://groups.google.com/forum/?fro.../zrp|sort:date

* ns235 build example :
tar xvf ns-allinone-2.35_gcc482.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < zrp-ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
./install
cd ns-2.35/
cp ns ns235-zrp
sudo cp ns235-zrp /usr/local/bin/
.... Simulation example : ns235-zrp zrp-Demo1-1.tcl


-

Last edited by knudfl; 09-28-2015 at 06:31 AM.
 
1 members found this post helpful.
Old 09-28-2015, 06:52 AM   #8
shivee
Member
 
Registered: Nov 2013
Posts: 30

Rep: Reputation: Disabled
thank you how to execute a nam file to visualise the simulation in ns2.35?
 
Old 09-28-2015, 08:59 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,314

Rep: Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576
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.
Old 09-29-2015, 04:49 AM   #10
shivee
Member
 
Registered: Nov 2013
Posts: 30

Rep: Reputation: Disabled
Smile 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?
 
Old 09-29-2015, 05:53 AM   #11
shivee
Member
 
Registered: Nov 2013
Posts: 30

Rep: Reputation: Disabled
awk and trave

do awk scripts to calculate throughput and other such parameters vary for different trace files?
 
Old 09-29-2015, 05:57 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,314

Rep: Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576
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 05:59 AM.
 
1 members found this post helpful.
Old 09-29-2015, 06:07 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,314

Rep: Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576Reputation: 3576
Re #11.

Depends what you are doing. And why not test that yourself ?
 
Old 09-29-2015, 06:12 AM   #14
shivee
Member
 
Registered: Nov 2013
Posts: 30

Rep: Reputation: Disabled
the initialised values in awk scripts are getting printed as such.how to get the actual data from the trace files?
 
Old 09-29-2015, 06:22 AM   #15
shivee
Member
 
Registered: Nov 2013
Posts: 30

Rep: Reputation: Disabled
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 07:51 AM.
 
  


Reply

Tags
ns2, zrp


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] How to make modified ZRP protocol from ZRP protocol vishalpolara Linux - Newbie 12 10-07-2015 06:02 AM
ZRP mikunmicii Linux - Newbie 1 06-10-2014 12:04 PM
[SOLVED] ZRP patch farfattou Linux - Software 2 02-27-2013 06:43 AM
Help me, code ZRP vuichoigiaitri Linux - Wireless Networking 2 08-19-2012 05:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:30 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