## What You Need to Know of The *IP Address*

### What’s the Deal with The IP Address Range?

#### What You Need to Know of the IP Address Range

What of the **IP Address**** Range**

This time we’re doing an understanding of an IP address.

### What is an IP Address, For Pete’s sake?

Well here you see the tcp/ip settings network connection details from a computer running the Windows 7 operating system.

Now you’ll notice this says ipv4 settings. There’s two types of IP addresses ipv4 and ipv6. We’re going to focus here on ipv4 which is often just known as an ipaddress.

ipv6 will be covered separately.

### So:

… here you see the ipv4 address 192.168.1.1 and then you also see the ipv4 subnet mask of 255.255.255.0. Let’s take a look at the output of the command show interface G 0/0 on a cisco router.

And this is just showing us the parameter set for this particular interface. But it’s really kind of the same thing as we saw in the windows 7 computer.

### Here we see the Internet address:

This is the ipv4 address of 192.168.1. 0. 1. But then there’s this strange slice 24 at the very end. and that is simply another way of indicating the subnet mask.

And it means exactly the same thing as what we saw in the previous image, where we had a subnet mask of 255.255.255.0

We’ll get into the significance of that and what those different types of notation mean as the article progresses. But for right now just know that slice 24 is another way of expressing the subnet mask of 255.255.255.0

When we talk about IP addresses we have to talk about two different types of ip addresses.

### There’s the…

Host or Node ip address and then there’s a network address. We’re going to use the term host and node synonymously that mean exactly the same thing but very very close.

So we’ll just we’ll use them synonymously for the purpose of the excercise.

and a host or a node is a single

entity on a network running the internet net’s

Protocol or IP in this case ipv4 and a

network address represents a whole group

of hosts such as what you see in the

graphic a good way to think about it is

to compare it to telephone numbering

where the phone number 206 555 one two

one two in this case represents a single

entity on a telephone network and the

area code 206 represents a whole bunch

of local phone numbers multiple entities

on the network now let’s go to an

example here we see an ipv4 address this

is just some random IPv4 addresses that I chose

208 dot 79.1 15.3 each one of those

sections is called an octet or a byte

and the reason they’re called octet sore

bytes is because they map to 8-bit

binary numbers and there’s 8 bits in a

byte now a bit is simply a contraction

of the term binary digit in every IP

address ipv4 address anyway is made up

of a total of 32 bits divided into four

sections again called octet s– or bytes

bits exist in one of two states they’re

either on in which case they’re

represented by a one or often which case

they’re represented by a zero let’s take

a look at an example

so we’ll just pull one group of bits out

of this ipnet address and it could be all ones

like what you see here it could be all

zeros or it could be a combination of

ones and zeros such as what you see here

now how does it work well every bit has

a corresponding decimal value ranging

from 1 to 2 to 4 to 8 16 to 32 to 64 to

128 and to determine the decimal value

of the byte we simply add up the decimal

values of each of the bits that are

turned on so let’s take a look at an

example here the two-bit and the one

bitter turned on we simply add two plus

one and we get a byte value of three so

the decimal value of this entire byte is

three because the one bit and the two

bitter the only bits that are turned on

here’s another example

in this case the four bit and the two

bitter turned on we add those together

four plus two equals six of the decimal

value of the byte is six and one final

example in this case the 32-bit and the

two bitter turned on thirty two plus two

equals thirty four and that is the

decimal value of this byte now in the

real world you may see five or six bits

turned on but same thing you just add up

the decimal values of the bits that are

turned on to get the decimal value of

the byte now let’s dissect that I dress

a little more as I mentioned each one of

the bytes represents an 8-bit binary

number so 208 maps to 1 1 0 1 0 0 0 0 79

maps to 0 1 0 0 1 1 1 1 1 15 maps to 0 1

1 1 0 0 1 1 and 3 maps to 0 0 0 0 0 0 1

1 well let’s see if we can figure out

exactly how we arrived at these numbers

so let’s start with the leftmost bite

the too late too late as we said maps to

this binary number but let’s take a look

at it a little more closely here you can

see the 128 bit is turned on the 64 bit

is turned on and the 16 bit is turned on

so we simply add 16 to 64 which gives us

a value of 80 and then we add that to

128 well 128 plus 80 equals 208 and

that’s where the byte value of 208 comes

from it’s really pretty simple as you

can see let’s take a look at 79 0 1 0 0

1 1 1 1 let’s take a look at where that

comes from in this case the 1 bit the 2

bit the 4 bit the 8 bit are turned on as

is the 64 bit so 1 plus 2 equals 3 plus

4 equals 7 plus 8 equals 15 plus 64

equals 79 now let’s take a look at 115

