Friday, September 25, 2015

IPv4 and the Binary Breakdown

Had a really good time at school today.

Our Cisco class today consisted of a short lecture than open lab time. I like how our instructor Mr. Stark breaks things down. He really does like to add some humor in a topic that is pretty technical in nature and he also gives the class an opportunity to answer questions that are presented.

Normally I'll have just enough time to jot down some math on a scratch piece of paper to get a response going. Most instructors won't do that, consistently at least, so it shows how patient he is. Which is great because I'm normally asking plenty of questions too.

We were discussing how to break down IP assignments between the network and host portions of an address and how to find the pattern to gather the range of IP's you could assign. The math itself isn't overly complicated but the fact that you have to redo your formula as soon as you move from bit to another bit outside of octets is what was tripping me up a little.

Then he made it SO much easier after we started breaking things down into binary. In a 32 bit address scheme the 4 octets that are separated by dots are really only for humans to figure out what's going on. I'll be honest, I kinda giggled until he explained what he  meant.

So when we look at an IP address we see 192.168.2.1, but a computer just understands binary. So they don't see those dots. So when you break down an IP to binary (I'll use the one from up top here) it looks like this  11000000 10101000 00000010 00000001. Removing the dots in the addressing seemed to make it easier for me to convert.

Here's a table I found that breaks it down by bits in each octet.


Of course this was only half of the solution. There still is the subnet mask which is what will tell a computer which part of the IP address to use as the network and host portions. In some cases it appears that the subnet mask is more important to understand than the IP address itself, because understanding the amount of hosts you can use will determine how large your network can be.

It took me a minute but we did a few more range calculations and it all made sense to me. Then I realized how massive and particular any one network could be.

Here's a video I found if you're interested in really learning this concept step by step.

2 comments: