Provided by Colasoft Co., Ltd.

DHCP ( Dynamic Host Configuration Protocol )

Home > Protocols > DHCP Update: 2005-11-10 16:03:48    I have words to say about this protocol
On this page
SUMMARY
Protocol : Dynamic Host Configuration Protocol
Protocol suite : TCP/IP
Layer : Application Layer
Type : Application layer configuration protocol
Ports : 67 (UDP) server
68 (UDP) host
Related protocols : BOOTP,
Bootstrap Protocol
Working groups : Dhc, Dynamic Host Configuration.
Ip1394, IP Over IEEE 1394
DESCRIPTION
The Dynamic Host Configuration Protocol (DHCP) provides configuration parameters to Internet hosts.

DHCP consists of two components:
  • A protocol that delivers host-specific configuration parameters from a DHCP server to a host.

  • A mechanism for the allocation of network addresses to hosts.


From the client's point of view, DHCP is an extension of the BOOTP mechanism. This behavior allows existing BOOTP clients to interoperate with DHCP servers without requiring any change to the clients' initialization software. There are some new, optional transactions that optimize the interaction between DHCP clients and servers that are described in sections 3 and 4.

There are two primary differences between DHCP and BOOTP. First, DHCP defines mechanisms through which clients can be assigned a network address for a finite lease, allowing for serial reassignment of network addresses to different clients. Second, DHCP provides the mechanism for a client to acquire all of the IP configuration parameters that it needs in order to operate.

IP requires the setting of many parameters within the protocol implementation software. Because IP can be used on many dissimilar kinds of network hardware, values for those parameters cannot be guessed at or assumed to have correct defaults. The use of a distributed address allocation scheme based on a polling/defense mechanism, for discovery of network addresses already in use, cannot guarantee unique network addresses because hosts may not always be able to defend their network addresses.
DHCP supports three mechanisms for IP address allocation:
  • Automatic allocation

  • DHCP assigns a permanent IP address to the host.

  • Dynamic allocation

  • DHCP assigns an IP address for a limited period of time. Such a network address is called a lease. This is the only mechanism that allows automatic reuse of addresses that are no longer needed by the host to which it was assigned.

  • Manual allocation

  • The host's address is assigned by a network administrator.

    The first service provided by DHCP is to provide persistent storage of network parameters for network clients. The model of DHCP persistent storage is that the DHCP service stores a key-value entry for each client, where the key is some unique identifier (for example, an IP subnet number and a unique identifier within the subnet) and the value contains the configuration parameters for the client.

    The second service provided by DHCP is the allocation of temporary or permanent network (IP) addresses to clients. The basic mechanism for the dynamic allocation of network addresses is simple: a client requests the use of an address for some period of time. The allocation mechanism (the collection of DHCP servers) guarantees not to reallocate that address within the requested time and attempts to return the same network address each time the client requests an address.



Header format

8

16

24

32 bits

Opcode

Hardware type

Hardware address length

Hop count

Transaction ID

Number of seconds

Flags

Client IP address

Your IP address

Server IP address

Gateway IP address

Client hardware address

Server host name

Boot filename

