Node to have functionality of both source and sink

551 views
Skip to first unread message

Vipan Arora

unread,
Jul 18, 2012, 12:15:09 AM7/18/12
to ns-3-...@googlegroups.com
Hello..
I am new to NS3.I am using NS3 for wireless sensor networks. In that i created two nodes one as source and other as sink.
The code for these two nodes is running. I want to add one more node which would be sink and the middle node will behave both as source and sink.
ie. middle with respect to first node it will behave as sink and with respect to third node it will behave as source.Kindly suggest me

Vipan Arora

Konstantinos

unread,
Jul 18, 2012, 5:40:53 AM7/18/12
to ns-3-...@googlegroups.com
Hi Vipan,

You have just to connect the appropriate callbacks or applications on each node that will enable it to send and receive packets.
The functionality below (PHY, MAC, NET) are the same and do not need to be changed.

The same way you made node1 a source will apply to node2 to make it also source.
All you have to take care of is to set the appropriate address as destination.
e.g. at node1 set the address of node2 and on node2 the address of node3.

Konstantinos

unread,
Jul 24, 2012, 12:20:18 PM7/24/12
to ns-3-...@googlegroups.com
But you said that you have that!
I don't have any code for sensor networks, have a look at the examples of wireless

On Tuesday, 24 July 2012 17:09:08 UTC+1, Vipan Arora wrote:
Hi Konstantinos

Can you provide me the code for communication between two nodes in a wireless sensor networks

Vipan Arora

Vipan Arora

unread,
Jul 24, 2012, 11:53:55 PM7/24/12
to ns-3-...@googlegroups.com
Hi Konstantinos

I have got the code for communication between two wireless nodes. Is same code be relevant to sensor networks??

Vipan

Konstantinos

unread,
Jul 25, 2012, 5:58:57 AM7/25/12
to ns-3-...@googlegroups.com
currently there is no support for pure sensor networks (meaning the protocol stack for sensor networks is a bit different from wireless).
however you can simulate wireless nodes with small communication range (like sensor nodes) and build your network on top of that.

There are some patches for wsn (e.g. 6LoWPAN implementation) but I don't know much about that.

other than that, the capabilities (e.g. Tx/Rx) are in principle the same.
Message has been deleted

idrees.a...@gmail.com

unread,
Apr 9, 2013, 1:01:22 PM4/9/13
to ns-3-...@googlegroups.com

Dear
Konstantinos
i have build a topology in which i have created 5 WiMax SS Nodes 1 BS node i ASNGW and an application server in which the application server is responsible to provide services. i have linked all of the nodes. but from this discussion it seems that we have to create source and sink on all of the intermediate nodes as i have directly defined apllication source on SSs and Sink at application server, is my topology correct.

Konstantinos

unread,
Apr 9, 2013, 1:32:12 PM4/9/13
to ns-3-...@googlegroups.com
Hi,

First of all, I don't know much about WiMax so I don't know what is a SS node and ASNGW. The application server is a different node? What type of services does it provide? 

Perhaps you haven't understand the point of source and sink. The source/sink is a type of application, the end point of a communication. So for example, if you have a node with a source application (this can be a for example an OnOffApplication) and another node with a sink application (e.g. PacketSink application) you can send packets from one node to the other. The packets may pass through multiple other nodes; it depends on the path that the packet will follow. You don't have to install any application at the intermediate nodes, only the proper routing protocol depending on the system you simulate.

If you want to send (new) data from every SS node towards the application server, then you need to install source applications on every SS node and one or multiple sink applications on the application server node. If you just want one node to generate new data and others just to forward the data to the application server node, then you only need one source application (at that SS) and one sink application that the application server node.

Gowtham MIT

unread,
Apr 10, 2013, 8:46:59 AM4/10/13
to ns-3-...@googlegroups.com

Hi sir,
 I am new to NS3.I am using NS3 for wireless sensor networks. i studied some tutorials. but can't understand fully.

                 For my project I need to understand some basic programs .. for that i need some program which transmit  packets from specified node to another speciffied node . .. for this case i tried changing example programs .But it works automatically with considering my case .. i know that i am wrong .. so anyone please help me understand how to handle this case  ..

with regards
Gowtham Mit

Konstantinos Katsaros

unread,
Apr 10, 2013, 8:47:16 AM4/10/13
to Gowtham MIT, ns-3-...@googlegroups.com
Dear Gowtham, 

What type of scenarios do you want to simulate? Wired? Wireless? Mobile/Cellular?
Have you looked at the representative examples for each one of these types? 

Your mail is entitles to for a node to have both source and sink functionality, but you ask to have transmissions from 1->2 and 4->5. So you only need source applications (e.g. OnOffApplication) installed on node 1 and 4 and sink application (e.g. PacketSink) on 2 and 5. The rest of the nodes will act as intermediate routers if there is no direct link between the respective nodes. 

Please send your questions to the ns-3-users mailing list, not directly to me.

Regards,

Konstantinos Katsaros

On 10 Apr 2013, at 13:39, Gowtham MIT <gowtham...@gmail.com> wrote:

Hi sir , i am new to NS-3 . .I am using NS3 for wireless sensor networks .i studied few tutorials .but cant understand fully  .. i am unable to write code with seeing examples..
  
     For my project i need some basic programs to understand .. for that I need a program which contain 3 or above node.in which we are going to define  the packet transmission ..  for example we are having 5 node (0,1,2,3,4).. i need packet transmission from 1->2  and  4->5 alone ... can any one please me understand with example.. 
Kindly suggest me..
               
with regards
Gowtham Mit

idrees.a...@gmail.com

unread,
Apr 10, 2013, 8:58:50 AM4/10/13
to ns-3-...@googlegroups.com
Thanks Alot Sir, i got the point that we need only proper routing path on all intermediate nodes from source to sink. Sir, SS means subscriber station and ASN-GW means Access Services Network gateway

Gowtham MIT

unread,
Apr 10, 2013, 9:34:53 AM4/10/13
to ns-3-...@googlegroups.com
Thank you for your reply,yet if i use an on off application as you said it can be used only once to send a packet..I need to transfer packets between any two nodes whose id's are fed during run time(i.e a node should be able to act as a source as well as a sink) either directly or through a suitable routing mechanism until the simulation stops and to mention,i am working on wireless networks.Thanks in advance.


--
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/qYRkRF4qOUw/unsubscribe?hl=en.
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 http://groups.google.com/group/ns-3-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vipan Arora

unread,
Jul 24, 2012, 12:09:08 PM7/24/12
to ns-3-...@googlegroups.com
Hi Konstantinos

Can you provide me the code for communication between two nodes in a wireless sensor networks

Vipan Arora

On Wednesday, July 18, 2012 3:10:53 PM UTC+5:30, Konstantinos wrote:
Reply all
Reply to author
Forward
0 new messages