0% found this document useful (0 votes)
38 views

Dynamic Host Configuration Protocol

Uploaded by

Shagun Pandey
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Dynamic Host Configuration Protocol

Uploaded by

Shagun Pandey
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Dynamic Host Configuration Protocol

Dynamic Host Configuration Protocol (DHCP) is a network


management protocol used to dynamically assign an IP address to
nay device, or node, on a network so they can communicate using
IP (Internet Protocol). DHCP automates and centrally manages
these configurations. There is no need to manually assign IP
addresses to new devices. Therefore, there is no requirement for
any user configuration to connect to a DHCP based network.

DHCP can be implemented on local networks as well as large


enterprise networks. DHCP is the default protocol used by the
most routers and networking equipment. DHCP is also called RFC
(Request for comments) 2131.

DHCP does the following:

o DHCP manages the provision of all the nodes or devices


added or dropped from the network.
o DHCP maintains the unique IP address of the host using a
DHCP server.
o It sends a request to the DHCP server whenever a
client/node/device, which is configured to work with DHCP,
connects to a network. The server acknowledges by
providing an IP address to the client/node/device.

DHCP is also used to configure the proper subnet mask, default


gateway and DNS server information on the node or device.

There are many versions of DCHP are available for use in IPV4
(Internet Protocol Version 4) and IPV6 (Internet Protocol Version
6).

How DHCP works


DHCP runs at the application layer of the TCP/IP protocol stack to
dynamically assign IP addresses to DHCP clients/nodes and to
allocate TCP/IP configuration information to the DHCP clients.
Information includes subnet mask information, default gateway, IP
addresses and domain name system addresses.

DHCP is based on client-server protocol in which servers manage


a pool of unique IP addresses, as well as information about client
configuration parameters, and assign addresses out of those
address pools.
The DHCP lease process works as follows:

o First of all, a client (network device) must be connected to


the internet.
o DHCP clients request an IP address. Typically, client
broadcasts a query for this information.
o DHCP server responds to the client request by providing IP
server address and other configuration information. This
configuration information also includes time period, called a
lease, for which the allocation is valid.
o When refreshing an assignment, a DHCP clients request the
same parameters, but the DHCP server may assign a new IP
address. This is based on the policies set by the
administrator.

Components of DHCP
When working with DHCP, it is important to understand all of the
components. Following are the list of components:

o DHCP Server: DHCP server is a networked device running


the DCHP service that holds IP addresses and related
configuration information. This is typically a server or a
router but could be anything that acts as a host, such as an
SD-WAN appliance.
o DHCP client: DHCP client is the endpoint that receives
configuration information from a DHCP server. This can be
any device like computer, laptop, IoT endpoint or anything
else that requires connectivity to the network. Most of the
devices are configured to receive DHCP information by
default.
o IP address pool: IP address pool is the range of addresses
that are available to DHCP clients. IP addresses are typically
handed out sequentially from lowest to the highest.
o Subnet: Subnet is the partitioned segments of the IP
networks. Subnet is used to keep networks manageable.
o Lease: Lease is the length of time for which a DHCP client
holds the IP address information. When a lease expires, the
client has to renew it.
o DHCP relay: A host or router that listens for client
messages being broadcast on that network and then
forwards them to a configured server. The server then sends
responses back to the relay agent that passes them along to
the client. DHCP relay can be used to centralize DHCP
servers instead of having a server on each subnet.

Benefits of DHCP
There are following benefits of DHCP:

Centralized administration of IP configuration: DHCP IP


configuration information can be stored in a single location and
enables that administrator to centrally manage all IP address
configuration information.

Dynamic host configuration: DHCP automates the host


configuration process and eliminates the need to manually
configure individual host. When TCP/IP (Transmission control
protocol/Internet protocol) is first deployed or when IP
infrastructure changes are required.

Seamless IP host configuration: The use of DHCP ensures that


DHCP clients get accurate and timely IP configuration IP
configuration parameter such as IP address, subnet mask, default
gateway, IP address of DND server and so on without user
intervention.

Flexibility and scalability: Using DHCP gives the administrator


increased flexibility, allowing the administrator to move easily
change IP configuration when the infrastructure changes.
Dynamic Host Configuration Protocol (DHCP)
from Geeks for geek
Prerequisite – Protocols in Application Layer
Dynamic Host Configuration Protocol(DHCP) is an
application layer protocol which is used to provide:

1. Subnet Mask (Option 1 – e.g., 255.255.255.0)