Options


  • Opcode
  • 8 bits.

    Value

    Description

    1

    BOOTREQUEST, Boot request.

    2

    BOOTREPLY, Boot reply



  • Hardware type
  • 8 bits.

    Value

    Description

    1

    Ethernet.

    2

    Experimental Ethernet.

    3

    Amateur Radio AX.25.

    4

    Proteon ProNET Token Ring.

    5

    Chaos.

    6

    IEEE 802.

    7

    ARCNET.

    8

    Hyperchannel.

    9

    Lanstar.

    10

    Autonet Short Address.

    11

    LocalTalk.

    12

    LocalNet (IBM PCNet or SYTEK LocalNET).

    13

    Ultra link.

    14

    SMDS.

    15

    Frame Relay.

    16

    ATM, Asynchronous Transmission Mode.

    17

    HDLC.

    18

    Fibre Channel.

    19

    ATM, Asynchronous Transmission Mode.

    20

    Serial Line.

    21

    ATM, Asynchronous Transmission Mode.

    22

    MIL-STD-188-220.

    23

    Metricom.

    24

    IEEE 1394.1995.

    25

    MAPOS.

    26

    Twinaxial.

    27

    EUI-64.

    28

    HIPARP.

    29

    IP and ARP over ISO 7816-3.

    30

    ARPSec.

    31

    IPsec tunnel.

    32

    Infiniband.

    33

    CAI, TIA-102 Project 25 Common Air Interface.



  • Hardware address length

  • 8 bits.

  • Hop count

  • 8 bits. This field is used by relay agents. Client sets to zero, optionally used by relay agents when booting via a relay agent.

  • Transaction ID

  • 32 bits. A random number chosen by the client, used by the client and server to associate messages and responses between a client and a server.

  • Number of seconds

  • 16 bits. The elapsed time in seconds since the client began an address acquisition or renewal process.

  • Flags
  • 16 bits

    1

    16

    B

    0


    B, Broadcast. 1 bit.

  • Client IP address

  • 32 bits. Only filled in if client is in BOUND, RENEW or REBINDING state and can respond to ARP requests.

  • Your IP address

  • 32 bits. Client IP address

  • Server IP address

  • 32 bits. IP address of next server to use in bootstrap; returned in DHCPOFFER, DHCPACK by server.

  • Gateway IP address

  • 32 bits. Relay agent IP address, used in booting via a relay agent.

  • Client hardware address

  • 16 bytes.

  • Server host name

  • 64 bytes.

  • Boot filename

  • 128 bytes. Null terminated string; "generic" name or null in DHCPDISCOVER, fully qualified directory-path name in DHCPOFFER.

  • BOOTP/DHCP options

  • Variable length. The first four bytes contain the (decimal) values 99, 130, 83 and 99. This is the same magic cookie as has been defined for BOOTP. The remainder of the field consists of a list of tagged parameters that are called options. All of the vendor extensions used by BOOTP are also DHCP options.



Client-Server Protocol
DHCP uses the BOOTP message format. The 'Opcode' field of each DHCP message sent from a client to a server contains BOOTREQUEST. BOOTREPLY is used in the 'op' field of each DHCP message sent from a server to a client.
  • Allocating a network address

  • The following summary of the protocol exchanges between clients and servers refers to the DHCP messages described in the following illustrate.

    Message

    Use

    DHCPDISCOVER

    Client broadcast to locate available servers.

    DHCPOFFER

    Server to client in response to DHCPDISCOVER with offer of configuration parameters.

    DHCPREQUEST

    Client message to servers either (a) requesting offered parameters from one server and implicitly declining offers from all others, (b) confirming correctness of previously allocated address after, e.g., system reboot, or (c) extending the lease on a particular network address.

    DHCPACK

    Server to client with configuration parameters, including committed network address.

    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 canceling remaining lease.

    DHCPINFORM

    Client to server, asking only for local configuration parameters; client already has externally configured network address.


  • Reusing a previously allocated network address

  • If a client remembers and wishes to reuse a previously allocated network address, a client may choose to omit some of the steps described in the previous section.

  • Interpretation and representation of time values

  • A client acquires a lease for a network address for a fixed period of time (which may be infinite). Throughout the protocol, times are to be represented in units of seconds. The time value of 0xffffffff is reserved to represent "infinity".

  • Obtaining parameters with externally configured network address

  • If a client has obtained a network address through some other means (e.g., manual configuration), it may use a DHCPINFORM request message to obtain other local configuration parameters. Servers receiving a DHCPINFORM message construct a DHCPACK message with any local configuration parameters appropriate for the client without: allocating a new address, checking for an existing binding, filling in 'yiaddr' or including lease time parameters. The servers SHOULD unicast the DHCPACK reply to the address given in the 'ciaddr' field of the DHCPINFORM message.



