help to simulate WSN

99 views
Skip to first unread message

薛旸

unread,
May 9, 2019, 11:26:23 AM5/9/19
to ns-3-users
Hello, I have learned the basic knowledge about NS3 and I want to simulate WSN network. I used the LrWpanHelper for channel, InternetStackHelper for TCP/IP and PacketSinkHelper OnoffHelper for application. 

I learned from /examples/ipv6/wsn-ping6.cc and my purpose is to simulate one node installed sink to receive packets and (n-1) nodes installed onoff app to send packets to the sink node. (n=5 in the code)

But my code can not run well and I do not know. The problems maybe:
1,I did not use SixLowPanHelper sixlowpan because I thought it is used for ipv6 and mine is ipv4;
2,The PacketSinkHelper and OnOffHelper can not be used based on ns3::UdpSocketFactory;

I want to know why my code is wrong.  Thank you so much! ! !
WSN.cc
Message has been deleted

薛旸

unread,
May 9, 2019, 10:38:15 PM5/9/19
to ns-3-...@googlegroups.com
the running result is as followed:
屏幕快照 2019-05-10 上午10.34.33.png


Zhangmin Wang <wangzha...@gmail.com> 于2019年5月10日周五 上午9:59写道:
Hi, You should release additional issues during the running of the program.

在 2019年5月9日星期四 UTC+8下午11:26:23,薛旸写道:

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
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 https://groups.google.com/group/ns-3-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/a5013c0b-4701-435f-91f3-93012a0502fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted
Message has been deleted

Yang Xue

unread,
May 10, 2019, 9:34:55 AM5/10/19
to ns-3-...@googlegroups.com
sorry, I can not find out why IP address are set wrong.  The examples/ipv6/wsn-ping6.cc is using ipv6 in the IP level. So I guess whether the ipv4 protocol can not work based on the 802.15.4(lrwpan).

Zhangmin Wang <wangzha...@gmail.com> 于2019年5月10日周五 上午11:32写道:
Hi, do not mix Ipv6, Ipv4. And the IP address maybe set incorrectly. 

ipv4.SetBase("10.1.1.0", "255.255.255.0","0.0.0.1");

Please ensure that your IP address complies with network specifications. 
I hope you can succeed.

在 2019年5月10日星期五 UTC+8上午10:38:15,薛旸写道:
the running result is as followed:
屏幕快照 2019-05-10 上午10.34.33.png


Zhangmin Wang <wangzha...@gmail.com> 于2019年5月10日周五 上午9:59写道:
Hi, You should release additional issues during the running of the program.

在 2019年5月9日星期四 UTC+8下午11:26:23,薛旸写道:
Hello, I have learned the basic knowledge about NS3 and I want to simulate WSN network. I used the LrWpanHelper for channel, InternetStackHelper for TCP/IP and PacketSinkHelper OnoffHelper for application. 

I learned from /examples/ipv6/wsn-ping6.cc and my purpose is to simulate one node installed sink to receive packets and (n-1) nodes installed onoff app to send packets to the sink node. (n=5 in the code)

But my code can not run well and I do not know. The problems maybe:
1,I did not use SixLowPanHelper sixlowpan because I thought it is used for ipv6 and mine is ipv4;
2,The PacketSinkHelper and OnOffHelper can not be used based on ns3::UdpSocketFactory;

I want to know why my code is wrong.  Thank you so much! ! !

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
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-...@googlegroups.com.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
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 https://groups.google.com/group/ns-3-users.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages