First of all you have to learn the structure of NS2 very well i.e you have to know how it work.
Then you have to learn very well how to configure node of a network using TCL code. What parameter should you change to deploy your thinking in the networrk( like queue length, tcp agent CBR, VBR, congestion control, req queue management etc.) These steps may be enough for a simple analysis type work.
But if you want to show some changes in the protocol then you must have to be master in C++ and also have to know which code module is used for which functionality. If you understand very well then proceed further to implement the changes you are thinking that should be for improvement. Then please change the corresponding configuration TCL file supporting to run the protocol.
Finally recompile the code.
>> ns your_dersired_protocol.tcl
If you get some data from the network you design then compare the data with previous by using Ploting tool( I prefer GNU plot or excel). But run the procol atleast three times and make an average to get the desired result because result may be different from one another. so we consider average is the closest approximation.
It is depend on you and your study background, that which layer protocol you will select for your PhD topic. If you need any further assistant so pm me.
Sir i had done performance evaluation of routing protocols and now i am working on congestion control .but i am facing problem in implementation on ns2. i want to learn it .Can you give me description of how i can master it?
You dont have to go far to be expert with NS2 or NS3. When you successfully install the simulators then in the DOC directory you will get a NS@2 & 3 official manual which is the best documentation for these simulators.
Aslo you can watch youtube to find some useful information.
If you want to handle an event such as reaching the queue length and do an action after that you should create an event handeler.This link will be usefull for knowing event handeler: