How do you remember how many hosts go with a subnet mask?

Started by deanwebb, February 16, 2015, 09:02:56 PM

Previous topic - Next topic

deanwebb

Like the title says, how do you do it?

I'll hold up 8 fingers and then start halving... 128, 64, 32, 16, 8, 4, 2... and then I subtract two from all but the last, since I learned about the /31 a year ago.
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

icecream-guy

256 subtraction method,    256 - the number in the mask

so with a 255.255.255.240

256-240 = 16,  then subtract 2 for the network and broadcast  16-2 = 14,  14 hosts is the correct answer,

this is only efficient for /24 networks or greater.

for /16 through /23  multiply by 256

255.255.240.0

256-240 = 16,  16x256 = 4096  - network and broadcast  4096-2 = 4094

for lager networks /9 - /15 you could always multiple by 256  twice.
:professorcat:

My Moral Fibers have been cut.

deanwebb

Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.

Ironman


icecream-guy

this also helps with subnetting,

255.255.255.192

256-192 =64

so your multiplier is 64,

subnets are .0, .64, .128, .192
:professorcat:

My Moral Fibers have been cut.

deanwebb

I ought to write that up so that I remember it better.

Mad rep point to Mr. Ristau.
Take a baseball bat and trash all the routers, shout out "IT'S A NETWORK PROBLEM NOW, SUCKERS!" and then peel out of the parking lot in your Ferrari.
"The world could perish if people only worked on things that were easy to handle." -- Vladimir Savchenko
Вопросы есть? Вопросов нет! | BCEB: Belkin Certified Expert Baffler | "Plan B is Plan A with an element of panic." -- John Clarke
Accounting is architecture, remember that!
Air gaps are high-latency Internet connections.