Bug 294

Summary: what is NetDevice::GetMulticast used for ?
Product: ns-3 Reporter: Mathieu Lacage <mathieu.lacage>
Component: networkAssignee: Craig Dowell <craigdo>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: Rename *NetDevice::MakeMulticastAddress to GetMulticast
Rename MakeMulticastAddress to GetMulticast and remove GetMulticast(void).

Description Mathieu Lacage 2008-08-25 12:45:32 UTC
I grepped in our codebase but I could not find any user of this method. What is its expected purpose ?
Comment 1 Craig Dowell 2008-08-25 16:08:52 UTC
GetMulticast is primarily there for symmetry with GetBroadcast.  It is meant to be used in the same way as GetBroadcast, both internally to the net device and externally.  GetMulticast returns the base address of the multicast MAC address space as defined by RFC.

GetMulticast has a helper associated with it called MakeMulticastAddress which takes the multicast base address and maps an IP address onto that address according to RFC 1112.  MakeMulticastAddress is how code munging IP addresses (now only ARP) is expected to interact with multicast addresses.  You can find the single example of this in arp-ipv4-interface.cc if you want.

The bottom line is that a public GetMulticast provides a similar method for multicast as broadcast, similar semantics to IsMulticast () to IsBroadcast ()  and allows you to change the way IP addresses are mapped to multicast addresses while creating MAC addresses that will be correctly received by net devices that support multicast.
Comment 2 Mathieu Lacage 2008-08-25 16:22:04 UTC
(In reply to comment #1)
> GetMulticast is primarily there for symmetry with GetBroadcast.  It is meant to
> be used in the same way as GetBroadcast, both internally to the net device and
> externally.  GetMulticast returns the base address of the multicast MAC address
> space as defined by RFC.

I don't understand who would use it externally and, no one uses it externally. So, my question is, what is a practical use-case for this method from an external point of view ? I really don't see what you could use it for.

> GetMulticast has a helper associated with it called MakeMulticastAddress which
> takes the multicast base address and maps an IP address onto that address
> according to RFC 1112.  MakeMulticastAddress is how code munging IP addresses
> (now only ARP) is expected to interact with multicast addresses.  You can find
> the single example of this in arp-ipv4-interface.cc if you want.

I understand that MakeMulticastAddress is used externally but GetMulticast is not, as far as I can tell, and I don't see how and why it would ever be used externally.

> 
> The bottom line is that a public GetMulticast provides a similar method for
> multicast as broadcast, similar semantics to IsMulticast () to IsBroadcast () 
> and allows you to change the way IP addresses are mapped to multicast addresses
> while creating MAC addresses that will be correctly received by net devices
> that support multicast.

I am sorry but I really don't understand what you mean here.
Comment 3 Tom Henderson 2008-08-26 01:14:47 UTC
I do not have a use case for it but it seems harmless.
Comment 4 Sebastien Vincent 2008-11-04 10:45:20 UTC
Created attachment 287 [details]
Rename *NetDevice::MakeMulticastAddress to GetMulticast 

Rename  GetMulticast
Comment 5 Sebastien Vincent 2008-11-04 15:03:27 UTC
Created attachment 288 [details]
Rename MakeMulticastAddress to GetMulticast and remove GetMulticast(void).
Comment 6 Mathieu Lacage 2008-11-05 02:18:38 UTC
(In reply to comment #5)
> Created an attachment (id=288) [details]
> Rename MakeMulticastAddress to GetMulticast and remove GetMulticast(void).


ok with me for commit.