TITLE
    Mac OS X Server: What Is Needed Before NetInfo Starts
Article ID:
Created:
Modified:
30753
9/23/98
10/26/99

TOPIC

    A Mac OS X Server computer needs four critical pieces of network-related information when it starts up: its IP address, network mask, broadcast address, and host name. Each piece of information can be hard-coded, so that a change requires changing information stored on the computer's hard disk, or can be obtained dynamically when the computer starts up.

    This article describes how a booting computer gets these important pieces of information, and gives you some tips for making sure that configuration works properly. For information on startup steps omitted here, see the Mac OS X Server files /etc/rc.boot, /etc/rc, and /etc/rc.net.


DISCUSSION

    Manual Or Automatic

    You can set up a Mac OS X Server computer so that its network configuration information--host name, Internet address, network mask (or netmask), and broadcast address--are determined from information on the computer itself. Specifically, you can use the HostManager application to set this information, which is then stored in the file /etc/hostconfig. Once you have done this, though, changing this information is cumbersome, and replacing hardware becomes awkward too.

    Alternatively, a Mac OS X Server computer can get this network configuration information automatically from the network. This is usually easier and more efficient than configuring manually. Automatic configuration often allows you to maintain this information in one central ``location''--NetInfo.

    Internet Address Configuration

    A computer that is booting can determine its Internet address using the BOOTP protocol, which is built on top of UDP. Using this protocol, the booting computer (which we call the client computer) broadcasts its hardware network address, such as its Ethernet or token ring address. A configuration server somewhere on the local network--a BOOTP daemon called bootpd--receives the message and sends a reply. The information in the reply it sends depends on whether the configuration server's BOOTP database contains information about the client computer.

    Usually the configuration server's database contains information about the client computer. The database is made up of information from the /machines directories in its immediate domain hierarchy--local domain, second-level domain, and so on through the root domain. The configuration server's /machines directories contain a directory for each client computer in the domain. In each such directory, the en_address property contains the hardware network address of the client computer. For example, at Rhino, in the /machines/pfm directory in the /info domain there is an en_address property containing the address 0:0:f:1:48:91, which is pfm's Ethernet address. If the configuration server has an appropriate /machines NetInfo subdirectory with an en_address that matches the client computer's hardware network address, then the configuration server returns the client computer's Internet address in the BOOTP reply.

    If the client computer has just been added to the network, though, the configuration server will not recognize the new computer's hardware address. If the NetInfo domain is configured to add computers automatically, then the configuration server invokes automatic host addition. It sends a reply to the client computer, containing a temporary Internet address and information indicating that it is invoking automatic host addition. The temporary address is based on the configuration_ipaddr property in /machines of the NetInfo domain. Other information in the reply includes a prompt that the client computer then poses to the user, such as ``Network does not recognize computer. Enter host name:''.

    On the other hand, if the client computer is new and the domain is not configured to add computers automatically, the configuration server sends no reply. If the client computer gets no replies, it can not boot. You have to add the computer manually using a computer that's already on the network, then reboot the new computer.

    To find out more about adding computers to a network, both with and without automatic host addition, see the Mac OS X Server Network and System Administration references located in the system/ documentation directory on your server.

    Multiple domains on one subnet

    What if a single network or subnet has two domains on it, one of which (domain A) has automatic host addition enabled but does not have the client computer's host information, and the other of which (domain B) does have the client computer's host information? It's possible that a configuration server in domain A might respond before one in domain B!

    When a client computer receives a BOOTP reply indicating that the configuration server doesn't recognize the client, it waits and retries the BOOTP request before acting on that reply. Even this isn't foolproof: if domain B's configuration server is slow and does not get a reply back to the client computer in time, the client computer might receive only the automatic host addition replies, despite delays and retries. If this occurs, reboot the client computer; if it occurs frequently, examine the communication between the client computers and the configuration servers, and the load on the configuration servers.

    If both domain A and domain B have automatic host addition enabled and the client computer really is new to the network, there is no way to specify which domain should automatically add the new computer. In a case like this, enable automatic host addition for only one of the two domains, and add new computers to the other domain manually.

    Reverse ARP (RARP)

    Mac OS X Server doesn't provide support for the Reverse Address Resolution Protocol (RevARP or RARP). BOOTP is a newer protocol with greater flexibility. If a device on your network requires RARP support, you will have to provide it either through third-party software or through a different piece of hardware.

    Netmask and Broadcast Address Configuration

    Like the Internet address, the netmask for a computer can be hard-coded or obtained from the network. Similarly, the broadcast address can be hard-coded or computed based on the netmask.

    Netmask configuration

    There are three classes of netmask values you can set using HostManager, which writes the information to /etc/hostconfig:
    • A specific netmask, such as 255.255.255.0, 255.255.240.0, or 0xffffff80.
    • The default netmask, according to the Class (A, B, or C) of the network number portion of the Internet address. For a Class A network, this is 0XFF000000 (255.0.0.0); for Class B, 0XFFFF0000 (255.255.0.0); and for Class C, 0XFFFFFF00 (255.255.255.0); see Marcum 1991. The netmask corresponds to an empty value in /etc/hostconfig. A new Mac OS X Server system has this setting.
    • A directive to acquire the netmask from the network, as described below. This is specified in /etc/hostconfig by the value -AUTOMATIC-.

    The ICMP protocols include provisions for getting the network mask from ``the network.'' The booting computer sends a broadcast message, this time requesting the netmask, using an ICMP Netmask Request packet. Computers that receive the broadcast reply with their netmasks, using an ICMP Netmask Reply packet. The booting computer uses the mask in the first ICMP Netmask Reply packet that it receives.

    The hazards of a bad netmask

    There's an interesting caveat to automatic netmask configuration. If a computer on the network has an incorrect netmask, that wrong netmask can be propagated around the network. This can lead to apparently intermittent boot-up problems. If you suspect this as the cause of some of your troubles, you can diagnose it with the following steps:

    1. Run the command ifconfigen0 on the computer where you're having troubles.

    The output will be similar to:

    en0: flags=63<UP,BROADCAST,NOTRAILERS,RUNNING>
    inet 129.18.1.2 netmask ffffff00 broadcast 129.18.1.255

    2. Examine the netmask field. The value displayed is in hexadecimal. If it's incorrect for your network, then either the value set using HostManager is incorrect or some device on your network--on that local subnet, if you're using subnets--is propagating an incorrect netmask.

    Once a computer is up and running, it is usually impossible to determine which computer provided the incorrect netmask. Sometimes, you might be able to see the message sent to the console by ifconfig if you exit loginwindow to the console. During a verbose boot, though, a message like the following is sent to the console:

    en0: setting netmask to 0xffffff00 received from 192.42.172.1

    In this case, the node at address 192.42.172.1 provided the netmask 0xffffff00, which is equivalent to 255.255.255.0.

    Other nodes might also have incorrect netmasks. If you have a network analyzer, check the replies to an ICMP Netmask Request to locate the node or nodes replying with an incorrect netmask. If you have no network analyzer, you will have to examine the source of the netmask on each computer on that network or subnet to find which are incorrect.

    Broadcast address configuration

    Using HostManager, you can use two sorts of broadcast address specifications--an explicit broadcast address, and an automatically computed broadcast address. Usually, you will use the automatically computed broadcast address, which is based on the computer's Internet address and netmask.

    Automatic computation generates a broadcast address with the computer's network number in the network number portion of the address, and all 1 bits in the host number portion. The following table shows some examples.

    Internet Address
    Netmask Default
    Broadcast Address
    129.18.1.2
    255.255.0.0
    129.18.255.255
    129.18.1.2
    255.255.255.0
    129.18.1.255
    129.18.1.2
    255.255.255.240
    129.18.1.15
    129.18.1.2
    255.255.255.240
    129.18.1.207

    It's sometimes easier to understand unusual netmasks like the last two in the table if you see them in hexadecimal format, so here are the same addresses in hexadecimal:
    Internet Address
    Netmask Default
    Broadcast Address
    0X81120102
    0XFFFF0000
    0X8112FFFF
    0X81120102
    0XFFFFFF00
    0X811201FF
    0X81120102
    0XFFFFFFF0
    0X8112010F
    0X81120102
    0XFFFFFFF0
    0X811201CF

    For the first three example addresses, the Internet address remains the same and the netmask changes, masking different bits. The default broadcast address changes accordingly. For the fourth example, the last byte in the Internet address changed from 02 to c3. The netmask indicates that the low-order four bits are in the host number portion. The default broadcast address is calculated appropriately.

    The formula for computing a broadcast address is:

    broadcast_address = Internet_address | (~netmask)

    The broadcast address is the Internet address logically ORed with the logical NOT of the netmask.

    The alternative to automatically computing the broadcast address is to hard-code it. If you do this, you specify an Internet address using either hexadecimal or dotted-decimal notation.

    Unless you have very specific reasons for changing the broadcast address, and you understand what you're doing and why, Apple Computer strongly recommends against hard-coding a broadcast address. An incorrect broadcast address can cause big problems.

    Host Name Configuration

    As with the Internet address, you configure the host name using HostManager; the information is stored in /etc/hostconfig. You can either hard-code the host name by specifying it explicitly, or you can have the computer get it from the network during startup. And also as with the Internet address, Apple Computer recommends that you have the computer obtain its name from the network.

    Automatic host name configuration uses a SunRPC-based protocol, BOOTPARAM. This protocol is similar to the BOOTP protocol, although it is built using SunRPC on top of UDP rather than using ICMP. A booting computer broadcasts a BOOTPARAM WHOAMI request, noting its Internet address and asking for the host name corresponding to that address. If multiple servers reply to the request, the computer uses the information from the first response it receives.

    When Not To Use Automatic Configuration

    If a computer provides networkwide NetInfo services, hard-code that computer's Internet address and host name, and consider hard-coding its netmask as well. If a computer provides configuration services, hard-code its Internet address and host name also. Normally, a computer providing networkwide NetInfo services also provides configuration services to the network.

    Hard-coding the information on these particular computers ensures that the computers providing NetInfo and configuration services do not themselves need a configuration server to boot. This is important, because if no configuration server is running and all configuration servers need to ask for their names, there's no way for any of them to start, and then no computers in the domain can start.

    The Environment Before NetInfo Starts

    There is one very important thing to remember when working in single-user mode or when configuring services such as syslog, local file systems, and routing that are invoked during the boot process before NetInfo is started--NetInfo is not running.

    Since NetInfo isn't running, the services provided by NetInfo and the information stored in its databases are not available. The system reverts to using the Unix-style flat file databases, such as /etc/hosts.

    For example, when you configure routing using SimpleNetworkStarter or HostManager, you can specify ``None'' for no routing, ``Dynamic'' to run routed, or a specific Internet address that indicates a default route. If you choose the last option, you must use the address of the router, not the host name--routing starts before NetInfo, so normal name translation services aren't available.

    If you sometimes need to perform administrative tasks in single-user mode when NetInfo isn't running, you will need to set up the Unix-style flat file databases. For example, put host names in /etc/hosts and list network services you need in /etc/services. (See ``The NetInfo Lookup Server--lookupd'' to find out how these files are used by NIS once NetInfo is running.)

    What if you are in single-user mode and you want to start NetInfo? See ``The Tough Stuff.''

    Note: The document references in this and other articles in this issue refer to the books and articles listed in ``Mac OS X Server Networking References.''

    Networking Terms and Protocols

    ARP (Address Resolution Protocol): The part of IP that translates a high-level Internet address to a low-level physical hardware address (such as an Ethernet address).

    BOOTP (Bootstrap Protocol): An IP protocol that allows a computer to acquire start-up information from the network, including its Internet address.

    broadcast address: A special reserved address that broadcasts messages to all computers in a network. All hosts with the same network address receive information sent to that network's broadcast address. The special address 255.255.255.255 is the broadcast address of the current network.

    host number: A computer's identification number within a network.

    ICMP (Internet Control Message Protocol): An integral part of IP that handles error and control messages.

Document Information
Product Area: Mac OS System Software
Category: Mac OS X Server
Sub Category: General Topics
Keywords: kmosXserver

Copyright © 2000 Apple Computer, Inc. All rights reserved.