Introduction to DHCPv4 Message Format

DHCPv4 clients and servers exchange messages for easing IP address information as discussed in the previous lesson. The format of all DHCPv4 messages is common. The DHCPv4 message format is based on the BOOTP specification.

The DHCP v4 uses UDP port numbers 67 and 68 with BOOTP.  Post 68 is the DHCPv4 source port number while port number 67 is the destination port. DHCP messages contain a special option in the option field that differentiates them from BOOTP messages.  The figure below illustrates the DHCPv4 message format.

  • OP Code –This is an 8-bit field that specifies the type of message. It has two different states: the value of 1 indicates a REQUEST and a value of 2 indicates a REPLY message.
  • Hardware Type– This is also an 8-bit field that identifies the type of hardware used in the network. This field identifies the hardware address type.
  • Hardware Address Length– This is another 8-bit field for the identification of the address length of a DHCP client.
  • Hops – This field counts and controls the relay agent and forwarding of messages. This client set the field to 0 before transmitting a request.
  • Transaction Identifier- The client uses this field to match the request with replies received from DHCPv4 servers.
  • Seconds– This field identifies the elapsed time in seconds since a client began attempting to get the IP address on a lease basis or renew a previous lease. The DHCPv4 servers use this field to prioritize replies when multiple client requests are outstanding.
  • Flags– As shown in the figure this is 16 bits field of the DHCPv4 message. The client that does not know its IPv4 address uses this field when it sends a request and used only one bit (leftmost) out of 16 bits, which is the broadcast flag. if this flag is set to 1, the DHCP server sent a reply back by broadcast. The remaining bits of the flags field are reserved for future use.
  • CIADDR– This is the client IP address field used during lease renewal when the address of the client is valid and usable. The client puts own IPv4 address in this field in case of a valid IPv4 address while in the bound state; otherwise, it sets the field to 0.
  • YIADDR – ‘your’ (client) IPv4 address, assigned by the server to the client.
  • SIADDR – This is an IP address of the next server for the client to use in the configuration and bootstrap process, which may be the same server sending this reply. The sending server always includes its IPv4 address in a special field called the Server Identifier DHCPv4 option.
  • GIADDR– This is a gateway or relay agent IP address. The IP address may be the interface IP of the relay agent through which the DHCP message was received. It facilitates communications of DHCPv4 requests and replies between the client and a server that are on different subnets or networks.
  • CHADDR – This field matches responses from servers with previously transmitted requests and specifies the physical layer of the client system.
  • Server Name– Used by the server sending a DHCPOFFER or DHCPACK message. The server may optionally put its name in this field. This can be a simple text nickname or a DNS domain name, such as
  • SNAME: Server hostname, sending a DHCPOFFER or DHCPACK message. This can be a simple text nickname or a DNS domain name.
  • Boot Filename– The client uses a boot file name optionally to request a particular type of boot file in a DHCPDISCOVER message and a server also used this in a DHCPOFFER to fully specify a boot file directory and filename
  • DHCP Options– This is an optional field that holds several parameters required for basic DHCP operation. The length of this field is not fixed. Both the client and server use this field.