sending packets from nodes hop by hop in wireless mesh network

446 views
Skip to first unread message

majid....@gmail.com

unread,
Jun 15, 2015, 1:04:51 PM6/15/15
to ns-3-...@googlegroups.com
hi everyone
I need to implement a wireless topology on ns3 so that some message flow from some sources to some receivers through some relay nodes.
I begin my work with three nodes that one of them is source, one is relay and the other is receiver.
but my problem is the message is not sent hop by hop.
the message was broadcast.
the receiver didn't receive the message if it was not on the range of source.
so what can I do now?
can anyone give me some suggestions or sample codes?
do I have to use addhoc standard or some other routing protocols?
I appreciate any help.

Tommaso Pecorella

unread,
Jun 15, 2015, 6:03:14 PM6/15/15
to ns-3-...@googlegroups.com
Hi,

sorry if this seems noobish, but.. what you ask is [nearly] impossible.

Fact: you are trying to use a multi-hop mesh network routing.
Fact: multi-hop mesh network routing protocols don't forward broadcast messages (flooding and controlled flooding are an exception to this rule).
Fact: flooding and controlled flooding are not implemented in ns-3.

Consequence: deadlock.

Double check your scenario and its requirements and, most important, decide the routing protocol, they're not all the same.

Cheers,

T

majid lotfian

unread,
Jun 18, 2015, 4:50:32 AM6/18/15
to ns-3-...@googlegroups.com
hi Tommaso
thanks for response.
let me describe further : my work is implementing network coding on wireless mesh network and examining some topology for this method.
for doing that I need to implement my topology on ns3 and then add coding to it.
in coding, every node can blend it's produced message and received message (how many of them) with a certain coefficient, and send them to destinations and the destinations can retrieve their messages from the combined packets by it's coefficient.
so I need hop by hop routing from some source to some destinations through some relay nodes so that sources and relays can encode and destinations can decode packets.
do you suggest me something for implementing such topologies on ns3?(like how to implement hop by hop routing, what kind of protocols I have to use , ...)

Tommaso Pecorella

unread,
Jun 18, 2015, 5:10:56 AM6/18/15
to ns-3-...@googlegroups.com
Hi Majid,

