Indeed, NS-3 can only be used to build a basic wireless network environment, which is different from sensor networks. You need to make it as close to the sensor network through scenarios and parameter settings.
Hi, I assume here that you need specific WSN support and not a general MANET environment. So let me quote one of Tommaso Pecorella's posts on the ns-3 mailing list (this message is a bit outdated -June 2014- and is in line with ns-3 release 3.20 and not the current 3.22, however I think for the WSN aspect the summary is still valid and I think it delineates what is possible (and what is not possible yet) quite nicely)
"
PHY-MAC layer: the 802.15.4 standard is implemented by the lr-wpan module. Please check the documentation for current limitations.
(...)
IPv6 and adaptation layers: the sixlowpan module is working alongside with lr-wpan. As a result, IPv6 works with lr-wpan flawlessly. 6LoWPAN-ND is not implemented (yet).
Routing: there is no WSN-specific routing protocol in ns-3.20. The RIPng protocol (i.e., RIP for IPv6) is available, but it is not meant to be used in WSN. It may work, but it is NOT meant to be used in WSN. The logical alternatives are: CTP and RPL. I can speak for RPL, but I know there's a CTP implementation around.
RPL: I am testing it. In particular I am trying to have a stable enough code subset. The implementation is still too untested and too much changing to be released to the general public. When I'll be able to have a decent enough subset, I'll release it.
(...)
"
To my best knowledge, to date, RPL is not released yet.
Lueant Thank you for ur valuable information.. my plan to use ns3 to investigate some protocol i am trying to design. i am new to ns3 i like to master ns3 in order to do this.. my question ho to implement simple protocol such as LEACH, PEGASIS, VGA and so on in ns3 and then to develop some of this.. I hope its clear for more help and advice
I think the course of action is clear: for a good understanding of ns-3, first use the official documentation associated with each release: tutorial (first document to read!), manual and the library manual. Then manipulate the examples provided with ns-3, it already covers a lot a gives the good practice to design a decent simulation code.
The other unavoidable place to go is the ns-3 google group: https://groups.google.com/forum/#!forum/ns-3-users.
Browse the existing messages, a lot of them relate to WSN-specific aspects. I know there was an unofficial LEACH code disseminated in this group, so I guess it's a nice starting point once you've read at least the tutorial and the manual.