Bug 2234 - Ipv6L3Protocol should trash multicast packets not interesting for the node
Ipv6L3Protocol should trash multicast packets not interesting for the node
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: ipv6
ns-3-dev
All All
: P5 enhancement
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-29 17:56 UTC by Tommaso Pecorella
Modified: 2015-12-02 18:38 UTC (History)
2 users (show)

See Also:


Attachments
Patch (24.52 KB, patch)
2015-11-29 17:56 UTC, Tommaso Pecorella
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2015-11-29 17:56:07 UTC
Created attachment 2198 [details]
Patch

Ipv6L3Protocol::Receive should not forward up all the multicast packets regardless if there's a socket interested in them.
Comment 1 Tommaso Pecorella 2015-11-29 17:59:59 UTC
The patch could look a bit strange on some parts, but it's made to be compliant with the upcoming MLDv2, where filtering is way more fine-grained.

In this patch the filtering is assumed to be *only* based on the Destination / Interface pair. MLDv2 also takes into account the source address. The relevant source-based filters could be added with MLDv2.
Comment 2 Tom Henderson 2015-11-30 14:06:26 UTC
why is Ipv6LeaveGroup (void) without any parameters?  Does this leave _all_ groups?  Do you need to join a group with no sources to just leave that specific group?  Or is it assumed that only one group is ever joined, and if so, please specify what happens if JoinGroup() is called repeatedly for different groups?  Please adjust the doxygen accordingly.  

I'd suggest to add more detail to the below doxygen, or a \see of some sort

+   * \enum Ipv6MulticastFilterMode
+   * \brief Enumeration of the possible filter of a socket.
+   */
+  enum Ipv6MulticastFilterMode

this should be a WARN:
+      NS_LOG_LOGIC ("not adding a non-multicast address " << address);

this should be a NS_LOG_FUNCTION (this << address):

+bool Ipv6Interface::IsSolicitedMulticastAddress (Ipv6Address address) const
+  NS_LOG_FUNCTION_NOARGS ();

(perhaps other log statements need to be similarly fixed in this file).

Otherwise, I am fine with the proposal.
Comment 3 Tommaso Pecorella 2015-11-30 17:40:00 UTC
(In reply to Tom Henderson from comment #2)
> why is Ipv6LeaveGroup (void) without any parameters?  Does this leave _all_ groups?  

Just the one the socket did bind to. And yes, it's a bug: if more than one socket is listening to the same group, the first disjoining will force-disjoin the second one.
I'll add a counter to prevent such things.

> Do you need to join a group with no sources to just leave that
> specific group?  Or is it assumed that only one group is ever joined, and if
> so, please specify what happens if JoinGroup() is called repeatedly for
> different groups?  Please adjust the doxygen accordingly.  

Will do. To summarize it: JoinGroup with INCLUDE and no sources is equivalent to leaving a group (see the MLDv2 specifications).

> I'd suggest to add more detail to the below doxygen, or a \see of some sort
> 
> +   * \enum Ipv6MulticastFilterMode
> +   * \brief Enumeration of the possible filter of a socket.
> +   */
> +  enum Ipv6MulticastFilterMode
> 
> this should be a WARN:
> +      NS_LOG_LOGIC ("not adding a non-multicast address " << address);
> 
> this should be a NS_LOG_FUNCTION (this << address):
> 
> +bool Ipv6Interface::IsSolicitedMulticastAddress (Ipv6Address address) const
> +  NS_LOG_FUNCTION_NOARGS ();
> 
> (perhaps other log statements need to be similarly fixed in this file).
> 
> Otherwise, I am fine with the proposal.
Comment 4 Tommaso Pecorella 2015-12-02 18:38:05 UTC
changeset:   11778:710f305a22c9