LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 06-22-2017, 04:44 AM   #1
fatma alzahra
LQ Newbie
 
Registered: Aug 2014
Posts: 26

Rep: Reputation: Disabled
new trace ns2 with energy update ei, es , et , er


Hello all;
I'm using ns-2.29 and when running test-suit-energy.tcl i got the resulted trace with old format

i follow the following link
https://www.isi.edu/ilense/software/...s2_energy.html
and update cmu-trace.cc file with the one in link above then re-compile
but no change occur in resulted trace file
Quote:
[energy 979.917000 ei 20.074 es 0.000 et 0.003 er 0.006]
... i simulate it in ns-2.33 and ns-2.35 and got the new trace ok

but i need it in ns-2.29 to merge it with nis-mob patch

thanks in advance ;
 
Old 06-22-2017, 06:53 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Ns2 is not (only) c++, but (also) OTcl (Tcl), which means changes must appear in tcl/lib/files.tcl, and must be compiled into a new executable 'ns'.

Code:
cd ns-2.35/tcl/
grep -in energy *
ns-lib.tcl:323:#                  -energyModel    "EnergyModel"
ns-lib.tcl:324:#                  -initialEnergy  (in Joules)
ns-lib.tcl:357:Simulator instproc energyModel  {val} { $self set energyModel_  $val }
ns-lib.tcl:358:Simulator instproc initialEnergy  {val} { $self set initialEnergy_  $val }
ns-lib.tcl:607:     energyModel_ initialEnergy_ txPower_ rxPower_ \
ns-lib.tcl:736: if [info exists energyModel_] {
ns-lib.tcl:747:         $node addenergymodel [new $energyModel_ $node \
ns-lib.tcl:748:                         $initialEnergy_ $l1 $l2]
ns-lib.tcl:1292:Simulator instproc energy-color-change {level1 level2} {
ns-lib.tcl:1341:        $self instvar energyModel_ 
ns-lib.tcl:1343:        if [info exists energyModel_] {
Code:
grep -in newtrace *
ns-default.tcl:602:Simulator set WirelessNewTrace_ 0
ns-lib.tcl:886:Simulator instproc use-newtrace {} {
ns-lib.tcl:887: Simulator set WirelessNewTrace_ 1
ns-mobilenode.tcl:718:  $T newtrace [Simulator set WirelessNewTrace_]
ns-queue.tcl:529:       set newtrace [$ns create-trace $type $file $src $dst $op]
ns-queue.tcl:535:               $newtrace target $oldTrace
ns-queue.tcl:538:               $newtrace target [$ns set nullAgent_]
ns-queue.tcl:541:       $self edrop-trace $newtrace

Last edited by knudfl; 06-22-2017 at 07:01 AM.
 
Old 06-23-2017, 01:55 AM   #3
fatma alzahra
LQ Newbie
 
Registered: Aug 2014
Posts: 26

Original Poster
Rep: Reputation: Disabled
Hello All;
thank you knudfl
actually i checked each line of resulted grep command and it seems ok for my ns version 2.29

when i re-compile ns2 after adding cmu-trace.cc
ns-allinone-2.29/ns-2.29$
./configure
make clean
make
make install <<<< give me error
Quote:
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 /usr/local/man/man1
so i change directory to ns-allinone-2.29$ ./install
and worked ok
does (./install) in main directory compensate for (make install) in ns-2.29 directory
thanks in advance ..
i really appreciate your help..
 
Old 06-23-2017, 06:57 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #3.
Quote:
make install <<<< give me error
The word error doesn't appear : No error.
... You are looking at a normal 'make install' output.
Please check the result with $ ls /usr/local/bin/ns*
And : $ which ns
And : $ ns

About 'make install' : I guess you mean 'sudo make install' ? Or su ? If you aren't already running as root.
And no. $ ./install isn't doing 'make install' in ns-2.29/.

-

Last edited by knudfl; 06-23-2017 at 07:01 AM.
 
Old 06-24-2017, 01:45 AM   #5
fatma alzahra
LQ Newbie
 
Registered: Aug 2014
Posts: 26

Original Poster
Rep: Reputation: Disabled
Quote:
fatma@ubuntu:~/Desktop/ns-allinone-2.29/ns-2.29$ ls /usr/local/bin/ns*
/usr/local/bin/ns /usr/local/bin/ns-lte-mih-myevalvid
/usr/local/bin/ns233-mobiwan /usr/local/bin/ns-mih
/usr/local/bin/ns233-orig /usr/local/bin/ns-mipbu
/usr/local/bin/ns-EAP /usr/local/bin/ns-mobiwan
/usr/local/bin/ns-eap-eka /usr/local/bin/ns-mobiwan-nemo-lte
/usr/local/bin/ns-EAP-ERP /usr/local/bin/ns-msctp
/usr/local/bin/ns-fhmip /usr/local/bin/ns-nistmob-wimax
/usr/local/bin/ns-lte /usr/local/bin/ns-orig
/usr/local/bin/ns-lte-evalvid-asconf /usr/local/bin/ns-test
Quote:
ns2.29
Quote:
fatma@ubuntu:~/Desktop/ns-allinone-2.29/ns-2.29$ sudo make install
[sudo] password for fatma:
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 /usr/local/man/man1
Q3) what parameters do i change in tcl example to decrease energy value in resulted trace
Quote:
s 1.000000000 _0_ AGT --- 0 tcp 40 [0 0 0 0] [energy 1000.000000] ------- [0:0 1:0 32 0] [0 0] 0 0
r 1.000000000 _0_ RTR --- 0 tcp 40 [0 0 0 0] [energy 1000.000000] ------- [0:0 1:0 32 0] [0 0] 0 0
s 1.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] [energy 1000.000000] ------- [0:255 -1:255 30 0] [0x2 1 1 [1 0] [0 4]] (REQUEST)
s 1.000295000 _0_ MAC --- 0 AODV 108 [0 ffffffff 0 800] [energy 1000.000000] ------- [0:255 -1:255 30 0] [0x2 1 1 [1 0] [0 4]] (REQUEST)
N -t 1.000296 -n 1 -e 999.999136
s 3.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] [energy 999.998272] ------- [0:255 -1:255 30 0] [0x2 1 2 [1 0] [0 6]] (REQUEST)
s 3.000295000 _0_ MAC --- 0 AODV 108 [0 ffffffff 0 800] [energy 999.998272] ------- [0:255 -1:255 30 0] [0x2 1 2 [1 0] [0 6]] (REQUEST)
N -t 3.000296 -n 1 -e 999.998272
s 7.000000000 _0_ RTR --- 0 AODV 48 [0 0 0 0] [energy 999.996544] ------- [0:255 -1:255 30 0] [0x2 1 3 [1 0] [0 8]] (REQUEST)
 
Old 06-24-2017, 03:42 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #5.

Please edit your posts to us CODE Tags [code]code text[/code]

? Why repeat the perfectly OK output from 'sudo make install' ?
 
Old 06-25-2017, 03:15 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #1.

About newtrace.

1) Did you remember cmu-trace.h ?
Code:
$ cd trace/
$ grep -in -A2 -B4 newtrace *.h

