wire / wire-format / dhcp-protocol
DHCP automatically assigns IP addresses and network configuration. Process: DISCOVER (client broadcasts), OFFER (server responds with IP), REQUEST (client requests the offered IP), ACK (server confirms). DHCP options: subnet mask (1), router (3), DNS (6), domain name (15), lease time (51), server ID (54), requested IP (50), message type (53). DHCP uses UDP ports 67 (server) and 68 (client).
aka: DHCP (Dynamic Host Configuration Protocol)
spec: RFC 2131
DHCP automatically assigns IP addresses and network configuration. Process: DISCOVER (client broadcasts), OFFER (server responds with IP), REQUEST (client requests the offered IP), ACK (server confirms). DHCP options: subnet mask (1), router (3), DNS (6), domain name (15), lease time (51), server ID (54), requested IP (50), message type (53). DHCP uses UDP ports 67 (server) and 68 (client).
| field | size | meaning |
|---|---|---|
| DISCOVER | broadcast | Client broadcasts DHCPDISCOVER to find servers. |
| OFFER | unicast/broadcast | Server responds with DHCPOFFER: offered IP, lease time, options. |
| REQUEST | broadcast | Client broadcasts DHCPREQUEST: accepts the offered IP, rejects others. |
| ACK | unicast/broadcast | Server responds with DHCPACK: confirms the IP assignment. |
| NAK | unicast/broadcast | Server responds with DHCPNAK: rejects the request (e.g., IP no longer available). |
| RELEASE | unicast | Client releases the IP (optional). |
| DECLINE | broadcast | Client declines the IP (e.g., ARP probe found conflict). |
| Options | variable | TLV options: type (1 byte), length (1 byte), value. Option 53 = DHCP message type, 1 = subnet mask, 3 = router, 6 = DNS, 15 = domain name, 51 = lease time, 54 = server ID, 50 = requested IP, 255 = end. |
| Magic cookie | 4 bytes | 0x63 0x82 0x53 0x63 (DHCP magic cookie in options field). |
example:
00 00 00 00
DHCP (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/dhcp-protocol
or /wire-format/dhcp-protocol.json