Bug 651 - Ipv4StaticRouting doesn't work stand-alone: can't deliver local packets
Ipv4StaticRouting doesn't work stand-alone: can't deliver local packets
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: routing
ns-3-dev
All All
: P1 normal
Assigned To: Tom Henderson
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-06 04:33 EDT by Martín Ferrari
Modified: 2009-10-02 00:58 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martín Ferrari 2009-08-06 04:33:32 EDT
After a while trying to understand why the packets targeted at a specific ns3::Node were being looped, I found the following comment in src/routing/static-routing/ipv4-static-routing.cc:

// XXX this method not robust enough to work outside of ListRouting context
// because it will not perform local delivery
bool
Ipv4StaticRouting::RouteInput  (Ptr<const Packet> p, const Ipv4Header &ipHeader, Ptr<const NetDevice> idev,
                             UnicastForwardCallback ucb, MulticastForwardCallback mcb,
                             LocalDeliverCallback lcb, ErrorCallback ecb)

When I wrapped the Ipv4StaticRouting with ns3::Ipv4ListRouting, it started to work. I think either the code should not allow to have static routing without list routing, or the static routing should be fixed.

Regards, Martín.
Comment 1 Tom Henderson 2009-08-06 09:36:53 EDT
(In reply to comment #0)
> After a while trying to understand why the packets targeted at a specific
> ns3::Node were being looped, I found the following comment in
> src/routing/static-routing/ipv4-static-routing.cc:
> 
> // XXX this method not robust enough to work outside of ListRouting context
> // because it will not perform local delivery
> bool
> Ipv4StaticRouting::RouteInput  (Ptr<const Packet> p, const Ipv4Header
> &ipHeader, Ptr<const NetDevice> idev,
>                              UnicastForwardCallback ucb,
> MulticastForwardCallback mcb,
>                              LocalDeliverCallback lcb, ErrorCallback ecb)
> 
> When I wrapped the Ipv4StaticRouting with ns3::Ipv4ListRouting, it started to
> work. I think either the code should not allow to have static routing without
> list routing, or the static routing should be fixed.
> 

Note that this is also true of OLSR and GlobalRouting.  I haven't tried to solve this yet, but I would like to try to see whether we can just copy over the needed methods from ListRouting to these other protocols.
Comment 2 Tom Henderson 2009-10-02 00:58:06 EDT
changeset 54b51a1105d6

I tested this with Ipv4StaticRouting and Ipv4GlobalRouting (removing the ListRouting object).  I made the same change for Ipv6StaticRouting but it is not tested due to lack of an example for multi-hop routing.

NixVector and OLSR still need to operate in a ListRouting context.  Suggest to work such extensions after ns-3.6, if there is interest (patches welcome).