Specification of the DHCP client-server protocol
Assume that a DHCP server has a block of network addresses from which it can satisfy requests for new addresses. Each server also maintains a database of allocated addresses and leases in local permanent storage.
  • Constructing and sending DHCP messages

  • DHCP clients and servers both construct DHCP messages by filling in fields in the fixed format section of the message and appending tagged data items in the variable length option area.

    DHCP uses UDP as its transport protocol. DHCP messages from a client to a server are sent to the 'DHCP server' port (67), and DHCP messages from a server to a client are sent to the 'DHCP client' port (68). A server with multiple network address (e.g., a multi-homed host) MAY use any of its network addresses in outgoing DHCP messages.

  • DHCP server administrative controls

  • DHCP servers are not required to respond to every DHCPDISCOVER and DHCPREQUEST message they receive. For example, a network administrator, to retain stringent control over the clients attached to the network, may choose to configure DHCP servers to respond only to clients that have been previously registered through some external mechanism. The DHCP specification describes only the interactions between clients and servers when the clients and servers choose to interact; it is beyond the scope of the DHCP specification to describe all of the administrative controls that system administrators might want to use. Specific DHCP server implementations may incorporate any controls or policies desired by a network administrator.

  • DHCP server behavior

  • A DHCP server processes incoming DHCP messages from a client based on the current state of the binding for that client. A DHCP server can receive the following messages from a client:
      DHCPDISCOVER

      DHCPREQUEST

      DHCPDECLINE

      DHCPRELEASE

      DHCPINFORM


Top of Page

EXAMPLES

Top of Page


PROTOCOL RELATIONS
Parent layer
Child layer
BOOTP
DHCP
Top of Page

GLOSSARY
Automatic allocation
A host is allocated a permanent IP address.

BOOTP
Bootstrap Protocol (BOOTP) is an Internet protocol that enables a diskless workstation to discover its own IP address, the IP address of a BOOTP server on the network, and a file to be loaded into memory to boot the machine. This enables the workstation to boot without requiring a hard or floppy disk drive.

Binding
A collection of configuration parameters, including at least an IP address, associated with a DHCP client. Bindings are managed by DHCP servers.

Dynamic allocation
A host is allocated an IP address for a limited time period or until the host explicitly relinquishes the address.

Manual allocation
A host is assigned an IP address and DHCP is used to convey the assigned address to the host.

Top of Page

REFERENCES
RFCs:
[RFC 1534] Interoperation Between DHCP and BOOTP.
[RFC 2131] Dynamic Host Configuration Protocol.
                Obsoletes: RFC 1531, RFC 1541.
[RFC 2132] DHCP Options and BOOTP Vendor Extensions.
                Updated by: RFC 3942.
                Obsoletes: RFC 1533.
[RFC 2241] DHCP Options for Novell Directory Services.
                Defines BOOTP/DHCP options 85 (NDS Servers), 86 (NDS Tree Name) and 87 (NDS Context).
[RFC 2242] NetWare/IP Domain Name and Information.
                Defines BOOTP/DHCP options 62 (NetWare/IP Domain Name) and 63 (NetWare/IP Information).
[RFC 2485] DHCP Option for The Open Group's User Authentication Protocol.
                Defines the DHCP User Authentication Protocol Option.
[RFC 2563] DHCP Option to Disable Stateless Auto-Configuration in IPv4 Clients.
[RFC 2610] DHCP Options for Service Location Protocol.
                Defines BOOTP/DHCP options 78 (SLP Directory Agent) and 79 (SLP Service Scope).
[RFC 2855] DHCP for IEEE 1394.
[RFC 2937] The Name Service Search Option for DHCP.
[RFC 2939] Procedures and IANA Guidelines for Definition of New DHCP Options and Message Types.
                Obsoletes: RFC 2489.
[RFC 3004] The User Class Option for DHCP.
[RFC 3011] The IPv4 Subnet Selection Option for DHCP.
[RFC 3046] DHCP Relay Agent Information Option.
                Defines DHCP option 82 (Relay Agent Information Option).
