ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
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.
hello everyone
I m working on ns2.35 ubuntu 12.04
when i try to use awk script for genthroughput, instant jitter, e2e delay using command
awk -f filename.awk ns.trc >aodv.xg
then it always show that
awk: cannot open genthroughput.awk(No such file or directory)
bt it works fine for pdf (pdf and other scripts are in the same folder)
plz help me as soon as possible thanx
this z my 2nd post (nobody give reply to my first post )
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Not sure you will get any usable Xgraph file.xg with
$ awk -f genthroughput.awk ns.trc > aodv.xg
* Please remember <space> :
$ awk -f genthroughput.awk ns.trc >[space]aodv.xg
File not found : Not easy to guess.
But you don't have to type any file names.
* Please take advantage of "bash completion" :
$ awk -f gen<TAB>
* And please remember : There can be no spaces in file names.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← #3 .
Well, then please try out some of the other *th*.awk,
and perl scripts from "awk_scripts-06.2014.tar.bz2".
Download link https://drive.google.com/file/d/0B7S...ew?usp=sharing
→ →
avg_throughput.awk
avg_throughput-zigbee.awk
chainThroughput.pl
flow-thr.awk
genthroughput.awk
instantThroughput.awk
instantThroughputStll.awk
thpt.awk
thr_drop_delay.awk
thr-one.pl
Throughput2007.awk
throughput-8.pl
throughput-9.pl
throughput_newtrace.awk
thruput.awk
updown-link-thr.pl
wireless-thr.awk
BEGIN{
recvd = 0;#################### to calculate total number of data packets received
rt_pkts = 0;################## to calculate total number of routing packets received
}
{
##### Check if it is a data packet
if (( $1 == "r") && ( $7 == "cbr" || $7 =="tcp" ) && ( $4=="AGT" )) recvd++;
##### Check if it is a routing packet
if (($1 == "s" || $1 == "f") && $4 == "RTR" && ($7 =="AODV" || $7 =="message" || $7 =="DSR" || $7 =="OLSR")) rt_pkts++;
}
END{
printf("##################################################################################\n");
printf("\n");
printf("Normalized Routing Load = %.3f\n", rt_pkts/recvd);
printf("\n");
printf("##################################################################################\n");
}
NRL is in uppercase bcoz m using awk file which is NRL_ot.awk
when m using nrl_ot.awk
it show
awk: fatal: can't open source file `nrl_ot.awk' for reading (No such file or directory)
Please spell out your words and do not use text-speak. You will get more replies to a better written and properly spelled question.
From what I can make out, you are in the wrong directory. Please read your documentation and follow the steps more closely, you will find out that you have forgotten or missed a cd command.
Last edited by szboardstretcher; 10-08-2014 at 03:02 PM.
nona19@ubuntu:~$ cd /home/nona19/ns-allinone-2.35/ns-2.35
nona19@ubuntu:~/ns-allinone-2.35/ns-2.35$ cd tcl
nona19@ubuntu:~/ns-allinone-2.35/ns-2.35/tcl$ cd ex
nona19@ubuntu:~/ns-allinone-2.35/ns-2.35/tcl/ex$ gedit aodv.tcl
nona19@ubuntu:~/ns-allinone-2.35/ns-2.35/tcl/ex$ ns aodv.tcl
num_nodes is set 10
couldn't open "ns.trc": permission denied
while executing
"open ns.trc w"
invoked from within
"set nsTrc [open ns.trc w]"
(file "aodv.tcl" line 209)
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Ref. post #12, etc.
Ubuntu 12.04 : Must be a very strange setup you have,
when lower case file names cannot be found / picked up.
→ Strange setup, or a totally wrecked OS.
Quote:
root@ubuntu:/home/nona19/ns-allinone-2.35/ns-2.35
You are not supposed to work as root with any user application.
Root is for administrative tasks only.
The only ns2 commands that will require a root prompt are :
# make install ,,, and # cp ns-<protocol-name> /usr/local/bin/.
About using awk scripts and trace files : Some (most?) files.tr
will make many of the awk scripts choke, and return :
"division by zero attempted".
About using a default awk or perl script to create a file(.xg),
that Xgraph can use : Is not going to work.
* How to create files.tr that Xgraph can plot, see post #2,
.... ~5 examples are attached : xgraph_ns2-files-tcl.2014.tar.gz
* A new link to the "Joe Naoum-Sawaya tcl" http://www.360doc.com/content/12/122...56135064.shtml
→ "Measure the throughput, packet drop rate,end-to-end delay for UDP-based application".
-
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.