Hi Ehsan,
Cognitive Radio means all and nothing: what are you looking for
exactly? wifi over TV white spaces? IEEE 802.22?
Anyway, to my knowledge, neither ns-2 nor ns-3 support any of these
technologies explicitly. You'll have to do some development to achieve
what you want.
That said, my suggestion is to go for ns-3, as it is better designed
and better maintained than ns-2. For Cognitive Radio / Dynamic
Spectrum Access stuff, you might find ns-3's spectrum module useful,
some information about it is provided here:
http://iptechwiki.cttc.es/Ns3_Spectrum
Regards,
Nicola