[RFC 3118] Authentication for DHCP Messages.
[RFC 3203] DHCP reconfigure extension.
[RFC 3256] The DOCSIS (Data-Over-Cable Service Interface Specifications) Device Class DHCP (Dynamic Host Configuration Protocol) Relay Agent Information Sub-option.
[RFC 3361] Dynamic Host Configuration Protocol (DHCP-for-IPv4) Option for Session Initiation Protocol (SIP) Servers.
[RFC 3396] Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4).
                Updates: RFC 2131.
[RFC 3397] Dynamic Host Configuration Protocol (DHCP) Domain Search Option.
                Defines DHCP option 119 (Domain Search).
[RFC 3442] The Classless Static Route Option for Dynamic Host Configuration Protocol (DHCP) version 4.
                Defines DHCP option 121 (Classless Static Route).
                Updates: RFC 2132.
[RFC 3456] Dynamic Host Configuration Protocol (DHCPv4) Configuration of IPsec Tunnel Mode.
[RFC 3495] Dynamic Host Configuration Protocol (DHCP) Option for CableLabs Client Configuration.
                Defines DHCP option 122 (CableLabs Client Configuration).
[RFC 3527] Link Selection sub-option for the Relay Agent Information Option for DHCPv4.
[RFC 3594] PacketCable Security Ticket Control Sub-Option for the DHCP CableLabs Client Configuration (CCC) Option.
                Defines DHCP option 122 (CableLabs Client Configuration) suboption 9 (Security Ticket Control).
[RFC 3634] Key Distribution Center (KDC) Server Address Sub-option for the Dynamic Host Configuration Protocol (DHCP) CableLabs Client Configuration (CCC) Option.
                Defines DHCP option 122 (CableLabs Client Configuration) suboption 10 (KDC Server Address).
[RFC 3679] Unused Dynamic Host Configuration Protocol (DHCP) Option Codes.
[RFC 3825] Dynamic Host Configuration Protocol Option for Coordinate-based Location Configuration Information.
                Defines DHCP option 123 (GeoConf).
[RFC 3925] Vendor-Identifying Vendor Options for Dynamic Host Configuration Protocol version 4 (DHCPv4).
                Defines DHCP options 124 (V-I Vendor Class) and 125 (V-I Vendor-Specific Information).
[RFC 3942] Reclassifying Dynamic Host Configuration Protocol version 4 (DHCPv4) Options.
                Updates: RFC 2132.
                Redefines the DHCP option assignment space.
[RFC 3993] Subscriber-ID Suboption for the Dynamic Host Configuration Protocol (DHCP) Relay Agent Option.
                Defines DHCP Agent Suboption Code 6 (Subscriber-ID).
[RFC 4014] Remote Authentication Dial-In User Service (RADIUS) Attributes Suboption for the Dynamic Host Configuration Protocol (DHCP) Relay Agent Information Option.
                Defines DHCP Agent Suboption Code 7 (RADIUS Attributes).
[RFC 4030] The Authentication Suboption for the Dynamic Host Configuration Protocol (DHCP) Relay Agent Option.
[RFC 4039] Rapid Commit Option for the Dynamic Host Configuration Protocol version 4 (DHCPv4).
                Defines DHCP option 80 (Rapid Commit).
Obsolete RFCs:
[RFC 1497] BOOTP Vendor Information Extensions.
                Obsoleted by: RFC 1533.
                Obsoletes: RFC 1048, RFC 1084, RFC 1395.
                Updates: RFC 951.
[RFC 1531] Dynamic Host Configuration Protocol.
                Obsoleted by: RFC 1541.
[RFC 1533] DHCP Options and BOOTP Vendor Extensions.
                Obsoleted by: RFC 2132.
                Obsoletes: RFC 1048, RFC 1084, RFC 1395, RFC 1497.
[RFC 1541] Dynamic Host Configuration Protocol.
                Obsoleted by: RFC 2131.
                Obsoletes: RFC 1531.
[RFC 2489] Procedure for Defining New DHCP Options.
                Obsoleted by: RFC 2939.
