Skip to content

Why a mix of CIDR and net range? #3

Open

Description

@benoitjpnet

Hi,

I'm curious about this decision to mix CIDR and net range notation. Is there a specific reason? It makes parsing the database a bit more difficult.

Thanks.

Activity

  1. ipapi-is commented on Sep 16, 2023

    @ipapi-is
    Owner

    Hey,

    Will be done in the next release.

    What format do you suggest?

  2. benoitjpnet commented on Sep 16, 2023

    @benoitjpnet
    Author
  3. ipapi-is commented on Sep 17, 2023

    @ipapi-is
    Owner

    CIDR doesn't work for all networks.

    How would you represent the network

    1.2.3.4 - 1.2.3.7 in CIDR format?

    Kind regards, Nikolai

  4. benoitjpnet commented on Sep 19, 2023

    @benoitjpnet
    Author

    Well 1.2.3.4/30? From .4 to .7. (Not caring about network and broadcast address).
    Maxmind use CIDR like this. If you then want network ranges, then you can convert with their tool.

    e.g:
    Screenshot_20230919_202749

  5. ipapi-is commented on Sep 21, 2023

    @ipapi-is
    Owner

    You are correct.

    How do you represent 1.2.3.1 - 1.2.3.7 in CIDR?

    Not possible with one CIDR address, you have to provide 3 CIDR ranges:

    1.2.3.1/32
    1.2.3.2/31
    1.2.3.4/30
    

    Conclusion:

    I will probably use the following format to represent IP ranges (Using integers):

    ipVersion,startIp,endIp
    4,1246803551,1246803551
    6,55838750780053364850524370207644844032,55838750780053364868971114281354395647
    

    Alternative, I can use the following format:

    ipVersion,startIp,endIp
    4,84.246.248.128,84.246.248.191
    4,84.246.248.192,84.246.248.255
    6,2606:54c0:7680:5330::,2606:54c0:7680:5330:ffff:ffff:ffff:ffff
    

    The problem with both of those formats is that they need considerably more space than CIDR format.

  6. acidvegas commented on Oct 4, 2023

    @acidvegas

    while it takes up more space, it is a consistent 2 variables, rather than breaking up a range into potentially more than 2 cidrs. but i do think the format of choice should be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions