LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-30-2015, 12:14 PM   #1
shivee
Member
 
Registered: Nov 2013
Posts: 30

Rep: Reputation: Disabled
awk script on a trace file doesnot give actual value


Hi! I am trying to implement ZRP MANET protocol in ns2.I have uptil now obtained the trace file and have awk files to calculate throughput,delay and other such parameters.When I run throughput.awk the result displayed is 'throughput=-0.0 start time=400 end time=0.I can't figure out the solution.Kindly help me.Else suggest me someother method to analyse the trace file obtained.Thank You.I use ns2.35 in ubuntu 14
 
Old 09-30-2015, 02:35 PM   #2
robertdaleweir
Member
 
Registered: Jul 2006
Location: Canada
Distribution: Fedora
Posts: 93

Rep: Reputation: 11
Quote:
Originally Posted by shivee View Post
Hi! I am trying to implement ZRP MANET protocol in ns2.I have uptil now obtained the trace file and have awk files to calculate throughput,delay and other such parameters.When I run throughput.awk the result displayed is 'throughput=-0.0 start time=400 end time=0.I can't figure out the solution.Kindly help me.Else suggest me someother method to analyse the trace file obtained.Thank You.I use ns2.35 in ubuntu 14
Hi shivee
Can you post a copy of throughput.awk code. Also a few lines of the 'trace file'.
 
Old 10-01-2015, 11:14 AM   #3
shivee
Member
 
Registered: Nov 2013
Posts: 30

Original Poster
Rep: Reputation: Disabled
Code:
BEGIN {
recv=0;
gotime = 1;
time = 0;
packet_size = 50;
time_interval=2;
}
#body
{
        event = $1
             time = $2
             node_id = $3
             level = $4
             pktType = $7

 if(time>gotime) {

  print gotime, (packet_size * recv * 8.0)/1000; #packet size * ... gives results in kbps
  gotime+= time_interval;
  recv=0;
  }

#============= CALCULATE throughput=================

if (( event == "r") && ( pktType == "cbr" ) && ( level=="AGT" ))
{
 recv++;
}

} #body


END {
;
}
the above is the awk script.And can you tell me which part of trace file you want to analyse so I that I can put it.Thanks!
 
  


Reply

Tags
awk-ns2, 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] awk script for caluclating throughput (trace file of ns2) rc49 Programming 6 09-28-2015 06:03 PM
awk scripts for trace file mikes1313 Linux - Newbie 7 04-18-2013 06:11 PM
awk file for wimax trace Narges Linux - Newbie 3 11-11-2012 07:38 AM
awk + trace file analysing RSM_smile Linux - Newbie 1 08-30-2012 04:23 PM
File Trace NS-2 and Program AWK. easyvn112 Linux - Software 11 07-07-2012 03:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:08 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
Open Source Consulting | Domain Registration