This post is related to subnet (sub network). Please move it if it's not in right place.
It's more about confirming my understanding about subnet.
Theoretically, a subnet is a logical group of hosts (systems) in a bigger network. They have an IP address in following format xx.xx.xx.xx/xx
Now if someone gives me a subnet address (195.23.24.29/24). Can I get IP addresses of all the hosts in this subnet?
Here is my understanding:
Any IP address has two parts (first 3 octets represent network (xx.xx.xx) & 4th octet is host).
Coming back to subnet & my example, the 24 after the slash (/) represent the subnet mask (?). It means 24 ones & remaining (32-24 = 8) zeros.
11111111 11111111 11111111 00000000
255.255.255.0
Also the first (00000000) & last (11111111) can’t be used for hosts as first is for network & last is for broadcast. So we’ll have combinations starting from 00000001 till 11111110. Total 254 combinations or hosts in this subnet.
They’ll have IPs: 195.23.24.1, 195.23.24.2, 195.23.24.3 ………………………….. 195.23.24.254.
Is my understanding about subnet & above calculation correct?
I’ll provide another example to clarify my understanding:
Subnet address: 195.23.24.76/27
11111111 11111111 11111111 11100000
00000 & 11111 can’t be used. Combinations left are: 00001 till 11110.
Host IPs are: 195.23.24.1, 195.23.24.2, 195.23.24.3 …………………………… 195.23.24.30
Total 30 hosts are in the subnet.
If it’s correct then the 4th octet in subnet address is useless, we’re not using it for any purpose??
Thanks.