LinuxQuestions.org
Review your favorite Linux distribution.
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-02-2012, 03:18 AM   #1
albho
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
getting error while running" xgraph Error in file `out.tr' at line 23930: "


hi i am newbie to ns2. currently i am working under ns2 for my academic project. i getting error over xgraph

code:

xgraph out.tr

error:

Error in file `out.tr' at line 23930:
Unknown line type
like so on to every line in tracefile

please help .... thanks
 
Old 04-02-2012, 04:40 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,263

Rep: Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660
Welcome to LQ.

Trace files can be filtered into a format that xgraph can read, with awk / awk scripts
http://www.linuxquestions.org/questi...-graph-870284/
http://www.linuxquestions.org/questi...ts-awk-870934/

May be the old application "Trace Graph" can handle some files.tr ?
http://ns-2.blogspot.com/2008/10/tra...ator-ns-2.html
> Download >> http://www.angelfire.com/al4/esorkor/

.
 
Old 04-02-2012, 01:00 PM   #3
albho
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
hi thanks i have created my awk script the code in my project. but i cant find the mistake please help me to find the mistake...

code:

proc finish {file is_all_cleint_finished} {
global env

global file2 wwwClient page_dl_time log_file tracefile total_dl num_of_attackers total_page_download_time
global num_of_requiered_sesssions num_of_legitimate_clients sim_scenario sim_num total_attackers_bw ns cl
global simulation_starting_time total_time total_session
global debug_scnario basic_scenario_with_droptail basic_scenario_with_wdaq simple_flooding_with_droptail
global simple_flooding_with_wdaq basic_flooding_type1_with_wdaq basic_flooding_type2_with_wdaq
global flooding_on_minimum_type1_with_wdaq flooding_on_minimum_type2_with_wdaq flooding_with_no_punishment_type1_with_wadq
global flooding_with_no_punishment_type2_with_wdaq sophisticated_flooding_with_wdaq

global patch_for_sim_scenario_1_2 tcp_trace


# close ns2 trace file
close $tracefile

# if 0 {
puts "\nFinishing test program at [[Simulator instance] now]"
set f [open temp.rands w]
puts $f "TitleText: $file"
puts $f "Device: Postscript"

exec rm -f temp.p temp.d
exec touch temp.d temp.p
#
# split queue/drop events into two separate files.
# we don't bother checking for the link we're interested in
# since we know only such events are in our trace file
#
exec awk {
# {
# if (($1 == "+" || $1 == "-" ) && \
# ($5 == "tcp" || $5 == "ack" || $5 == "http"))\
# print $2, $8 + ($11 % 90) * 0.01
# }
# Forward (server to client) data
{
if (($1 == "r") && ($3 == "0") && ($4 == "1") && \
($5 == "http" || $5 == "ack"))\
print $6
}
} out.tr > temp.p
exec awk {
# {
# if ($1 == "d")
# print $2, $8 + ($11 % 90) * 0.01
# }
# Reverse (client to server) data
{
if (($1 == "r") && ($3 == "1") && ($4 == "0") && \
($5 == "http" || $5 == "ack"))\
print $6
}
} out.tr > temp.d

exec awk { BEGIN {s = 0} { s += $1 } END {print s*8/60.1}
} temp.p > temp.fwd
exec awk { BEGIN {s = 0} { s += $1 } END {print s*8/60.1}
} temp.d > temp.rev
# Uncomment these two lines to look at the average forward and reverse
# bit rate for this test
#puts -nonewline "[exec cat temp.fwd]"
#puts " [exec cat temp.rev]"
puts $f \"packets
flush $f
exec cat temp.p >@ $f
flush $f
# insert dummy data sets so we get X's for marks in data-set 4
puts $f [format "\n\"skip-1\n0 1\n\n\"skip-2\n0 1\n\n"]

puts $f \"drops
flush $f
#
# Repeat the first line twice in the drops file because
# often we have only one drop and xgraph won't print marks
# for data sets with only one point.
#

set ehud -1
exec head $ehud temp.d >@ $f

# exec head -1 temp.d >@ $f
exec cat temp.d >@ $f
close $f
#exec xgraph -display $env(DISPLAY) -bb -tk -nl -m -x time -y packet temp.rands &

exec rm -rf temp.p temp.d temp.rands temp.fwd temp.rev

#}

i have given the awk script which i have been using.
please can you point out the mistake thanks

Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

Trace files can be filtered into a format that xgraph can read, with awk / awk scripts
http://www.linuxquestions.org/questi...-graph-870284/
http://www.linuxquestions.org/questi...ts-awk-870934/

May be the old application "Trace Graph" can handle some files.tr ?
http://ns-2.blogspot.com/2008/10/tra...ator-ns-2.html
> Download >> http://www.angelfire.com/al4/esorkor/

.
 
  


Reply


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
Cannot connect using VNC , error "error opening security policy file /usr/X11R6/lib/" wmasry Linux - Newbie 5 01-18-2012 01:58 PM
What i s this error pop-up: "On line 3: unknown type "evolution""?? kline Linux - Desktop 0 11-25-2011 05:12 PM
"bad tty" & "file descriptor error" while building RPM on F13 gosssamer Linux - Software 7 12-28-2010 06:02 PM
Backup Script error "line 31: syntax error: unexpected end of file" eswanepoel General 7 12-07-2007 10:28 AM
Error in man command "sh: line 1: /usr/bin/gtbl: No such file or directory" MinA Slackware 1 09-06-2004 07:36 PM


All times are GMT -5. The time now is 08:51 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration