Support small ipv4 networks#42626
Conversation
15de0d0 to
2040b6e
Compare
|
Looks like a bad rebase, maybe? There's several unrelated commits. |
|
Possibly. I ran into some difficulties with getting everything signed off. Should I start over? |
|
Maybe start a new branch from master and see if your change can be cherry-picked onto the new branch. |
|
I think it's just because the branch wasn't up to date with master (commits that don't belong in here look to be PR's that were already merged). I suspect a rebase should fix that (but you can duplicate your branch to have a backup if you're unsure 😅) |
|
Tried rebasing, and that looks to automatically resolve the issue; (after that, a "force" push to this branch should update the PR) @mfeit-internet2 do you want me to do the rebase and push to your branch? |
|
Oh .. if you do a rebase, could you also squash the last two commits? (so that the fix-up commit is combined with the actual changes?) |
|
@thaJeztah Sure, go for it. |
|
At long last, this looks ready to go. |
|
None of what failed in the last CI iteration had anything to do with the code changed here. How do we proceed? |
f19ae56 to
9d50097
Compare
…roadcast addresses. This was originally in moby/libnetwork#2624, which has been closed since the code was moved here. When creating a new network, IPAM's address allocator attempts to reserve the network and broadcast addresses on IPv4 networks of all sizes. For RFC 3021 point-to-point networks (IPv4 /31s), this consumes both available addresses and renders any attempt to allocate an address from the block unsuccessful. This change prevents those reservations from taking place on IPv4 networks having two or fewer addresses (i.e., /31s and /32s) while retaining the existing behavior for larger IPv4 blocks and all IPv6 blocks. In case you're wondering why anyone would allocate /31s: I work for a network service provider. We use a lot of point-to-point networks. This cuts our address space utilization for those by 50%, which makes ARIN happy. This patch modifies the network allocator to recognize when an network is too small for network and broadcast addresses and skip those reservations. There are additional unit tests to make sure the functions involved behave as expected. Try these out: * `docker network create --driver bridge --subnet 10.200.1.0/31 --ip-range 10.200.1.0/31 test-31` * `docker network create --driver bridge --subnet 10.200.1.0/32 --ip-range 10.200.1.0/32 test-32` My installation has been running this patch in production with /31s since March. Signed-off-by: Mark Feit <[email protected]> Signed-off-by: Sebastiaan van Stijn <[email protected]>
9d50097 to
3a938df
Compare
|
Did a rebase/squash, as it looked like some unrelated changes made it into the PR, and some fixes to CI were merged on master, so getting a fresh new run of CI |
|
@thaJeztah Thanks for looking into that; we're looking forward to having this in the released code. The CI still fails on Windows for, again, nothing having to do with the changes. |
|
Yes, CI was looking better, but then I triggered too many PRs and apparently there was a cap on the auto-scaler, so PR's got in queue waiting for Windows machines to be available; let me kick it again. |
|
This looks sane in general, but it's also been open long enough that it's probably worth the effort to also support RFC6164 for /127 IPv6 point to point addressing as part of it. I wouldn't block on this, but it's a logical addition to support for /31 addressing |
This was originally in moby/libnetwork#2624, which has been closed since the code was moved here. It fixes #32444 and moby/libnetwork#2249.
What I did
When creating a new network, IPAM's address allocator attempts to reserve the network and broadcast addresses on IPv4 networks of all sizes. For RFC 3021 point-to-point networks (IPv4 /31s), this consumes both available addresses and renders any attempt to allocate an address from the block unsuccessful.
This change prevents those reservations from taking place on IPv4 networks having two or fewer addresses (i.e., /31s and /32s) while retaining the existing behavior for larger IPv4 blocks and all IPv6 blocks.
In case you're wondering why anyone would allocate /31s: I work for a network service provider. We use a lot of point-to-point networks. This cuts our address space utilization for those by 50%, which makes ARIN happy.
How I did it
The network allocator was modified to recognize when an network is too small for network and broadcast addresses and skip those reservations.
How to verify it
There are additional unit tests to make sure the functions involved behave as expected.
Try these out:
docker network create --driver bridge --subnet 10.200.1.0/31 --ip-range 10.200.1.0/31 test-31docker network create --driver bridge --subnet 10.200.1.0/32 --ip-range 10.200.1.0/32 test-32My installation has been running this patch in production with /31s since March.
Description for the changelog
Added support for RFC 3021 point-to-point networks (IPv4 /31s) and single hosts (IPv4 /32s).
A picture of a cute animal (not mandatory but encouraged)
How about Linda Ball's ASCII art bunny?