Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DHCP Options field padding

Tags:

rfc

dhcp

bootp

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?

like image 375
Chris Avatar asked Feb 10 '26 22:02

Chris


1 Answers

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.

like image 80
Joseph Avatar answered Feb 13 '26 14:02

Joseph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!