Question regard Rebroadcasting a message

30 views
Skip to first unread message

dear...@hotmail.com

unread,
Oct 5, 2015, 10:14:44 PM10/5/15
to ns-3-users
Hello Ns3 users,

I'm new here. I want to implement rebroadcasting for ad hoc network with condition scenario "e.x wait 5 seconds before rebroadcasting & don't send the message to the node that the current node received the message fourm" 

I looked at tutor and example I find this one good for mi 

simple ad hoc example.cc to do the send and receive of messages 

  71 {
  72   while (socket->Recv ())
  73     {
  74       NS_LOG_UNCOND ("Received one packet!");
  75     }
  76 }
  77
   78 static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
   79                              uint32_t pktCount, Time pktInterval )
  80 {
  81   if (pktCount > 0)
  82     {
  83       socket->Send (Create<Packet> (pktSize));
  84       Simulator::Schedule (pktInterval, &GenerateTraffic,
   85                            socket, pktSize,pktCount-1, pktInterval);
  86     }
  87   else
  88     {
  89       socket->Close ();
  90     }
  91 }



now If I want the node that got the message/pkt to rebrodcast it again  how can i do it? or am I using wrong direction here in my implementation ? if what I'm doing wrong can you plz guide me to the right way to do brodcasting for set of nodes then when the nodes receive the message they re-brodcast the message received to other nodes? 


also is there a way to make a node rebrodcast to all nodes in range but the one it actually received the message from ?


gracias,

Jamila 


Konstantinos

unread,
Oct 6, 2015, 7:26:23 AM10/6/15
to ns-3-users
Dear Jamila,

Similar questions have been asked in the list in the past, e.g. https://groups.google.com/d/msg/ns-3-users/18F-MVDqeOI/vqQw64eNAQAJ
You should read the discussion and all referred posts to have a better understanding how to solve your problem. 

Regards,
K.

dear...@hotmail.com

unread,
Oct 6, 2015, 8:21:28 AM10/6/15
to ns-3-users
hi Sir

thank you for the answer I read what written there but I'm a lil confused,

do I have to create new module to do brodcasting and re-brodcasting ?

also to do brodcasting and re-brodcasting I need to follow the routing protocol guidline like OLSR AODV and use route input and route output like the one in your page tutorial for internet/routing? 

so I can't use source and sink and instead I should use routeinput route output? 

where you suggest me to start from? is riping the way to go ? 


thank you so very much and sorry for taking a lot from your time,

Jamila 

Konstantinos

unread,
Oct 6, 2015, 8:34:09 AM10/6/15
to ns-3-users
All your questions are answered in the post I linked since that user has the same questions.

In principle, it is up to you how you design it and how you implement it. 
My personal advice based on my experience is to create a new module. 
The fact that you might only have one or two classes/files it's a good thing, as it will be easier to debug it. 
Reply all
Reply to author
Forward
0 new messages