Hello friends! Today we will read about What is DHCP in this post and will also see its working, advantages and configuration. You read it completely, you will understand it easily. So let’s start:-
What is DHCP?
The full name of DHCP is Dynamic Host Configuration Protocol. It is a network management protocol used to automatically assign IP addresses to hosts on a network. It assigns IP address to the host so that they can communicate with each other.
DHCP can be implemented on local networks as well as on large networks. DHCP is a default protocol used on most routers and other networking devices.
DHCP is also called RFC (Request for Comments) 2131.
If a host wants to communicate with another host in any network, then for this it must have a unique IP address.
You can also manually configure these IP addresses on each host. But if the network is very large then this approach will not work. In large networks, you cannot assign IP addresses by going to each host manually. DHCP is used to solve this problem.
The work of Dynamic Host Configuration Protocol is to assign IP address to the hosts. These IP addresses are assigned automatically.
DHCP is a client/server protocol. Its port number is 67.
Hosts को IP address प्रदान करना DHCP का प्रमुख काम होता है। लेकिन यह IP address के अलावा बहुत सी information (सूचना) hosts को प्रदान करता है। ऐसी कुछ सामान्य information की list नीचे दी जा रही है।
- IP address (Ex – 184.108.40.206)
- Subnet Mask (Ex – 244.244.0.0)
- Domain Name (Ex – www.websitename.com)
- Default Gateway (Ex. 10.0.0.0.1)
- DNS Server Address
Advantages of DHCP
Its advantages are as follows:-
Due to DHCP, the possibility of errors (mistake) in IP address configuration is completely reduced.
By using it, you do not need to manage the list of IP addresses. Also, you do not need to manage which IP address is free and which has been assigned. DHCP does this work automatically.
If you move the host to another network, then DHCP assigns it a new IP address.
By this it becomes very easy to add new clients to a network.
Through this the IP address can be used again, less IP address is required than this.
It is very easy to implement and use it.
It supports many scopes like:- multicast scope, super scope etc.
Components of DHCP
The components of DHCP are given below:-
DHCP Server – This is a network device that stores the IP address and other information. It is a server or router that acts as a host.
DHCP Client – This is a device that receives configuration information from the DHCP server. This device can be a mobile, computer and other device.
IP Address Pool – This is a range of IP addresses that are available to the DHCP client. IP address is assigned in order from lowest to highest.
Subnet – IP networks are divided into two or more segments called subnets. It is easy to manage the network through subnet.
Lease – This is a time in which the DHCP client holds the IP address information. When the lease expires, the DHCP client has to renew it again.
DHCP Relay – This is a TCP / IP host that forwards DHCP messages between the client and the server.
How does DHCP work?
There are some steps from requesting the host to the process of assigning an IP address to it. These steps are explained below.
- First, the client broadcasts the discover message to the available servers. This message is used to discover the DHCP server in the network.
- After this the server which receives this message sends the offer message to the client. The server shows its own existence through the Offer message.
- After this, the client broadcasts the Request message to the server for the IP address and other information.
- After this, the server sends the information to the client through a unicast acknowledgment message.
Disadvantages of DHCP
Its disadvantages are as follows:-
- Its biggest disadvantage is its security because it does not have a secure mechanism to authenticate the client.
- Sometimes, while assigning IP addresses to hosts, there may be a conflict between the IP addresses.
- In this, it is difficult to trace the activities of the internet.
DHCP server has an important role in any network. DHCP server can be configured on any router or switch. If you are configuring DHCP server then you should have the information given below.
You must have network ID.
You should also know which are the addresses which are already being used.
You should also know the address of the default router (default gateway) of the network.
You should also know the address of the DNS (Domain Name System) server.
Above is the information which is required to configure any DHCP server. Below are some steps to configure DHCP server. You can easily configure DHCP by following these steps.
- First of all, you exclude those addresses which are already being used or reserved for other purposes.
- After this you create a pool with a unique name for the subnet.
- After this, you set the network ID and subnet mask that the server will use to assign IP addresses to the hosts.
- After this you set the address of the default gateway.
- After this the address of the DNS server is set.
- If you do not want to use the pre-set lease time, then you can set the lease time in days, hours and minutes.
Below is an example of DHCP configuration.
router(config)#ip dhcp excluded-address 192.168.16.1 192.168.16.10
router(config)#ip dhcp pool edutechgyan
router (dhcp-config)#network 192.168.10.0 255.255.255.0
router (dhcp-config)#default-router 192.168.10.1
router (dhcp-config)#dns-server 220.127.116.11
router (dhcp-config)#lease 2 15 2
Look at the above example carefully, first of all network Id and broadcast address have been excluded. After this a pool has been created in the name of edutechgyan. After this the network and subnet mask have been defined. Network is defined by network Id. After this the default gateway and DNS server have been defined. Lastly, the lease time has been defined. Default lease time is 24 hours. But if you want to change it then you can.