0% found this document useful (0 votes)
2 views

Introduction to IP Addressing and Binary

Uploaded by

Arixson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Introduction to IP Addressing and Binary

Uploaded by

Arixson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 11

Introduction to IP Addressing and Binary

This is a typical IP address.

Odds are good you've probably seen one of these.

They show up all over the place on our computers every computer on a TCAP IP
network must have a uniqueIP address.

IP addresses are distinct in that it's going to be for values separated by three
dots.

Well I've got a little bit of interesting news for you.

This is actually a lie.

A real IP address is nothing more than 32 ones and zeros.

That's it.

Just ones and zeros on and offs pulses of electricity or light whatever it might
be.

But to show you that I've decided I like to play go.

So I got to go game out and I'm going to represent zeros with little white beads.

I'm going to represent ones with black beads.

So what I have here in front of me is a real IP address.

This is 32 ones and zeros.

And what we need to do in this episode is understand how we can take ones and zeros
and convert them into something like this.

So to do that the first thing you need to appreciate is that there really are no
dots dots don't exist in IP addresses.

They're really just separators.

I mean here's a phone number right here.

Now if you take a look at this phone number would you actually dial an open
parenthesis and a close parenthesis and a dash as part of your dialing process on a
phone.

Of course not.

The reason those are there on a phone number is because human beings need to be
able to use telephones and they're used as separators.

So it's really the same thing with IP addresses.

So in order to go from this down to this we're going to have to go through a


process.

Let me show you how this works.


The first thing you want to do is if you have 32 ones and zeros.

We're going to break them up into four groups of eight so we're just going to
separate these with my hand and there's no particular reason for separating them
into four groups of eight other than it was chosen arbitrarily as a good way to do
this.

So I'm going to just kind of artificially separate them a little bit so we can see
it a little bit better.

Now I've got four groups of eight here.

If you have eight ones and zeros you could have all zeros.

So here we have all zeros.

Or you could have all one's

Or we can have a whole bunch of combinations in between like this is one possible
combination between all zeros and all ones.

This is another possible this is another possible combination.

So is this and this is one as well.

So the whole idea behind dotted decimal notation is that instead of us having to
say things like my IP address is 0 0 0 1 0 0 1 0 0 1 0 0 1 0.

And cause that's really hard to type into a computer.

The dotted decimal notation is nothing more than a shortcut a shorthand that we use
to represent 32 ones and zeros in a row.

So by breaking them into groups of eight we can have different combinations


anywhere from all zeros to all ones with a bunch of combinations in between.

There are exactly two to the eight or 256 combinations.

Now in the IP world we start with zeros so it's 0 to 255 and that's where IP
addresses come from.

It's simply taking eight ones and zeros and converting it into a value that goes
between 0 and 255.

The secret to converting from binary to Dahdah decimal is to take a piece of paper
and remember one number.

Remember 128.

If you can remember that number you can convert this very very easily and you're
going to have to do this on the network plus by the way.

So if you could remember the number 128 you take a piece of paper and then the
upper left hand corner you write in 128 and then you take half of that then half
than half and half and half and half and half.

So if you take a look we've got one two three four five six seven eight locations.

Got it.
All right.

So once you've got this little cheat sheet let's go ahead and pick a value.

So what I'm going to do is 1 1 0 0 0 1 0 1.

So just like that.

So let's go ahead and do that.

Now I'm going to use beads.

But on your piece of paper you could just write ones and zeros directly underneath
each of these letters 0 1 0 1 ok 1 1 0 0 0 1 0 1.

OK.

Now what you have to do at this point is simply take a look and wherever you have a
one you add those values together.

So let's go through the math here.

So 128 we got to 1 there so that gets added plus 64 is 192.

Now we don't add any of these because these are all zeros plus four is one hundred
ninety six.

We don't add the two because that's a zero plus one is one hundred ninety seven.

Congratulations you've just converted 1 1 0 0 0 1 0 1 into the dotted decimal


notation of 197 perfect.

That's great but let's do it a few more times to make sure you get the idea.

I'm going to pick another value.

In this case I'm going to pick 0 0 0 0 1 1 1 0.

Now again you could just write ones and zeroes on the piece of paper to do this for
yourself.

But let's go through the process and remember if it has a zero underneath that we
don't add it.

So we're not going to add 128.

We're not going to add 64.

We're not going to add 32.

We're not going to add 16 or 1.

So it's only these three values.

So eight plus four plus two equals 14.

So 0 0 0 0 1 1 1 0 equals 14 as an octet.
Fantastic.

Let's try it one more time.

And again I'm just going to pick an arbitrary value so this time I'm going to do 1
0 1 0 1 0 1 0 and again you can write ones and zeroes underneath your piece of
paper to do the exact same thing I'm doing with my gobies.

So here we go.

First we'll get rid of the zeros so we're going to add 128 plus 32 and that's 160
plus 8 equals 168.

Plus two equals 170.

So 1 0 1 0 1 0 1 0 equals 170.

Fantastic.

Now there's a couple of these.

After you look at these for a while you start to notice certain things for example
that these were all zeros like that.

Then the answer is going to be zero.

Equally if it's all ones it's 255 it's important.

You should be able to recognize some of these binary values and instantly be able
to convert it into an octet.

So all 00 all ones is 2:55.

If you have just the one followed by seven zeros that's going to be 128.

If you have seven zeros with just the one that's one that's all you need to do to
take any binary value and convert it into an octet.

So if you remember 128 it's really easy to do.

So let's go ahead and reverse the process.

So now what I'm going to do is I'm going to give you an octet value and I need to
be able to convert it into binary.

Don't worry we still use the exact same tool just remember 128.

OK so I've got my little piece of paper with the 128 all the way down to the 1
again.

So let's go ahead and do a couple of examples.

Let's start off with a pick an arbitrary value here between 0 and 255.

Let's do 171.

So to do that let's go through the process so to make this happen.

You start with your initial value 171 and you start on the left and you march over
to the right.

So how many 128 are there in 171.

Well there's exactly one.

So we'll put a one bead there and we subtract 100 in 28 from one hundred and
seventy one and we get the remainder of 43.

So now we march down the next one.

How many 64 are there and 43 will 64 is bigger than 43 so 0.

Then we go to the next value 32.

So how many 32 are there and 43.

Well there is exactly one and we go ahead and do the subtraction.

So we have 43 minus 32 and we have 11.

So we'll keep carrying that 11 along as we go.

So how many 16s are there and 11 hole that's bigger than 11 so there is zero.

So we come to the next eight.

How many Eights are there at 11.

Well there is exactly one leaving the remainder of three.

So how many forms are there in 3 0.

How many tools are there and 3 1 and then that leaves a value of 1 and how many
ones are in one one.

So that's exactly how we go through the process.

So we've taken 171 and we converted it into 1 0 1 0 1 0 1 1.

Fantastic.

Let's try it again this time I'm going to pick another arbitrary value.

You guys get the right place and this time we're going to use the value to 24.

So let's go through the process.

So we start with 2:24 how many 1:28 are there and 2:24.

There's exactly one and that leaves us a value of 96.

So how many Sixty-Four is are there and 96.

Well there's exactly one.

So that leaves us the value of 32.

So we go ahead and take the 32 how many 32 are there and 32.
There's exactly one and not were done.

So all we have to do is throw zeros in for the rest because we don't have the
remainder left to deal with so 2:24 equals 1 1 1 0 0 0 0 0.

Perfect.

Let's do it one more time.

So this time let's pick the value 95.

So we'll start on the far left hand side.

How many 1:28 are there and 95.

Well 128 is bigger than 95 five so there's zero.

So now we have ninety five.

So how many 64 is are there and 95.

Well there's just one so 95 minus 64 equals 31.

How many 32 are there and 31 32 is bigger than 31 so 0.

How many 16s are there and 31 modes exactly one.

And after we do the subtraction we have exactly 15 so that's moved down to the
eights.

How many are there in 15.

There's one and we do the subtraction and now we have seven.

How many fours are there in seven.

One we do the subtraction and now we have three.

How many twos are there in three.

One we do the subtraction.

Now we have one and then we put a one on the end.

So we have just converted 95 into the binary value 0 1 0 1 1 1 1 1.

Fantastic.

It's really important that you know how to convert binary to octets and octets to
binary not just for the network plus but for the real networking world.

Now keep in mind I've shown you how to do it by hand but in reality will use things
like Windows calculator there's apps that you can put on your phone that allow you
to do this conversion very very quickly and easily.

So for the test do it by hand.

But in the real world use a calculator.


Each computer on a TCP/IP network must have a unique IP Address

IPv4 Addresses are written as four octets, such as 192.168.4.12

Each octet represents a binary string; 192, for example, is 11000000

Introduction to ARP (Address Resolution Protocol)

I'm a computer and I've got this IP packet that I want to send to another computer
on my broadcast domain.

Now to do that I can't just send an IP back it by itself.

I'm running.

I don't know say gigabit ethernet so I need to put MAC addresses and make an
Ethernet frame to put this IP packet inside of.

So to do that I'm going to have to get the MAC address of the other computer so
that I can go ahead make an Ethernet frame out of the whole shebang and send it out
so that that computer can get it now to do that I've got a problem.

And the problem is if this is me over here and I want to send it to this guy I may
know his IP address because I've got an IP packet but I don't know his MAC address.

So what I'm going to have to do is go through a process called ARP RPN is a


broadcast that sends out onto a network that says I know your IP address if you
have this IP address please respond back.

So let me show you how all this works.

All right.

Now I've got my small network here.

I've gone ahead and thrown some IP addresses on each one of the computers to help
understand how ARP actually works.

And keep in mind what we're concentrating on is that I've got a IP packet over here
on my computer and I want to get it to this guy.

So I need his MAC address.

So this guy is going to do is he is going to send out an ARP and an ARP is a


broadcast.

So basically all he says is who has 192 168 15 163.

Please tell 192 168 15:23 So he's going to send this out now.

Everybody's going to get this.

It's a broadcast but only one computer the purple computer is going to respond
because that's his IP address and he's going to say oh that's me and here's my MAC
address.

So by doing that when my computer gets that response he can then go ahead and put
the right MAC address.
Send out the ether net frame and send the data to that particular computer.

Now if you think about this for a little bit it would mean that every time I wanted
to talk to any computer on my network I would have to keep RPM and that would seem
to be inefficient.

Would it be a great idea if individual computers kept a list of all the different
IP addresses on their network as well as the MAC address.

Well they do and you can actually do an ARP command within windows to see the cache
of what your computer has kept track of.

So let me show you how this works.

So here I am at a command prompt.

And to run it I just type ARP space minus A.

That means show me what's stored.

Now when I run this you'll see that it's kept a bunch of IP addresses for computers
within my local area network.

You'll see some are dynamic.

I want you to ignore the static ones for right now let's just concentrate on the
dynamic ones.

These are stored within your computer and it'll keep these for a few minutes.

So if you do an ARP minus A on your computer you may not see as much so you might
find yourself having to you know go out to web browser or pinging other computers
or something to actually have ARP minus A show you anything.

Anyway the important thing for network plus is that if you want to see your ARP
cache you have to use the ARP space minus A command.

So that's what ARP is all about.

Art or address resolution protocol is simply what your computer uses when it has
the IP address and it needs to know the Mac.

Make sure you know ARP minus A for the network plus

ARP resolves IP addresses

ARP is what a computer uses when it knows the IP address, but needs the MAC address

Type ARP/arp -a to see the ARP cache

ARP requests are broadcast over a network

Subnet Masks

I've got a little network right here in front of me.

Now if you take a look at this network first of all I got one two three four
computers on this network and they're all plugged together into the switch in the
center.

But I also have a router.

Now this router also has an IP address because routers always have an IP address.

That's part of one local area network but it also has another IP address which I
don't have on here right now.

That helps to go out into the big Internet.

Now here's the issue, now we know about ARP from the previous episode but the
challenge we have is how do we arp.

For example if this computer right here wants to talk to this computer right here
he would normally just broadcast out in arp get the IP address and everything would
be great.

However what does this computer right here what's to talk to somebody way out on
the Internet.

