Wednesday, 12 April 2017

Dynamic Host Configuration Protocol















The DHCP Is a protocol used in a network to help configure the parameters needed for devices to communicate such as IP addresses. The DHCP configures these parameters automatically so that a network administrator would not have to configure each device statically on a network. The DHCP
server manages a pool of IP addresses and settings about client configuration parameters such as default gateway, domain name, the name servers, and time servers. This allows clients to ask the DHCP Server for a IP address and lease them for several days (Or varying times depending on the configuration of the DCHP server) and to come back and request a new IP or preferably the one they were already assigned before.

How IP addresses are distributed

Dynamic:
The way IP address are given to clients are different depending on the configuration of the server or your needs but in general there is 3 ways that they are distributed. Firstly we have dynamic allocation, This uses a lan and a range of IP addresses. The Lan is configured to request IP addresses from the DHCP, using request and grant process the DHCP allocates the IP’s to clients that request one for a predetermined time. At the end of this time the IP address is revoked and not renewed unless a IP is requested again which may be a different address to what was already leased before.

Automatic:
Similar to dynamic allocation in that IP’s are leased for a predetermined time. The difference between dynamic and automatic is that clients who are using a DHCP which has automatic assigned IP will if possible always receive the same IP the DHCP has assigned the client before. This works cause the DHCP server will keep a table of the IP address it has given out and remember which client has had which IP.

Manual: 
Manual or static DHCP assignment is when the DHCP issues private address to each client based on their MAC address. Depending on how the server is set up it is also possible for clients who’s MAC is not found or recognised the server can use the pervious methods of assigning IP’s to clients.


DHCP Operation

DHCP operations fall into four phases as follows:
server discovery, IP lease offer, IP lease request, and IP lease acknowledgement (Also known as DORA).


Discover: 
The client broadcasts messages on the network subnet using the destination address 255.255.255.255 or the specific subnet broadcast address. If the client is on an authoritative server he will be denied any request to be provided with the IP he last knew. But on a non-authoritative server this may be possible.

Offer: 
When a DHCP receives an discover message from a client ( Request to lease an IP) the server reserves an ip for the client and makes a new message which is the lease offer. This message goes back to the client with the following: the client's MAC address, the IP address that the server is offering, the subnet mask, the lease duration, and the IP address of the DHCP server making the offer once this is all compiled it is sent to the client who made the Discover request.

Request: 
When the offer reaches the client the client responds with the request. It will confirm its offered IP and send off the request to is accepted DHCP. A client may receive several offers but will only accept one.

Acknowledgment: 
Once the DHCP receives the request and confirmation for the ip in which it has offered it begins compiling the last message. This message contains the lease duration and any other information requested by the client and the protocol sets up the network interface with the agreed condition.

No comments:

Post a Comment