How do I find the x th subnet of X.X.X.X /XX (300 th subnet of 172.16.0.0 /29)?

# Networking – How to Find Network Address of a Given Subnet

ipv4subnet

#### Related Solutions

It depends on the nature of your home network and how it's used. Are you just "consuming" resources from the Internet? Do you have an "experimental or test" network? Do you offer services back to the Internet via a server? Ultimately - Is there a need to segregate devices by network?

For example, in my "home" network, I have three subnets. I have the regular network - the network to which my girlfriend's PC connects for example. And the one my friends access via their tablet, laptop, or phone, when they come over to visit.

And then I have "my" network, which is for me screwing around and doing things with various flavors of Linux and Windows builds.

And I run an "external" network which has a mumble server, a game server, and occasionally a honeypot (since I like to see what it can catch... - ha!).

Is my infrastructure typical? No, but it's not that unusual either.

In the future (perhaps not immediate - but down the road nonetheless) as more devices in the house become IP connected, QoS issues will likely start to arise. Managing by network (the fridge, microwave, security system, garage opener, and coffee maker go in A, my tablet, laptop, PC, and watch go in B, my TV, game console, security camera, and web server go into C, etc).

It's (usually) easier to manage devices by network than by individual IP. (For example, my devices get priority when downloading something rather than my girlfriend's.... SSHHH).

Then there's the question of IPv4 w/NAT vs the imminently promised arrival of IPv6. If and when IPv6 begins to significantly affect the consumer market (in terms of endpoints), subnetting will be absolutely required. You're evaluating the home environment based on the assumption it always seems like a private 192.168.0/24 environment.

If IPv6 begins to touch consumer endpoints, that isn't necessarily guaranteed. Combine that with the likely need to mix with IPv4 devices, and I could easily see "subnetting" being required. (Of course, almost every consumer router would have to be thrown away and replaced with something new anyway.)

Subnet masks, when represented as a row of 32 bits (1s or 0s), always have all 1s on the left (the most significant bits of the first octets), and all 0s on the right (the least significant bits of the last octets). So we can describe them in shorthand by just noting how many 1's there are.

As you know, a /21 has 21 1's, starting from the left:

```
11111111.11111111.11111000.00000000
```

Now convert each octet to decimal to get the familiar "dotted-decimal" or "dotted-quad" notation:

```
255.255.248.0
```

This is because the most significant bit in an octet (8-bit Byte) is the "128's place", the next is the "64's place", etc:

```
128, 64, 32, 16, 8, 4, 2, 1
```

So in that third octet, you have 5 1s and 3 0's:

```
128 + 64 + 32 + 16 + 8 + 0 + 0 + 0 = 248
```

Now let's look at your /23:

```
11111111.11111111.11111110.00000000
```

That third octet converts to decimal like this:

```
128 + 64 + 32 + 16 + 8 + 4 + 2 + 0 = 254
255.255.254.0
```

You see, by adding two bits to the subnet mask, you're not adding a "binary 2" (the value 2, which is 10 in binary), or even the max value two bits can store (binary 11 = decimal 3).

You've got to look at the binary place-value of the 1s you're adding to the mask. In your case, you were adding a 1 in the 4's place, and a 1 in the 2's place, so you're adding 6 to that octet's value.

```
248 + 6 = 254
```

Because of the way that subnet masks "grow from the left" like this, there are only 9 possible values for any octet in a subnet mask:

```
0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 0
128 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 128
128 + 64 + 0 + 0 + 0 + 0 + 0 + 0 = 192
128 + 64 + 32 + 0 + 0 + 0 + 0 + 0 = 224
128 + 64 + 32 + 16 + 0 + 0 + 0 + 0 = 240
128 + 64 + 32 + 16 + 8 + 0 + 0 + 0 = 248
128 + 64 + 32 + 16 + 8 + 4 + 0 + 0 = 252
128 + 64 + 32 + 16 + 8 + 4 + 2 + 0 = 254
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255
```

## Best Answer

calculate how many address is there in /29 subnet (full IP has 32 bits, so you're left with 3 bits for subnet), 2 to the power of 3 is 8. You have 8 address per subnet.

see how many /29 subnets can you have in a one /24 subnet (172.16.0.0-172.16.0.255), it 256/8 so 32 /29 subnets

Divide 300 by 32 and get 9.75 so the 300th /29 subnet will be in the 10th /24 subnet (172.16.9.0-172.16.9.255), beacuse you have to take 9 full /24 subnets and part of 10th

multiply 9*32 and you get that the 9th subnet ends with 288th /29 subnet, so you have to take 12 more /29 subnets from the 172.16.9.0/24, which is (12-1)*8 so the 300th is 172.16.9.88.0/29