2. Router Address (Option 3 – e.g., 192.168.1.1)
3. DNS Address (Option 6 – e.g., 8.8.8.8)
4. Vendor Class Identifier (Option 43 – e.g., ‘unifi’ =
192.168.1.9 ##where unifi = controller)
DHCP is based on a client-server model and based on
discovery, offer, request, and ACK.
DHCP port number for server is 67 and for the client is 68. It
is a Client server protocol which uses UDP services. IP
address is assigned from a pool of addresses. In DHCP, the
client and the server exchange mainly 4 DHCP messages in
order to make a connection, also called DORA process, but
there are 8 DHCP messages in the process.
These messages are given as below:

1. DHCP discover message –


This is a first message generated in the communication
process between server and client. This message is
generated by Client host in order to discover if there is any
DHCP server/servers are present in a network or not. This
message is broadcasted to all devices present in a
network to find the DHCP server. This message is 342 or
576 bytes long
1. As shown in the figure, source MAC address (client PC) is
08002B2EAF2A, destination MAC address(server) is
FFFFFFFFFFFF, source IP address is 0.0.0.0(because PC has
no IP address till now) and destination IP address is
255.255.255.255 (IP address used for broadcasting). As
the discover message is broadcast to find out the DHCP
server or servers in the network therefore broadcast IP
address and MAC address is used.

2. DHCP offer message –


The server will respond to host in this message specifying
the unleased IP address and other TCP configuration
information. This message is broadcasted by server. Size
of message is 342 bytes. If there are more than one DHCP
servers present in the network then client host will accept
the first DHCP OFFER message it receives. Also a server ID
is specified in the packet in order to identify the server.
1. Now, for the offer message, source IP address is
172.16.32.12 (server’s IP address in the example),
destination IP address is 255.255.255.255 (broadcast IP
address) ,source MAC address is 00AA00123456,
destination MAC address is FFFFFFFFFFFF. Here, the offer
message is broadcast by the DHCP server therefore
destination IP address is broadcast IP address and
destination MAC address is FFFFFFFFFFFF and the source
IP address is server IP address and MAC address is server
MAC address.
Also the server has provided the offered IP address
192.16.32.51 and lease time of 72 hours(after this time
the entry of host will be erased from the server
automatically) . Also the client identifier is PC MAC address
(08002B2EAF2A) for all the messages.

2. DHCP request message –


When a client receives a offer message, it responds by
broadcasting a DHCP request message. The client will
produce a gratuitous ARP in order to find if there is any
other host present in the network with same IP address. If
there is no reply by other host, then there is no host with
same TCP configuration in the network and the message is
broadcasted to server showing the acceptance of IP
address .A Client ID is also added in this message.
1. Now, the request message is broadcast by the client PC
therefore source IP address is 0.0.0.0(as the client has no
IP right now) and destination IP address is
255.255.255.255 (broadcast IP address) and source MAC
address is 08002B2EAF2A (PC MAC address) and
destination MAC address is FFFFFFFFFFFF.
Note – This message is broadcast after the ARP request
broadcast by the PC to find out whether any other host is
not using that offered IP. If there is no reply, then the
client host broadcast the DHCP request message for the
server showing the acceptance of IP address and Other
TCP/IP Configuration.

2. DHCP acknowledgement message –


In response to the request message received, the server
will make an entry with specified client ID and bind the IP
address offered with lease time. Now, the client will have
the IP address provided by server.
1. Now the server will make an entry of the client host with
the offered IP address and lease time. This IP address will
not be provided by server to any other host. The
destination MAC address is FFFFFFFFFFFF and the
destination IP address is 255.255.255.255 and the source
IP address is 172.16.32.12 and the source MAC address is
00AA00123456 (server MAC address).

2. DHCP negative acknowledgement message –


Whenever a DHCP server receives a request for IP address
that is invalid according to the scopes that is configured
with, it send DHCP Nak message to client. Eg-when the
server has no IP address unused or the pool is empty, then
this message is sent by the server to client.

3. DHCP decline –
If DHCP client determines the offered configuration
parameters are different or invalid, it sends DHCP decline
message to the server .When there is a reply to the
gratuitous ARP by any host to the client, the client sends
DHCP decline message to the server showing the offered
IP address is already in use.

4. DHCP release –
A DHCP client sends DHCP release packet to server to
release IP address and cancel any remaining lease time.
5. DHCP inform –
If a client address has obtained IP address manually then
the client uses a DHCP inform to obtain other local
configuration parameters, such as domain name. In reply
to the dhcp inform message, DHCP server generates DHCP
ack message with local configuration suitable for the client
without allocating a new IP address. This DHCP ack
message is unicast to the client.

Note – All the messages can be unicast also by dhcp relay


agent if the server is present in different network.
Advantages – The advantages of using DHCP include:

 centralized management of IP addresses


 ease of adding new clients to a network
 reuse of IP addresses reducing the total number of IP
addresses that are required
 simple reconfiguration of the IP address space on the
DHCP server without needing to reconfigure each client

The DHCP protocol gives the network administrator a method


to configure the network from a centralised area.
With the help of DHCP, easy handling of new users and reuse
of IP address can be achieved.
Disadvantages – Disadvantage of using DHCP is:

 IP conflict can occur

You might also like