Creating a Successful UDP Socket connection in a Mesh Network

442 views
Skip to first unread message

Chris 9999

unread,
Apr 9, 2014, 7:52:26 AM4/9/14
to ns-3-...@googlegroups.com
Dear All,

I am trying to create a WiFi mesh network using ns3 MeshHelper. My problem is that the UDP socket connection is performing very poorly, with zero throughput in some cases. 

Using example code and this source (http://personal.ee.surrey.ac.uk/Personal/K.Katsaros/ns3.html) I have put together a script (attached) that creates a mesh network with the MeshHelper, positions the nodes very close together, and tries to setup a UDP socket between two of the nodes. I am using FlowMonitor to record the throughput of the UDP flow. 

When I place the source and sink right next to each other, the connection is usually fine with expected throughput. When I put the sink on another node, I sometimes get good results, but more often 0-30% of packets are received. I have tried varying the number of nodes, distances between their positions, and changing the propagation loss model and all of these things seem to have little effect: in general most nodes fail to receive packets. I am wondering why this is.

Could anyone take a look at my code and see if I have setup the MeshHelper wrong, or perhaps the mobility/positioning, or whether there is something else I need to consider to make the UDP socket connection more effective? Right now I'm not sure what the problem is. 

Thanks in advance.
Chris.
ieee34-debug.cc

Tommaso Pecorella

unread,
Apr 10, 2014, 2:01:52 AM4/10/14
to ns-3-...@googlegroups.com
Hi,

I haven't checked the code (I have very little time right now), but more than often the answer is: collisions.

Check how many packets are discarded at level 2 (MAC) due to collisions, you'll probably find out that it's pretty high. Mind that having a high node density is only worsening the problem, and by "density" one should consider the node number in a node surrounding. I.e., the more the nodes per square meter, the higher the density. However also increasing the node's Tx power means higher density.
Usually the solution is to lower the node's Tx power...

Cheers,

T.

Chris 9999

unread,
Apr 10, 2014, 4:41:27 PM4/10/14
to ns-3-...@googlegroups.com
Thanks for your helpful reply.

I am still struggling. Today I have been testing with a FixedRssLossModel, which I hope means that distances aren't an issue, and I have tried spacing the nodes 100m apart. I have noticed that if I have 19 or less nodes in my mesh, everything works 100%. If I add one node above this, no packets are received no matter where the source is in my network.

I wasn't able to figure out tracing MAC packet drops. Is it not just: 

Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacTxDrop", MakeCallback(&MacTxDrop));  ?

Chris.

Tommaso Pecorella

unread,
Apr 10, 2014, 4:49:51 PM4/10/14
to ns-3-...@googlegroups.com
Hi,

the cutoff effect is, indeed, strange. Have you checked the pcap traces ?

Anyway, send the script, I'll try to have a look at it.

Cheers,

T.

Tommaso Pecorella

unread,
Apr 10, 2014, 4:58:21 PM4/10/14
to ns-3-...@googlegroups.com
By the way, the MacTxDrop and MacRxDrop traces doesn't seems to be extremely useful. Always check how a trace is used in the code before assuming it's the right one...
(and if you think that a trace should be called upon a certain event and it isn't, report it as a bug).

Perhaps we should find the time to check the WiFi traces and how they're used :P

Cheers,

T.

Chris 9999

unread,
Apr 11, 2014, 6:26:23 AM4/11/14
to ns-3-...@googlegroups.com
Here is the script. How can the WiFi traces be checked?
ieee34-debug.cc

Tommaso Pecorella

unread,
Apr 11, 2014, 3:16:17 PM4/11/14
to ns-3-...@googlegroups.com
Hi,

I would check the script if I could. But you didn't include all the needed sources, so I will not.

My suggestion is: enable the pcap trace files and check those.

T.

Chris 9999

unread,
Apr 11, 2014, 3:29:05 PM4/11/14
to ns-3-...@googlegroups.com


Apologies. I have attached the required header file here and the code again, if you or anyone else wish to check.

Thanks very much for taking the time to help. I will investigate the pcap traces and see what information I can find.

Chris.
myapp.h
ieee34-debug.cc

Ricardo S C

unread,
Jun 16, 2017, 7:43:32 PM6/16/17
to ns-3-users
Hi Chris,

I am having the same issue. Were you able to solve it? If yes, could you please share the solution?

Thanks a lot!

Ricardo S. C.

Chris Luke

unread,
Jun 18, 2017, 2:59:00 PM6/18/17
to ns-3-...@googlegroups.com
Hi Ricardo,

I'm afraid it has been a long time since I used ns3! From memory, I wasn't able to solve the problem you are also facing. I hope you can find some assistance elsewhere.

All the best.

Chris


--
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/Z9-2vj-HMjE/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.
Reply all
Reply to author
Forward
0 new messages