[Ns-developers] comments on proposed loopback changes

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Mon Apr 27 00:03:43 PDT 2009


[CCing ns-dev because probably no one is subscribed to ns-reviews yet]

On Sun, 2009-04-26 at 21:54 -0700, Tom Henderson wrote:

> 1) Why is this device created by Ipv4L3Protocol?  Shouldn't it just be 
> created as part of the node?  What if someone builds an IPv6 only node?

Presumably, there would be an ipv6 loopback device. This is what I was
expecting at least. If you want to, we can probably add it in the Node
directly but, if we do this, then, the problem will be identifying which
device is the loopback device from Ipv4L3Protocol. Should we hardcode an
assumption that device 0 is always the loopback device ? Maybe we should
add a Node::GetLoopbackDevice method which always returns device 0 ?

> 
> 2) (this is a spillover discussion from another bug (550)).
> 
> There is a LoopbackChannel introduced that seems to exist so that 
> NetDevice::GetChannel() doesn't have to return NULL.  Or is there 
> another reason for this object that I'm not seeing?  I think it would be 
> clearer to just have LoopbackNetDevice::GetChannel() just return 0 and 
> not create a LoopbackChannel object.  Plus, even though there is one 
> possible device stored in the channel, GetNDevices returns 2:

Again, don't care much: I did what appeared to make sense to me but I
don't feel strongly in any way about it.

> 
> + uint32_t
> + LoopbackChannel::GetNDevices (void) const
> + {
> +   return 2;
> + }
> 
> 
> > (note: I also did fix a couple of XXX from the multi-address merge)
> 
> Thanks, can this XXX comment be removed now?

I thought I had removed the ones I fixed but it appears I forgot one.

> 
> +      // XXX multi-address case
> +      if (dest.IsBroadcast ())
> +        {
> +          NS_LOG_LOGIC ("All-network Broadcast");
> +          hardwareDestination = m_device->GetBroadcast ();
> +          found = true;
> +        }
> ...



More information about the Ns-developers mailing list