Problem AODV RouteOutput

383 views
Skip to first unread message

Alessandro Russo

unread,
Aug 31, 2011, 8:39:53 AM8/31/11
to ns-3-...@googlegroups.com
Hi Folks,

I was working on my multicast protocol using AODV, and I found a problem in AODV.
Whenever a route is not found, it returns the loopback: see aodv-routing-protocol.cc::296
[...]
  // Valid route not found, in this case we return loopback.
  // Actual route request will be deferred until packet will be fully formed,
  // routed to loopback, received from loopback and passed to RouteInput (see below)
  uint32_t iif = (oif ? m_ipv4->GetInterfaceForDevice (oif) : -1);
  DeferredRouteOutputTag tag (iif);
  if (!p->PeekPacketTag (tag))
    {
      p->AddPacketTag (tag);
    }
  return LoopbackRoute (header, oif);
}
[...]

IMHO this is an error, because makes the routing protocol list and the priority associated to each routing protocol useless.
e.g., I have the following routing protocols:

    Ipv4StaticRoutingHelper staticRouting;
    Ipv4ListRoutingHelper list;
    list.Add (staticRouting, 0); //static
    list.Add (aodv, 10);//unicast
    list.Add (pimdm, 11);//multicast scope

I added a route entry manually:

    Ptr<Ipv4> ipv4A = source.Get(0)->GetObject<Ipv4> ();
    Ptr<Ipv4StaticRouting> staticRoutingA = staticRouting.GetStaticRouting (ipv4A);
    staticRoutingA->AddHostRouteTo (multicastGroup, multicastSourceR, 1, 1);//just one entry to set first hop from the source

source will send all packet to "multicastGroup" through "multicastSourceR",
and when the AODV is queried for the route, it returns the loopback instead of being honest saying "I don't know..."

Do you agree?

Best Regards,

 Alessandro  R.

Tom Henderson

unread,
Sep 1, 2011, 12:41:34 AM9/1/11
to ns-3-...@googlegroups.com

It may very well be that there is a problem, but, my first question is
why you are not using the multicast routing API (AddMulticastRoute())
instead of using a unicast API call (AddHostRouteTo ()) to add a
multicast route?

The loopback return in RouteOutput() is just a technique to redirect
(unicast) packets through RouteInput() where AODV can cache for route
discovery if needed. RouteOutput() requires an immediate return value
to the transport protocol and AODV can't work with that method. I would
expect that multicast would work independently of this, although I am
not sure of the interaction between PIM and AODV if route discovery
hasn't occurred yet.

- Tom

Alessandro Russo

unread,
Sep 1, 2011, 3:25:28 AM9/1/11
to ns-3-...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.


Hi Tom,

I was going to replace the static unicast route with the multicast one: this is the origin of the problem.
So AODV first defers the packet, then requests that route; actually, I didn't remember such mechanism.
Thanks for the explanation!!

Regards,
Alex

ashok kumar

unread,
Sep 1, 2011, 4:05:05 AM9/1/11
to ns-3-...@googlegroups.com
Hi Sorry for coming in mid way of discussion.
I had posted question relating to provision of equal cost multiple paths between subnets, but there were no takers for that question. May I request you to kindly look at the question.
 
-----
Is ECMP supported in NS3. I deliberately created multiple paths between subnets and used Ipv4GlobalRoutingHelper::
PopulateRoutingTables () to create routes. But when I run the program, I am getting following error.

assert failed. cond="m_ecmpRootExits.size () <= 1", msg="Assumed there is at most one exit from the root to this vertex", file=../src/internet/model/global-route-manager-impl.cc, line=309

Continuing My question, when looking at routing overview of NS3 documentation I found following.
---------------------
Presently, we can handle IPv4 point-to-point, numbered links, as well as shared broadcast (CSMA) links, and we do not do equal-cost multipath.
----------------------
Is the above said thing still holds good in NS3. If so any one please suggest how to support equal cost multiple paths



To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.

Tom Henderson

unread,
Sep 1, 2011, 10:18:25 AM9/1/11
to ns-3-...@googlegroups.com
On 09/01/2011 01:05 AM, ashok kumar wrote:
> Hi Sorry for coming in mid way of discussion.
> I had posted question relating to provision of equal cost multiple paths
> between subnets, but there were no takers for that question. May I
> request you to kindly look at the question.

Sure, I did not see that one.

>
> -----
> Is ECMP supported in NS3. I deliberately created multiple paths between
> subnets and used Ipv4GlobalRoutingHelper::
> PopulateRoutingTables () to create routes. But when I run the program, I
> am getting following error.
>
> assert failed. cond="m_ecmpRootExits.size () <= 1", msg="Assumed there
> is at most one exit from the root to this vertex",
> file=../src/internet/model/global-route-manager-impl.cc, line=309

Yes, it should be supported. However, you can see that there was a
loose end to this feature; namely, there were no tests added at the time
of submission, and the issue in the tracker was left open as a result:
https://www.nsnam.org/bugzilla/show_bug.cgi?id=667

So, maybe you found a case where it doesn't work, or maybe it has
regressed since then. In either case, if you could provide an example
or test case that you think is not working properly (by uploading it to
that tracker issue, or sending to me), we could try to debug that and
finish off 667.

>
> Continuing My question, when looking at routing overview of NS3
> documentation I found following.
> ---------------------
> Presently, we can handle IPv4 point-to-point, numbered links, as well as
> shared broadcast (CSMA) links, and we do not do equal-cost multipath.

This is dated documentation; will fix.

> ----------------------
> Is the above said thing still holds good in NS3. If so any one please
> suggest how to support equal cost multiple paths

Please review the code and discussion in issue 667.

- Tom

ashok kumar

unread,
Sep 2, 2011, 8:43:19 AM9/2/11
to ns-3-...@googlegroups.com, to...@tomh.org
Hi
I tried those patches. Rebuilt NS3 but still getting same error.
assert failed. cond="m_ecmpRootExits.size () <= 1", msg="Assumed there is at most one exit from the root to this vertex", file=../src/internet/model/global-route-manager-impl.cc, line=346

One clarification, I am using NS-3.11. The path names referenced in the patch file are different from that of ns-3.11. So I manually applied the patches. Is this OK.
I am sending the file as attachement. Please let me know where I am going wrong. May I still hope for using global routing for supporting multiple paths  or I have to try some other methods.




- Tom

fat-tree.cc

Alessandro Russo

unread,
Sep 2, 2011, 9:11:10 AM9/2/11
to ns-3-...@googlegroups.com
Just a note. Since routing protocol are installed with priority:

    Ipv4ListRoutingHelper list2;
    list2.Add (staticRouting, 0);
    list2.Add (aodv, 10);

when we add a static route for a multicast address

    multicast.AddMulticastRoute (multicastRouter, multicastSource, multicastGroup, inputIf, allNetDev.Get(0));

and a node starts sending packet to this multicast address, the Ipv4listrouting queries AODV which
defers this packet, even if it should not because AODV is unicast, so it might be helpful to add the following lines

  if (dst.IsMulticast())
     {
      sockerr = Socket::ERROR_NOROUTETOHOST;
      NS_LOG_LOGIC ("AODV: No multicast routing protocol");
      return route;
     }

so that the IPv4ListRouting sees a null route from AODV, check the next routing protocol,
that might be StaticRouting containing the MulticastRoute we added or another protocol.

Regards,

Alex

Tom Henderson

unread,
Sep 2, 2011, 1:51:30 PM9/2/11
to ns-3-...@googlegroups.com

>
> when we add a static route for a multicast address
>
> multicast.AddMulticastRoute (multicastRouter, multicastSource,
> multicastGroup, inputIf, allNetDev.Get(0));
>
> and a node starts sending packet to this multicast address, the
> Ipv4listrouting queries AODV which
> defers this packet, even if it should not because AODV is unicast, so it
> might be helpful to add the following lines
>
> if (dst.IsMulticast())
> {
> sockerr = Socket::ERROR_NOROUTETOHOST;
> NS_LOG_LOGIC ("AODV: No multicast routing protocol");
> return route;
> }
>
> so that the IPv4ListRouting sees a null route from AODV, check the next
> routing protocol,
> that might be StaticRouting containing the MulticastRoute we added or
> another protocol.
>
> Regards,
>
> Alex
>

I think you did find a problem here. There is some logic already in
AODV's RouteInput() method:

// AODV is not a multicast routing protocol
if (dst.IsMulticast ())
{
return false;
}

however, just above that, there is a check whether there is a
DeferredRouteOutput tag applied to the packet, so it never reaches that
check. The problem here is that AODV::RouteOutput() should not be
appending such a tag to a multicast packet.

I filed a bug to track and fix this.

https://www.nsnam.org/bugzilla/show_bug.cgi?id=1255

Thanks,
Tom

Reply all
Reply to author
Forward
0 new messages