Publications:
[ISBN 0130997218] DHCP: A Guide to Dynamic TCP/IP Network Configuration.
[ISBN 1565928385] DHCP for Windows 2000.
[ISBN 1578701376] The DHCP Handbook: Understanding, Deploying, and Managing Automated Configuration Services.
[ISBN 0672323273] The DHCP Handbook (2nd Edition).
                


Top of Page

OTHER PROTOCOLS OF TCP/IP SUITE
AARP   RRP   RTP Video   RTP Audio   RTP   COPS   Gopher   HSRP   ICP   MPLS   IEEE 802.2   CIP   FTP - Data   FTP - Ctrl   IMAPS   IP Fragment   LDAPS   PUP   MSSQL   RSH   SQL   POP3s   RTELNET   RSVP   STP   VLAN   MSN   H.323   MSRDP   HTTPS   WINS   LPD   GTP   ICMPv6   POP   TELNET   H.225   VRRP   PIM   RARP   SAP   OSPF   RLOGIN   SCTP   SIP   RTCP   PPPoE   Mobile IP   IMAP3   WhoIs   SLP   NCP   PPTP   MGCP   LDAP   L2TP   Kerberos   IPv6   GRE   Ethernet SNAP   AFP   CIFS   IEEE 802.3   Finger   NBDGM   NetBEUI   NBSSN   ESP   EIGRP   EGP   DHCP   CGMP   CDP   BOOTP   AH   NBNS   EthernetII   ICQ   PPP   ARP   RIP   IPX   IGRP   IGMP   SSH   RPC   NetBIOS   TFTP   SNMP   SNA   SMB   RADIUS   NTP   NNTP   UDP   TCP   BGP   DNS   SOCKS   IMAP   RTSP   NFS   ICMP   IP   FTP   Telnet   POP3   SMTP   HTTP  
Search RFCs:

Advanced Search
Search Glossary:
Exact search
Fuzzy search


All Protocols
Submit a Request

Recommend an Article

 Layer 7 Application Layer
  AFP
  BOOTP
  CIFS
  CIP
  COPS
  DHCP
  DNS
  Finger
  FTP
  FTP - Ctrl
  FTP - Data
  Gopher
  HSRP
  HTTP
  HTTPS
  ICP
  ICQ
  IMAP
  IMAP3
  IMAPS
  Kerberos
  LPD
  MGCP
  MSN
  MSRDP
  MSSQL
  NCP
  NFS
  NNTP
  NTP
  POP
  POP3
  POP3s
  RADIUS
  RLOGIN
  RRP
  RSH
  RTCP
  RTELNET
  RTP
  RTP Audio
  RTP Video
  RTSP
  SAP
  SIP
  SLP
  SMB
  SMTP
  SNA
  SNMP
  SOCKS
  SSH
  Telnet
  TELNET
  TFTP
  WhoIs
  WINS
 Layer 6 Presentation Layer
  NBNS
  NBSSN
  NCP
  NetBIOS
 Layer 5 Session Layer
  LDAP
  LDAPS
  NCP
  NetBEUI
  RPC
 Layer 4 Transport Layer
  H.225
  H.323
  NBDGM
  NetBEUI
  PUP
  SCTP
  TCP
  UDP
 Layer 3 Network Layer
  AARP
  AH
  BGP
  EGP
  EIGRP
  ESP
  GRE
  GTP
  ICMP
  ICMPv6
  IGMP
  IGRP
  IP
  IP Fragment
  IPv6
  IPX
  Mobile IP
  MPLS
  OSPF
  PIM
  PPPoE
  RIP
  RSVP
  STP
  VRRP
 Layer 2 Data Link Layer
  ARP
  CDP
  CGMP
  Ethernet SNAP
  EthernetII
  IEEE 802.2
  IEEE 802.3
  L2TP
  PPP
  PPTP
  RARP
  SQL
  VLAN
 Layer 1 Physical Layer
© 2006 - 2007 Colasoft Co., Ltd. All rights reserved.