-
Notifications
You must be signed in to change notification settings - Fork 99
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
CIDR ranges /32 and /31 don't give correct count #109
Comments
I'd say this is intentional. If usable was 1 it would lead to an inconsistency, as within /24 you also only have 254 usable addresses and not 256. It does not mean that .0 and .255 are invalid addresses, they are just not usable for devices. |
I'd also say that this is intended behaviour. However, having 0 usable adresses and still having FirstUsable and LastUsable other than NULL is misleading. That would definitively break the test suite if we NULL FirstUsable and LastUsable when usable = 0. I'd vote for :
Any help would be appreciated. |
Maybe, I don't understand correctly. But It should be an IP network with an IP Address available 192.168.1.1 (in example) https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#IPv4_CIDR_blocks |
Thanks you fravelgue for the reference This is what we have today :
According to : https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#IPv4_CIDR_blocks
Would that be OK for everyone ? |
That looks correct to me.
Thanks for looking into this.
…
On Aug 28, 2020 at 11:06 pm, <lduchosal ***@***.***)> wrote:
Thanks you fravelgue for the reference
This is what we have today :
Address
Mask
Total
Usable
Network
Broadcast
FirstUsable
LastUsable
1.0.0.1/32
255.255.255.255
1
0
1.0.0.1
1.0.0.1
1.0.0.1
1.0.0.1
1.0.0.1/31
255.255.255.254
2
0
1.0.0.1
1.0.0.2
1.0.0.1
1.0.0.2
According to : https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#IPv4_CIDR_blocks
We should have :
Address
Mask
Total
Usable
Network
Broadcast
FirstUsable
LastUsable
Typical use
1.0.0.1/32
255.255.255.255
1
1
1.0.0.1
1.0.0.1
1.0.0.1
1.0.0.1
Host route
1.0.0.1/31
255.255.255.254
2
2
1.0.0.1
1.0.0.2
1.0.0.1
1.0.0.2
Point-to-point links (RFC 3021)
Would that be OK for everyone ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#109 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAPUMCJN3DGX5C6VL2LWUSLSC6TWRANCNFSM4OVIMHPA).
|
No that causes weird issues when subnetting. It should be 0 usable addresses for both and FirstUsable and LastUsable should be $null Therefore it should be:
Source for that:
|
This issue has a label |
CIDR ranges /32, and /31 when given to the library to parse and then querying range.Usable, I get back a (0) where the .FirstUsable and .LastUsable properties are correctly showing a valid IP Address.
The text was updated successfully, but these errors were encountered: