DHCP RELATED

DHCP

Command for showing dhcp server address authorized for the client

ipconfig /showclassid adapter

DHCP RELAY AGENT


The DHCP Relay Agent component is a Bootstrap Protocol (BOOTP) relay agent that relays Dynamic Host Configuration Protocol (DHCP) messages between DHCP clients and DHCP servers on different IP networks.


To add the DHCP Relay Agent

Open Routing and Remote Access.

In the console tree, click General.

Where?

Routing and Remote Access/server name/IP Routing/General

Right-click General, and then click New Routing Protocol.

In the Select Routing Protocol dialog box, click DHCP Relay Agent, and then click OK.



DHCP uses a client-server model where one or more servers (DHCP servers) allocate IP addresses and other optional configuration parameters to clients (hosts) upon client bootup. These configuration parameters are leased by the server to the client for some specified amount of time. When a host boots up, the TCP/IP stack in the host transmits a broadcast (DHCPDISCOVER) message in order to gain an IP address and subnet mask, among other configuration parameters. This initiates an exchange between the DHCP server and the host. During this exchange, the client passes through the several well defined states listed below:
  1. Initializing
  2. Selecting
  3. Requesting
  4. Bound
  5. Renewing
  6. Rebinding
In moving between the states listed above, the client and server may exchange the types of messages listed in the DHCP Message Table below.

DHCP Message Table

ReferenceMessageUse
0x01DHCPDISCOVERThe client is looking for available DHCP servers.
0x02DHCPOFFERThe server response to the client DHCPDISCOVER.
0x03DHCPREQUESTThe client broadcasts to the server, requesting offered parameters from one server specifically, as defined in the packet.
0x04DHCPDECLINEThe client-to-server communication, indicating that the network address is already in use.
0x05DHCPACKThe server-to-client communication with configuration parameters, including committed network address.
0x06DHCPNAKThe server-to-client communication, refusing the request for configuration parameter.
0x07DHCPRELEASEThe client-to-server communication, relinquishing network address and canceling remaining lease.
0x08DHCPINFORMThe client-to-server communication, asking for only local configuration parameters that the client already has externally configured as an address.

DHCPDISCOVER

When a client boots up for the first time, it is said to be in the Initializing state, and transmits a DHCPDISCOVER message on its local physical subnet over User Datagram Protocol (UDP) port 67 (BootP server). Since the client has no way of knowing the subnet to which it belongs, the DHCPDISCOVER is an all subnets broadcast (destination IP address of 255.255.255.255), with a source IP address of 0.0.0.0. The source IP address is 0.0.0.0, since the client does not have a configured IP address. If a DHCP server exists on this local subnet and is configured and operating correctly, the DHCP server will hear the broadcast and respond with a DHCPOFFER message. If a DHCP server does not exist on the local subnet, there must be a DHCP/BootP Relay Agent on this local subnet to forward the DHCPDISCOVER message to a subnet that contains a DHCP server.
This relay agent can either be a dedicated host (for example, Microsoft Windows Server), or router (for example, a Cisco router configured with interface level IP helper statements).

DHCPOFFER

A DHCP server that receives a DHCPDISCOVER message may respond with a DHCPOFFER message on UDP port 68 (BootP client). The client receives the DHCPOFFER and moves into the Selecting state. This DHCPOFFER message contains initial configuration information for the client. For example, the DHCP server will fill in the yiaddr field of the DHCPOFFER message with the requested IP address. The subnet mask and default gateway are specified in the options field, subnet mask and router options, respectively. Other common options in the DHCPOFFER message include IP Address lease time, renewal time, domain name server, and NetBIOS name server (WINS). The DHCP server will send the DHCPOFFER to the broadcast address, but will include the clients hardware address in the chaddr field of the offer, so the client knows that it is the intended destination. In the event that the DHCP server is not on the local subnet, the DHCP server will send the DHCPOFFER, as a unicast packet, on UDP port 67, back to the DHCP/BootP Relay Agent from which the DHCPDISCOVER came. The DHCP/BootP Relay Agent will then either broadcast or unicast the DHCPOFFER on the local subnet on UDP port 68, depending on the Broadcast flag set by the Bootp client.

