Tuesday, 5 February 2019

DHCP Theory

Requirement of Dynamic IP address assignment
At first, most TCP/IP networks were relatively small and static. Manual IP address management techniques were sufficient for them. Each station kept its own IP address somewhere in its secondary storage. Once the address had to be changed, it required manual administrative action. as more complex networks were established, as more and more underlying network devices were used for TCP/IP communication networks, manual administration became difficult. as thin client workstations without secondary storage came into network, a need for centralized administration of IP addresses configuration bindings became essential.

Evolution of Dynamic host Configuration Protocol (DHCP)
A special protocol Reverse Address Resolution Protocol (RARP) was designed for such bindings. It allowed a machine on a network segment to learn its own IP address and then to begin normal TCP/IP operation. Another protocol, BOOTP, was also developed to allow dislikes stations retrieve all the TCP/IP configuration parameters needed to start functioning normally after a startup. BOOTP defines a concept of BOOTP relay agent which specifies how BOOTP traffic is forwarded between multiple segment. So dynamic IP address assignment was possible over Multiple subnetworks with BOOTP. The BOOTP extension mechanism was later on used and developed by BOOTP's descendant, Dynamic Host Configuration Protocol (DHCP).
There are two primary different between DHCP and BOOTP. First, DHCP defines mechanisms through which clients can be assigned a network address for a finite lease, allowing for serial reassignment of network address to different clients. Second, DHCP provides the mechanism for a client to acquire all of the IP configuration parameters that it needs in order to operate. DHCP is base on BOOTP, adding the capability of automatic allocation of reusable network address and additional configuration options. DHCP captures the behavior of BOOTP relay agents, and DHCP participants can interoperate with BOOTP participants.

Benefits of DHCP implementation
Reliable IP address configuration: DHCP minimizes configuration errors caused by manual IP address configuration, such as typographical errors or address conflicts caused by the assignment of an IP address to more than one computer  at the same time.
Reduced network administration: DHCP includes the following features to reduce network administration
  • The ability to define TCP/IP configuration from a central location.
  • The ability to assign a full range of additional TCP/IP configuration values by means of DHCP option such as the subnet mask, DNS servers and default gateway.
  • The efficient handling of IP address changes for clients that must be updated frequently, such as those for portable computer that move to different location on a wireless network.
  • The forwarding of initial DHCP message by using a DHCP relay agent, thus eliminating the need to have a DHCP server on every subnet.
IP address assignment process of DHCP
DHCP allocated IP addresses on a dynamic basic, otherwise known as lease. Although you can set the lease duration anywhere from a few minutes to unlimited, you will typically set the duration for not more than a few hours or days. The default lease time is eight days for wired clients and three days for wireless clients. IP address are handed out to requesting network clients from  a pool of addresses that you define. When a client requests an IP address, the DHCP server offers the next available IP address from the pool. It is possible to reserve particular IP addresses for specific clients based on the media access control (MAC) address of the client's network interface.
Let us discuss the communication between DHCP server and client.

DHCP discovery: The DHCP client broadcast a DHCPDISCOVER packet to every computer in the subnet. The only computer that respond are computers that have the DHCP server role. Or computers or routers those are running a DHCP relay agent respond to Discovery. The DHCP relay agent forwards the message to the DHCP server. Discovery Message consists of communication details such as IP address fields for source=; destination= and UDP source port=68; destination port=67 and Client MAC address and other DHCP options.

DHCP offer: When a DHCP server receives a DHCPDISCOVER message from a client, which is an IP address lease request, the server reserve an IP address for the client and makes a lease offer by sending a DHCPOFFER message to the client. This message contains the client's MAC address, the IP address that the server is offering, the subnet mask, the lease duration. Offer Message consists of communication details such as IP address field for source= (DHCPServer); destination= and UDP source port=67; destination port=68 and MAC addresses of Client and Server.

DHCP request: The client receives the DHCPOFFER packet. it might receive the packet from multiple servers. If it does, it usually select the server that made the fastest response to its DHCPDISCOVER, which typically is the DHCP server closest to the client. the client then broadcast a DHCPREQUEST that contains a server identifier. This informs the DHCP servers that which server's DHCPOFFER the client has chosen to accept Request Message consist of communication details such as IP address field source=; destination= and UDP source port=68; destination port=67 and MAC addresses of client and Server.

DHCP acknowledgement: The DHCP servers receive the DHCPREQUEST. Servers use this message as the notification that the client selected a particular server's offer. The chosen server stores the IP address client information in the DHCP database and responds with a DHCPPACK message. If the DHCP server cannot provide the address that was offered in the initial DHCPOFFER, the DHCP server sends a DHCPNAK message. Acknowledgment Message consists of communication details such as IP address field source=; destination= and UDP source port=67; destination port=68 and MAC address of Client and Server.

The protocol expects the DHCP client to configure its network interface with the negotiated parameters. After the client obtain an IP address, it should probe the newly received address with ARP (Address Resolution Protocol) to prevent address conflicts caused by overlapping address pools of DHCP servers.
A DHCP client may request more information than the server sent with the original DHCPOFFER. The client may also request repeat data for a particular application. For example, browser use DHCP information to obtain web proxy settings.

DHCP Server authorization
DHCP communication typically occurs before any user or computer authentication. Therefore an unknown DHCP server can provide invalid information to clients. You can avoid this by authorizing the server. The domain administrator uses a process called DHCP authorizing to register the DHCP Server in the Active Directory domain before  it can support DHCP clients. Authorizing the DHCP server is one of the post-installation tasks that you must perform after installing the DHCP server.

DHCP Configuration Option
DHCP reservation: If you want a computer or a device to obtain a specific address from the score range, you can permanently reserve that address to be assigned to that device in DHCP. Reservation are useful for tracking IP address assigned to device such as printers.

Scope Options: These options are applied to any clients that obtain a lease within that particular scope. Active scope option types always apply to all computers obtaining a lease in a given scope. You can configure many optional properties on a scope, but typically you configure the following properties
Option 003 - Router (the default gateway for the subnet)
Option 006 - DNS servers
Option 005 - DNS suffix

PXE Boot Options: PXE-enabled network cards add the DHCP option 60 to their discover packets. Normally, DHCP clients send a DHCP option 67 packet, and then DHCP servers return a DHCP 68 option offer. The ports that DHCP uses also are used by the Windows Deployment Services PXE server function. Therefore, if you deploy DHCP and a PXE server on the same machine, you must set DHCP to make offers that also include the 60 option. A DHCP server then makes the DHCP 60 offer back to the client. You need to set DHCP options 60 (PXE Client), 66 (Boot Server Host Name), and 67 (Bootfile Name)

Implementing DHCP server

No comments:

Post a Comment