How to update AODV route selection?

549 views
Skip to first unread message

Emad Aldalu

unread,
Oct 12, 2014, 6:18:03 PM10/12/14
to ns-3-...@googlegroups.com
Hi
I have added a new field (minEnergy) to aodv routing table. The field registers the minimum energy of the nodes along a path from the source to destination. Below is a sample output:
Node: 0 Time: 70s 
AODV Routing table
Destination Gateway Interface Flag Expire Hops MinEnergy
10.0.0.2 10.0.0.2 10.0.0.1 UP 2.58           1 1
10.0.0.3 10.0.0.2 10.0.0.1 UP 2.06           2 1
10.255.255.255 10.255.255.255 10.0.0.1 UP 9223371966.85  1 1
127.0.0.1 127.0.0.1 127.0.0.1 UP 9223371966.85  1 1

Node with ID=0 can reach node 10.0.0.3 with number of hops equal to 2 and the minimum energy of the nodes along the path is 1 J.
My goal is to chose the path based on the minimum energy. But AODV constructs only single path from the source to destination. Isn't it?
I noticed that in aodv-routing-protocol.cc, the protocol either updates an existing route or create a new route if none is exist.
How can minEnergy be used in the selection process?

Thanks,
Emad

Konstantinos

unread,
Oct 12, 2014, 6:36:09 PM10/12/14
to ns-3-...@googlegroups.com
Dear Emad,

You have to understand how AODV works and design first step-by-step how your protocol will work.
As you have already identified, it finds a route with min-hops using RREQ/RREPLY messages and then keeps that until broken.
So it is your task to identify how the route will be constructed using the min energy and for how long it will be used. Design it on the paper and then try to implement it.

Emad Aldalu

unread,
Oct 12, 2014, 7:06:05 PM10/12/14
to ns-3-...@googlegroups.com
Thank you Konstantinos for the reply.
I understand exactly how should the protocol work. But the problem is in the implementation. I want to make use of the existing AODV since it will be much easier than implementing a new protocol from the scratch. As I mentioned, the minEnergy is there in the control packet header and in the route entry, but I couldn't identify where the min hop selection criteria take place.
Please tell me if I'm wrong, As I know, the node ignores the RREQ if it was seen before. This result in constructing only one single path which depends on the first arriving RREQ.
In other words, the intermediate node or the destination node will reply for the first arriving RREQ, and the resulting RREP with go back to the source in the same path from where the RREQ arrived. This result in single path.

The code below is copied from aodv-routing-protocol.cc, method RoutingProtocol::RecvReply. Does changing the condition by including the minEnergy will do the task?

1414  // (iv) the sequence numbers are the same, and the New Hop Count is smaller than the hop count in route table entry.
1415  else if ((rrepHeader.GetDstSeqno () == toDst.GetSeqNo ()) && (hop < toDst.GetHop ()))
1416  {
1417  m_routingTable.Update (newEntry);
1418  }

Thanks,
Emad

Tommaso Pecorella

unread,
Oct 13, 2014, 12:40:12 AM10/13/14
to ns-3-...@googlegroups.com
Dear Emad,

just a question. Why are you asking and not trying ? Like someone wise said once: "Look at me still talking when there's Science to do"

Kostantinos already pointed this out. Understand the protocol you're modifying (and its implementation) and then modify it. If you hope it will work out of the box, you're not on the right track.
As a side note, the line you posted contains another thing to change, but I'll not tell you what it is. You have to... see above.

T.

Emad Aldalu

unread,
Oct 13, 2014, 1:00:48 PM10/13/14
to ns-3-...@googlegroups.com
Thanks Tommaso.
I just wanted to make sure if it is possible to construct a route based on the highest minEnergy before editing anything. I was thinking that multiple routes should be constructed (as in AOMDV) then choosing the best route based on the energy.
I already edited AODV in which minEnergy is there in the routing table and populated with the appropriate value. AODV code is not that easy so please bear with me.

Thanks,
Emad   

Konstantinos

unread,
Oct 13, 2014, 2:52:50 PM10/13/14
to ns-3-...@googlegroups.com
See in your own answer where you are mistaken in the approach you have to the problem.


I was thinking that multiple routes should be constructed (as in AOMDV) then choosing the best route based on the energy.

The design and implementation of AOMDV is different in many ways from AODV, and it is not implemented in NS-3.
So the first part should be to implement AOMDV and then introduce the energy component.

Emad Aldalu

unread,
Oct 13, 2014, 11:00:32 PM10/13/14
to ns-3-...@googlegroups.com
Hi Konstantinos,
The Key question before looking on the energy, does AODV guarantee finding the route with min-hop from the source to destination?

Thanks,
Emad 

Tommaso Pecorella

unread,
Oct 14, 2014, 3:48:59 AM10/14/14
to ns-3-...@googlegroups.com
Dear Emad,

I understand you are a bit scared by the code and the whole thing, but you can't always rely on others for any small doubt.

I could reply that yes, AODV is guaranteed to find the min hop path, but who am I to tell an absolute truth ?
My opinion is equivalent to your (not exactly, I have a bit more experience), but nobody can be 100% sure that the code is bug free, and that there is not a strange case where the min hop is not reached.

In any case, if you keep relying on others to reassure you, you'll always be waiting for someone else to validate your work. A suggestion (not limited to ns-3): trust in yourself, and be ready to discuss your ideas. If your point of view is right, then everyone will agree. If it's not, you can learn something and increase your understanding.
It's the scientific process, you need to discuss your ideas (not the ideas of other people). Hence, you need to build up your own ideas.

About the non-hop thing... it's in the code line you posted. If the message is from a path with less hops, it is updated. As a consequence... you know.

Cheers,

T.

Emad Aldalu

unread,
Oct 26, 2014, 10:49:18 AM10/26/14
to ns-3-...@googlegroups.com
Hi,
AODV doesn't always construct the min-hop path. There is a possibility for multiple nodes to send RREP, more specifically calling SendReplyByIntermediateNode, but this RREP is not always received by neighbors so RecvReply has no chance to update the existing route. In the debugging, sometimes, a neighbor node calls SendReplyByIntermediateNode, but none of the nodes receives that RREP. Can the RREP be lost? 
Example of 4X4 nodes where the source is n0 and the destination is n15. 

n12    n13    n14    n15

n8      n9      n10    n11

n4      n5      n6      n7

n0      n1      n2      n3

Different paths were constructed. The test was run for 10 times, the number of hops in 70% of the runs was 4 hops. 
n0---n5---n6---n10---n15
n0---n5---n10---n15
n0---n5---n9---n14---n15
n0---n5---n6---n10---n15
n0---n4---n9---n10---n15
n0---n1---n6---n10---n15
n0---n5---n6---n11---n15

Can anyone please explain this behavior?

Thanks,
Emad

Tommaso Pecorella

unread,
Oct 26, 2014, 5:19:34 PM10/26/14
to ns-3-...@googlegroups.com
This is the 4th edit of this message. The previous ones were:
- First: pure rage. Trashed.
- Second: irony, turning into rage. Trashed.
- Third: mild irony, still ending in rage. Trashed.

Let's see if the 4th one is better.

AODV finds the shortest patch provided that the shortest path is feasible, i.e., that packets are received by the nodes.
Given that a packet can be dropped due to excessive interference or collisions, sometimes AODV doesn't find the path with the minimum number of hops.

Mind that if you'd be one of my students I would have kicked you out of my office for asking this kind of clarification.

T.
Reply all
Reply to author
Forward
0 new messages