programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Tim Cooke
• Ron McLeod
• Jeanne Boyarsky
• Paul Clapham
Sheriffs:
• Liutauras Vilda
• Henry Wong
• Devaka Cooray
Saloon Keepers:
• Tim Moores
• Stephan van Hulst
• Tim Holloway
• Al Hobbs
• Carey Brown
Bartenders:
• Piet Souris
• Mikalai Zaikin
• Himai Minh

Ranch Hand
Posts: 3852
• Number of slices to send:
Optional 'thank-you' note:
This post is related to subnet (sub network). Please move it if it's not in right place.

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:
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.

author
Posts: 23923
142
• Number of slices to send:
Optional 'thank-you' note:

ankur rathi wrote:I’ll provide another example to clarify my understanding:
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.

Actually the Host IPs are: 195.23.24.65, 195.23.24.66, 195.23.24.67 …………………………… 195.23.24.94

Henry

ankur rathi
Ranch Hand
Posts: 3852
• Number of slices to send:
Optional 'thank-you' note:

Henry Wong wrote:

ankur rathi wrote:I’ll provide another example to clarify my understanding:
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.

Actually the Host IPs are: 195.23.24.65, 195.23.24.66, 195.23.24.67 …………………………… 195.23.24.94

Henry

Thanks Henry.

195.23.24.76/27
195.23.24.01001100
27 -> 11100000

consider only bits where subnet mask is having 1s, ignore rest.
195.23.24.010-00000

since 00000 & 11111 can't be used.

195.23.24.01000001 will be first host (195.23.24.65). 195.23.24.66 ................. 195.23.24.01011110 (195.23.24.94) will be last.

Thanks again Henry!
:)

 Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters?