Subject: [dhcwg] Relationship between DHCP hardware type and SNMP interface type

From: "Philippe Ragon" <[email-masked]>
Date: Wed, 14 May 2003 17:17:37 +0200

Hi,

I have just noticed that the list of values for DHCP hardware type and the
one for ifType in SNMP Interface MIB are not at all synchronized. For
example an Ethernet 10 Mbs CSMA-CD interface is designated by :
- htype = 1 in DHCP messages
- ifType = 6 in MIB-II

Both set of values being under IANA control, such a situation is curious and
prevents from using the following pseudo-code in a DHCP client to fill up a
Discover message :

// X is the identifier of the interface we want to configure IP-wise
Get ifType for interface X
htype = ifType
Get ifPhysAddress for interface X
hlen = strlen(ifPhysAddress)
strncpy (chaddr, ifPhysAddress, hlen-1)

I also have one additional question :

ifType = 1 (= other) allows to specify an interface whose type is not in the
defined list AND there is no htype value available to specify the same thing
ifPhysAddress = Null string allows to specify an interface for which
physical address is meaningless AND I am not sure that it is legal to set
hlen to 0 (and chaddr to 0 ?) to specify the same thing

This would be useful to handle an interface attached to a point to point
link (at least logically) towards a relay agent. This would be the case for
example of an interface mapped to a permanent ATM VCC.  In such a case, the
identification of the path that must be used to return responses from server
is left to the relay (e.g. as described by RFC 3046) and thus the content of
chaddr is not used, and more it is meaningless (no 'physical' address is
actually assigned to the interface).

Any comment / explanation will be welcome.

Philippe Ragon

---

From: "Barr Hibbs" <[email-masked]>
Date: Fri, 16 May 2003 17:31:08 -0700

Relationship between DHCP hardware type and SNMP interface typethat's
because the "Interface Type (ifType)"  and "Hardware Type (htype)" fields
are really NOT the same thing.  It's unfortunate that we have such
differences sprinkled throughout the Internet protocols, but we do.  Also,
I'd be *very* wary of relying on the results of an "strlen()" function call
to obtain or work with addresses in general, simply because they are NOT
guaranteed to be null-terminated (breaking an assumption of "strlen()") and
because some vendors stuff invalid strings into the 'haddr' and 'hlen'
fields intentionally even when specifying 'htype' = 6.

We had a long discussion thread about hlen=0, htype=0, and haddr=0 some time
ago, but I've forgotten many of the details of that discussion including
what was the objective, why it was being proposed for use, how to properly
interpret the meanings, when it should be used, and where its use was
appropriate.

--Barr

  -----Original Message-----
  From: [email-masked] [mailto:[email-masked]]On Behalf Of
Philippe Ragon
  Sent: Wednesday, May 14, 2003 08:18
  To: [email-masked]'
  Subject: [dhcwg] Relationship between DHCP hardware type and SNMP
interface type

  Hi,

  - ifType = 6 in MIB-II

  Both set of values being under IANA control, such a situation is curious
and prevents from using the following pseudo-code in a DHCP client to fill
up a Discover message :

  htype = ifType

  ifType = 1 (= other) allows to specify an interface whose type is not in
the defined list AND there is no htype value available to specify the same
thing

  Philippe Ragon