DHCPREQUEST

After the client receives a DHCPOFFER, it responds with a DHCPREQUEST message, indicating its intent to accept the parameters in the DHCPOFFER, and moves into the Requesting state. The client may receive multiple DHCPOFFER messages, one from each DHCP server that received the original DHCPDISCOVER message. The client chooses one DHCPOFFER and responds to that DHCP server only, implicitly declining all other DHCPOFFER messages. The client identifies the selected server by populating the Server Identifier option field with the DHCP server's IP address. The DHCPREQUEST is also a broadcast, so all DHCP servers that sent a DHCPOFFER will see the DHCPREQUEST, and each will know whether its DHCPOFFER was accepted or declined. Any additional configuration options that the client requires will be included in the options field of the DHCPREQUEST message. Even though the client has been offered an IP address, it will send the DHCPREQUEST message with a source IP address of 0.0.0.0. At this time, the client has not yet received verification that it is clear to use the IP address.

DHCPACK

After the DHCP server receives the DHCPREQUEST, it acknowledges the request with a DHCPACK message, thus completing the initialization process. The DHCPACK message has a source IP address of the DHCP server, and the destination address is once again a broadcast and contains all the parameters that the client requested in the DHCPREQUEST message. When the client receives the DHCPACK, it enters into the Bound state, and is now free to use the IP address to communicate on the network. Meanwhile, the DHCP server stores the lease in its database and uniquely identifies it using the client identifier or chaddr, and the associated IP address. Both the client and server will use this combination of identifiers to refer to the lease. The client identifier is the Mac address of the device plus the media type.
Before the DHCP client begins using the new address, the DHCP client must calculate the time parameters associated with a leased address, which are Lease Time (LT), Renewal Time (T1), and Rebind Time (T2). The typical default LT is 72 hours. You can use shorter lease times to conserve addresses, if needed.

DHCPNAK

If the selected server is unable to satisfy the DHCPREQUEST message, the DHCP server will respond with a DHCPNAK message. When the client receives a DHCPNAK message, or does not receive a response to a DHCPREQUEST message, the client restarts the configuration process by going into the Requesting state. The client will retransmit the DHCPREQUEST at least four times within 60 seconds before restarting the Initializing state.

DHCPDECLINE

The client receives the DHCPACK and will optionally perform a final check on the parameters. The client performs this procedure by sending Address Resolution Protocol (ARP) requests for the IP address provided in the DHCPACK. If the client detects that the address is already in use by receiving a reply to the ARP request, the client will send a DHCPDECLINE message to the server and restart the configuration process by going into the Requesting state.

DHCPINFORM

If a client has obtained a network address through some other means or has a manually configured IP address, a client workstation may use a DHCPINFORM request message to obtain other local configuration parameters, such as the domain name and Domain Name Servers (DNSs). DHCP servers receiving a DHCPINFORM message construct a DHCPACK message with any local configuration parameters appropriate for the client without allocating a new IP address. This DHCPACK will be sent unicast to the client.

DHCPRELEASE

A DHCP client may choose to relinquish its lease on a network address by sending a DHCPRELEASE message to the DHCP server. The client identifies the lease to be released by the use of theclient identifier field and network address in the DHCPRELEASE message. If you need to extend the current DHCP pool range, remove the current pool of addresses and specify the new range of IP addresses under the DHCP pool. In order to remove specific IP addresses or a range of addresses that you want to be in the DHCP pool, use the command ip dhcp excluded-address.
Note: If devices use BOOTP, infinite length leases are shown in the DHCP bindings of routers.


Comments

Popular posts from this blog

Boot configuration Data Store --BCDEdit /set

ADSI Edit

Userenv logging (User Environment logging)