[Ns-developers] NetDevice and ArpIpv4Interface

Tom Henderson tomh at tomh.org
Fri May 16 10:06:17 PDT 2008


Mathieu Lacage wrote:
> On Thu, 2008-05-15 at 11:20 +0100, Gustavo Carneiro wrote:
>> NetDevice and ArpIpv4Interface look perfect candidates for merging into a
>> single virtual object via AddObject (aka AddInterface).  Right now:
>>
>>   1- ArpIpv4Interface "decorates" (or "wraps") NetDevice;
>>   2- The ArpIpv4Interface has one "interface index" at IP level, NetDevice
>> has another "interface index" at Node level, and they can be different (I
>> was surprised to find out recently);
> 
> Yes, because it is possible to have multiple Ipv4 interfaces to map to a
> single NetDevice to support multihoming.
> 
>>   3- There are two interface lists, one at IP level, one at Node level;
> 
> Yes, again, this is by design to support multihoming.
> 
>>   4- Checking if a NetDevice supports IP or not is not trivial, as my
>> GlobalRoutingManager patch demonstrates:
>>
>> +      // Check if it is an IP interface (could be a pure L2 NetDevice)
>> +      bool isIp = false;
>> +      for (uint32_t i = 0; i < ipv4Local->GetNInterfaces (); ++i )
>> +        {
>> +          if (ipv4Local->GetNetDevice (i) == ndLocal)
>> +            {
>> +              isIp = true;
>> +              break;
>> +            }
>> +        }
>> +      if (!isIp)
>> +        {
>> +          continue;
>> +        }
>> +
>>
>> I think this design predates the introduction of object interfaces in NS-3.
>> If we were designing it now, I think most of us would agree in a better
>> design:
>>
>>   1- ArpIpv4Interface becomes an optional interface of NetDevice
>> (AddObject);
>>   2- Thus there would be only one interface index for both, and only one
>> interface list at Node level (IP can filter out non-IP interfaces).
> 
> I don't think that the above could be made to support IP-level
> multihoming correctly.

This is a known naming issue that we ought to clean up now:

http://www.nsnam.org/bugzilla/show_bug.cgi?id=85

Tom


More information about the Ns-developers mailing list