Bug 911 - IPv4 multicast forwarding not going to all output interfaces in route
IPv4 multicast forwarding not going to all output interfaces in route
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
pre-release
All All
: P5 normal
Assigned To: Tom Henderson
: bug
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-14 10:16 UTC by Ken Renard
Modified: 2010-08-10 02:42 UTC (History)
2 users (show)

See Also:


Attachments
Sample program to demonstrate multicast packets sent out on only 1 of N output interfaces (3.19 KB, text/x-c++src)
2010-05-14 10:16 UTC, Ken Renard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Renard 2010-05-14 10:16:13 UTC
Created attachment 868 [details]
Sample program to demonstrate multicast packets sent out on only 1 of N output interfaces

ns-3.8 and potentially earlier

In Ipv4L3Protocol::IpMulticastForward(), we loop around the output interfaces associated with this multicast route.  However, after we hit the first valid output interface, we return instead of continuing to consider other output interfaces.  This results in no more than 1 of the N outputInterfaces defined by the multicast route being used to forward a multicast packet.  Looks like the same goes for Ipv6L3Protocol::IpMulticastForward ().

An example network:

//
//   n0 ======  n1 ====== n2
//              |
//              ======n3
//
//  Multicast source is n0
//  Multicast is forwarded by n1 to n2 and n3
//

In this case, n1 has been assigned a multicast route from its interface to n0 that is forwarded out its interfaces to both n2 and n3.  As seen in a resulting packet trace, the packet only shows up at n2 and not at n3.  Attached sample program demonstrates this network.

Simple patch that seems to work for me (will need to do something similar for IPv6):

Index: ipv4-l3-protocol.cc
===================================================================
--- ipv4-l3-protocol.cc (revision 469)
+++ ipv4-l3-protocol.cc (working copy)
@@ -755,7 +755,7 @@
           rtentry->SetGateway (Ipv4Address::GetAny ());
           rtentry->SetOutputDevice (GetNetDevice (i));
           SendRealOut (rtentry, packet, h);
-          return;
+          continue;
         }
     }
 }



Thanks!

-Ken Renard
Comment 1 Tom Henderson 2010-05-24 01:29:18 UTC
Will commit something after testing.
Comment 2 Tom Henderson 2010-08-10 02:42:01 UTC
fixed in changeset 2666c1d862ef