and in this case the 64 bit is turned on

the 32 bit is turned on the 16 bit is

turned on the to bit is turned on and

the 1 bit is turned on 1 plus 2 equals 3

plus 16 equals 19

plus 32 equals 51 plus 64 equals 115 and

yes by the way we usually do add them up

from

right to the left now let’s do the last

one this is pretty simple but you could

do this one in your head in this case

the one bit and the two bitter turned on

therefore the bite value is a total of

three before we go any farther I think

it’s important to mention that in the

early days of the Internet the IPv4 addresses

space was divided into five classes

three of which were used in commonly

applied IP addresses Class A B and C now

the significance of this is that Class A

ip addresses were assigned to networks with

a large number of nodes in this case you

can see a little over 16 and a half

million nodes per network were supported

we use the number one through 126 to

identify it as a Class A in that first

octet and then we use the last three

octaves for the host portion of the

IPv4 addresses so the first octet was used for

the network portion and the last three

for the host next we’ll take a look at a

Class B which was used for medium-sized

networks in this case it supports sixty

five and a half thousand hosts

approximately while we use the first two

octets for the network portion the last

two for the hosts that first octet has

to fall within the range of 128 to 191

that identifies it as a Class B and then

for a Class C the first octet has to

fall within the range of 192 to 223

inclusive and we use the first three

octets for the network portion and the

last one octet the fourth octet for the

host portion now you may wonder where

these strange numbers come from and

there’s a very important formula that I

want to introduce you to it’s one that

you’re going to go back to time and time

again and it is two to the power of n

minus 2 2 because we’re dealing with a

base 2 number system to the power of n

where n equals the total number of bits

were working with and minus 2 because of

internet net’s rules that we’ll talk about in

a different video so if you think about

the class a network you’ll notice that

there are three octets that make up the

host portion of the ipnet address how many

bits are in each of those octet s– you

said eight you got that correct so that

gives us a total of how many bits to

work with for the host portion of a

Class A ip address the answer is 24

if we take two to the power of 24 it

gives us 16,777,216 we subtract two and

that’s where that number comes from so

anytime you want to know the total

number of hosts available on a network

you take a look at the total number of

host bits take two to the power of

whatever that number is in this case 24

subtract two and that tells you how many

hosts or nodes you can have per network

so what do you suppose the formulas for

a class be if you said two to the power

of 16 you’d be right

well two to the power of 16 minus 2

gives us 65535 and for a Class C it’s 2

to the power of what well if you said 8

you get it right and it would give us 2

to the power of 8 minus 2 or 254 nodes

per network now as I said this this

formula 2 to the power of n minus 2 is

an important one that we’re going to

come back to time and time again as we

work on IP addresses for now just know

that maybe write it down in red so

you’ll be able to come back to it easily

in the future now you may also wonder

where those first octet values come from

and it’s from the leading bit pattern

and we’re not going to go into a lot of

detail on this but I did want to include

this graphic so that you could see where

it comes from a Class A ip address always

has a leading bit of zero so the

leftmost bit is always zero therefore

the first octet has to fall within the

range of 0 to 127 inclusive because of

internet net’s rules we limit it to 1 to 126 a

Class B the first two bits are always

one zero which mathematically would give

us a first octet value of 128 through

191 inclusive couldn’t be anything else

and for a Class C the first three bits

are always 1 1 0 which gives us a first

octet value of 192 to 223 inclusive

again can’t be anything else

now earlier we did the binary conversion

where we went from binary to decimal now

let’s go from decimal to binary and the

way we’re going to do this is with the

table which you see on screen right now

and the rows in the table represent the

octet of the IP address that we’re going

to convert and the columns represent the

decimal values of each of the bits in an

8-bit binary

number so the first thing we do is we

ask ourselves can we subtract 128 from

200 the answer is yes so we put a 1 in

the 128 s column that leaves us with a

remainder of 72 can we subtract 64 from

72 yes so we put a 1 in the 64’s column

that leaves us with a remainder of 8 can

we subtract 32 from 8 the answer is no

so we put a 0 there what do you suppose

goes in the 16s column well if you set a

0 you’d be right we’re still dealing

with that remainder of 8 can we subtract

8 from 8 sure so we put a 1 in the

eights column and that leaves us with a

remainder of 0 so we put a 0 in each of

the 3 remaining columns now let’s do 191

and I’ll show you a really cool trick

can we subtract 128 from 191 sure so we

put a 1 in the 128 column leaving us

with a remainder of 63 can we subtract

64 from 63 no so we put a 0 there but

look what we put in the remaining

placeholders all ones and the reason is

simple this is the trick because anytime

you have consecutive ones from least bit

to greatest bit the value is always

going to be one less than the next

