multiple nodes to send receive packets

79 views
Skip to first unread message

Ahsan Alnasar

unread,
Oct 13, 2017, 4:30:23 AM10/13/17
to ns-3-users
hi i need help.  i am creating multple nodes in wifi adhoc model to send and receive multiple packets. i am using loop to create sink sockets and putting them in array same as for sender. i am broadcasting packets. problem.

problelm is for single siink and sender code is sending and receivng pakckets. when i ncrease no of sender and keep single sink. it makes connection successfully but dont recive any single mesage.


for(int i =0; i < 2;i++)
{
 TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
  Ptr<Socket> recvSink = Socket::CreateSocket (c.Get (i), tid);
  InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
  recvSink->Bind (local);
arrary[i.scoket]= recSink
  arrary[i.scoket]->SetRecvCallback (MakeCallback (&ReceivePacket));
}
for(int i =0; i < 2;i++)
{
sender[i].source = Socket::CreateSocket (c.Get (i), tid);
 InetSocketAddress remote = InetSocketAddress (i.GetAddress (1, 0), 80);
 sender[i].source ->Connect (remote); 
}

Vishnu Kumar

unread,
Sep 7, 2018, 4:17:57 AM9/7/18
to ns-3-users
hi bro,
i also implement adhoc file same way is you get the solution.
then please help me

thank you

Ahsan

unread,
Sep 7, 2018, 5:36:07 AM9/7/18
to ns-3-...@googlegroups.com
sorry I also didn't get any solution

--
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/wl6Hi1pFSXA/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.


--
Ahsan Alnasar


Ns3 lover

unread,
Sep 8, 2018, 10:27:06 AM9/8/18
to ns-3-...@googlegroups.com
Hello, I think it is a collision problem .

2018-09-07 10:35 GMT+01:00 Ahsan <ahsana...@gmail.com>:
sorry I also didn't get any solution

On Fri, Sep 7, 2018 at 1:18 PM Vishnu Kumar <vishnu...@gmail.com> wrote:
hi bro,
i also implement adhoc file same way is you get the solution.
then please help me

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/wl6Hi1pFSXA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@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.


--
Ahsan Alnasar


--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages