Assigning an IPv4 Address to a Device
Network applications use TCP/IP to identify other network hosts that use IP addresses. The IP address provides directions to the exact location of a host device on a network. Each device must have a unique IP address.
Each IP address includes a network identifier and a host identifier. The following table describes these identifiers.
Identifies systems located on the same physical network. All systems on the same physical network must have the same network identifier.
Identifies a workstation, server, router, or other TCP/IP host within a network. The address for each host must be unique to the network identifier.
Addresses can be local or remote. If an IP determines that a destination address is a local address, it transmits the packet directly to the network host. If the destination IP address is not on the local network, the address is considered a remote address, and the IP looks for a route to a remote host. If a route is found, the IP sends the packet by using that route. If a route is not found, the IP sends the packet to the default gateway for the source host. A gateway is a device that connects networks by using different communication protocols.
|Windows Embedded CE supports multiple default gateways, but only one gateway is active at any point in time.|
Each IPv4 address is 32 bits long and composed of four octets, or 8-bit fields. An octet is a decimal number in the range from 0 through 255. Each octet is separated by a period. This format is called dotted decimal notation. The IP address 18.104.22.168 is an example of dotted decimal notation.
The following list shows the methods that Windows Embedded CE supports for assigning an IP address to a device.
The device can be manually assigned an IP address by using the registry. This method is known as Static IP address assignment. This registry assignment may be done by way of a user interface (UI), if the OEM provides a UI for the user of the device.
The device can retrieve an address from a Dynamic Host Configuration Protocol (DHCP) server, or allocator, which is normally configured and administered for one or more network segments.
The DHCP client uses the Name reg value under the HKEY_LOCAL_MACHINE\Init registry key for the device name in the DHCP packets, unless that name is the same as the OrigName registry value.
Windows Embedded CE can automatically assign an address to a device from a reserved set of IP addresses. This method is known as Automatic IP.
For more information, see Manually Configuring an IPv4 Address.
An OEM can configure the name of a particular device by using the sethostname function or by including the following lines of code in the Platform.reg file.
[HKEY_LOCAL_MACHINE\Ident] "OrigName"="WinCE" "Name"="MyUniqueName"
When the device boots, the system copies the original name to the HKEY_LOCAL_MACHINE\Ident\OrigName registry key. If another device wants to connect to your device by using the value of the Name, the other device can do so.
|The names of the registry entries for configuring the name of a device may change in future releases.|
For information about the sethostname function, see sethostname.
For information about host name registration, see Name Registration for IPv4.