What is DHCP?


DHCP, Dynamic Host Configuration Protocol, is a communications protocol that dynamically assigns unique IP address to network devices. As a network device joins or leaves an IP-based network, DHCP automatically renews or releases an IP address.

How does DHCP work?

DHCP runs in a client/server mode, where server sets up a pool of available IP addresses for a network. A DHCP server also provides network gateway, subnet masks, name servers and amount of time ("lease") that a given IP address will be valid. A DHCP client retrieves those parameters and uses them to join the existing network. In homes and small offices, a router also acts as a DHCP server. In a larger network, a dedicated server may act as a DHCP server along with performing other server activities.

The process of obtaining an IP address from the DHCP server is as follows.

  • A computer (client) configured to use DHCP sends a DHCP DISCOVER request to the network.
  • A DHCP Server receives a DHCP DISCOVER request, look up available IP address pool and picks an IP address to be assigned. The DHCP Server tries to find the same IP address for the client if it was assigned an IP address previously. The DHCP server sends DHCP OFFER response to the client.
  • The client receives the DHCP Offer response, and reply to the DHCP server by sending DHCP REQUEST packet to accept the offer.
  • The DHCP server sends ACK (acknowledge) packet to confirm IP address assignment. If the IP address is no longer available, NACK (No acknowledge) packet is sent and the process repeats until the client receives a valid IP address from the server.

What are the benefits of using DHCP?

A computer, tablet or smartphone that needs to join existing (home or office) network must be configured properly to communicate with other devices in the network. Manually configuring static IPv4 or IPv6 addresses along with network specific information results in human errors as there are significant number of digits to be entered. Also, manual configuration may end up assigning a same IP address to multiple devices causing an IP conflict. The DHCP automates that cumbersome manual process and assigns the IP address dynamically. You may also interest in reading static and dynamic IP addresses.

DHCP allows network administrators centrally manage and automate the assignment of the IP addresses without having to worry about assigning a duplicate IP address to multiple computers, and re-entering network gateway, subnet mask, and other network related information to each computer and hence making network administration a lot easier to manage.

How do you know if you're using DHCP

If you want to know if you're using a dynamic or static IP address, you may use ipconfig command on Windows. On a MAC or Linux machines, you may use ifconfig command.

On Windows machine, the ipconfig command output will resemble like this.

C:\>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : iplocation
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Hybrid
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Wireless Network Connection:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Intel(R) PRO/Wireless LAN 2100 3B Mi
ni PCI Adapter
        Physical Address. . . . . . . . . : 00-0C-F1-65-5B-70
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 192.168.1.100
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
        DHCP Server . . . . . . . . . . . : 192.168.1.1
        DNS Servers . . . . . . . . . . . : 192.168.1.1
        Lease Obtained. . . . . . . . . . : Thursday, February 08, 2007 2:27:17 PM
        Lease Expires . . . . . . . . . . : Thursday, February 15, 2007 2:27:17 PM

On Mac and Linux machines, the ifconfig command output will look like this.

bash %>ifconfig
eth0      Link encap:Ethernet  HWaddr F2:3C:91:DB:8A:88
          inet addr:192.168.1.96  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27522604 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27666143 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2704290926 (2.5 GiB)  TX bytes:52580665594 (48.9 GiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:17632 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17632 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:2249069 (2.1 MiB)  TX bytes:2249069 (2.1 MiB)

Search Our Website

Advertisement

Advertisement

Incapsula DDos Response Plan

Privacy Articles

Wiki What is Cyberbullying?

Advertisement