Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

DHCPv4 (dhcpv4)

Reached from

Lower layerSelectorValue
udpdst_port / src_port67 (0x0043)
udpdst_port / src_port68 (0x0044)

Fields

FieldTypeDefaultAutoDescription
openum(8)1 (boot_request)BOOTP message op code (1 = BOOTREQUEST, 2 = BOOTREPLY).
htypeuint(8)1Hardware address type (1 = Ethernet).
hlenuint(8)6Hardware address length, in octets (6 for Ethernet).
hopsuint(8)0Relay hop count, incremented by each relay agent.
xiduint(32)305419896Transaction ID chosen by the client.
secsuint(16)0Seconds elapsed since the client began acquisition.
flagsflags(16)0x0BOOTP flags (bit 15 = broadcast reply requested).
ciaddripv40.0.0.0Client IP address (when already bound).
yiaddripv40.0.0.0“Your” (client) IP address assigned by the server.
siaddripv40.0.0.0Next server IP address (boot server).
giaddripv40.0.0.0Relay agent (gateway) IP address; non-zero when relayed.
chaddrmac02:00:00:00:00:01Client hardware (MAC) address; followed by 10 octets of padding.
chaddr_paddingbytes(10)00 00 00 00 00 00 00 00 00 00
snamebytes(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 00Optional server host name (64 octets, NUL padded).
filebytes(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 00Boot file name (128 octets, NUL padded).
magic_cookieuint(32)1669485411DHCP magic cookie (0x63825363).
optionstlv — rest of the PDU2 itemsDHCP options (8-bit code / length; Pad, End, Message Type, Relay Agent Information, …).

op

ValueName
1 (0x01)boot_request
2 (0x02)boot_reply

flags

BitMaskName
1532768 (0x8000)broadcast

options

  • Type 8 bits, length 8 bits.
  • The length counts the value only.
  • Unknown types are kept as raw value octets.
TypeNameValue fieldsDescription
0 (0x00)pad(type only, no length or value)
1 (0x01)subnet_maskmask
3 (0x03)routeraddresses
6 (0x06)dns_serversaddresses
12 (0x0c)host_name
15 (0x0f)domain_name
50 (0x32)requested_ipaddress
51 (0x33)lease_timeseconds
53 (0x35)message_typetype
54 (0x36)server_idaddress
55 (0x37)parameter_request_listcodes
58 (0x3a)renewal_timeseconds
59 (0x3b)rebinding_timeseconds
61 (0x3d)client_id
82 (0x52)relay_agent_infosuboptions
255 (0xff)end(type only, no length or value)

options › subnet_mask

FieldTypeDefaultAutoDescription
maskipv4

options › router

FieldTypeDefaultAutoDescription
addresseslist<ipv4> — rest of the PDU

options › dns_servers

FieldTypeDefaultAutoDescription
addresseslist<ipv4> — rest of the PDU

options › requested_ip

FieldTypeDefaultAutoDescription
addressipv4

options › lease_time

FieldTypeDefaultAutoDescription
secondsuint(32)

options › message_type

FieldTypeDefaultAutoDescription
typeenum(8)
options › message_type › type
ValueName
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

FieldTypeDefaultAutoDescription
addressipv4

options › parameter_request_list

FieldTypeDefaultAutoDescription
codeslist<uint(8)> — rest of the PDU

options › renewal_time

FieldTypeDefaultAutoDescription
secondsuint(32)

options › rebinding_time

FieldTypeDefaultAutoDescription
secondsuint(32)

options › relay_agent_info

FieldTypeDefaultAutoDescription
suboptionstlv — 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.
TypeNameValue fieldsDescription
1 (0x01)circuit_id
2 (0x02)remote_id
5 (0x05)link_selectionaddress
11 (0x0b)server_id_overrideaddress
FieldTypeDefaultAutoDescription
addressipv4
options › relay_agent_info › suboptions › server_id_override
FieldTypeDefaultAutoDescription
addressipv4

Constraints

LevelRule
warningmagic_cookie = 1669485411

Sample templates