best, or possibly worst, explanation of subnet masks ever

Trying to explain subnet masks inside our company chat system, and this was the result. It is either the best, or possibly the worst, explanation of subnet masks and IP addresses ever. So there is that.

Credits: Images from this on IPV4 CIDR
http://www.sput.nl/internet/cidr-routing.html

My #knowledgeshare began like this and went down from there. But the actual IP is definitely about to be blocked. Hence I changed the IP to something ridiculous to protect the GUILTY:

after hours #knowledgeshare

the IP is 192.168.1.30 but I *only* want to block that one IP so I used a ‘subnet mask’ of 32 which looks like this

192.168.1.30/32  (not the real IP but you get the idea)

Because on the surface /32 makes NO SENSE AT ALL! Why? Because masks are binary. Obviously, right?

If you look at it in binary a pattern emerges like this big chart which also looks a bit scary.

ipv4 subnet mask in binary
IP V4 Table from http://www.sput.nl/internet/cidr-routing.html

Think of the zero’s as “hey you are cool man. come on into the party dude!” and the ones are like “oh hell no you aren’t getting in here!”

So the 1’s are the “mask” in a subnet mask.

Visualized another way it looks like the following party-pic. These guys are PARTYING HARD with 256 IPs.

IP binary subnet mask

But  you know, first you can’t have a zero IP address so you can’t use 192.168.1.0. Then you’ve got the supervisor (router) who gets the first IP in the block (e.g. 192.168.1.1 is the router in 192.168.0.1/255.255.255.0

Then you have the drunk screamer – that is the broadcaster. Think Robin Williams in Good Morning Vietnam! This guy, the biggest in the subnet, gets the last number.

In our example subnet that is 192.168.1.255 (remember IPs start at 0. Thus 0 to 255 = 256 IPs.) Anyway this guy –> “192.168.1.255” is the guy who is like HEY WHO THE HELL IS IN HERE!!!?!?!?!  And now everyone has to reply because they are screaming and we all have to answer!

So that leaves 254 (1router-broadcast=254) available host ips in this block. Further by convention you typically don’t assign the .0 IP so that really leaves 253. Basically it looks like this in

Binary
11111111111111111111111100000000

Hex
FFFFFF00

Octet
255.255.255.0 2⁸ /24 256

/#endKnowledgeShare/