Hey what's up guys welcome to CertBros. In this video we're going to be
looking at binary. Ok so in the last video we looked at IP addresses what
they are and what they do. In this video we're gonna take it up a notch. Binary is
how computers process data and it's just a whole bunch of ones and zeros. You've
likely seen or heard about binary especially in those cheesy hacker or
cybersecurity videos. It can look intimidating at first but it's actually
very simple. An IP version 4 address is 32 bits long
This means the address is made up of 32 binary digits. Each digit is called a bit
The IP address contains four octets each octet contains eight binary bits. When we
type in an IP address the computer will convert that into binary and to fully
understand how IP addresses work we need to be able to do the same. We're going to
use just one octet for our conversion and then the same process is repeated
for the rest of the IP address. So here we have eight binary bits
These bits can either be a 1 or a 0. So how do we make numbers like 192 from
ones and zeros? Well each bit represents a value
The value doubles in size from right to left this is called the power of two
Using this chart we can see each bit is assigned its own column. It's important
to know that one means on, and zero means off. This means we can turn columns on or
off just by adding either a 1 or a 0. So let's try it. All of our columns
currently have a 0 which means they're all off what value does 8 zeros give us? Well
because all columns are off there's nothing to add up so our binary value is
0 If we turn on the one column by adding a
1, what value does that give us? It gives us one
If we put a 1in the two column that gives us a value of two. Pretty
straightforward so far right? Ok this time let's turn on the 1 and
the 2 column what do we do here? We need to add up all of the columns that have a
1 so our value here would be 3. Hopefully, that makes sense. Let's try one
that's a bit more difficult. Our binary value is 0 0 1 0 1 1 0 1 again we just
need to add up all of our columns. 32 + 8 = 40 + 4 that's 44
+ 1 = 45. So 45 is our number. Ok so now we've gone over the basics
let's bring in an IP address and convert it to binary. Remember there are 8 bits
in each octet so we're going to do this one at a time. The first number in our IP
address is 192 so this is the number we need to generate from our binary bits
We always start with the highest value we can. In this case 128 so we put a 1 in
that column. That leaves us with 64 remaining and that just so happens to be
the next column so we'll add a 1 there as well. This means our binary value for
192 is 1 1 0 0 0 0 0 0. The next number in our IP address is 54
again we start with the highest number possible this time that's 32, that leaves
us with 22, so we can add 16, then we're left with 6, we can get that by adding
the 4 and then the 2 and that's it so the binary value for 54 is 0 0 1 1 0 1 1 0
The next number is 103. If you think you're getting the idea by now try
pausing the video, writing out this power of 2 chart, and trying to work out how to
get 103. It's ok we'll wait. Ok that's long enough.
We start with 64 because that's the highest value we can use, + 32 that
gives us 96. So only 7 left to go. We'll add 4 2 & 1
meaning the answer is 0 1 1 0 0 1 1 1. And the last one to do is 29 so we need
16 8 4 & 1 meaning our last binary value is 0 0 0 1 1 1 0 1 and we have now
converted our IP address into binary. Don't worry though this isn't something
you need to do all of the time but it is extremely important that you understand
how this works especially as we progress. If you're not great with maths again
don't worry. The more you practice this you will start to memorize it. Without
thinking you'll know that 128 + 64 = 192. Ok so moving on
In the last video we spoke about how an IP address is split into a network
section and a host section. The way we know which is which is with a subnet
mask. Our IP is a Class C address so we should know that the default subnet mask
is 255.255.255.0. Previously I said wherever there's a 255 this is the
network section and wherever there is a 0 this is the host of section and that's
true in the simplest form however it can get a bit more complicated than that. The
real way to see which part of an IP address is the network section is by
looking at the subnet mask binary bits. Anytime you see a 1 this bit is the
network section anytime you see a 0 this is the host section. I know it may
seem overkill with this example but as we move on into subnetting is extremely
important you understand how this works. Now instead of a full subnet mask you
will often see it written as a forward slash and then the number of Network
bits. In this case instead of 255.255.255.0 we could write it as /24
This is usually added to the end of the IP address
Let's take a closer look at the host section. You can see we have eight bits
thinking back to our chart how many host addresses can we have with eight bits?
We can have all zeros All ones
or anything in between. 255 is the number we get if we add up all of the columns
this means we have a total number of 256 possible combinations and that's
including zero. There is a catch though
You cannot use the first or last IP address for a host, these are reserved. The first
address in this case 192.54.103.0 is the network address
and the last address 192.54.103.255 is a broadcast address. This is used
to send messages to all computers in this network
So we only have 254 usable hosts. So just remember, you cannot assign the first or
the last address to a host. Ok so that's the basics of binary. We'll be
using this a lot as we go especially when we move on to subnetting. This video
is part of our full CCNA course which can be found in the description so
please feel free to go and check it out. If you like this video don't forget to
give it a thumbs up, comment and subscribe, the support from you guys
really does help the channel grow. Other than that I hope this video helped and
thank you for watching