In the following NED file:
import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.node.aodv.AodvRouter;
import inet.physicallayer.wireless.unitdisk.UnitDiskRadioMedium;
import inet.visualizer.common.IntegratedVisualizer;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;
import inet.common.scenario.ScenarioManager;
import inet.networklayer.ipv4.RoutingTableRecorder;
network myAodvNet
{
parameters:
int numHosts;
@display("bgb=750,750");
submodules:
radioMedium: UnitDiskRadioMedium {
parameters:
@display("p=100,200;is=s");
}
configurator: Ipv4NetworkConfigurator {
parameters:
config = xml("<config><interface hosts='*' address='145.236.x.x' netmask='255.255.x.x'/> </config>");
@display("p=100,100;is=s");
}
visualizer: IntegratedVisualizer {
parameters:
@display("p=100,30");
}
sender: AodvRouter {
parameters:
@display("i=device/pocketpc_s;r=,,#707070;p=68.908,116.843994");
}
receiver: AodvRouter {
parameters:
@display("i=device/pocketpc_s;r=,,#707070;p=654.626,256.158");
}
host[numHosts]: AodvRouter {
parameters:
@display("i=device/pocketpc_s;r=,,#707070;p=461.38397,221.704");
}
routingTableRecorder: RoutingTableRecorder {
parameters:
@display("p=-60,310;is=s");
}
scenarioManager: ScenarioManager {
parameters:
script = default(xml("<scenario/>"));
@display("p=-60,428;is=s");
}
connections allowunconnected:
}
I have 5 AodvRouter nodes(sender, host[0], host[1], host[2] and receiver) where the sender node is supposed to send UdpBasicApp packets to the receiver node.
Although Host[0] is closer and is in the communication range of the sender node, the sender node sends AodvReq packets to Host[2] which is not in the communication range of the sender node and is far away from the sender node. It is interesting that all route request packets are sent only to node host[2] and not to other nodes. I have shown this in the photo below. What is the cause of such a strange phenomenon?
Thanks a lot
I expected the AodvRouter to send the route request to the nodes that are in the communication range of the sender node and not the node that is far away and out of the communication range of the sender node. That is, it is expected that the route request packets will go to node host[0] first, then node host[1], then node host[2], and then the receiver node, and the receiver node will send the route reply packet in reverse to the sender node, and then the sender node will send the UdpBasicApp data packets to the receiver node using the route discovered.