jelco wrote:Example: 192.168.1.100/16. 16 divided by 8 is two, so the last two octets are the variable components of the address. That makes the base address 192.168.0.0.
Broadcast address: 192.168.255.255
Amount of addresses: 2^16 = 65 536
Next network: 220.127.116.11/16
I thought the broadcast address as such: all the bits in the variable portion of the address resolve to 1 (which is the same thing, of course. I just never thought it to be the last address, for some reason). But now I know I'm finding broadcast correctly.
I do remember something about 2^x.... Now I know!
Additionally your subnet mask is 255.255.0.0, and I'd guess your gateway is 192.168.0.1. (Note that the gateway and broadcast address are not standardized and can be different, but a gateway is rarely different from the base address + 1 and the broadcast is even more unlikely to differ from its default of last address.) Subnet masks are nothing more than bitmasks, and have a 1 for a bit that's 'static' within the subnet (always the same for every address) and a 0 for every 'variable' bit. Since the last two octets are variable in /16s, the first two are static. This converts to 255.255.0.0.
I thought the base address +1 would give the first usable host? Is the first usable host, therefore, gateway +1? Anywho, you have confirmed my findings of subnet masks
Subnets that use entire octets are easy to work with (/8, /16 and /24); most confusing elements kick in at in-between range sizes. A nice example is the student-range of my Uni's address space. My own PC for example is 18.104.22.168, and I happen to know the network is a /20. With 32-20=12 variable bits there's 1.5 octet we can designate as 'variable'. A bit of binary maths and you end up with these details:
Base address: 22.214.171.124
Broadcast address: 126.96.36.199
Amount of addresses: 2^12 = 4096
Next Network: 188.8.131.52/20
Subnet mask: 255.255.240.0
I just remember that the the prefix for the last octet is /24. If something like /26 or /22 pops up (which is usually the case), I just add or subtract the corresponding bits. All this 1.5 of an octet is confusing <_>. Again, it's just another way of looking at it.
Next network: increment the last non-variable bit of the network prefix, and use the same amount of bits.
I think this is my only real problem. What if, hypothetically, the network looked something like this:
what would the next network be? There isn't a last static bit to increment with that prefix and that address. As for the last usable host, it's broadcast address -1, I hope.
I appreciate the help.