I have a small problem...
I wanted to compare the functionality and efficiency of the AODV
protocol in ns-3 with the implementation in JIST/SWANS. One of the
tested topology was a matrix of nodes, to which in each simulation I
added one row and one column of nodes. The flow of data was set between
the first and last node in the network, located at two ends of the
diagonal of the network. I noticed that an increasing number of nodes in
the network couses bigger packet loss, which is obvious, however, these
losses were growing much faster than in simulation using JIST.
I reviewed the logs from the simulation along with a colleague and we
noticed that sometimes in the routing table in nodes there appears a
strange entry, in which the source, destination and gateway address are
set to 102.102.102.102. The entry is added to the routing table at the
time when the source node sends a RREQ, because there is no entry
corresponding to the target node.
As we noted after receiving the RREP message corresponding to RREQ, the
source node adds a new entry to its routing table, but does not remove
the entry containing the address of 102.102.102.102. Would not be better
if we add an empty entry specifying, however, the RREQ Destination
address?
void
RoutingProtocol::SendRequest (Ipv4Address dst)
...
RoutingTableEntry rt;
if (m_routingTable.LookupRoute (dst, rt))
{
rreqHeader.SetHopCount (rt.GetHop ());
if (rt.GetValidSeqNo ())
rreqHeader.SetDstSeqno (rt.GetSeqNo ());
else
rreqHeader.SetUnknownSeqno (true);
rt.SetFlag (IN_SEARCH);
m_routingTable.AddRoute (rt);
}
else
{
rreqHeader.SetUnknownSeqno (true);
RoutingTableEntry newEntry;
newEntry.SetFlag (IN_SEARCH);
newEntry.SetDestination(dst); // Shouldn't we add destination
address to the entry?
m_routingTable.AddRoute (newEntry);
}
…
}
We found also that the problem exists also in RouteRequestTimerExpire
method, because it does not check whether the entry was found in the
routing table. Shouldn't we check here whether the entry was found in
the routing table?
void
RoutingProtocol::RouteRequestTimerExpire (Ipv4Address dst)
{
NS_LOG_LOGIC(this);
RoutingTableEntry toDst;
if (!m_routingTable.LookupRoute (dst, toDst)) // Shouldn't we check it
here?
{
return;
}
if (toDst.GetFlag () == VALID)
{
SendPacketFromQueue (dst, toDst.GetRoute ());
NS_LOG_LOGIC ("route to " << dst << " found from " <<
toDst.GetInterface().GetLocal());
return;
}
…
--
Yours Sincerely
Mariusz Skrocki
http://codereview.appspot.com/115075