DHCP Header
DHCP Header
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Op (1 byte)
0
htype (1 byte)
1
hlen (1 byte)
2
hops (1 byte)
3
xid (4 bytes)
4 5 6 7
secs (2 bytes)
8 9 10
flags (2 bytes)
11
ciaddr (4 bytes)
12 13 14 15
yiaddr (4 bytes)
16 17 18 19
siaddr (4 bytes)
20 21 22 23
Notes: Op the message type (see DHCP message types table below) Htype Hardware address type (see HTYPE codes table below) Hlen Hardware address length Hops set to zero by a client but can optionally be used when booting via a relay agent Xid Transaction ID, a random number choosen by the client, used by the client and server so that no-one get confused between messages. Secs The number in seconds since the address was allocated, the client fills this part Flags Exactly what it says on the tin Ciaddr The clients IP address, but only if they have one, basically if the client is BOUND, RENEW or REBINDING. Yiaddr Your (client) IP address. Siaddr IP address of the next server to use in bootstrap. Is returned in DHCPOFFER and DHCPACK messages by the DCHP server. Giaddr VPN server IP address used in booting via relay agents Chaddr Client Hardware address (should be unique LOL) Sname Optional server host name, should be a null terminated string File Boot file name, it should be a null terminated string. For DHCPDISCOVER messages it should be a fully generic name or null, for DHCPOFFER messages it should be a fully qualified directory path name. Options For optional parameters.
B = Broadcast The rest of the byte must be zerod this is for future use.