1.install ns-allinone-2.31 orginal software in your linux pc.
2.then remove or rename the aodv protocol from ns-allinone-2.31/ns-2.31.
3.then paste this files aodv,tclfiles,input.tcl inside ns-allinone-2.31/ns-2.31.
4.now goto terminal and type cd ns-allinone-2.31 and then cd ns-2.31 and type make
5.copy the nam exe and xgraph exe from ns-allinone-2.31/xgraph-xx and ns-allinone-2.31/nam-xx
6.it will compile my given code .then run the tcl file by giving ./ns input.tcl
7.now xgraph and animation generate automatically while compiling tcl file