Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

DHCP

Marco Trujillo Silva


marcotrujillo@hotmail.com
marcotrujillo@hotmail.com

Utilidad de DHCP

•DHCP es un protocolo
TCP/IP que proporciona un
método para asignar
dinámicamente direcciones
IP a los equipos de una red
marcotrujillo@hotmail.com
marcotrujillo@hotmail.com
Manual Vs. Automatic TCP/IP Configuration

Manual TCP/IP Configuration Automatic TCP/IP Configuration

Disadvantages Advantages

• IP addresses entered • IP addresses are suplied


manually on each client automatically to client
computer computers
• Possibility of entering • Ensures that clients always
Incorrect Invalid IP address use correct configuration
• Incorrect configuration can information
lead to communication and • Elimination of common
network problems source of network problems
• Administrative overload on • Cient configuration updated
networks where computers automatically to reflect
are frecuenty moved changes in network structure
Overview of DHCP

Dynamic Host Configuration Protocol (RFC 2131, 2132) was


derived from the Internet standard Bootstrap Protocol
(BOOTP - RFCs 951, 1534,1542 and 1084).

Uses UDP ports 67 and 68.

Allowed dynamic assignment of IP addresses (as well as


remote-booting of diskless work stations).

In addition to supporting dynamic assignment of IP addresses,


DHCP supplies all configuration data required by TCP/IP, plus
additional data required for specific servers.
marcotrujillo@hotmail.com

DCHP Operation
DHCP Client DHCP Client IP addres Information sent by
IP Automatic IP automatic DHCP server to DHCP clients
including:

•An IP Address
IP address 1
•A Subnet Mask
Non-DHCP Client
Static IP •Optional values, such as:
IP address 2 Non-DHCP Clients
– A default gateway
Static IP address
DHCP Server – The IP address of DNS
– The IP address of WINS
Switch LAN
marcotrujillo@hotmail.com

The DHCP Lease Generation Process

Steps to lease IP
addressing information to
clients:
• (1) IP Lease Request
– Begins when client starts up
or renew and is denied
– Client send Broadcast
(255.255.255.255) a
DHCPDISCOVER message
– Client uses 0.0.0.0 as source
IP
– The message also contains
MAC address
marcotrujillo@hotmail.com

The DHCP Lease Generation Process


(2) IP Lease Offer
– The server DHCP respond with
DHCPOFFER message
– The message includes:
» MAC address client
» An offered IP address
» A subnet mask
» A server identifier (IPAddress)
– The client waits 1s for an offer. If
not receives, rebroadcasts at 2,4,
8, and 16s intervals, plus a random
length time bettwen 0 - 1000ms.
– If client not receive an offer, it uses
range:
169.254.0.1 to 169.254.255.254.
– The client continues in an attempt
to find a DHCP server every five
minutes.
marcotrujillo@hotmail.com

The DHCP Lease Generation Process

(3) IP Lease Selection


– The DHCP client responds to the
fisrt offer receives by broadcasting
a DHCPREQUEST message to
accept the offer
– The message includes :
» A server identifier
(IPAddress)of the server
whose offer it accepted
– Other DHCP servers then retract
their offers and retrain their IP
addresses for others IP lease
requests.
marcotrujillo@hotmail.com

The DHCP Lease Generation Process

(4) IP Lease
Acknowledgement
– The DHCP server issuing the
accepted offer broadcast a
DHCPACKNOWLEDGEMENT
message to acknowledge the
succesful lease.
– The message includes :
» A valid lease for the IP
address
» Other information
– When client receives the ack,
TCP/IP initializ by using the
configuration information that the
DHCP server provides .
marcotrujillo@hotmail.com
The DHCP Lease Renuewal Process
DHCPREQUEST Automatic Lease Renewal
Source IP Address = 192.168.0.77
Dist. IP Address = 192.168.0.108 – Cliente automatically attempts
Request IP Address = 192.168.0.77 to renew its lease when 50%
Hardware Address = 000102 . . .
of the lease duration expires
– Sends DHCPREQUEST to the
server from which it obtained
the lease
– The server renew the lease
and any updated configuration
DHCP Client DHCP Server with DHCPACK message
DHCPACK – If cannot renew continues to
Source IP Address = 192.168.0.108 use current configuration and
Dest. IP Address = 192.168.0.77 then send broadcast a
Offered IP Address = 192.168.0.77 DHCPDISCOVER to update
Client Hardware Address = 000102 . . . when 87.5% of the current
Subnet Mask = 255.255.255.0 lease duration expires.
Length of Lease = 8 days
Server identifier = 192.168.0.108 – If server respod with
DHCP Options: Router = 192.168.0.1 DHCPOFFER the client renew
its lease.
marcotrujillo@hotmail.com
The DHCP Lease Renuewal Process
DHCPREQUEST
Source IP Address = 192.168.0.77
Dist. IP Address = 192.168.0.108
Request IP Address = 192.168.0.77
Hardware Address = 000102 . . . Manual Lease Renewal
– To renew the lease manually,
use ipconfig command with
the /renew switch.
c:\>ipconfig /renew
– This sends a DCHPREQUEST
DHCP Client DHCP Server to the DHCP server tu update
DHCPACK configurationoptions and to
Source IP Address = 192.168.0.108 renew the lease time.
Dest. IP Address = 192.168.0.77 – You can use ipconfig
Offered IP Address = 192.168.0.77 command the /release switch
Client Hardware Address = 000102 . . . for release a lease
Subnet Mask = 255.255.255.0
Length of Lease = 8 days c:\>ipconfig /release
Server identifier = 192.168.0.108
DHCP Options: Router = 192.168.0.1
marcotrujillo@hotmail.com
Others messages
If the client detects a problem with the parameters in the
DHCPACK message (the address is already in use on
the network for example), the client sends a
DHCPDECLINE message to the server and restarts the
configuration process.

