How to change the route in AODV

77 views
Skip to first unread message

kei

unread,
Mar 28, 2024, 9:59:47 AMMar 28
to ns-3-users
I am currently looking to modify the AODV program so that I can change intermediate nodes in the middle of a communication.
The node I want to switch is already registered in the routing table when the first node starts communication.
How can I change the route during communication?
The first node is
[sender] <----> [node1] <---> [geteway] <---> [sinker]
Then after a few seconds of communication, it changes to
[sender] <----> [node2] <---> [gateway] <---> [sinker]

Tommaso Pecorella

unread,
Mar 28, 2024, 9:06:54 PMMar 28
to ns-3-users
It's "sink" not "sinker".

Lexicon aside, it looks like a route recovery after a failure.

If node1 stops forwarding packets, node2 will (eventually) take over.

If you need an uninterrupted communication, the easiest way I can think of is:
1) invalidate the existing route in the source - thus forcing a new RREQ/RREP exchange (you need to modify Aodv to do this), and
2) make sure that node1 doesn't reply.

Alternatively (not suggested) you can modify the Aodv classes, expose the routing table, and change it manually in the sender, node1, node2 and gateway.
Brutal, but it might work.

kei

unread,
Mar 31, 2024, 8:03:31 AMMar 31
to ns-3-users
Thanks for the reply.
I am considering the plan you suggested.
However, I am having trouble with how to stop packet forwarding on node 1.
Probably in the AODV implementation, after the communicating node is no longer able to communicate for some reason and after the ActiveRouteTimeout (3 seconds) elapses, the RREQ packet is sent again and the route establishment starts.
In the implementation I am aiming for, I would like to intentionally stop the packet delivery of the selected node and immediately make a new route to one of the nodes out of the multiple options.
Any ideas would be appreciated.

2024年3月29日金曜日 10:06:54 UTC+9 Tommaso Pecorella:

Tommaso Pecorella

unread,
Mar 31, 2024, 12:05:00 PMMar 31
to ns-3-users
AODV does not remember the "multiple options". My reply was made assuming that you do know exactly how AODV works, so my best suggestion is to  study both the AODV code and the standard. 

Zoe Jiang

unread,
Jun 23, 2024, 8:37:23 PM (6 days ago) Jun 23
to ns-3-users
Hi kei,
have you successfully addressed this issue? I'm tring to modify AODV recently, I want to switch in the k-shortest paths, but I have no idea, can you share some experience?
Best wishes

Aidan Hansen

unread,
Jun 26, 2024, 10:09:26 PM (3 days ago) Jun 26
to ns-3-users

It seems that you do not understand the working principle of AODV.

In fact, you do not understand the working principle of the routing layer in ns3. I suggest you carefully read the ns3 manual. You can learn about the principles of the routing layer in ns3 through OSPF or AODV because these routing protocols follow the basic simulation logic of ns3.

 you may not  understand the above process, the most important thing you need to know is how data packets are transmitted in ns3. How exactly does a data packet get sent from node1 to node2. This is an essential question. In ns3, the routing protocols (AODV, OSPF) specify almost a static protocol. By default, in the same subnet, every node is working and attempting to communicate. The reason is that when you decide to stop a particular node from working automatically, it is challenging to make it work again by any means. This is a difficult task.

Anyway, what you need to do is not to modify AODV but to re-examine your requirements.

I know there might be some ways to solve your problem, but you need to clarify your requirements

Tommaso Pecorella

unread,
Jun 27, 2024, 10:58:54 AM (2 days ago) Jun 27
to ns-3-users
I didn't check the code, but I know the 101 of AODV.

AODV does NOT keep a list of the alternate paths, so it's not designed to do what you want. Said so, it's not an impossible task, but it will be a terribly difficult one - next to design, develop, build, and test a new routing protocol.

Now, there are two alternatives:
  1. You find a paper, or - better - a standard to guide you.
  2. You design a new protocol, based on AODV - which does what you want..
You first should find a reliable reference (point 1) BEFORE doing step 2 - you don't want to reinvent the wheel.
If you find a good reference, use it to modify the code. Mind: the changes won't simple, because RREP is sent only on the selected path - not on all of the available ones.

If you don't find anything... well, you're in the academic research area, and you'll understand why I can't tell you more on my ideas on how to do it. Copyrights...
Reply all
Reply to author
Forward
0 new messages