INFO: Configuring Windows CE to Send and Receive DHCP Options (290279)



The information in this article applies to:

  • Microsoft Windows CE Operating System, Versions 3.0
  • Microsoft Windows CE Operating System, Versions 2.12
  • Microsoft Windows CE Operating System, Versions 2.11
  • Microsoft Windows CE Operating System, Versions 2.0

This article was previously published under Q290279
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

SUMMARY

Dynamic Host Control Protocol (DHCP), as specified in RFC 2131, is implemented in Windows CE beginning with version 2.0. The main purpose of DHCP is to enable dynamic configuration of network addressing parameters. However, it also includes provisions for requesting other information from the server (see RFC 1533). This article describes the mechanism used by Windows CE to request additional DHCP options and retrieve information returned by the server.

MORE INFORMATION

There are two categories of option support in DHCP: requested options, which are used to obtain additional information from the server, and send options, which are used to give additional information to the server. Refer to RFC 1533 for a full list of DHCP-defined options.

Requested Options

The default list of options requested from the server includes the following:

Subnet mask (1)Specifies the subnet mask to use
Router (3)Specifies the list of IP addresses for routers on the client's subnet
Domain name server (6)Specifies a list of IP addresses for DNSs on the network
Domain name (15)Specifies the DNS domain name that the client should use for DNS host name resolution
NetBIOS over TCP/IP name server (44)Specifies a list of IP addresses for NetBIOS name servers (NBNS)
NetBIOS over TCP/IP node type option (46)Allows configurable NetBIOS over TCP/IP clients to be configured as described in RFC 1001/1002, where 1=b-node, 2=p-node, 4=m-node, and 8=h-node
NetBIOS over TCP/IP scope (47)Specifies a string that is the NetBIOS over TCP/IP scope ID for the client, as specified in RFC 1001/1002

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.


To change this default list, options which are to be sent out by Windows CE are read from the registry on a per adapter basis under the following key:

HKEY_LOCAL_MACHINE\Comm\<adapter name>\Parms\TcpIp\DhcpOptions

Values are created under this key that have the names of the options to request. The default ("@") value under the DhcpOptions key must also be defined.

The registry setting format is a binary structure equivalent to the actual DHCP option encoding (as per RFC 1533), a one-byte code, followed by a one-byte length value, followed by the actual data.

Example: The following setting (in .REG file notation) shows requesting the value for the subnet mask option:

HKEY_LOCAL_MACHINE Comm\<adapter name>\Parms\TcpIp\DhcpOptions
@=""
"1"

After DHCP has retrieved the information from the server, you might find the following under the value "1" above:

01 04 ff ff ff 00

This corresponds to a subnet mask of 255.255.255.0. (type 1, length 4, data 0xFFFFFF00).

Send Options

Windows CE version 2.12 (with QFE fix #1 applied) and later also supports the capability to supply data to send options to the server. The most common case requiring this is the sending of the host name option.

The key for the send options is as follows:

HKEY_LOCAL_MACHINE\Comm\<adapter name>\Parms\TcpIp\DhcpSendOptions

Values are created under this key which have the names of the options to send. The default ("@") value under the DhcpOptions key must also be set. The format of the option data must include type and length fields, as specific by RFC 1533. Windows CE does not attempt to parse the data, it just copies it into the packet.

Example: The following example setting shows how to set the host name option (12) to the value "myhost":

HKEY_LOCAL_MACHINE\Comm\<adapter name>\Parms\TcpIp\DhcpSendOptions
@=""
"12"=hex:0c,06,6d,79,68,6f,73,74

REFERENCES

World Wide Web Consortium (http://www.w3.org) Request for Comment documents RFC2131 and RFC1533

Modification Type:MinorLast Reviewed:11/22/2005
Keywords:kbinfo KB290279