Bug 651

Summary: Ipv4StaticRouting doesn't work stand-alone: can't deliver local packets
Product: ns-3 Reporter: Martín Ferrari <martin.ferrari>
Component: routingAssignee: Tom Henderson <tomh>
Status: RESOLVED FIXED    
Severity: normal CC: craigdo, mathieu.lacage, tomh
Priority: P1    
Version: ns-3-dev   
Hardware: All   
OS: All   

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).