ipbus/ipbus-firmware

Source IP in DHCPDISCOVER packets

Opened this issue · 1 comments

In the current implementation of DHCP in IPbus, the source IP of the DHCPDISCOVER messages is set to 192.168 & NOT MAC addr(15 downto 0).

Within the documentation or recent issues of IPbus I could unfortunately not find the specific reasoning for doing so.

According to RFC2131 [0]:

DHCP messages broadcast by a client prior to that client obtaining
its IP address must have the source address field in the IP header
set to 0.

In my interpretation DHCP servers or network architects are free to assume that any packet not originating from 0.0.0.0 is not an expected DHCPDISCOVER which could lead to problems in certain setups. (Maybe not at ATLAS/CMS, but at independent test setups.)

I would thus propose to set the source IP of the DHCPDISCOVER packets to 0.0.0.0.

[0] https://www.ietf.org/rfc/rfc2131.txt

You are quite correct, RFC2131 does specify that the source IP address for DHCPDISCOVER should be 0.0.0.0.

As to why we did something different, we wanted to have a meaningful identifier field and we played the game of ensuring that we had a static 1's complement IP checksum by balancing this with the source IP address, having seen that other systems out there put their 'guess' as IP address in their DHCPDISCOVER.

So RFC says it should be 0.0.0.0, established practice says it doesn't matter.