Suggest me the best tool for Establishing Ad Hoc network and finding the neighboring nodes within the range defined for that node. Also I need to incorporate the changes in topology when the nodes moves out of range.
You may use GloMoSim, it provides full support in terms of Network, Mac and Physical layer protocols and mobility models . IT does not provide great GUI however , you may implement almost any functionality of MANETS in there.
If I design a improved (for example change OSPF)routing protocol in ad hoc network, How can I modify the route protocol using ns-2 or ns-3 or GloMoSim? Which is easy to implement?
I think OMNET++ and NS-2 are interesting options. OMNET++ is easier and provides GUI. NS-2 may be difficult at the beginning but it has a bigger community. Maybe you can exchange or share things with many people.
There are many different solutions available today. Matlab, Opnet, Qualnet, NS3 ...
There are several question that it is necessary to have in mind.
If you want a theoretical study, Matlab probably is the better, but if you want discrete event simulator you have several alternatives.
If you have enough founds and you want to use commercial models of devices, Opnet or Qualnet are very good. It is possible to obtain a university license but it is uncomfortable to think that in any moment you can lost the license if the firm change the politics of offer a free license and your research is for several years.
If you want a free, open code tool, in my opinion, the best today are omnet and NS3, (NS2 has stopped the development of new models). The learning curve of omnet is better than Ns3, but if in your close surrounding the people are working with ns3 you should choose ns3 it is comfortable to have someone close that you could ask your dudes. In other case omnet if probably a better election.