cmu-trace.h-104-		PacketTracer();
cmu-trace.h-105-        	virtual ~PacketTracer();
cmu-trace.h-106-		void setNext(PacketTracer *next);
cmu-trace.h-107-		PacketTracer *getNext();
cmu-trace.h:108:		int format_unknow(Packet *p, int offset, BaseTrace *pt_, int newtrace);
cmu-trace.h-109-	protected:
cmu-trace.h:110:		virtual int format(Packet *p, int offset, BaseTrace *pt_, int newtrace) = 0;	//return 0 if the packet is unknown
cmu-trace.h-111-		PacketTracer *next_;
cmu-trace.h-112-};
--
cmu-trace.h-125-	char	tracename[MAX_ID_LEN + 1];
cmu-trace.h-126-	int	nodeColor[MAX_NODE];
cmu-trace.h-127-        int     tracetype;
cmu-trace.h-128-        MobileNode *node_;
cmu-trace.h:129:	int     newtrace_;
cmu-trace.h-130-
cmu-trace.h-131-	//<zheng: ns 2.27 removed the following part, but we need it to control the broadcast radius>
2) Please be aware that some (mac)protocols are still / can be : old trace by default in the latest ns2 versions.
So please always add the newtrace setting in the simulations.tcl ( $ns_ use-newtrace ) if you want "new".


About OS type :
The recommended nist-mob OS is still the 32bits CentOS 6.9 - i386
http://www.linuxquestions.org/questions/tags/nist-mob/

-

Last edited by knudfl; 06-25-2017 at 03:19 AM.
 
  


Reply

Tags
nist-mob, ns2



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 log/trace Mobile Node's Energy in ns2? Sana Shaikh Programming 1 05-31-2016 04:36 PM
Trace for energy Model in ns2.31 ines8989 Linux - Networking 5 01-30-2014 11:13 AM
Sir, While installing ns2.34 on fedora 16 got the error : trace/cmu-trace.cc 1327:22 jeevanpinto Linux - Newbie 2 06-28-2012 03:35 AM
energy metric in ns2 roh Linux - Networking 2 01-13-2010 02:48 AM

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

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