Giter Site home page Giter Site logo

Why is the IPv4 ToCIDR method dividing an IP segment into multiple groups, such as 124.55.21.1--124.55.21.255. about ip2location-go HOT 1 CLOSED

BadDeveloper2022 avatar BadDeveloper2022 commented on May 21, 2024
Why is the IPv4 ToCIDR method dividing an IP segment into multiple groups, such as 124.55.21.1--124.55.21.255.

from ip2location-go.

Comments (1)

ip2location avatar ip2location commented on May 21, 2024

I try my best to explain the calculation about the CIDR calculation. The IP address contains 4 octets, and each of them are 8 bits that give values between 0 and 255. The number that comes after the slash is the number of bits consisting of the routing prefix. This can be calculated as netmask, and also determine how many available addresses are in the block.

If the routing prefix value is less than 31, first and last IPs are base and broadcast addresses and are unusable.

For the group you suggested (124.55.21.1 - 124.55.21.227), where the CIDR base IP is on 124.55.21.0, the closest group you can get is 124.55.21.1/25. Its first useable IP is 124.55.21.1 and last usable IP is 124.55.21.126 (Not 124.55.21.127).

You can cross-check the result with ARIN, and Wikipedia.

from ip2location-go.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.