Simulation of Wireless Sensor networks.

70 views
Skip to first unread message

abou...@gmail.com

unread,
May 9, 2016, 1:31:23 PM5/9/16
to ns-3-users
Dear all,
i need to simulate a wireless sensor networks.
the simulation scenario is to create a number of nodes ( 100 nodes).
All nodes must to send data to the sink.
i need to know how to create a loop that all nodes send their data packet to the sink.
the bellow is an incomplete sample of my source .
Have you please any idea.
Many thanks in advance.

LrwpanWirelessNode1     --->   Sink       <-----    LrwpanWirelessNode2
                                                |
  
     .......                          LrwpanWirelessNode100........

         UdpServerHelper udpServer(6000);
         //The Destination: Mobile Node
         ApplicationContainer apps = udpServer.Install (Sink.Get(0));
         Ipv6Address remoteHostAddr = i3.GetAddress (1,1);
         UdpClientHelper udpClient(remoteHostAddr, 6000);


         udpClient.SetAttribute ("Interval", TimeValue (Seconds(inter_Packet_Interval)));
         udpClient.SetAttribute ("PacketSize", UintegerValue (packetSize));
         udpClient.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));



         //The Source: The WirelessSensorLrwpan nodes
         ApplicationContainer apps2 = udpClient.Install (WirelessLrwpan.Get(0));// Here i need to create a loop to create that each WirlesseLrwpanSensor node send each own data packet

         apps.Start (Seconds (30.0));
         apps2.Start (Seconds (30.0));
         apps.Stop (Seconds (300.0));







Tommaso Pecorella

unread,
May 9, 2016, 1:40:11 PM5/9/16
to ns-3-users
Yes, the idea is: start by reading the tutorial and explain what the problem is.
From the description you gave, I see no problem whatsoever, except (maybe) the fact that you don't know how to get the most out of the WSN.

Cheers,

T.

jhon abraham

unread,
May 9, 2016, 1:42:45 PM5/9/16
to ns-3-...@googlegroups.com
Thank you Prof Tommaso for your Response,
My probleme is how to create a loop to install the udp applications on each node.
thank you.


--
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 a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/mSAV48X2RNY/unsubscribe.
To unsubscribe from this group and all its topics, 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.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
May 9, 2016, 8:27:03 PM5/9/16
to ns-3-users
What about a "for" ?
I'm sorry, but I still don't understand the problem. We can help you with ns-3, but you must have already some basic C++ knowledge, and if you don't know how to make a loop, then the problem is elsewhere.

T.
Reply all
Reply to author
Forward
0 new messages