aomdv_ns2.35

147 views
Skip to first unread message

Soorya

unread,
Feb 5, 2019, 6:43:59 AM2/5/19
to Network Simulator 2 (NS2)
This is a part of  aomdv.tcl on ns2.35 to reate trace object for ns, nam. Why certain lines are commented here? When I am  running aomdv.tcl , I am getting output on the terminal but 'the animator NAM' is not displaying . How can I view the output of aomdv on nam?

                      set nsTrc [open ns.trc w]
                      $ns trace-all $nsTrc
                    # set namTrc [open nam.trc w]
                    # $ns namtrace-all-wireless $namTrc $val(x) $val(y)
                      set scenarioTrc [open scenario.trc w]

                        proc fileTrace {} {
                                #  global ns nsTrc namTrc
                                   global ns nsTrc scenarioTrc
                                   $ns flush-trace
                             
                                  close $nsTrc
                                  close $scenarioTrc
                              #  close $namTrc
                             #  exec nam nam.trc &
                      }

knudfl

unread,
Feb 5, 2019, 7:34:36 AM2/5/19
to Network Simulator 2 (NS2)
Hi.

"ns-2.35/tcl/ex/aomdv.tcl" is the first "ns2 aomdv example", issued  `15 Jan 2009´, with ns-2.34 .

AOMDV examples :   aomdv-examples-3.tar.gz 
→ There are so far 12 examples in the examples package.

Message has been deleted
Message has been deleted

SOORYA V NAIR

unread,
Feb 5, 2019, 11:27:25 PM2/5/19
to ns-u...@googlegroups.com
Thank you

--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.

Soorya

unread,
Feb 13, 2019, 8:58:58 PM2/13/19
to Network Simulator 2 (NS2)
I want to implement energy efficient aomdv in mobile adhoc network. I have found several aomdv examples. which one is the basic aomdv protocol where I can do the modifications? And when I run aomdv.tcl , nodes are just displayed on animator ,nothing else.Is this the correct output of aomdv.tcl?

knudfl

unread,
Feb 14, 2019, 4:41:17 AM2/14/19
to Network Simulator 2 (NS2)
"aomdv.tcl" : A template with no traffic / no communication.
The included feature is section  # Tracing ....
   314  # ------------------------------------------------------------------------------
   
315  # Tracing
   
316  # ------------------------------------------------------------------------------
   
317
   
318  # printing simulation time


SOORYA V NAIR

unread,
Feb 15, 2019, 3:53:14 AM2/15/19
to ns-u...@googlegroups.com
What mofification is to be done in aomdv.tcl for adding traffic/communication between nodes.

--

knudfl

unread,
Feb 15, 2019, 12:11:43 PM2/15/19
to Network Simulator 2 (NS2)
Actually it's no secret how to achieve communication : Just run the examples. And read the examples, please.
E.g. eshete-aomdv2.tcl shows communication in NAM.
....  And in the trace file `ns.trc´ →
$ awk -f all-2.awk ns.trc
cbr s
:59831 r:208, f:76256
avg_end_to_end_delay
: 0.4355
Packet Delivery ratio: 0.3476
Packet Drop ratio: 0.9965

Analyzing scripts https://drive.google.com/drive/folders/1rU_MFAEl1GCLMTJPLR3zbxPxkQQHkQ7T?usp=sharing

There is also "communication" in aomdv.tcl :
$ awk -f all-2.awk ns.trc
cbr s
:161954 r:152364, f:344124
avg_end_to_end_delay
: 0.0537
Packet Delivery ratio: 94.0786
Packet Drop ratio: 0.0592


SOORYA V NAIR

unread,
Feb 16, 2019, 12:14:40 AM2/16/19
to ns-u...@googlegroups.com
Ok..Thank you

SOORYA V NAIR

unread,
Feb 21, 2019, 12:18:45 AM2/21/19
to ns-u...@googlegroups.com
Sir,
Is 'eshete-aomdv2.tcl ' a basic aomdv with mobility only?Is mobility is the only difference between aomdv.tcl and eshete-aomdv2.tcl?Can I take eshete-aomdv2.tcl as the basic model to implement energy efficiency in manet?

knudfl

unread,
Feb 21, 2019, 6:58:38 AM2/21/19
to Network Simulator 2 (NS2)
@Soorya ,   Hi.
»» Is 'eshete-aomdv2.tcl ' a basic aomdv ... «« :
Please read the file differences →
$ diff -dbBwaur aomdv.tcl eshete-aomdv2.tcl > diff-.....txt
.... The output is attached :   diff-dbBwaur__aomdv.tcl--eshete-aomdv2.tcl.txt
.... Changes are marked with + and -


