DHCPv4 (dhcpv4)
- Layer: Application and control
- Header: variable length
- Notes: Application protocols
Reached from
Fields
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
op | enum(8) | 1 (boot_request) | BOOTP message op code (1 = BOOTREQUEST, 2 = BOOTREPLY). | |
htype | uint(8) | 1 | Hardware address type (1 = Ethernet). | |
hlen | uint(8) | 6 | Hardware address length, in octets (6 for Ethernet). | |
hops | uint(8) | 0 | Relay hop count, incremented by each relay agent. | |
xid | uint(32) | 305419896 | Transaction ID chosen by the client. | |
secs | uint(16) | 0 | Seconds elapsed since the client began acquisition. | |
flags | flags(16) | 0x0 | BOOTP flags (bit 15 = broadcast reply requested). | |
ciaddr | ipv4 | 0.0.0.0 | Client IP address (when already bound). | |
yiaddr | ipv4 | 0.0.0.0 | “Your” (client) IP address assigned by the server. | |
siaddr | ipv4 | 0.0.0.0 | Next server IP address (boot server). | |
giaddr | ipv4 | 0.0.0.0 | Relay agent (gateway) IP address; non-zero when relayed. | |
chaddr | mac | 02:00:00:00:00:01 | Client hardware (MAC) address; followed by 10 octets of padding. | |
chaddr_padding | bytes(10) | 00 00 00 00 00 00 00 00 00 00 | ||
sname | bytes(64) | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | Optional server host name (64 octets, NUL padded). | |
file | bytes(128) | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | Boot file name (128 octets, NUL padded). | |
magic_cookie | uint(32) | 1669485411 | DHCP magic cookie (0x63825363). | |
options | tlv — rest of the PDU | 2 items | DHCP options (8-bit code / length; Pad, End, Message Type, Relay Agent Information, …). |
op
| Value | Name |
|---|---|
| 1 (0x01) | boot_request |
| 2 (0x02) | boot_reply |
flags
| Bit | Mask | Name |
|---|---|---|
| 15 | 32768 (0x8000) | broadcast |
options
- Type 8 bits, length 8 bits.
- The length counts the value only.
- Unknown types are kept as raw value octets.
| Type | Name | Value fields | Description |
|---|---|---|---|
| 0 (0x00) | pad | (type only, no length or value) | |
| 1 (0x01) | subnet_mask | mask | |
| 3 (0x03) | router | addresses | |
| 6 (0x06) | dns_servers | addresses | |
| 12 (0x0c) | host_name | ||
| 15 (0x0f) | domain_name | ||
| 50 (0x32) | requested_ip | address | |
| 51 (0x33) | lease_time | seconds | |
| 53 (0x35) | message_type | type | |
| 54 (0x36) | server_id | address | |
| 55 (0x37) | parameter_request_list | codes | |
| 58 (0x3a) | renewal_time | seconds | |
| 59 (0x3b) | rebinding_time | seconds | |
| 61 (0x3d) | client_id | ||
| 82 (0x52) | relay_agent_info | suboptions | |
| 255 (0xff) | end | (type only, no length or value) |
options › subnet_mask
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
mask | ipv4 |
options › router
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
addresses | list<ipv4> — rest of the PDU |
options › dns_servers
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
addresses | list<ipv4> — rest of the PDU |
options › requested_ip
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
address | ipv4 |
options › lease_time
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
seconds | uint(32) |
options › message_type
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
type | enum(8) |
options › message_type › type
| Value | Name |
|---|---|
| 1 (0x01) | discover |
| 2 (0x02) | offer |
| 3 (0x03) | request |
| 4 (0x04) | decline |
| 5 (0x05) | ack |
| 6 (0x06) | nak |
| 7 (0x07) | release |
| 8 (0x08) | inform |
options › server_id
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
address | ipv4 |
options › parameter_request_list
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
codes | list<uint(8)> — rest of the PDU |
options › renewal_time
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
seconds | uint(32) |
options › rebinding_time
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
seconds | uint(32) |
options › relay_agent_info
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
suboptions | tlv — rest of the PDU |
options › relay_agent_info › suboptions
- Type 8 bits, length 8 bits.
- The length counts the value only.
- Unknown types are kept as raw value octets.
| Type | Name | Value fields | Description |
|---|---|---|---|
| 1 (0x01) | circuit_id | ||
| 2 (0x02) | remote_id | ||
| 5 (0x05) | link_selection | address | |
| 11 (0x0b) | server_id_override | address |
options › relay_agent_info › suboptions › link_selection
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
address | ipv4 |
options › relay_agent_info › suboptions › server_id_override
| Field | Type | Default | Auto | Description |
|---|---|---|---|---|
address | ipv4 |
Constraints
| Level | Rule |
|---|---|
| warning | magic_cookie = 1669485411 |
Sample templates
- dhcpv4-discover —
templates/protocols/app/dhcpv4-discover.wpg.yaml - dhcpv4-relay —
templates/protocols/app/dhcpv4-relay.wpg.yaml - scenario-dhcp-discover-flood —
templates/scenarios/dhcp-discover-flood.wpg.yaml