How to simulate WSN with NS-3

4,445 views
Skip to first unread message

ram...@gmail.com

unread,
Feb 6, 2014, 5:53:02 AM2/6/14
to ns-3-...@googlegroups.com
I want to simulate WSN with NS-3. The network is formed by n sensor nodes and one sink in a hierarchical architecture. 
I want to draw a curve: throughput= f (number of nodes) 
I am starting to use NS-3. Thank you for your support

Rohini SharmaOhlan

unread,
Feb 6, 2014, 7:35:51 AM2/6/14
to ns-3-...@googlegroups.com
use leach protocol to get an idea how sensor nodes works?


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/groups/opt_out.

Tommaso Pecorella

unread,
Feb 6, 2014, 1:33:14 PM2/6/14
to ns-3-...@googlegroups.com
How to get two birds with a stone.

LEACH protocol. What's this ? I mean, I perfectly know what it is, the point is... it's paper-ware. Good to write a scientific paper, but no practical standard is using it. Enough said.

About the original question. Analysis of the question.
"The network is formed by n sensor nodes and one sink in a hierarchical architecture."
What do you mean by "hierarchical architecture" ?
802.15.4 could use multi-tree topology, but it's never used practically. Not even the "basic" tree one is used.

You didn't specify the MAC/PHY protocol you'd like to simulate, nor the IP-level topology. Nor if you need clustering or not.

Need more details on what's your intended topology, please.

Cheers,

T.

ram...@gmail.com

unread,
Feb 10, 2014, 7:39:48 AM2/10/14
to ns-3-...@googlegroups.com
Thanks,
My network forms a tree. The sink is the root and the sensors are nodes in the tree. I chose this example to train using NS-3.

Tommaso Pecorella

unread,
Feb 10, 2014, 4:15:44 PM2/10/14
to ns-3-...@googlegroups.com
Hi,

bad luck. The lr-wpan module implements 802.15.4, but only the ad-hoc part (plus, it's not yet merged). The IPv6 routing level might be a tree, but you'd need the RPL module, which is still unreleased.

By the way, it's a quite harsh way to train ns-3 on unreleased and on not-yet-merged modules... It'd suggest to train yourself with more "stable" stuff, and then move to the development parts.

However, if you're really into WSN, feel free to join the discussions about them on ns-dev mailing list. At the moment me and some other people are woking on improving the lr-wpan module to merge it as soon as possible in the main ns-3 branch.

Cheers,

T.

ram...@gmail.com

unread,
Feb 11, 2014, 8:04:13 AM2/11/14
to ns-3-...@googlegroups.com
Thanks Tommaso,

In this case, I can use NS-2? 
What is the best for the WSN NS-2 or NS-3.

Tommaso Pecorella

unread,
Feb 11, 2014, 1:46:05 PM2/11/14
to ns-3-...@googlegroups.com
Hi,

definitely ns-3. The lr-wpan module (although still being worked on) it's more precise and complete than the ns2 one. 6LoWPAN and IPv6 aren't in ns2 and RPL is not going to be implemented in ns2. Enough said.

Cheers,

T.

Anas D.

unread,
Feb 12, 2014, 8:00:10 AM2/12/14
to ns-3-...@googlegroups.com

Hi,
i am also working on wireless sensor networks. but a novice in ns3 like you.  i started using the simple-adhoc example using 802.11b standard. i will add more nodes and continue from there. 

Tommaso Pecorella

unread,
Feb 12, 2014, 4:32:34 PM2/12/14
to ns-3-...@googlegroups.com


On Wednesday, February 12, 2014 3:43:32 PM UTC+1, ram...@gmail.com wrote:
Thanks,
How can I specify a hierarchical topology in the simulation with NS-3? 
There is an implementation of LEACH or HEED protocol with NS-3?

Hi,

no, there's no LEACH or HEED implementation in ns-3. And, about the topology, it depends on what layer you're looking at. MAC or IP ?

Cheers,

T.

Fernaz Nur

unread,
Jan 28, 2015, 11:50:50 PM1/28/15
to ns-3-...@googlegroups.com

Hi!! I am very much new in ns3. I have just started understanding the example programs. I want to simulate a tree based WSN and simulate my MAC protocol there. How can I change MAC protocol in wifi-adhoc program?

Tommaso Pecorella

unread,
Jan 29, 2015, 3:03:17 AM1/29/15
to ns-3-...@googlegroups.com
Hi,

please study the Wi-Fi module documentation. The module is very complex and it is not possible to "simply" change the MAC protocol without understanding the relationships with all the other module components.

Good luck,

T.

Vladislav Efremov

unread,
May 14, 2015, 11:33:00 AM5/14/15
to ns-3-...@googlegroups.com
Hi Tommaso,
I'm developing wsn uwb specific model for simulation. 
I took lr-wpan module as a base and I changed phy and mac levels, error model, spectrum  etc code in a way to make what I need. 
But its still LrWpanDevices.
Now I want to create a grid example where I have several nodes and the first node sends packets to the last node (not broadcast). Experiments with just two nodes is not interesting anymore)
And I a little bit confused here because I need a kind of routing protocol which operates on MAC level, I don't want to deal with Network Layer (or even higher) at all and want to avoid it.
I want use CSMA and some routing protocol on MAC level and implement a simple grid example.
Could you please advise is it possible and how?
Ideally in the future I want to compare behavior using TDMA and CSMA mechanism for my network on MAC layer, but it's another question...

Tommaso Pecorella

unread,
May 14, 2015, 5:45:58 PM5/14/15
to ns-3-...@googlegroups.com
Hi Vladislav,

this could have been a new topic... but it's ok.

I'd suggest to check ISA100 for hints (there's no ns-3 model, but the standard can give you some ideas).
You will need for sure a way to propagate and handle the routing tables (even if they're based on MAC addresses, they're still routing tables) and so on. Basically you need a L2 routing protocol. Unfortunately I work at L3 (IP), so I can't suggest you one in particular.
Once you have the routing tables, you can either complete the work at MAC level, or use 6LoWPAN MESH headers to handle the multi hop forwarding. They're not implemented, but it should be trivial to do.

Anyway, for sure it is possible, but you'll need to implement the routing at L2. Possible, but not avoidable.

Hope this helps,

T.

Tann Lybear

unread,
May 15, 2015, 8:47:34 AM5/15/15
to ns-3-...@googlegroups.com
regard to WSN with NS-3 discussion ,  I am also interesting.
Sir , could you give advice or recommend  if I want work on MAC protocol with grouping method , How can enable AP to separate STA into each groups ?

Thanks in advance .
Best regards,
libea
Message has been deleted
Message has been deleted

ram...@gmail.com

unread,
Feb 12, 2014, 9:43:32 AM2/12/14
to ns-3-...@googlegroups.com

Tommaso Pecorella

unread,
May 15, 2015, 9:10:49 AM5/15/15
to ns-3-...@googlegroups.com
Hi,

if you have an AP and some STAs, you're not working with a WSN. Please start a new thread.

Thanks,

T.

Jayasree Sengupta

unread,
Dec 1, 2017, 1:16:54 AM12/1/17
to ns-3-users
In NS-3, can I simulate multihop routing in WSN environment ?

Tommaso Pecorella

unread,
Dec 3, 2017, 7:26:48 AM12/3/17
to ns-3-users
Read the posting guidelines, PLEASE.

T.
Reply all
Reply to author
Forward
0 new messages