Receiving packets from multiple clients at same time

300 views
Skip to first unread message

Milad Mhb

unread,
Jan 26, 2016, 9:14:40 AM1/26/16
to ns-3-users
Hi all,

In my scenario, there are one server and multiple clients, which each of them must send a hello-pkt to server every one second, so server must be capable of revceiving ( or buffering) multiple packet at same time and handle all of them.

Currently I am using "socket->SetRecvCallback()" and then "socket->RecvFrom()" to read packets but it receive only packet from one client instead of all.

Please Note: I am using "ns3::UdpSocketFactory" to create my socket as I want use UDP Protocol and all my connections are Ad-hoc.

Can any one suggest how I can achieve this?

Regards,

Tommaso Pecorella

unread,
Jan 26, 2016, 9:20:37 AM1/26/16
to ns-3-users
Hi,

you can achieve this by fixing your code. If the server doesn't receive packets, then you did a mistake in the clients setup.

T.

Milad Mhb

unread,
Jan 26, 2016, 9:33:04 AM1/26/16
to ns-3-users
Server receive packet but only from one client each time not all of them in parallel. I assume it is because all of them arrive at same time and server don't buffer them and accept only first one.

How can a server accept and buffer all packets ?

Konstantinos

unread,
Jan 26, 2016, 9:42:35 AM1/26/16
to ns-3-users
You can't have parallel reception in single radio/channel wifi... in such case you have collisions. 
Give some jitter at the start of the hello broadcast. this should solve your problem

Milad Mhb

unread,
Feb 3, 2016, 2:13:46 AM2/3/16
to ns-3-users
Why can't I use RTS/CTS concept to solve this problem? (it suppose to be its job to handle)
for example i can set rtslimit to 0 then

Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue (rtslimit));

I have tried it and it didn't work but I would like to know the reason.

Regards,

Konstantinos

unread,
Feb 3, 2016, 3:09:11 AM2/3/16
to ns-3-users
Hi

No, it would not solve the problem because your HELLO packets are broadcast and RTS/CTS mechanism does not work with such packets.
Think about it. You send a RTS for a broadcast packet. Who answers with the CTS?  

Regards,
K.

Milad Mhb

unread,
Feb 3, 2016, 3:32:37 AM2/3/16
to ns-3-users
Oh! Right...
So I will use random number as jitter of broadcast messages, and set RTS/CTS for unicast messages.

Thank you

ashishbha...@gmail.com

unread,
Jul 21, 2020, 2:40:25 AM7/21/20
to ns-3-users
hello were you able to solve the issue can you share the code
Reply all
Reply to author
Forward
0 new messages