9
DHCP (Dynamic Host Configuration Protocol) Mohammed Hisham P.M By Mohammed Hisham P.M

DHCP Protocol

Embed Size (px)

Citation preview

Page 1: DHCP Protocol

DHCP (Dynamic Host Configuration Protocol)

Mohammed Hisham P.M

ByMohammed Hisham P.M

Page 2: DHCP Protocol

What is DHCP?Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that

automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway.

Clients should require no manual configuration by the user to connect to the network.

Each client should be able to discover appropriate configuration information dynamically.

This is normally accomplished through the use of a Dynamic Host Configuration Protocol [UDP]

Mohammed Hisham P.M

DHCP Requires little or no administrative overhead, after initial configurations of the

DHCP server. Dynamically maps IP addresses to MAC addresses. Addresses can be leased for a predefined amount of time before the lease

expires and must be renewed by the client.

Page 3: DHCP Protocol

Three methods of allocating IP-addresses

Mohammed Hisham P.M

●DDynamic allocation: A network administrator assigns a range of IP addresses to DHCP, and each client computer on the LAN is configured to request an IP address from the DHCP server during network initialization. The request-and-grant process uses a lease concept.

●AAutomatic allocation: The DHCP server permanently assigns a free IP address to a requesting client from the range defined by the administrator

●SStatic allocation: The DHCP server allocates an IP address based on a table with MAC address/IP address pairs, which are manually filled in (perhaps by a network administrator). Only clients with a MAC address listed in this table will be allocated an IP address.

Page 4: DHCP Protocol

DHCP Message Format

Number of Seconds

OpCode Hardware Type

Your IP address

Unused (in BOOTP)Flags (in DHCP)

Gateway IP address

Client IP address

Server IP address

Hardware AddressLength Hop Count

Server host name (64 bytes)

Client hardware address (16 bytes)

Boot file name (128 bytes)

Transaction ID

Options

Mohammed Hisham P.M( There are >100 Options )

Page 5: DHCP Protocol

DHCP Message Type

• Message type is sent as an option.

Value Message Type

1 DHCPDISCOVER

2 DHCPOFFER

3 DHCPREQUEST

4 DHCPDECLINE

5 DHCPACK

6 DHCPNAK

7 DHCPRELEASE

8 DHCPINFORM

Page 6: DHCP Protocol

Client IP: ??Gateway: ??DNS: ??

Client IP: 192.168.1.10/24Gateway: 192.168.1.1DNS: 192.168.1.6

Normal DHCP Operation

Mohammed Hisham P.M

DHCPDISCOVERBroadcast for a DHCP Server

Pool: 192.168.1.0/24Gateway: 192.168.1.1DNS Server: 192.168.1.6

DHCPOFFERMAC unicast with configuration information

DHCPREQUESTBroadcast requesting configuration information sent in DHCPOFFER

DHCPACKAcknowledge configuration information and begins lease

Page 7: DHCP Protocol

DHCP – a client-server protocol• DHCP operates in a Client/Server environment and uses the

following messages

Mohammed Hisham P.M

DHCPDISCOVER : Client request for serverDHCP Client

00:a0:24:71:e4:44 DHCP Server

DHCPDISCOVERSent to 255.255.255.255

DHCP Server

DHCPOFFER: DHCP server replies to client with configuration information

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPOFFER

DHCPOFFER

Page 8: DHCP Protocol

DHCPREQUEST: Client requests the use of configuration information from one of the DHCP servers that sent an offer

Mohammed Hisham P.M

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPREQUEST

DHCPACK

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPRELEASE

DHCPRELEASE:Client requests a release of its DHCP configuration

DHCPACK: from DHCP server acknowledges that Client can now begin to use configuration information

Page 9: DHCP Protocol

}It relieves the network administrator of a great deal of manual configuration work.

}The ability for a device to be moved from network to network and to aautomatically obtain valid configuration parameters for the current network

can be of great benefit to mobile users.}Because IP addresses are only allocated when clients are actually active, it is

possible, by the use of reasonably short lease times and the fact that mobile clients do not need to be allocated more than one address, to reduce the total number of addresses in use in an organization.

Mohammed Hisham P.M

DHCP Pros

DHCP Cons

}Uses UDP, an unreliable and insecure protocol.

}DNS cannot be used for DHCP configured hosts.