A DHCPDISCOVER message is sent with the broadcast IP address as the destination address

2) DHCP(Dynamic Host Configuration Protocol)

DHCP (Dynamic Host Configuration Protocol)

IP addresses are configured statically or dynamically.

Dynamically assigning IP addresses to computers, laptops, tablets, smartphones etc required DHCP server and DHCP Protocol

Explained:

A DHCPDISCOVER message is sent with the broadcast IP address as the destination address

DHCP server (192.168.252.1) will provide an IP address to computer A1

Step by Step process explained

1) DHCP Discover

The computer will send a DHCP discover message. This is a broadcast because it doesn’t have an IP address and it doesn’t know if there is a DHCP server on the network. the client sends out a DHCPDISCOVER message requesting an IP address. The DHCPDISCOVER message contains an identifier unique to the client (typically the MAC address). The message might also contain other requests, such as requested options (for example, subnet mask, domain name server, domain name, or static route). The message is sent out as a broadcast. If the network contains routers, those routers can be configured to forward DHCPDISCOVER packets to the DHCP servers on attached networks. This message is broadcasted to all devices present in a network to find the DHCP server. This message is 342 or 576 bytes long.

Source MAC address (client A1) is AAABBBAAABBB, destination MAC address(DHCP 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)

A DHCPDISCOVER message is sent with the broadcast IP address as the destination address

2) DHCP Offer

The DHCP server will respond with a DHCP offer message which contains an IP address for the computer (we have to configure the DHCP server to define what IP addresses we want to give). We can also assign a default gateway and DNS server(s) to the computer. Any DHCP server that receives the DHCPDISCOVER message might send a DHCPOFFER message in response. The DHCP server might not send a DHCPOFFER message back to the client for multiple reasons: the most common reasons are that all available addresses are currently leased, the subnet is not configured or the client is not supported. If the DHCP server sends a DHCPOFFER message in response, the DHCPOFFER will contain an available IP address and any other configuration information that is defined in the DHCP setup. 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. 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.

A DHCPDISCOVER message is sent with the broadcast IP address as the destination address

3) DHCP Request

A1 computer will send a DHCP Request in response to the DHCP offer message, requesting if it’s OK to use the information that it has received. The client receives DHCPOFFER messages from the DHCP servers that responded to the DHCPDISCOVER messages. The client compares the offers with the settings that it requested, and then selects the server that it wants to use. It sends a DHCPREQUEST message to accept the offer, indicating which server it selected. This message is broadcast to the entire network to let all DHCP servers know which server was selected. The client will produce a gratitutous 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 .The request message is broadcast by the client PC A1 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 AAABBBAAABBB (PC A1 MAC address) and destination MAC address is FFFFFFFFFFFF.

A DHCPDISCOVER message is sent with the broadcast IP address as the destination address

4) DHCP ACK

The DHCP server will respond with a DHCP ACK message to tell the computer it’s OK to use this information. If a server receives a DHCPREQUEST message, the server marks the address as leased. Servers that are not selected will return offered addresses to their available pool. The selected server sends the client an acknowledgment (DHCPACK), which contains additional configuration information. The client might now use the IP address and configuration parameters. It will use these settings until its lease expires or until the client sends a DHCPRELEASE message to the server to end the lease. 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.

A DHCPDISCOVER message is sent with the broadcast IP address as the destination address
Ex. A1 will get the IP address 192.168.252.10 Subnet Mask 255.255.255.0 Gateway 192.168.252.254 that is configured in the DHCP Scope.

DHCP messages that a client sends to a server are sent to well-known port 67 (UDP—Bootstrap Protocol and DHCP). DHCP Messages that a server sends to a client are sent to port 68

Client attempts to renew the lease: DHCPREQUEST, DHCPACK

The client starts to renew a lease when half of the lease time has passed. The client requests the renewal by sending a DHCPREQUEST message to the server. If the server accepts the request, it will send a DHCPACK message back to the client. If the server does not respond to the request, the client might continue to use the IP address and configuration information until the lease expires. As long as the lease is still active, the client and server do not need to go through the DHCPDISCOVER and DHCPREQUEST process. When the lease has expired, the client must start over with the DHCPDISCOVER process.

Client ends the lease: DHCPRELEASE

The client ends the lease by sending a DHCPRELEASE message to the DHCP server. The server will then return the client’s IP address to the available address pool.

Commands to Configure DHCP Pool on the Cisco Network devices

1) Configure DHCP Pool

ip dhcp pool Cisco (Any name you can give)

network 192.168.1.0 255.255.255.0 (IP subnet)

default‐router 192.168.1.1 (Define default gateway)

dns‐server 8.8.8.8 (Define DNS IP address)

2) Exclude Range (Optional)

ip dhcp excluded‐address 192.168.1.1 192.168.1.10 (Ex. Excluded Starting 10 IP addresses)

Command to see the DHCP Bindings

Router#show ip dhcp binding

IP helper-Address

By using the ip helper-address command, a router can be configured to accept a broadcast request for a UDP service and then forward it as a unicast to a specific IP address

Router(config)# interface GigabitEthernet0/0/0
Router(config-if)#ip helper-address 192.168.252.1 (DHCP Server)

How is Dhcpdiscover transmitted?

The client transmits a DHCPDISCOVER message on its local network when it boots or senses an active network connection. Because the client has no way of knowing the subnet to which it belongs, the DHCPDISCOVER message is an IPv4 broadcast (destination IPv4 address of 255.255. 255.255).

When client sends a Dhcpdiscover message how is the message sent?

The DHCPDISCOVER message contains an identifier unique to the client (typically the MAC address). The message might also contain other requests, such as requested options (for example, subnet mask, domain name server, domain name, or static route). The message is sent out as a broadcast.

What is the destination IP address when an IPv4 host sends a Dhcpdiscover message?

What is the destination IP address when an IPv4 host sends a DHCPDISCOVER message? Because a DHCP client does not have a valid IPv4 address, it must use a broadcast IP address of 255.255. 255.255 as the destination address to communicate with the DHCP server.

Which DHCP message is sent as a broadcast?

The client discovers a DHCP server by broadcasting a discover message to the limited broadcast address (255.255. 255.255) on the local subnet. If a router is present and configured to behave as a BOOTP relay agent, the request is passed to other DHCP servers on different subnets.