Vous êtes sur la page 1sur 25

BAI513 - PROTOCOLS

DHCP
BAIST Network Management

Objectives
At

the end of this presentation, the


student will be able to:
Describe the history of DHCP
Describe the DHCP address discovery
process
Describe the fields contained in the DHCP
header and their functions.

History of DHCP

DHCP is based on BOOTP and maintains


some backward compatibility.
The main difference is that BOOTP was
designed for manual pre-configuration of
the host information in a server database,
while DHCP allows for dynamic allocation
of network addresses and configurations
to newly attached hosts.
Additionally, DHCP allows for recovery
and reallocation of network addresses
through a leasing mechanism.

DHCP Defined

The Dynamic Host Configuration Protocol


(DHCP) is an Internet protocol for
automating the configuration of
computers that use TCP/IP.
DHCP can be used to automatically assign
IP addresses, to deliver TCP/IP stack
configuration parameters such as the
subnet mask and default router, and to
provide other configuration information
such as the addresses for printer, time
and news servers.

DHCP Components
DHCP consists of two components:
1. A protocol for delivering host-specific
configuration parameters from a
DHCP server to a host
2. A mechanism for allocation of network
addresses to hosts.

Allocating IP Addresses
DHCP

supports 3 mechanisms for


allocating IP addresses.
Automatic - assigns a permanent IP
address to a client
Dynamic - assigns an IP address to a
client for a limited period of time
Manual - a client's IP address is
assigned by the network
administrator, and DHCP is used simply
to convey the assigned address to the client

DHCP Address Discovery

The DHCP Address Discovery process


actually uses seven packets:
DHCPDISCOVER packet
DHCPOFFER packet
DHCPREQUEST packet
DHCPACK packet
Client (Win2k) then sends 3 ARP packets to
validate the IP address assigned by the
DHCP Server

The Discover Packet


Client to Server

When a DHCP client has no IP address


(booting for the first time, or after a lease
expires), it must broadcast a DHCP Discover
Packet onto the network.
The DHCP Discover Packet Is Always Sent
with a destination Hardware (FF:FF:FF:FF)
and IP Broadcast (255.255.255.255)
addresses.

The DHCPDISCOVER Packet


If the DHCP client was on the network
before, the client also defines a preferred
addresstypically the client prefers the
last address it used
In the DHCP Discover packet, the Message
Type value is onethis indicates that this
packet is a DHCP Discover packet
The Client Identifier field value is based on
the clients hardware address
NOTE: Parameters found in DHCP Options

The DHCPOFFER Packet


Server to Client
The DHCP server sends the DHCPOFFER
packet (unicast destination address) to
offer an IP address to the DHCP client
Each responding DHCP server includes an
unique server identifier in the option field
The DHCPOFFER packet includes the IP
address that is offered to the client, and
sometimes answers to the requested
options in the DHCPDISCOVER packet

The DHCPREQUEST Packet


Client to Server
Once

the DHCPOFFER packet is


received, the client can either accept
the offer by issuing a DHCPREQUEST
(broadcast) packet,
If a host receives a multiple offers the
server ID in the DHCPREQUEST
identifies which server, and offer the
client is using.

The DHCPACK Packet


Server to Client
The DHCPACK

packet (unicast) includes


some answers to the clients request
for information, such as:
The client subnet mask is 255.255.0.0
The clients default gateway address is
10.0.0.1
The clients DNS server address is 10.0.0.1

Additional DHCP Packets

Additional DHCP packets that may be used


include:
DHCPNAK
- Server to client indicating client's
notion of network address is incorrect (e.g., client has
moved to new subnet) or client's lease as expired
DHCPDECLINE - Client to server indicating network
address is already in use.
DHCPRELEASE - Client to server relinquishing
network address and cancelling remaining lease.
DHCPINFORM - Client to server, asking only for
local configuration parameters; client already has
externally configured network address.

DHCP Frame
The

DHCP Frame is comprised of:

The DHCP Header and DHCP Data Fields are


encapsulated inside a UDP Header.
The UDP Header is encapsulated inside a standard
IPv4 Header which is encapsulated inside a standard
MAC Header with a CRC Trailer.

DHCP Header Structure

DHCP Header Fields


Opcode

This 1-byte field indicates whether this


packet is a DHCP request (0x01) or DHCP
reply (0x02)

Hardware Type

This 1-byte field identifies the hardware


address type, and matches the values
assigned for ARP hardware type definitions

DHCP Header Fields


Hardware Address Length
This

1-byte field indicates the length of


the hardware address

Hop Count
This

field is set to zero by the client,


and may be used by relay agents as
they assist a client in obtaining an IP
address and/or configuration
information

DHCP Header Fields


Transaction ID

This 4-byte field contains a random number


selected by the client, and is used to match
requests and responses between the client
and server

Number of Seconds

This 2-byte field indicates the number of


seconds that elapsed since the client began
requesting a new address, or renewal of an
existing address

DHCP Header Fields


Flags

The first bits of the 2-byte Flags field can be


toggled to one to indicate that the DHCP
client cannot accept unicast MAC layer
datagrams before the IP software is
completely configured

Client IP Address

The DHCP client fills in this 4-byte field with


its IP address after it is assigned and bound
to the IP stack

DHCP Header Fields


Your IP Address
This

4-byte field contains the address


being offered by the DHCP server

Server IP Address
This

4-byte field contains the IP


address of the DHCP server to use in
the boot process

DHCP Header Fields


Gateway IP Address

This 4-byte field contains the address of


the DHCP relay agent, if one is used

Client Hardware Address

This 16-byte field contains the hardware


address of the client

DHCP Header Fields


Server Host Name
This

64-byte field can contain the


server host name, but such
information is optional
This field can contain a null-terminated
string (all zeroes)

Boot Filename
This

field contains an optional boot


filename or null-terminated string

DHCP Data Field

DHCP Data Field is often refered to as the


Options Field
This field is used to expand the data that is included
in the DHCP packet.
This field always starts with the Magic Cookie
number (0x63.82.53.63) and ends with the End
identifier (0xFF)

DHCP Option 53: Message Type - This


required option indicates the general purpose
of any DHCP message

DHCP Options Field

The DHCP boot sequence uses the


following message types:
DHCP Message Type 1: Discover (client to
server)
DHCP Message Type 2: Offer (server to client)
DHCP Message Type 3: Request (client to
server)
DHCP Message Type 4: ACK (server to client)

Summary
This

presentation covered information


that allowed the student to:
Describe the history of DHCP
Describe the DHCP address discovery
process
Describe the fields contained in the DHCP
header and their functions.

Vous aimerez peut-être aussi