0% found this document useful (0 votes)
22 views

C-Data Training Courses - DHCP Principle

Uploaded by

nourlinkinpark
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

C-Data Training Courses - DHCP Principle

Uploaded by

nourlinkinpark
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

C-Data

DHCP Principle
Shenzhen C-Data Technology Co., Ltd.
Part 1
DHCP
Introduction
What is DHCP Protocol

• DHCP ( Dynamic Host Configuration


Protocol ) is a network protocol that allows
computers to automatically obtain IP addresses
and other related network configuration
information, such as subnet masks, default
gateways, DNS services, etc., when connecting
to a new network environment. 。
DHCP Application Scenarios

• DHCP adopts the client/server communication mode.


The client submits a configuration request to the server,
and the server returns the IP address assigned to the
client and other corresponding configuration information
to achieve dynamic configuration of IP address and other
information.

• In a typical application of DHCP, it generally includes a


DHCP server and multiple clients (such as PCs and
laptops).
DHCP Technical Advantages

01 02 03 04

Automated configuration Save IP address resources: Improve network security: The DHCP protocol has a
of network parameters: In Through the DHCP The DHCP protocol can wide range of application
large networks, manually protocol, the server can prevent unauthorized scenarios, including but
configuring the network dynamically allocate IP computers from accessing not limited to home
parameters of each addresses, avoiding the the network, thereby networks, enterprise
computer is a tedious and waste caused by static improving network networks, school
error-prone task. Using allocation of IP addresses. security. networks, etc. In these
the DHCP protocol, scenarios, using the DHCP
network parameters can protocol can greatly
be automatically assigned simplify the workload of
to the required network configuration
computers, greatly and management, and
improving work efficiency. improve network
availability and security. 。
Part 2
DHCP
Protocol
Introduction
IP address Allocation Method

Static Allocation
In static IP address allocation, each device is

assigned a fixed IP address. This approach works well

for small networks, but is not easy to manage.

Dynamic Allocation
In dynamic IP address allocation, a DHCP server

assigns IP addresses to devices and reclaims those

addresses when the devices no longer need them.

This method is easy to manage and suitable for large

networks.
DHCP Server Deployment and Function

DHCP server deployment


DHCP server usually runs on a router or a dedicated DHCP server to manage
the allocation of IP addresses.

DHCP server function


The main function of the DHCP server is to manage the allocation, recycling and
reassignment of IP addresses to ensure that each device can obtain a unique IP
address.
How the client obtains the IP address
Client issues DHCP request
When a client device connects to the network, it issues a DHCP discovery request to seek
available DHCP servers.

DHCP server response


When the DHCP server receives the request, it will provide an IP address and related
configuration information (such as subnet mask, default gateway, DNS service, etc.) to the
client.

Client accepts IP address


The client will accept the IP address provided by the DHCP server and use this address to
start communicating within the LAN.
DHCP Protocol Process

(1)DHCP DISCOVER (2)DHCP OFFER

The client sends the DISCOVER message to After receiving the DHCP DISCOVER

find an available DHCP server. message, the server will send the message to
provide the client with network configuration
information such as the IP address.

(3)DHCP REQUEST (4)DHCP ACK


After receiving the DHCP OFFER message, the After receiving the DHC PREQUEST message,
client will send the message to confirm the the server will send the message to confirm
accepted IP address and other configuration the validity of the IP address and other
information to the server. configuration information to the client.
DHCP Protocol Lease Process

IP lease IP lease renewal

When the client obtains an IP address from DHCP When the lease expires, the client negotiates with the
server, it does not own this address permanently. DHCP server to renew the lease. If the client still needs
This IP address is leased to the client. After the to use the original IP address, it will send a
lease expires, it needs to be renewed or reapplied. DHCPREQUEST message to the DHCP server to request a
lease renewal. If the DHCP server agrees to renew the
lease, it will send a DHCP OFFER message to the client,
containing the new lease period and configuration
information. The client will accept the new lease and
update its configuration information
Part 3
DHCP
Security &
Reliability
Security of DHCP protocol

01 Security of Client IP Address


When allocating IP addresses, the DHCP protocol takes effective measures to
ensure the security of the client's IP address, such as binding the IP address to the
MAC address and automatically releasing the IP address after the lease expires.

02 Message transmission security


The DHCP protocol transmits messages through the UDP protocol. The UDP
protocol itself is a connectionless protocol and is unreliable. However, the DHCP
protocol ensures the reliability of message transmission through some
mechanisms, such as message checksums and retransmission mechanisms.

