The DHCP Test tool allows you to initiate DHCP transactions or exercise a DHCP Server.

The "DHCP Type" popup menu at the upper left corner of the test parameters area allows you to select what DHCP transaction to generate. "Discover" sends a dhcp discover message, if an "Offer" is received, it will then send a "Request" to request this lease and wait for a corresponding "Ack". This simulates one or more clients starting up with no previous lease information. "Verify" sends a DHCP "Request" message as if the client is in the INIT-REBOOT state to verify an existing lease. Renew sends a DHCP "Request" message as if the client is trying to renew an existing lease. "Rebind" sends a DHCP "Request" message as if the client is trying to rebind. Inform sends a DHCP "Inform" message. Release sends a DHCP "Release" message using any IP addresses previously discovered to release the corresponding lease bindings. BootP sends a request that does not include a DHCP message type to simulate a BootP client.

"How Many" specifies the number of DHCP transactions to generate. Each DHCP transaction (after the first) will use a unique Client_ID formed by appending the transaction number to the Client_ID prefix. The first test uses the actual clientID you enter along with the hardware and IP address of your machine. If you specify the number of DHCP transactions as zero, the tester will just listen and log any DHCP Server responses. For example, if you set How Many to zero, select Verbose Logging, press Test, and then "Renew DHCP Lease" in the Mac OS X Network Preferences panel, the DHCP Tester will show the actual response (if any) the local DHCP client received.

"Delay" specifies the delay between initiating DHCP transactions. Note this setting is only approximate since transactions are generated at normal application time when the system is not otherwise occupied. You can disable "Verbose Logging" to improve system responsiveness. The tool automatically waits so as not to generate more than 10 outstanding transactions at a time to avoid overflowing it's own UDP receive buffer space.

The "Repeat" checkbox sets the DHCP Test tool to continuously repeat the previously selected transactions.

The "Cycle" checkbox sets the DHCP Test tool to continuously cycle through each DHCP transaction type in order.

"Request Address:" if the DHCP Type is "Discover", "Verify", "Renew", "Rebind" or "Release" and the tool is not responding to previous reply, the specified Request Address is used. This feature is intended to test how well the server rejects invalid IP addresses (request for an address not on the attached network).

"Address Time" allows you to specify a value for the DHCP "Address Time" option to request a specific lease time. You can verify the effect by examing the "Expire Time" in the table or enabling "Verbose Logging" to see the actual Lease Time returned.

"Server Address" if specified identifies the DHCP Server to use.

The "Non Zero ciaddr" checkbox sets the 'ciaddr' in DHCP requests to the IP address of the test machine. This simulates the behavior of Mac OS clients that find a DHCP server after previously self configuring, or have a previous address from being attached to another network.

The "FQDN (Option 81)" checkbox sends DHCP Option 81 with flags 0101 (E=1 canonical name encoding, S=1 perform FQDN-to-address DNS updates). This asks the DHCP Server to update the DNS server with the new address assignment (choosing an appropriate name as desired).

"Client_ID" specifies the prefix of the DHCP client ID string to use. You can include non-printing characters in the Client_ID field by using percent escapes (%XX where X is a hex digit 0-9, A-F). If you leave the Client_ID field empty, the Ethernet MAC address of the test machine will be used instead incremented by 1 for each successive test. This can be used to test static lease assignments based on matching the corresponding MAC address.

The "Hardware Address" field allows you to specify the client hardware address sent in DHCP packets. Normally this defaults to the actual hardware address of the selected network port, but you can override this to test particular configurations.

"Option List" specifies any DHCP options to explicitly request using the DHCP Parameter List option. You can specify a series of otpions as a list of option numbers separated by commas (example: 3,6,44).

"Network Port" allows you to select which network port will be used to send and receive DHCP messages. Since the standard UDP client port for DHCP may already be bound by Mac OS X's built-in DHCP client (and thus not available), the DHCP Test tool sends "raw" IP datagrams and receives any responses using the UNIX packet capture library (libpcap). Both of these mechanisms need to know the actual network device to use.

The "Logging" popup allows you to select the amount of detail you want recorded in the log drawer. The options are "Exception", "Summary", or "Verbose". Any log data is automatically saved to a file in /Library/Logs/IPNetMonitorX. You can hide or display the log drawer using the disclosure triangle in the lower left corner of the DHCP Test window.

The "Test" ("Abort") button is used to start or stop the actual test. While the test is running, each transaction is recorded in the table showing what messages were sent, the response if any, and the round trip time of the response. Each DHCP message sent and received can also be shown in the log drawer. A green check mark indicates a message sent or received. "!Ack" indicates a Negative Acknowledgement was received. A red "X" indicates there was no response within the time out period (10 seconds).

Design Notes

The DHCP Test tool was developed to test the DHCP Server in IPNetRouterX. In order to simulate multiple DHCP clients, the tester will often be requesting information about leases from a hardware and IP address that is different from the actual machine address. The tester tries to work around this conflict by requesting that all responses be broadcast, but some DHCP Server implementations may not support this properly.

The DHCP Test tool is powerful enough to simulate multiple hosts loading a server, but also has much simpler uses. For example: you might enable Verbose Logging and send a single Discover message with your current Client_ID to see the complete set of DHCP options returned including all DNS servers and Default-Gateways (which are not otherwise visible in the Network Preferences Panel - multiple Default-Gateways can cause network slowdowns on Mac clients depending on your network).

For more information on DHCP, refer to RFC-2131, RFC-2132, or a good book on TCP/IP.

Previous | Next | Return to IPNetMonitorX Help