»» take eshete-aomdv2.tcl as the basic model to implement energy efficiency in manet «« :
Please read and test AOMDV examples from  manet-examples-6.tar.gz
→  https://drive.google.com/file/d/15QeCkzdBSM7t898IPKCu6-lr_bdLgde0/view?usp=sharing
$ cd ex-manet6/
$ grep
-Rn AOMDV *
.
aomdv10
.tcl:2:# UDP/CBR over 5 node,10 node,50 node Ad-hoc network with AOMDV routing protocol.
aomdv10
.tcl:45:$ns node-config  -adhocRouting AOMDV \
aomdv50
.tcl:1:# UDP/CBR over 5 node,10 node,50 node Ad-hoc network with AOMDV routing protocol.
aomdv50
.tcl:48:$ns node-config  -adhocRouting AOMDV \
aomdv5
.tcl:2:# UDP/CBR over 5 node,10 node,50 node Ad-hoc network with AOMDV routing protocol.
aomdv5
.tcl:45:$ns node-config  -adhocRouting AOMDV \
.
manet0
-16.tcl:37:set val(rp) AOMDV


SOORYA V NAIR

unread,
Feb 25, 2019, 2:20:56 AM2/25/19
to ns-u...@googlegroups.com
Thank you sir...Does ns2 has Patricle swarm optimization algorithm for finding energy efficient routes?

knudfl

unread,
Feb 25, 2019, 3:18:59 AM2/25/19
to Network Simulator 2 (NS2)

SOORYA V NAIR

unread,
Feb 26, 2019, 12:28:10 AM2/26/19
to ns-u...@googlegroups.com
Sir,
In my paper they have mentioned that Particle swarm optimization is used to find the fitness funtion such as energy and to optimize routes.Does ns2 has its implementation?
Screenshot_20190226-105104.jpg

SOORYA V NAIR

unread,
Feb 26, 2019, 1:54:01 AM2/26/19
to ns-u...@googlegroups.com
Sir ,
Also I want to know how to find routes from a source to destination in a mobile network.since nodes are moving ,how can I find the paths to a particular destination in a mobile adhoc network?

SOORYA V NAIR

unread,
Feb 26, 2019, 8:46:59 PM2/26/19
to ns-u...@googlegroups.com
Sir,
Can you please tell me how can I route traffic to a destination node in mobile adhoc network?Since nodes are moving how we can find paths between a source and destination after adding mobility to the network?

knudfl

unread,
Feb 27, 2019, 6:09:05 AM2/27/19
to Network Simulator 2 (NS2)
@Soorya.

? Tracking location of a moving mobile unit ?
That's what GPS is used for.  Probably nothing for the ancient ns2  ? ? ?

SOORYA V NAIR

unread,
Feb 27, 2019, 10:00:11 AM2/27/19
to ns-u...@googlegroups.com
Sir,
I have read that in AOMDV if the network is static we can send packets from source to destination and find the multiple paths between source and destination.While if we add mobility to the network then how it will work?How can we find the routes  that exist between source and destination?

knudfl

unread,
Feb 27, 2019, 4:28:31 PM2/27/19
to Network Simulator 2 (NS2)
@Soorya ,   Hi.

Assume you know the source location ... if stationary, not mobile / moving.
Destinations with various moving locations :  In the real world I'd vote for GPS location.  What else have you imagined ?

SOORYA V NAIR

unread,
Mar 2, 2019, 8:22:10 AM3/2/19
to ns-u...@googlegroups.com
Sir,Is there any code  for energy efficient routing in manet in ns2?

SOORYA V NAIR

unread,
Mar 5, 2019, 4:55:59 AM3/5/19
to ns-u...@googlegroups.com
Sir,
I am getting the error  "can't read "node_(0)": no such variable" while I was trying to add mobility.I set the no.of nodes as 5 and defined for loop from 0 to <val(n) .Parts of my code is given below.Can you help me to resolve my error.

-------------------------------------------------------------------------------------------------
set val(rp) AOMDV  ;                                # routing protocol
set val(n) 5.0 ;
-------------------------------------------------------
for {set i 0} {$i < $val(n) } {incr i} {
    set node($i) [$ns node]
    $node($i) random-motion 0;                 # disable random motion
}   
-------------------------------------------------------------------------------------------------------

$ns at 0.0 "$n(0) setdest 91.7 68.0 10000.0"
$ns at 0.5 "$n(1) setdest 28.4 168.3 10000.0"
$ns at 0.7 "$n(2) setdest 27.3 227.4 10000.0"
$ns at 5.0 "$n(3) setdest 20.05 3.98 10000.0"
$ns at 0.0 "$n(4) setdest 30.8 435.3 10000.0"
-----------------------------------------------------------------------------------------------------

for {set i 0} {$i < $val(n) } {incr i} {
        $ns at $val(end) "$node($i) reset";
}







   

knudfl

unread,
Mar 5, 2019, 5:24:13 AM3/5/19
to Network Simulator 2 (NS2)
Well, then please attach your files. Simulation, movement file etc.

Your nodes are defined as   n(0) ... n(X) .
The error seems to be that somewhere you are asking for n(0), but the code text is node_(0).

Soorya

unread,
Mar 5, 2019, 8:10:25 AM3/5/19
to Network Simulator 2 (NS2)

Thanks for your reply sir.I corrected the name from n (0) to node(0).But now I am getting the following error.I have attached my tcl file here.

num_nodes is set 5
INITIALIZE THE LIST xListHead
ns: _o32 setdest 91.7 68.0 10000.0:
    (_o32 cmd line 1)
    invoked from within
"_o32 cmd setdest 91.7 68.0 10000.0"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o32" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o32 setdest 91.7 68.0 10000.0"


aomdv.tcl

knudfl

unread,
Mar 5, 2019, 8:37:09 AM3/5/19
to Network Simulator 2 (NS2)
@Soorya.

The file name cannot be `aomdv.tcl´ . There can be only one file with that name.
Please always use new unique names for new files.
Overview  https://drive.google.com/file/d/1QbeW9Rtr_MU0JgfJiFQF-5N-5Okv8OGK/view?usp=sharing
Ref.  https://drive.google.com/drive/folders/0B7S255p3kFXNSmRYb2lGcDRUdWs?usp=sharing


Your errors :  Seems to be something wrong with this :
set val(dim) [expr $val(n) / $val(density)]
set val(x) [expr [expr sqrt($val(dim))] * 1000]
set val(y) [expr [expr sqrt($val(dim))] * 1000]

No issues when using  a fixed setting :
set val(dim) [expr $val(n) / $val(density)]
set val(x) 500
set val(y) 500





Dya Abdullah

unread,
Mar 5, 2019, 8:49:10 AM3/5/19
to ns-u...@googlegroups.com
Dear Kundfl

please could help me how to find the best path in AODV routing protocol based on higher residual energy node and minimum hop count please if you can send me the source code to do that. Your help would be appreciable. Dear Kundfl  I am working on ns.2.35

Best Regards,

knudfl

unread,
Mar 5, 2019, 10:55:13 AM3/5/19
to Network Simulator 2 (NS2)

SOORYA V NAIR

unread,
Mar 5, 2019, 8:22:10 PM3/5/19
to ns-u...@googlegroups.com
Thank you sir,it worked.

SOORYA V NAIR

unread,
Mar 12, 2019, 12:48:07 AM3/12/19
to ns-u...@googlegroups.com

Sir,
I have initialized the energy as  100 jules for all the nodes in manet.Now I want to calculate the energy consumption for each route in the aomdv protocol.How can I find all the routes in the routing table?Also I have an algorithm for selecting the best  path with less energy consumption?Is it in the aomdv.cc file I need to implement the algorithm?

Message has been deleted
Message has been deleted

SOORYA V NAIR

unread,
Apr 1, 2019, 9:39:05 PM4/1/19
to Network Simulator 2 (NS2)
Sir tcp or udp is preferred transport protocol in manet?

On Thu, Mar 28, 2019, 5:53 PM Soorya <soory...@gmail.com> wrote:
Hai Sir,

        Can you  help me  to code the following algorithm in aomdv.cc? Algorithm is attached here.

        Thank you

knudfl

unread,
Apr 2, 2019, 6:43:30 AM4/2/19
to Network Simulator 2 (NS2)
@Soorya


$ cd ex-manet6/
$ grep
-Rin tcp *
.
$ grep
-Rin udp *
.
.....  Plenty of both  tcp and udp ...

SOORYA V NAIR

unread,
Apr 2, 2019, 6:53:45 AM4/2/19
to ns-u...@googlegroups.com
Ok thank you sir

SOORYA V NAIR

unread,
Jun 3, 2019, 1:00:16 AM6/3/19
to Network Simulator 2 (NS2)
Hi sir,
 I have aomdv code which calculate energy consumption.While I run the program I  am getting paths with energy values.How can I compare these paths to find out path having highest energy?

SOORYA V NAIR

unread,
Jun 11, 2019, 3:24:59 AM6/11/19
to Network Simulator 2 (NS2)
Sir,
 Whether a node can transmit packets after its enegy become 0?
Reply all
Reply to author
Forward
0 new messages