03 Prevent malicious attacks


The DHCP protocol was designed with security issues in mind and took some
precautions to prevent malicious attacks, such as limiting the allocation range of
IP addresses, limiting the number of times each client can obtain an IP address,
etc.
How to ensure the reliability of DHCP protocol
IP address lease renewal
When the client restarts or is disconnected from the Internet, its IP address lease will expire
and it will need to apply for an IP address again. In order to ensure reliability, the DHCP server
will regularly update the IP address lease to ensure that the client can obtain a new IP address
in a timely manner.

Message retransmission mechanism


When the DHCP server sends a message to the client, it will set a timeout period. If no
response is received from the client within this time, the server will automatically retransmit
the message until a response is received or the maximum number of retransmissions is
reached.

Backup and recovery mechanism


The DHCP server can be configured with a backup and recovery mechanism. When the server
fails, data can be backed up in time and services can be restored to ensure service reliability.
Part 4
DHCP
Message
Format
DHCP Message Format
DHCP Message Format Analysis
The specific description of each field of the DHCP message is as follows:

※op : The operation type of the message is divided into request message and response message. 1 is the request message; 2 is the response
message. The specific message type is marked in the option field.
knowledge.

※htype : Hardware address type.

※hlen : Hardware address length. The system currently only supports Ethernet, and the hardware address length is fixed at 6.

※hops : The number of DHCP relays that DHCP messages pass through. Each time the DHCP request message passes through a DHCP relay, this
field will increase by 1.

※xid : Random numbers generated by client software and used to match request and response messages.

※secs : The time when the client enters the IP address application process or the time when the IP address is updated; it is set by the client
software according to the situation. Currently not used and fixed to 0.

※flags : flag field. The first bit is the broadcast response flag, which is used to identify whether the DHCP server response message is sent in
unicast or broadcast mode. 0 indicates unicast mode and 1 indicates broadcast mode. The remaining bits are reserved.
DHCP Message Format Analysis
The specific description of each field of the DHCP message is as follows:

※ciaddr : The IP address of the DHCP client.

※yiaddr : The IP address assigned to the client by the DHCP server.

※siaddr : The server IP address from which the DHCP client obtains information such as IP address.

※giaddr : The IP address of the first DHCP relay that the DHCP client passes through after sending a request message.

※chaddr : The hardware address of the DHCP client.

※sname : The name of the server from which the DHCP client obtains information such as IP address.

※file : The startup configuration file name and path information specified by the DHCP server for the DHCP client.

※options : Optional variable-length option field, including configuration information such as message type, valid lease period, DNS server IP
address, WINS server IP address, etc.
Part 5
DHCP Packet
Capture Example
DHCP Packet Capture Example

Through the wireshark packet capture software, DHCP messages can be filtered out
DHCP DISCOVER

Send a Discover packet by broadcast to


find the location of the server
DHCP OFFER

After receiving the Discover message, the DHCP


server will search for a suitable IP address in the
configured address pool, add the corresponding
lease period and other configuration
information (such as gateway, DNS server, etc.),
and construct an Offer message. Sent to the
DHCP client to inform the user that this server
can provide it with an IP address.
DHCP REQUEST

Send a broadcast Request message to


notify the selected server that it hopes to
obtain the assigned IP address
DHCP ACK

Check whether there is a corresponding


lease record based on the user MAC carried
in the Request message. If there is, an ACK
response message is sent to notify the user
that the assigned IP address can be used.
Part 5
DHCP Troubleshooting
&
optimization suggestions
DHCP Common faults and troubleshooting methods

Client cannot obtain IP address The server is not working properly


Check whether the client is correctly configured Check whether the DHCP server is running
with DHCP and ensure that the client is in the normally and whether the correct IP pool and
correct network environment. lease information are configured.

The network connection is unstable


Check whether the network equipment is normal and whether there are
network failures or attacks.
DHCP Optimization suggestions and performance improvement plans

Optimize lease time


Adjust the lease time according to the actual
situation to avoid wasting IP addresses due to too
long a lease time or frequent reassignment due to a
Use static IP address too short lease time.

For devices that require a fixed IP address,


you can use a static IP address to avoid the
DHCP allocation and lease process.
Configure subnet mask
and default gateway
Configure the correct subnet mask and default
gateway for each subnet so that clients can
correctly identify the network and send broadcast
requests.
Connecting the World with Data Technology

Thank you !

(86)755-26014509

www.cdatatec.com

You might also like