1

I've been delving into the wonderful word of networking (lol) and I have a few questions of clarification for IPv4 subnetting.

I'm pretty comfortable with the idea of subnetting. I understand that it's a way of splitting up an IP address into public/local addresses. From my experience though, the only time I've seen this used is in private networks (10.x.x.x, 198.162.x.x, etc).

How does subnetting work for public IP addresses? For instance, if I'm running a datacenter, would owning 30.214.41.2/16 be equivalent to owning the ~65000 addresses between 30.214.41.2 and 30.215.41.2?

As a follow up, do ISPs use this as a convenience for routing purposes?

I ask this because working with AWS, as far as I'm aware its not possible to allocate consecutive public IP addresses for public subnets. I'm building a public subnet, filling it with machines running an API, and would like each machine to have a consecutive public IPs within the subnet. Am I correct in assuming this isn't possible?

I understand IP allocation in AWS is in its own little world (since you're basically borrowing IPs that Amazon had previously purchased) and that it may be different everywhere else.

Apologies for the noob question :)

EDIT: 65000 not 600000

1

How does subnetting work for public IP addresses? For instance, if I'm running a datacenter, would owning 30.214.41.2/16 be equivalent to owning the ~65000 addresses between 30.214.41.2 and 30.215.41.2?

The subnet mask is always applied left-to-right, so no subnet that is /24 or less will ever have a non-zero start for the rightmost value. For your example:

      30.     214.      41.       2
00011110 11010110 00101001 00000010 address
11111111 11111111 00000000 00000000 network mask (/16)
======== ======== ======== ======== (bitwise AND)
00011110 11010110 00000000 00000000 network

The network in this case is 30.214.0.0/16 and the host range is 30.214.0.1-30.214.255.254 (30.214.0.0 and 30.214.255.255 have special meanings.)

As a follow up, do ISPs use this as a convenience for routing purposes?

ISPs can use the fact that they have subnetted their address range to simplify routing tables. This is known as route summarization and is pretty important in keeping the Internet working, because instead of your ISP having to advertise every network block that they use in a contiguous range, they can advertise just one. There's more to it than this, but fortunately that's beyond the scope of this question (it's complex and I have forgotten most of the details!)

As an aside, if you needed more than 65534 hosts in your hypothetical network, you could obtain two /16 networks that were adjacent to each other (e.g. 10.214.0.0/16 and 10.215.0.0/16) and supernet those into a single network (10.214.0.0/15). It's more common at the smaller network allocations (/24 and smaller), but you should be aware of its existence.

  • This is a great explanation. So to summarize: private subnetting and public subnetting are identical due to the fact that from a routing perspective, there's really no difference between a private IP and a public IP. Public IP subnetting is only effective then if you own the addresses consecutively correct? Isn't that pretty rare in this day and age? Or were IP addresses distributed originally in a such a way that the big players basically own "large blocks"? – jmkmay Jan 22 '18 at 16:16
  • That's correct. If you look at the original IP specification (RFC 791, "Addressing"), those "big blocks" were class A (/8), B (/16) and C (/24): subnetting wasn't officially supported way back then. I can't comment on the overall availability of IPv4 network allocations nowadays, but they are probably still available at the ISP level: getting allocations directly from a registrar is more problematic. Also, some good news is that when you switch to IPv6 the rules regarding subnetting remain essentially the same! – ErikF Jan 22 '18 at 18:38
  • I think its relatively difficult to get them at the ISP level, since most ISPs nowadays (at least where I live) use a form of PAT for addressing residentially. My neighbours have literally the same IP address as me. – jmkmay Jan 25 '18 at 16:44
0

I'm pretty comfortable with the idea of subnetting. I understand that it's a way of splitting up an IP address into public/local addresses. From my experience though, the only time I've seen this used is in private networks (10.x.x.x, 198.162.x.x, etc).

Subnetting works the same way for any unicast addressing. In fact, IP doesn't know anything about public or private addressing. Private addresses are simply blocks of addresses that the ISPs have agreed to not route. IP, itself, has nothing inherent that says any address is public or private.

What ISPs do will vary from ISP to ISP, and questions about the ISP networks are off-topic here.

  • Thanks for the response. So would owning, for instance, 30.214.41.2/16 be equivalent to owning the ~65000 addresses between 30.214.41.2 and 30.215.41.2? Obviously if I have 30.214.41.2 as a single host, I can't just declare 30.214.41.2/24 as my subnet, right? – jmkmay Jan 15 '18 at 17:06
  • If you are assigned a public address block, then you have exclusive use of the public address block, and you can subnet it in any way that you want. Normally, you will only advertise the entire block to the public Internet, but how you divide the block for your use is up to you. If you are only assigned a single address in that block, you must use the network mask given to you. that may be only /30, or it could be something smaller. – Ron Maupin Jan 15 '18 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.