15 DHCP Protocol Principles PDF
15 DHCP Protocol Principles PDF
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 2
Objectives
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 3
DHCP Application In The Enterprise Network
Request IP Address
Host A Switch
Assign IP Address
DHCP Server
Request IP Address
Host B
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 4
Enterprise networks are often comprised of multiple end systems that require
IP address assignment in order to connect with the network segment to which
the end system is attached. For small networks, a minimal number of end
systems attached to the network allows for simple management of the
addressing for all end systems.
For medium and large-scale networks however, it becomes increasingly
difficult to manually configure IP addresses with increased probability of
duplication of addressing, as well as misconfiguration due to human error, and
therefore the necessity to implement a centralized management solution over
the entire network becomes ever more prominent. The Dynamic Host
Configuration Protocol (DHCP) is implemented as a management solution to
allow dynamic allocation of addresses for existing fixed and temporary end
systems accessing the network domain.
In cases it is also possible that there may be more hosts than available IP
addresses on a network. Some hosts cannot be allocated a fixed IP address
and need to dynamically obtain IP addresses using the DHCP server. Only a
few hosts on a network require fixed IP addresses.
Address Allocation Mechanisms
DHCP Server
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 5
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 6
A DHCP server and a DHCP client communicate with each other by exchanging a
range of message types. Initial communication relies on the transmission of a DHCP
Discover message. This is broadcast by a DHCP client to locate a DHCP server when
the client attempts to connect to a network for the first time. A DHCP Offer message is
then sent by a DHCP server to respond to a DHCP Discover message and carries
configuration information.
A DHCP Request message is sent after a DHCP client is initialized, in which it
broadcasts a DHCP Request message to respond to the DHCP Offer message sent by
a DHCP server. A request message is also sent after a DHCP client is restarted, at
which time it broadcasts a DHCP Request message to confirm the configuration, such
as the assigned IP address. A DHCP Request message is also sent after a DHCP
client obtains an IP address, in order to extend the IP address lease.
A DHCP ACK message is sent by a DHCP server to acknowledge the DHCP Request
message from a DHCP client. After receiving a DHCP ACK message, the DHCP client
obtains the configuration parameters, including the IP address. Not all cases however
will result in the IP address being assigned to a client. The DHCP NAK message is
sent by a DHCP server to in order reject the DHCP Request message from a DHCP
client when the IP address assigned to the DHCP client expires, or in the case that the
DHCP client moves to another network.
A DHCP Decline message is sent by a DHCP client, to notify the DHCP server that the
assigned IP address conflicts with another IP address. The DHCP client will then apply
to the DHCP server for another IP address.
A DHCP Release message is sent by a DHCP client to release its IP address. After
receiving a DHCP Release message, the DHCP server assigns this IP address to
another DHCP client.
A final message type is the DHCP Inform message, and is sent by a DHCP client to
obtain other network configuration information such as the gateway address and DNS
server address after the DHCP client has obtained an IP address.
Address Pools
Host B
G0/0/0
Pool2(global)
10.2.2.0/24
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 7
The AR2200 and S5700 series devices can both operate as a DHCP server to
assign IP addresses to online users. Address pools are used in order to define
the addresses that should be allocated to end systems. There are two general
forms of address pools which can be used to allocate addresses, the global
address pool and the interface address pool.
The use of an interface address pool enables only end systems connected to
the same network segment as the interface to be allocated IP addresses from
this pool. The global address pool once configured allows all end systems
associated with the server to obtain IP addresses from this address pool, and
is implemented using the dhcp select global command to identify the global
address pool. In the case of the interface address pool, the dhcp select
interface command identifies the interface and network segment to which the
interface address pool is associated.
The interface address pool takes precedence over the global address pool. If
an address pool is configured on an interface, the clients connected to the
interface obtain IP addresses from the interface address pool even if a global
address pool is configured. On the S5700 switch, only logical VLANIF
interfaces can be configured with interface address pools.
DHCP Address Acquisition
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 8
DHCP ACK ②
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 9
After obtaining an IP address, the DHCP client enters the binding state. Three
timers are set on the DHCP client to control lease update, lease rebinding,
and lease expiration. When assigning an IP address to a DHCP client, a
DHCP server specifies values for the timers.
If the DHCP server does not set the values for the timers, the DHCP client
uses the default values. The default values define that when 50% of the lease
period remains, the release renewal process should begin, for which a DHCP
client is expected to renew its IP address lease. The DHCP client
automatically sends a DHCP Request message to the DHCP server that has
allocated an IP address to the DHCP client.
If the IP address is valid, the DHCP server replies with a DHCP ACK message
to entitle the DHCP client a new lease, and then the client re-enters the
binding state. If the DHCP client receives a DHCP NAK message from the
DHCP server, it enters the initializing state.
DHCP Rebinding Expiry
DHCP ACK/NAK ③
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 10
After the DHCP client sends a DHCP Request message to extend the lease,
the DHCP client remains in an updating state and waits for a response. If the
DHCP client does not receive a DHCP Reply message from the DHCP server
after the DHCP server rebinding timer expires which by default occurs when
12.5% of the lease period remains, the DHCP client assumes that the original
DHCP server is unavailable and starts to broadcast a DHCP Request
message, for which any DHCP server on the network can reply with a DHCP
ACK or NAK message.
If the received message is a DHCP ACK message, the DHCP client returns to
the binding state and resets the lease renewal timer and server binding timer.
If all of the received messages are DHCP NAK messages, the DHCP client
goes back to the initializing state. At this time, the DHCP client must stop
using this IP address immediately and request a new IP address.
IP Address Release
DHCP Release
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 11
The lease timer is the final timer in the expiration process, and if the DHCP
client does not receive a response before the lease expiration timer expires,
the DHCP client must stop using the current IP address immediately and
return to the initializing state. The DHCP client then sends a DHCP
DISCOVER message to apply for a new IP address, thus restarting the DHCP
cycle.
DHCP Interface Pool Configuration
G0/0/0
10.1.1.1/24
[Huawei]dhcp enable
[Huawei]interface GigabitEthernet0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select interface
[Huawei-GigabitEthernet0/0/0]dhcp server dns-list 10.1.1.2
[Huawei-GigabitEthernet0/0/0]dhcp server excluded-ip-address
10.1.1.2
[Huawei-GigabitEthernet0/0/0]dhcp server lease day 3
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 12
There are two forms of pool configuration that are supported in DHCP, these
include defining a global pool or an interface based pool. The dhcp select
interface command is used to associate an interface with the interface address
pool in order to provide configuration information to connected hosts. The
example demonstrates how interface Gigabit Ethernet 0/0/0 has been
assigned as part of an interface address pool.
DHCP Configuration Validation
[Huawei]display ip pool interface GigabitEthernet0/0/0
Pool-name : GigabitEthernet0/0/0
Pool-No : 0
Lease : 3 Days 0 Hours 0 Minutes
Domain-name : huawei.com
DNS-Server0 : 10.1.1.2
NBNS-Server0 : -
Netbios-type : -
Position : Interface Status : Unlocked
Gateway-0 : 10.1.1.1
Mask : 255.255.255.0
VPN instance : --
----------------------------------------------------------------
Start End Total Used Idle(Expired) Conflict Disable
----------------------------------------------------------------
10.1.1.1 10.1.1.254 253 1 251(0) 0 1
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 13
Each DHCP server will define one or multiple pools which may be associated
globally or with a given interface. For determining the pool attributes
associated with an interface, the display ip pool interface <interface>
command is used. The DHCP pool will contain information including the lease
period for each IP address that is leased, as well as the pool range that is
supported. In the event that other attributes are supported for DHCP related
propagation to clients such as with the IP gateway, subnet mask, and DNS
server, these will also be displayed.
DHCP Global Pool Configuration
G0/0/1
10.2.2.1/24
[Huawei]dhcp enable
[Huawei]ip pool pool2
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-pool2]network 10.2.2.0 mask 24
[Huawei-ip-pool-pool2]gateway-list 10.2.2.1
[Huawei-ip-pool-pool2]lease day 1
[Huawei-ip-pool-pool2]quit
[Huawei]interface GigabitEthernet0/0/1
[Huawei-GigabitEthernet0/0/1]dhcp select global
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 14
The example demonstrates the DHCP configuration for a global address pool
that is assigned to the network 10.2.2.0. The dhcp enable command is the
prerequisite for configuring DHCP-related functions, and takes effect only after
the dhcp enable command is run. A DHCP server requires the ip pool
command be configured in the system view to create an IP address pool and
set IP address pool parameters, including a gateway address, the IP address
lease period etc. The configured DHCP server can then assign IP addresses
in the IP address pool to clients.
A DHCP server and its client may reside on different network segments. To
enable the client to communicate with the DHCP server, the gateway-list
command is used to specify an egress gateway address for the global address
pool of the DHCP server. The DHCP server can then assign both an IP
address and the specified egress gateway address to the client. The address
is configured in dotted decimal notation for which a maximum of eight gateway
addresses, separated by spaces, can be configured.
DHCP Configuration Validation
[Huawei]display ip pool
-------------------------------------------------------------
Pool-name : pool2
Pool-No : 0
Position : Local Status : Unlocked
Gateway-0 : 10.2.2.1
Mask : 255.255.255.0
VPN instance : --
IP address Statistic
Total :253
Used :1 Idle :252
Expired :0 Conflict :0 Disable :0
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 15
The information regarding a pool can be also observed through the used of the
display ip pool command. This command will provide an overview of the
general configuration parameters supported by a configured pool, including
the gateway and subnet mask for the pool, as well general statistics that allow
an administrator to monitor the current pool usage, to determine the number of
addresses allocated, along with other usage statistics.
Summary
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 16
1. IP addresses that are used for server allocation such as any local DNS
servers in order to avoid address conflicts.
2. The default lease period for DHCP assigned IP addresses is set at a
period equal to one day.
Thank you
www.huawei.com