LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 04-06-2016, 12:55 AM   #1
ankur_pareek
LQ Newbie
 
Registered: Apr 2016
Posts: 5

Rep: Reputation: Disabled
Ns2 PUMA tace file shows no receiver with CBR packets at AGT on ubuntu 14.04


I am working with ns2 and seeing the puma trace file which I get on executing the default puma.tcl. I see only source sending CBR at AGT but no receiver receiving CBr at AGt level.What could be the reason? Please help
 
Old 04-06-2016, 07:22 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,811

Rep: Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190Reputation: 4190
Quote:
Originally Posted by ankur_pareek View Post
I am working with ns2 and seeing the puma trace file which I get on executing the default puma.tcl. I see only source sending CBR at AGT but no receiver receiving CBr at AGt level.What could be the reason? Please help
The reason is: there is a problem in your TCL script.

Since you post absolutely NO details (version/distro of Linux, version of NS2, the TCL script, the input/output, etc.), how do you think ANYONE will be able to help you?
 
Old 04-06-2016, 09:59 AM   #3
ankur_pareek
LQ Newbie
 
Registered: Apr 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Sorry i am working on ubuntu 14.04 and I have used puma.tcl given in tcl/ex.
 
Old 04-06-2016, 10:12 AM   #4
ankur_pareek
LQ Newbie
 
Registered: Apr 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
This is my awk script it also gives zero as expected as no CBR for receiver


BEGIN {
initialenergy = 100
maxenergy=0
n=100
nodeid=999
recvLine=0
sendLine=0
}
{

# Trace line format: energy
event = $1
time = $2
level= $4
traffic =$7

if (event =="r" || event =="d" || event =="s"|| event =="f") {
node_id = $9
energy=$17
}
if (event=="N"){
node_id = $5
energy=$7
}

####output
for (i=0; i<n; i++)
{


if (event == "r" && traffic =="cbr" ) {
if(level == "AGT")
recvLine ++ ;}

if ( event == "s" && traffic =="cbr") {
if(level == "AGT")
sendLine ++ ;
}


}

}

END {
printf("cbr s:%d r:%d, r/s Ratio:%.4f \n", sendLine, recvLine, (recvLine/sendLine));
}
 
Old 04-06-2016, 10:24 AM   #5
ankur_pareek
LQ Newbie
 
Registered: Apr 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
#This is mu puma.tcl

set opt(stop) 15
set nodes 25
set mobility 1
set scenario 1
set pausetime 0
set traffic cbr
set senders 5
set receivers 20
set X 1000
set Y 1000

set ns_ [new Simulator]

set topo [new Topography]
$topo load_flatgrid $X $Y

set tracenam [open puma.nam w]
$ns_ namtrace-all-wireless $tracenam $X $Y

set tracefd [open puma.tr w]
#$ns_ use-newtrace
$ns_ trace-all $tracefd

set god_ [create-god $nodes]

$ns_ node-config -adhocRouting PUMA \
-llType LL \
-macType Mac/802_11 \
-ifqLen 50 \
-ifqType Queue/DropTail/PriQueue \
-antType Antenna/OmniAntenna \
-propType Propagation/TwoRayGround \
-phyType Phy/WirelessPhy \
-channel [new Channel/WirelessChannel] \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF

for {set i 0} {$i < $nodes} {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0;
}

puts "Loading connection pattern ..."
source "puma-cbr-ex"

puts "Loading scenarios file..."
source "puma-scenario-ex"

for {set i 0} {$i < $nodes} {incr i} {
$ns_ at $opt(stop) "$node_($i) reset";
}

Node instproc join { group } {
$self instvar ragent_
set group [expr $group]

$ragent_ join $group
}

Node instproc leave { group } {
$self instvar ragent_
set group [expr $group] ;

$ragent_ leave $group
}

$ns_ at $opt(stop) "$ns_ halt"
puts "Starting Simulation ..."
$ns_ run
puts "NS EXITING..."
 
  


Reply

Tags
ns2, ns2 ns-allinone


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
How to change traffic from cbr to Pareto/exponential in ns2.35(ubuntu 12.04) Nindu Linux - Newbie 11 06-02-2017 02:01 PM
[SOLVED] NS2: How receive CBR packets at my own agent and duplicate them for new destination?? fahimeh_ak Programming 5 09-06-2016 11:12 PM
how divide CBR traffic on two path in ns2 moreroz Linux - Wireless Networking 0 11-19-2014 11:44 AM
PUMA in ns2 studentlb Linux - Software 1 06-15-2013 11:12 AM
Cannot create CBR traffic in ns2 Cataj Linux - Newbie 21 08-13-2009 12:04 AM


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