highest bit for example one plus two

equals three one less than four 1 plus 2

plus 4 equals 7 one less than 8 and so

on therefore one plus two plus four plus

eight plus 16 plus 32 has to equal 63

it’s very cool try this the next time

you’re at a cocktail party show them

they’ll be impressed

let’s try 127 now can we subtract 128

from 127 nope so we put a 0 there and

ones in the remaining placeholders now

before we go on let me ask a question

suppose instead of an eight bit binary

number in which the highest order bit is

128 what if we had a nine bit binary

number what would the highest order bit

value be there well it would be double

128 or 256 therefore if you have an 8

bit binary number in which all of the

bits are turned on what is its value

remember it’s going to be one less than

the next highest bit or in this case 255

now is that a number we see frequently

sure you see it a lot especially in a

subnet mask right

just remember that that anytime you see

an 8-bit binary number in which all of

the bits are turned on it has a value of

255 and conversely anytime you see a

value of 255 that represents 8 bits all

turned on in binary now let’s do 65 can

we subtract 128 from 65 nope so we put a

zero there what goes in the 64’s column

well it’s a 1 and we put a 0 in each of

the remaining placeholders until we get

to the very last one where we put in a 1

so the binary equivalent of 200 dot 191

dot 120 7.65 is what you see at the

bottom of the screen and about now you

should be asking yourself one of three

questions maybe all three so what who

cares what’s in it for me

well let’s see if we can answer that

with every ipaddress there’s always a

what a subnet mask right and what’s the

point of the subnet mask what does it do

well let me see if I can explain it what

classes that ip address 200 dot 1 91 dot

120 7.65 that is a Class C ip address we

know that because of the value of the

leading octet the leftmost octet which

falls within the range of 192 to 223

inclusive that makes it a Class C how

many bits make up the network portion of

a Class C ip address by default

remember that table that we had earlier

and it’s always 24 bits that make up the

network portion of a Class C ip address by

default how many bits are turned on in

the subnet mask well let’s see 255

always equals 8 bits turned on right so

255 255 255 let’s see that’s three

octets each of eight bits 3 times 8 is

24 there’s 24 bits turned on in the mask

do we see a correlation here if the bits

are turned on in the mask the

corresponding bits in the IP address our

network bits in this case bits 1 through

24 are turned on in the mask

therefore bits 1 through 24 in the ipaddress

our network bits this is

important for you to remember in order

for two nodes to communicate on an IP

network the network bits of their IP

address must match or a

router must be placed between them now

let’s take a look at an example that may

kind of throw a wrench in the works but

it’s the same concept look what happened

here the network architect stole two

bits from the host portion of the

ip address now we have a subnet mask of

255.255.255.0 192 what does that mean

well that simply means that we’ve

extended the mask by 2 bits into the

host portion of the ip address if you think

about it the only two bits that could be

turned on to equal 192 are the 128 and

the 64 bit so those are the only two

that could result in in that number

therefore those two are turned on and

now what we have is we still have a

major network number of 200 190 1.1 27

but look at the value of the bits turned

on between the two lines in the IP

address it’s the second of the first two

bits the 128 bit is not turned on but

the 64 bit is therefore the value of the

bits between the two lines is 64 and

that is our new entity called a subnet

ID now the subnet ID you can really

think of as just a sub Network in fact

that’s where the term subnet comes from

it comes from the sub Network of the

larger Network now our host ID in this

case is 1 we had 1 to 64 to get the

fourth octet value of 65 but what’s not

so clear to the eye is where the

dividing line is between network and

host and in this case it’s between bits

26 and 27 you run into this from time to

time and what you need to understand is

that in order to know where the dividing

line is you have to understand how the

subnet mask works now in the real world

you’ll probably use a 7/8 calculator but

if you’re thinking about taking a test

like Network Plus or the Cisco CCNA you

can’t take a subnet calculator into the

room with you so you’ll have to

understand how this works so what’s very

important for you to understand is that

the subnet mask identifies which bits in

the IP address our network bits and

pit’s or host bits and whether it’s

expressed in traditional dotted decimal

notation like 255.255.255.0 or in the

modern what’s called cider or classless

inter-domain routing notation a slash 24

it means exactly the same thing it means

that the first 24 bits are turned on the

first 24 bits are network bits and you

may see a slash 18 but all that means is

that the first 18 bits are turned on and

the last 14 would be host bits so the

first 18 would be network the last 14

would be host but again the most

important thing to remember is that

subnet masks identify which bits in the

IP address are Network bits and which

bits are host bits in subsequent videos

we’ll talk about how you can use that

understanding in routing and an access

control list and in almost every other

**ip address range** aspect of a router operation.

## Leave a Reply