How many subnets and hosts per subnet can you get from the network 172.31.0.0/19?
-
https://www.wolframalpha.com/input/?i=172.31.0.0%2F19 This will give you the information of a /19 subnet. Not sure exactly what you're trying to get at with your question as the /19 IS the subnet for that address range – lost_admin Feb 19 '21 at 18:15
-
@lost_admin: The network doesn't have to be as large as the whole reserved range, it only needs to be "not larger" but can easily be smaller. (And even if the entire range is used, one can still route parts of it as smaller networks, while still not getting to the individual subnet level.) – u1686_grawity Feb 19 '21 at 18:33
-
1@user1686 right, but their question is extremely vague on what they actually want. You could make as many subnets as you want with 3 IPs per if desired, so the overall answer is : it depends. – lost_admin Feb 19 '21 at 18:35
-
2This is a little like asking "how many pieces can you cut a ten-foot string into, and how long will the pieces be?" The answer depends on how finely you chop it up. You can get a large number of small pieces, or just two rather large ones, or pieces of different sizes, or... You don't have quite as many choices about how to subnet a range like that, but you still have a huge number of different options. – Gordon Davisson Feb 19 '21 at 19:03
2 Answers
How many subnets and hosts per subnet
That question is lacking an important parameter: how large do you want the subnets to be?
There isn't a single standard subnet size in IPv4. You could divide the same /19 into a few large /22's, or you could divide it into many small /29's, or you could even mix several different sizes.
A /19 means you have 32-19 = 13 bits to divide in any way you like. If not divided into subnets at all, it would have a total of 213 = 8192 addresses.
If, for example, you decide to divide the network into equal-sized /25 subnets, you would use 25-19 = 6 network bits (getting 26 = 64 subnets), and you would have 32-25 = 7 host bits remaining (which gives 27 = 128 addresses per subnet).
But if you need a different subnet size, then the "number of subnets" and "number of hosts" will change accordingly – there is no single answer.
- 426,297
- 64
- 894
- 966
8,192 IP's per this Subnet calculator: https://mxtoolbox.com/SubnetCalculator.aspx I haven't done the math myself, hopefully it's not including unusable IP's 172.31.0.0 or 172.31.0.255 broadcast
--EDIT Very rough calculation in excel shows 8,192 is all the IP's even unusable ones. 8,128 I believe is the usable IP's: 172.31.0.1-172.31.31.254 (254x in each range, ex: 172.31.0.1 to 172.31.0.254)
- 5,598
- 2
- 21
- 36
-
Which addresses are usable and which ones are not depends on the subnet size. The same .0.255 may be usable on a /22 but reserved on a /24. – u1686_grawity Feb 19 '21 at 18:23
-
I am sure you are right, I don't have a super good understanding of networking, just enough to make me dangerous. Please edit my answer if desired. Also link to simple article if you could since this is a bit of the 'blind leading the blind' (me & OP) – gregg Feb 19 '21 at 18:25
-
1In general, address ranges or routes don't _inherently_ have reserved or unusable addresses, only when you configure that range on an actual network interface as a subnet is when they begin to matter. (The term "subnet" is a bit fuzzy, different people mean different things.) So the calculator's answer of 8192 is right under the assumption that the /19 is an abstract range and its usage is not yet specified – and your idea of 8190 is also right under the assumption that the /19 will be used as a single large ethernet subnet (then it'd have .0.0 and .31.255 as the two reserved addresses). – u1686_grawity Feb 19 '21 at 18:46
-
1But because OP is asking about subnetting it _further_ (let's say to /24's) then _each_ of those subnets would have its own 2 reserved addresses, while the "parent" network wouldn't. – u1686_grawity Feb 19 '21 at 18:46