The client should wait a minimum of ten seconds before


restarting the configuration process to avoid excessive
network traffic in case of looping. On receipt of a
DHCPDECLINE, the server must mark the offered
address as unavailable (and possibly inform the system
administrator that there is a configuration problem).

If the client receives a DHCPNACK message, the client


restarts the configuration process.
marcotrujillo@hotmail.com
DHCP State Transition diagram

DHCPINFORM Message from a client that already has an IP address (manually configured
for example), requesting further configuration parameters from the DHCP server.
marcotrujillo@hotmail.com

Authorizing the DHCP Service


Domain Controller/
DHCP server
 If authorized,
the service starts
properly DHCP Service
 If unauthorized, Checks For
the service logs Authorization
an error and will not
respond to clients

DHCP Server Clients DHCP Server


Unauthorized DHCP servers could also be set up, sending false and
potentially disruptive information to clients.
marcotrujillo@hotmail.com

Qué son las opciones DHCP

Las opciones DHCP son parámetros de configuración que un


servicio DHCP asigna a los clientes junto con la dirección IP
y la puerta de enlace predeterminada

Datos de configuración IP del cliente DHCP


Cliente DHCP
Dirección IP del cliente
Máscara de subred del cliente
Opciones DHCP como:
 Dirección IP del enrutador
 Dirección IP del servidor DNS
 Dirección IP del servidor WINS
 Nombre de dominio DNS
Servidor DHCP
marcotrujillo@hotmail.com

Lease duration

Decrease Increase

• Generates more UNLIMITED • Reduces network


trafic due to lease • Generates network traffic traffic caused by lease
renewals when a computer is started renewals
• The lease can • Clients retain IP addresses • Clients tend to retain
expires if a DHCP if a DHCP server is IP addresses even if a
server is temporarily unavailable for extended DHCP server is
unavailable periods. temporarily
unavailable
• If PC turned off or • If only a few IP addresses
removed from are available or computers • If only a few IP
network? removed from the network? Addresses?
marcotrujillo@hotmail.com

Qué es un Agente de
retransmisión DHCP
Un Agente de retransmisión DHCP es un equipo o enrutador configurado para
escuchar difusiones DHCP/BOOTP procedentes de clientes DHCP y, a continuación,
retransmitir dichos mensajes a los servidores DHCP ubicados en distintas subredes

Agente de retransmisión DHCP Servidor DHCP

Unicast

Difusión Difusión
Subred A Subred B
Enrutadores
No admitido
según el
documento
RFC 1542
Cliente Cliente Cliente Cliente
marcotrujillo@hotmail.com
Cómo funciona un Agente de
retransmisión DHCP
Agente de
Agente de
retransmisión DHCP
retransmisión DHCP Servidor
Servidor DHCPDHCP

Cliente2
Cliente2 Enrutador
Enrutador Cliente3
Cliente1 No No
admitido según Cliente3
Cliente1 admitido
el documento RFC según
1542
el documento RFC 1542

1 El cliente1 difunde un paquete DHCPDISCOVER

2 El Agente de retransmisión reenvía el mensaje DHCPDISCOVER al servidor DHCP

3 El servidor envía un mensaje DHCPOFFER al Agente de retransmisión DHCP

4 El Agente de retransmisión difunde el paquete DHCPOFFER

5 El cliente1 difunde un paquete DHCPREQUEST

6 El Agente de retransmisión reenvía el mensaje DHCPREQUEST al servidor DHCP

7 El servidor envía un mensaje DHCPACK al Agente de retransmisión DHCP

8 El Agente de retransmisión difunde el paquete DHCPACK


marcotrujillo@hotmail.com

Desafío:
Capturar y analizar el tráfico DHCP

You might also like