I'd suggest to have a look at AODV, DSR and OLSR. However, I'd first study them on a book or some online reference, and only when you have a good understanding of the protocols you can move to ns-3.
About NC, it depends if you are using PNC, MNC or L3/4NC. I guess you don't mean PNC tho. Anyway, routing and NC kinds have to be decided together. Otherwise you'll not be able to do anything (and you'll not have a clue about where to apply the NC algorithm).
Summarizing, I'd suggest to consider the routing as an integral part of the problem and to write down the node stack with a greater attention on what layer does what, and based on what informations.

Have fun,

T.

majid lotfian

unread,
Jun 23, 2015, 4:21:45 AM6/23/15
to ns-3-...@googlegroups.com
why this code wouldn't work for me ?
Does it put on a loop or needs to stop simulation commands?
csma-ping.cc

Tommaso Pecorella

unread,
Jun 23, 2015, 4:33:43 AM6/23/15
to ns-3-...@googlegroups.com
If you know the answer, why are you asking ?

You need a Simulator::Stop(). Why you need it is in the OnOffApplication. Study its code and it will be clear.

Have fun,

T.

majid lotfian

unread,
Jun 23, 2015, 2:25:15 PM6/23/15
to ns-3-...@googlegroups.com
in fact, I need to ping from a node to another node through access point.
so I blend wifi-ap example with csma-ping example.
Do you think it's wrong?
ping message will be flow from node a to node b directly or through access point?

Tommaso Pecorella

unread,
Jun 23, 2015, 2:55:46 PM6/23/15
to ns-3-...@googlegroups.com
Hi,


On Tuesday, June 23, 2015 at 8:25:15 PM UTC+2, majid lotfian wrote:
in fact, I need to ping from a node to another node through access point.

Well, that is completely different from the thread topic. Please avoid mixing topics.
 
so I blend wifi-ap example with csma-ping example.
Do you think it's wrong?

Yes, if you don't know what you're doing. Mixing code without understanding what's going on is always bad.
 
ping message will be flow from node a to node b directly or through access point?

Uh? I mean... that's not an ns-3 problem, that's how 802.11 works. Please review what 802.11 "infrastructure" and "ad-hoc" modes are. I mean, do it on a textbook, not on ns-3.

T. 

majid lotfian

unread,
Jun 23, 2015, 3:16:12 PM6/23/15
to ns-3-...@googlegroups.com
no, this questions are across the topic.
I mean I need to pass messages through access point.
what can I do for this?
Message has been deleted

Tommaso Pecorella

unread,
Jun 23, 2015, 5:09:27 PM6/23/15
to ns-3-...@googlegroups.com
Hi,

I am more convinced now that your problem is the lack of understanding: you don't know what is the difference between infrastructured and ad-hoc mode in 802.11.
Mind, there's nothing dramatic in this, unless you keep pretending to know the standard while you clearly don't.

The thread topic is "sending packets from nodes hop by hop in wireless mesh network". This means Ad-hoc mode.
Now you ask how to use an Access Point, which is only used in Infrastructured mode.
As a consequence, the thread went off-topic. If you fail to recognize this is only because you are not really aware of the infrastructured Vs Ah-Hoc mode difference.
Can I point you to this ? It's quite clear: https://en.wikipedia.org/?title=Wireless_LAN

About how to use an AP... mind reading the tutorial ? I mean, it's here:
Moreover, the "examples/wireless" folder is literally filled with ad-hoc and infrastructure examples.

Still, neither the tutorial or the examples will be useful if you don't know what to look for.


T.

majid lotfian

unread,
Jun 24, 2015, 4:59:05 AM6/24/15
to ns-3-...@googlegroups.com
Hi Tommaso
I appreciate your response.
my problem is that on every papers on network coding, the topology that is used is a graph (that means ad hoc network)
but I need to implement it on real network that is a star topology by a few access point.
so this scenario bring me here.
because of your replies,I decide my final topology should be infrastructure.
Do you remember my last code that I upload here?
my problem is when send ping messages from node a to node b, I can't capture this packet on access point node by wireshark !
in fact, .pcap files from all netdevices are the same and I can't see packets pass through access point.
node a find node b by ARP messages and AP in not on the middle.
what do you think?


Tommaso Pecorella

unread,
Jun 24, 2015, 5:23:28 AM6/24/15
to ns-3-...@googlegroups.com
Hi,

I think that if you need to use NC, you should find a way to NOT use infrastructure mode. It would really change the network behaviour, and the results would be completely different from the ones you expect.

In order to build a butterfly topology with ad-hoc nodes you need a routing protocol (to be on top of NC, more later) and a precise node positioning, in order to build a logical topology out of a physical one.

About the routing, it really depends on what is your NC algorithm. This is often neglected in the papers, and most of them assumes that a source wants to send packets to ALL the nodes in the network. This can be accomplished with a controlled flooding algorithm. Alas, controlled flooding isn't implemented in ns-3. You could develop it tho, it shouldn't be too hard: take any ad-hoc routing protocol, trash everything in it (all) and just add a function to not forward packets if they have been recently forwarded. You'll need to find a way to recognize if a packet has been recently seen, but this is not dramatic.

About ARP and APs, I can ensure you that packets flow through the AP in all the infrastructure mode examples. Just check if the packets are "doubled" (sent twice by two different MAC addresses). Moreover, double check the MAC addresses, and remember that 802.11 MAC header doesn't have just two addresses, it does have up to four...

Have fun,

T.

majid lotfian

unread,
Jun 25, 2015, 4:57:11 AM6/25/15
to ns-3-...@googlegroups.com
how can I find transmission range of stanodes if I wand set up butterfly network?
I must put nodes on positions so that someone is out of range of some other.

majid lotfian

unread,
Jun 25, 2015, 9:46:18 AM6/25/15
to ns-3-...@googlegroups.com
now I set up butterfly topology with nodes in right and precise position and I ping correctly.
well, I must implement control flooding for routing protocol, as you mentioned before.
can you explain more please?

Tommaso Pecorella

unread,
Jun 25, 2015, 11:27:17 AM6/25/15
to ns-3-...@googlegroups.com
Hi,

sorry,not really. Find a good paper on controlled flooding (there are many around, please don't let me google it for you), and implement it.
There's a full thread on how to implement a routing protocol, you may want to read it.

have fun,


T.
Reply all
Reply to author
Forward
0 new messages