[SOLVED] Finding subnet mask, net address and broadcast

volstead

Reputable
Jul 4, 2019
61
8
4,535
Hi,
Let's say I have an IP of 8.19.129.31 /29 (this is not my IP). As I understand, the /29 means the leading bits from the left are marked off as 1's, so the subnet mask is 255.255.255.248. This leaves three bits in the right-most octet for hosts. However, my network IP as I take it, 8.19.129.248, is incorrect. Please help me understand why I am wrong. Thank you.
 
Solution
The way I learned subnetting in College was this:

I have a /24 (255.255.255.0) which is 11111111.11111111.11111111.00000000

I want two subnets so I borrow 1 bit and make a /25 (255.255.255.128) which is now 11111111.11111111.11111111.10000000

To figure out the number of available subnets, I do 2^n where n is the number of borrowed bits. I borrowed 1 bit so it makes 2^1 which is 2 subnets.

To figure out the number of available hosts, I do 2^n-2 where n is the number of 0 bits. In a /25 I have 7 0 bits which makes 2^7-2 which is 126 hosts. (The -2 is to account for the network address and the broadcast address. So technically a /25 has 128 addresses, but with one reserved for the network address and one reserved for the broadcast...
You can do it that way but you must understand how a mask work. You must convert 31 to binary and then only keep the first 5 bits.

There are other mathematical methods to do this but it is mostly a personal preference.

What you will find is the ip you picked is broadcast one for that subnet.
 

volstead

Reputable
Jul 4, 2019
61
8
4,535
I'm getting closer to an understanding of this. What I did was I lined up the subnet mask bits to the IP. Then I marked off where the corresponding 1's were for both the mask and the IP. This works out; however, I still do not understand why this works. I am new to this so I guess I need to keep reading. Thank you.
 

volstead

Reputable
Jul 4, 2019
61
8
4,535
U bumped into a crack, it works now, may not work latter under different circumstances. Another issue is that's a public IP and you are using in your LAN? more potential trouble ahead. Why the fixation with this 8 address?
I'm just practicing from website quizzes. Would you explain what you mean by "bumped into a crack"? What do I need to do? Thanks.
 

Terpinator

Reputable
Apr 12, 2017
84
2
4,565
The way I learned subnetting in College was this:

I have a /24 (255.255.255.0) which is 11111111.11111111.11111111.00000000

I want two subnets so I borrow 1 bit and make a /25 (255.255.255.128) which is now 11111111.11111111.11111111.10000000

To figure out the number of available subnets, I do 2^n where n is the number of borrowed bits. I borrowed 1 bit so it makes 2^1 which is 2 subnets.

To figure out the number of available hosts, I do 2^n-2 where n is the number of 0 bits. In a /25 I have 7 0 bits which makes 2^7-2 which is 126 hosts. (The -2 is to account for the network address and the broadcast address. So technically a /25 has 128 addresses, but with one reserved for the network address and one reserved for the broadcast address, leaving me with 126 usable IP addresses)

From there you can figure out the IP address ranges for each subnet.

The first subnet for example 192.168.1.0 would be the net address, then my host range would be 192.168.1.1 - 192.168.1.126, and 192.168.1.127 would be the broadcast address.
 
Last edited:
Solution

volstead

Reputable
Jul 4, 2019
61
8
4,535
The way I learned subnetting in College was this:

I have a /24 (255.255.255.0) which is 11111111.11111111.11111111.00000000

I want two subnets so I borrow 1 bit and make a /25 (255.255.255.128) which is now 11111111.11111111.11111111.10000000

To figure out the number of available subnets, I do 2^n where n is the number of borrowed bits. I borrowed 1 bit so it makes 2^1 which is 2 subnets.

To figure out the number of available hosts, I do 2^n-2 where n is the number of 0 bits. In a /25 I have 7 0 bits which makes 2^7-2 which is 126 hosts. (The -2 is to account for the network address and the broadcast address. So technically a /25 has 128 addresses, but with one reserved for the network address and one reserved for the broadcast address, leaving me with 126 usable IP addresses)

From there you can figure out the IP address ranges for each subnet.

The first subnet for example 192.168.1.0 would be the net address, then my host range would be 192.168.1.1 - 192.168.1.126, and 192.168.1.127 would be the broadcast address.
Thank you for the reply. I am confused about the borrowing part and number of subnets available. From your example you have
11111111.1111111.11111111.10000000. Mask is 255. etc. I get that. Here's my confusion: for the 2^n and 2^n - 2
I was using the same value so I would do 2^7 for number of subnets and 2^7-2 for hosts.

I admit, the more I review youtube vids and those free online courses, the more confused I get. I wish I could just talk face to face w/someone like you to go over this for as long as it takes. I consider myself an intelligent man but this concept is driving me loony.
 

Terpinator

Reputable
Apr 12, 2017
84
2
4,565
The math is coming from the final octet. (10000000) which makes 2^1 subnets. If I had 11000000 I would have 2^2 subnets, 11100000 is 2^3 and so on.

The number of hosts is 2^n-2 where "n" is the 0 bits. So in the example of 10000000, I have 7 zero bits, which gives me 2^7-2 hosts per subnet
 

volstead

Reputable
Jul 4, 2019
61
8
4,535
I see what you're getting at now. On reading online sources, seemed like some material did not make clear that "n" functions in two different ways, both as hosts and subnets. Guess I missed that. Thank you once again.
 

Terpinator

Reputable
Apr 12, 2017
84
2
4,565
I see what you're getting at now. On reading online sources, seemed like some material did not make clear that "n" functions in two different ways, both as hosts and subnets. Guess I missed that. Thank you once again.

"n" is just a variable used in the example. There is just a different value assigned to it when figuring out subnets or hosts. If it makes it easier you can write it as x for subnets and y for hosts. It really doesn't matter what variable you use as long as you keep the values straight. "n" is just what I use as it is what is always used when I see examples of subnetting.
 

volstead

Reputable
Jul 4, 2019
61
8
4,535
"n" is just a variable used in the example. There is just a different value assigned to it when figuring out subnets or hosts. If it makes it easier you can write it as x for subnets and y for hosts. It really doesn't matter what variable you use as long as you keep the values straight. "n" is just what I use as it is what is always used when I see examples of subnetting.
I finally get it now!😀