How are IP addresses assigned to end users?

How are IPv4 addresses assigned? What sparked my curiosity is that I used to have an IPv4 address of 96.32.179.XX and I moved roughly 2 weeks ago (about 10 miles from previous address) and now I have an IPv4 address of 24.158.252.XXX. Same city and state for each IP.

I would think that each City would be assigned an IPv4 Range, meaning that both of my addresses would start with 96.XX.XXX.XX Or are IPv4 addresses just randomly assigned from your ISP pool of IPv4 addresses that they have available?

Both IPv4 listed above are for residential accounts.


Your ISP can be a big company or a local company.

Big companies as Comcast or AT&T in USA have a lot of addresses that they have requested to its Regional Internet Registry.( ARIN in the United States, RIPE in Europe).

As the IPv4 scope is depleted it's very difficult to have a huge chunk of consecutive addresses.

The ISP range could be made of a chunk of 1024 addresses from one range, 4096 from other, etc.

ARIN, RIPE and the other registries assign whatever they find free to the requester.

Small ISPs most of the time depend on bigger ISPs, then, they don't request addresses to ARIN or RIPE. Instead of that they lease addresses from a bigger ISP, resulting on even more partitioned chunks.

Sites that geo-locate using the IP address use databases extracted from the information provided by the registries (ARIN, RIPE, etc.) so they are far from accurate and usually show the physical address of the ISP that requested the range from the registry, not knowing if that range is used by the ISP or leased to another.


Let's start from the top: The Internet Numbers Registry System (defined in RFC 7020) is a set of systems and organizations that work together to manage all IP addresses in the world.

IANA (Internet Assigned Numbers Authority) "owns" all IP addresses and delegates them to RIR's (Regional Internet Registries), who define their own policies regarding who can get an IP address block, and for what reason they should get one.

IANA assigns IPv4 "blocks", which are basically a set of consecutive IP addresses. The largest assignable block is a /8 block, which means all IP addresses starting with a certain octet (eg: 123...*). RIR's take IP addresses assigned to them by IANA and divide them up into smaller blocks, which are then assigned to organizations such as ISP's or large companies. (For example, Cloudflare is not an ISP, but does have quite a few IP addresses assigned because they operate a very large global network. You can't go to a RIR and request just one IP)

Your ISP will then, depending on its size, go to the RIR and request an allocation of IP addresses. The RIR then assigns your ISP some addresses from the available pool, in an ideal world, this would be one large block of consecutive addresses (for example 123.123.0.1/17 (123.123.0.1 - 123.123.127.254)). Unfortunately, the amount of available IP blocks of this size is rapidly shrinking because the IPv4 address space is running out. This is why an ISP might receive two /18 blocks instead of a single /17 block.

Then, when you connect to your ISP's network, you request an address (using DHCP) . Your ISP will pick an address from the pool of available addresses it was assigned by the RIR. Since the ISP probably owns multiple blocks of IP addresses, the chance exists that the IP address you will be assigned is completely different from the one you had previously.

It is possible for an ISP to neatly organize their IP allocations by assigning a certain block to a certain location, but this doesn't really serve any purpose except for looking pretty, which is why they don't do it.

TL;DR: You get your IP from an ISP, which gets it from a RIR, which gets it from IANA. IP's are assigned in a first come, first served method so when your RIR or ISP requests two blocks at separate times, they won't be consecutive. You get a random IP from the pool of available addresses at your ISP, which may be from any of the blocks they own. Your ISP could assign an IP based on your location, but since that has no real benefit, they probably don't.