Skip to content

TCL Script for AODV-UU in Ad hoc Hybrid Network

Here is my TCL script to running AODV-UU in ad hoc hybrid network scenario using NS-2.34 and AODV-UU-0.9.6.

# Februari 2011
set opt(namfile)         nam_aodv_out.nam
set opt(tracefile)
set val(chan)    Channel/WirelessChannel;    #channel type
set val(prop)    Propagation/TwoRayGround;   #radio-propagation model
set val(netif)   Phy/WirelessPhy;            #network interface type
set val(mac)     Mac/802_11;                 #MAC type
set val(ifq)     Queue/DropTail/PriQueue;    #interface queue type
set val(ifqlen)  50;                         #max nbr of packets in ifq
set val(ll)      LL;                         #link layer type
set val(ant)     Antenna/OmniAntenna;        #antenna type
set val(adhocRP) AODVUU;                       #routing protocol in used
set val(x)       1000;                        #x dimension of the topography
set val(y)       800;                        #y dimension of the topography
set val(stop)    500.0;                       #simulation time
set val(mobility) "/home/abdusy/Documents/aodv-simulation/mobil5_4"
set val(start-src)     1
set val(stop-src)     500
set nbrOfWirelessNodes   5
set nbrOfWiredNodes      4
set nbrOfGateways        2
set val(gw_discovery) reactive;                #gateway discovery method
The full tcl script you can download here.

37 thoughts on “TCL Script for AODV-UU in Ad hoc Hybrid Network”

  1. hi,
    I am working on ns-2.29 and i am implementing an energy efficient AODV protocol. There is the code available for AODV in usr/local/ns-allinone-2.29/ns-2.29/aodv/..
    I dont know which tcl script to run the code. I would be really grateful to u if u could help me out

  2. If you want to run a simulation, you need to make your own tcl script. But if you want to modify the AODV, you need to modify some files in ns-allinone-2.xx/ns-2.xx/aodv, such as aodv.h,, etc.

    1. hi,
      i am using ns2.35 and workin on energy efficient AODV protocol. but for energy efficient in which aodv file i have to modify sir help me . .

  3. hey i have been following your blog lately, you have done some great work in NS2. i am too working on it and i need some help. there is an energy model available in ns2, do u know the tcl script that i should run to get the results from it

  4. do you have simpler code like 2 nodes only, without the hierarchical scenario….
    i try to run aftyer successfully installed it (no error), but just that i changed in ns-2.34/tcl/ex/simple-wireless.tcl from DSDV to AODVUU, it does not work…

  5. Hi, I looked at your AODV-UU, that was great. Well I need your help to run it, I get an eror “wrong routing protocol”, can you please help me to run your code?

  6. Thanks for reply.
    Can you guide me more please….I have done it in Omnet, my problem in Omnet is RREQ that should be sent to neighbors to find the route, but it sends to all nodes.That’s why I want to check ns2.

  7. Dear Sir/Madam
    when i run the code of aodv that tcl file shown error mentioned blelow
    [root@localhost imran]# ns a.tcl
    num_nodes is set 7
    Wrong node routing agent!
    [root@localhost imran]#
    Please tell me how to solve this problem

  8. Sir,
    I am working on hybrid network on ns2.34. Your tcl script is really helpful for me to set the scenario.
    Sir, I want to know what to give in source (mobility). You have defined it as:
    It will be very helpful if you could please send me the code for mobility. I will be very grateful to you.
    Hoping for the positive response.

  9. Sir,
    I have ported aodv-uu 0.9.5 successfully on ns-2.34 but your tcl script is giving an error that wrong node routing agent. Is your tcl script run only on aodv-uu 0.9.6 ?
    I have also made another tcl script for 3 mobile nodes but it is also giving an error for ragent_ .
    Sir, please guide me.
    Hoping for the positive response.

  10. Sir,
    I have done patching and as per your instructions i have recompiled it. It is completed successfully. No error is generated. How to know that porting is done or not?

  11. dear sir,
    I want to aodv-uu patch to install in ns-2.34 .
    so, can u help me?
    May be happy!!!!

  12. Perkenalkan Pak, saya sakha
    share yang sangat bermanfaat pak, saat ini saya sedang menyelesaikan skripsi dgn topik modifikasi AODV, saya masih bingung, kalau kita memodifikasi protokol AODV, files yang mana yang harus nya dimodifikasi (aodv.h,, etc)? dan darimana kita harus memulai memodifikasi?
    Mohon pencerahannya pak, terima kasih

      1. Terima kasih. Saya juga sedang usaha untuk modify AODV files. AODV routing depends on 2 main metrics – hop count and also sequence number. If I were to change the sequence number into other metric, is it possible? For example, change it with node degree (this is what my supervisor suggested). The node degree has its own calculation, do you have any idea on how to implement it? Terima kasih sekali lagi.

        1. Hallo Mbak Wahidah Hashim,
          In research, everything is possible, but I don’t the impact. I have no idea about this, because I have no experience in this part.
          Good luck.

  13. Terima kasih pak sudah me replay,
    Sebagai contoh, saya akan menambahkan jalur alternatif pada pengiriman paket RREP, pada file mana yg saya modifikasi? dan juga mengubah format paket RREP seperti format paket RREQ nya pak
    Mohon pencerahannya pak, terima kasih

  14. Ajibesin Caleb Adejare

    Hi Sir or Ma, my name is Ajibesin Caleb Adejare. I run your tcl script AODV-UU in Ad-hoc hybrid network. But it complain of the following:
    num_nodes is set 7
    invalid command name “-llType”
    while executing
    “-llType $val(ll) ”
    (file “y.tcl” line 89)
    Pls Sir or Ma, how will i make correction of this. Kindly, help me out sir or ma.

  15. Ajibesin Caleb Adejare

    Pls sir or ma, i run other tcl script but when it comes to tcl script for manet routing protocols it was not going. Pls, what can i do to make this tcl script run as others.

  16. hii sir i want to know the aodvuu mobility file you mentioned source mobility in aodvuu as “/home/abdusy/Documents/aodv-simulation/mobil5_4”. . i have used setdest function as you told but didnt get output. so kindly try to send the source for mobility .it will be very useful for me sir

    1. Hi,
      You can create your own by using setdest. Go to directory ns-2:
      $ cd /home/user/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest
      $ ./setdest -v 2 -n 10 -s 1 -m 10 -M 50 -t 30 -P 1 -p 1 -x 500 -y 500 > mobil5

  17. Hi sir, how can I porting in Ubuntu?
    I had the same problem… “Wrong node routing agent”. I saw that I have to install Wimax… It’s correct? Sorry… I’m novate. Thank you!

  18. Hi Sir.
    How to determine the average speed of only neighbor node in file using ns2. and how to count the only number of neighbor node?

Leave a Reply

Your email address will not be published. Required fields are marked *