In that case he's still going to have to ARP but he's going to have to ARP to get
to his default gateway to his router.

So what we need is something built into every network that identifies it as its own
local area network and also a mechanism that allows an individual computer to
determine hey if I'm talking to this ip address this is a local call.

Just go ahead and arp.

However if it's a long distance call go ahead and talk through your default gateway
through your router to get out to the Internet.

And that's where your subnet mask really comes into play.

Now to help get us all wrapped around on this concept I've got something laid out
right here I'd like you to take a look at.

Now what we're looking at down here is what we're going to call my network ID the
network ID is the part of the network numbering system that has to be identical for
every computer on this particular network.

Now on my network which I've decided to set up this way all the computers are going
to be 232 25 208.

And then here I put zero.

The idea behind this is that when I'm setting up these network IDs no computer can
have just a zero as part of its numbering system because it's reserved for what we
call the network ID so I could have a computer in this network ID that's called a
232 7:35 dot 14 but no computer could be called 2:32 25 to 0 8 0.

That's reserved for this network ID.

Now the part over here that changes for every individual computer is going to be
called the host ID.

So what I'm going to do is I'm going to put a little skewer here to kind of
separate it and that's where this guy called the subnet mask comes into play a
subnet mask is a string of ones followed by a certain number of zeros.

Everywhere there is a one.

The numbers have to stay the same anywhere there's a zero you can change the
values.

So in this particular case our subnet mask is going to be 255 255 255 0 I need to
warn you about something for a minute.

Always remember computers don't use the dotted decimal notation.

It's just for us human beings when we type in 255 255 255 0 in our computers he
instantaneously changes it into what it really is 24 ones followed by eight zeros.

So let's take a look at this example one more time.

Now in this particular example the way we've gotten it set up is that the first
three numbers are identical.

And then the last number can be anywhere from 1 to 254.

We can't use 0 and we can't use 255.

But watch this.

So what I've done here is I've replaced the third set of ones with all zeros so and
good.

Get the right value in there.

And what we now have is a subnet mask of 255 255 0 0.

Now as you're looking at this stuff there's one thing you need to keep in mind we
always use these terms to find files and zeros.

But we know that the computer just uses all ones and zeros.

So what we can do is we can simply instead of say 2 5 5 2 5 5 2 5 0 or 2 5 5 5 5 0


0 we can talk like the cool kids and simply count the number of ones.

So taking a look at this will see we've got 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16.

So what is commonly done is that we simply say this is a whack 16 subnet that
little slashes what I call a whack and that is common terminology so you want to
get used to it.

The cool part now is that when we change the subject mass to something like this we
could literally if we wanted to say only the first two numbers have to be the same.

You can use any other 2 numbers that you want to use that doesn't matter because
they're all going to work.

So with a whack 16 subnet that means only the first two digits have to be the same
for all the computers.

So our network ID could be anything from I guess 232 . 25 dot 1.1 to 32 dot twenty
five dot 255 that 254.
I mean think how many different computers we could have on this little tiny
network.

So usually the subnet mask gets smaller for really huge networks and it gets longer
like a whacked 24 2 5 5 2 5 5 5 5 0 for smaller networks.

In fact we know these things ahead of time for example if we use a whacked 24
subnet mask to remember 2 5 5 2 5 5 2 5 0 we get exactly 254 hosts.

So that means the smallest network at least based on what we know so far we could
make would have up to 254 hosts.

Remember you can't use 0 or 255.

OK.

So this really makes things a big deal when it comes to making these subnets.

Right.

At what we call the dots where it's only two high fives and zeros.

We've got other episodes coming up where we're going to make it a little bit more
interesting.

So basically in order to make our network work all of the computers within this one
broadcast domain within this one network ID are all going to have to have the same
subnet mask and wherever there's a 2:55 in the subnet mask they're going to have to
have the exact numbers.

Now this gets put into every computer in existence.

So what I want to do right now is take a moment and walk you through a Mac a
Windows system in a Linux box to see where these numbers exist on your computer.

Each host needs a subnet mask

The host uses the subnet mask to know if the destination is on the local network or
a remote network

Each host knows the default gateway so that it can forward traffic to remote
networks

You might also like