-
Notifications
You must be signed in to change notification settings - Fork 911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dhcpcd InfiniBand support #4830
Conversation
@wmousa I'm reaching out to you since proposed the original isc-dhclient InfiniBand PR in cloud-init to support OpenStack VMs. Since isc-dhclient is no longer supported upstream, cloud-init has added support for udhcpc and more recently dhcpcd to enable cloud-init to use a currently supported dhcp client. Could you please review the proposed changes or help put us in contact with someone at Mellanox / Nvidia who might be willing to review and test? Unfortunately we lack hardware to test this on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if we could get confirmation this works as expected, but I'm not sure how long we should wait for.
9dc9c75
to
2aa9884
Compare
Dhcpcd will default to sending a default of hardware family and hardware address when no argument is given. Since this is the required behavior for dhcp on InfiniBand, use this flag if an InfiniBand interface is detected. from dhcpcd(8): -I, --clientid clientid Send the clientid. If the string is of the format 01:02:03 then it is encoded as hex. For interfaces whose hardware address is longer than 8 bytes, or if the clientid is an empty string then dhcpcd sends a default clientid of the hardware family and the hardware address.
Currently it uses the OpenStack codepath which grabs some random bytes out of the hardware address.
2aa9884
to
c975a24
Compare
I just pushed to merge test conflicts.
+1 I'd rather include this now - in theory it should work, and if not then at least we tried and we can iterate if testers with InfiniBand hardware show up. |
+1 to merge |
Dhcpcd will default to sending a default of hardware family and hardware address when no argument is given. Since this is the required behavior for dhcp on InfiniBand, use this flag if an InfiniBand interface is detected. from dhcpcd(8): -I, --clientid clientid Send the clientid. If the string is of the format 01:02:03 then it is encoded as hex. For interfaces whose hardware address is longer than 8 bytes, or if the clientid is an empty string then dhcpcd sends a default clientid of the hardware family and the hardware address.
Dhcpcd will default to sending a default of hardware family and hardware address when no argument is given. Since this is the required behavior for dhcp on InfiniBand, use this flag if an InfiniBand interface is detected. from dhcpcd(8): -I, --clientid clientid Send the clientid. If the string is of the format 01:02:03 then it is encoded as hex. For interfaces whose hardware address is longer than 8 bytes, or if the clientid is an empty string then dhcpcd sends a default clientid of the hardware family and the hardware address.
Currently it uses the OpenStack codepath which grabs some random bytes out of the hardware address.
Dhcpcd will default to sending a default of hardware family and hardware address when no argument is given. Since this is the required behavior for dhcp on InfiniBand, use this flag if an InfiniBand interface is detected. from dhcpcd(8): -I, --clientid clientid Send the clientid. If the string is of the format 01:02:03 then it is encoded as hex. For interfaces whose hardware address is longer than 8 bytes, or if the clientid is an empty string then dhcpcd sends a default clientid of the hardware family and the hardware address.
Currently it uses the OpenStack codepath which grabs some random bytes out of the hardware address.
Dhcpcd will default to sending a default of hardware family and hardware address when no argument is given. Since this is the required behavior for dhcp on InfiniBand, use this flag if an InfiniBand interface is detected. from dhcpcd(8): -I, --clientid clientid Send the clientid. If the string is of the format 01:02:03 then it is encoded as hex. For interfaces whose hardware address is longer than 8 bytes, or if the clientid is an empty string then dhcpcd sends a default clientid of the hardware family and the hardware address.
Currently it uses the OpenStack codepath which grabs some random bytes out of the hardware address.
Dhcpcd will default to sending a default of hardware family and hardware address when no argument is given. Since this is the required behavior for dhcp on InfiniBand, use this flag if an InfiniBand interface is detected. from dhcpcd(8): -I, --clientid clientid Send the clientid. If the string is of the format 01:02:03 then it is encoded as hex. For interfaces whose hardware address is longer than 8 bytes, or if the clientid is an empty string then dhcpcd sends a default clientid of the hardware family and the hardware address.
Currently it uses the OpenStack codepath which grabs some random bytes out of the hardware address.
Additional Context
Adds InifiniBand support to dhcpcd, updates udhcpc support to use the same client-id as dhcpcd and isc-dhclient.
Context on dhcp with InfiniBand:
InfinBand has its own software stack, but also uses a shim layer, IPoIB, to assign an IP address and provide compatibility with traditional transports (TCP / UDP) over its own transport. Its own transport uses RDMA to transfer data and typical users use a userspace library called libibverbs, on top of which various transports are built.
DHCP -> https://www.rfc-editor.org/rfc/rfc2855
DHCP InfinBand -> https://www.rfc-editor.org/rfc/rfc4390.html
DHCP hwaddr -> https://www.iana.org/assignments/arp-parameters/arp-parameters.txt
Some relevant excerpts from RFC4390:
The htype of 32 is the reason for setting "20" for udhcpc:
An InfiniBand address is longer than the required address.
The purpose of the client id is to provide a unique identifier within the subnet.
A client id is a type & unique identifier.
Matching implementation
The importance of client id is to provide a unique identifier to the dhcp server. Therefore, diverging implementations in cloud-init dhcp clients could cause a collision that would be problematic if say, an Alpine instance using udhcpc and an Ubuntu instance using dhcpcd or isc-dhclient on the same subnet report the same client id. The udhcpc code uses
get_ib_interface_hwaddr()
, which is implemented as:This diverges from the isc-dhclient implementation which uses
get_interface_mac(interface)[36:]
. The change in udhcpc is to ensure that a collision like this wouldn't occur.Test Steps
tox -e py3
Merge type