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.

Tags: , , , , , , , ,

35 Responses to “TCL Script for AODV-UU in Ad hoc Hybrid Network”

  1. Anil Says:

    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. abdusy Says:

    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.


    • sindhu chandran Says:

      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. Anil Says:

    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. Narendra Says:

    can you tell me how to write tcl script for showing local repair in AODV
    plz its urgent


  5. yat Says:

    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…


  6. Instalasi ns-allinone-2.33 pada ubuntu 8.04 hardy + gcc version 4.2.4 « takut akan tuhan adalah awal dari pengetahuan Says:

    […] TORA -> tersedia untuk NS-allinone-2.30 (pada lingkungan Red Hat Patching untuk AODV-UU -> tersedia untuk ns-allinone-2.34 Leave a Comment LikeBe the first to like this post.Leave a Comment so far Leave a comment […]


  7. Ehsan Says:

    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?


  8. Ehsan Says:

    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.



    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


  10. sana Says:

    dear sir,
    I am in need of a multicasting code for manet, plz can u help me with it sir.


  11. am Says:


    Can you send me the tcl script for wormhole removal in AODV protocol.
    pls its urgent..


  12. Shruti Saxena Says:

    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.



  13. shruti saxena Says:

    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.


  14. shruti Says:

    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?


  15. khinmyo Says:

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

    May be happy!!!!



  16. Khozaimi Says:

    Hi all..

    please help me, how to calculate buffer size in file ?!. help me, please ………..

    best regard


  17. simulating AODV protocol in NS-2.35 Says:

    […] (…ybrid-network/ etc. etc. […]


  18. sakhayudha Says:

    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


    • abdusy syarif Says:

      Hi Sakha,

      Yup, Anda bisa mulai memodifikasi AODV hanya pada kedua file utama (aodv.c/h). Tentukan terlebih dahulu bagian mana yg akan dimodifikasi. Sebagai contoh mungkin Anda bisa banyak belajar dari blog Elmurod (


      • Wahidah Hashim Says:

        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.


      • abdusy syarif Says:

        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.


  19. sakhayudha Says:

    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


  20. subhrananda goswami Says:

    how to trace aodv.tcl


  21. Rahul J Says:

    I want AOMDV patch file so if some one having pls give me


  22. Ajibesin Caleb Adejare Says:

    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.


  23. Ajibesin Caleb Adejare Says:

    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.


  24. kavi bharathi Says:

    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


    • abdusy syarif Says:

      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


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: