dhcprfcbootp

DHCP Options field padding


According to RFC2132 "Pad Option" (0s) CAN be used to align subsequent fields on word boundaries. But looking at DHCP packets I can't tell what is the size of the "word". Onetime "Options" field is 32 bytes, one time is 60 bytes. In my setup the DHCP server has no problem accepting packets with no padding.

Is padding required anymore nowadays? If it is to what size?


Solution

  • The TCP/IP Guide defines a "word" as 16 bits (2 bytes).

    RFC2131 says that you need to be able to handle an "Options" field of at least 312 octets (bytes).

    The padding can be any size. I just troubleshoot a DHCP client of an embedded device (old JetDirect box) that doesn't handle padding at all. Our Cisco switch adds padding after removing "Option 82" information which causes the device to choke. It doesn't appear to pad the information going to the server, but you don't know if client or switch will do that, so you need to be able to handle it.