Вы находитесь на странице: 1из 26

IP Addressing

IP Addressing
Basic Addressing Working with Addresses Summarization & Subnets VLSM Working with VLSM Networks Classful Addressing Working with Classful Addressing

Basic Addressing
IP addresses are written in dotted decimal format. Four sections are separated by dots. Each section contains a number between 0 and 255.
Dots separate the sections
10.1.1.1

Each section contains a number between 0 and 255

Basic Addressing
Why is each section a number between 0 and 255?
Computers operate in binary, humans operate in decimal. Computers treat IP addresses as a single large 32 digit binary number, but this is hard for people to do. So, we split them up into four smaller sections so we can remember and work with them better!

Dots separate the sections


10.1.1.1

Each section contains a number between 0 and 255 Why????

Basic Addressing
10.1.1.1

32/4 == 8. 00001010 00000001 00000001 00000001 28 = 256. 8 8 8 8 But, computers number 32 starting at 0, so to make a space of 256 numbers, we Each 8 digit group represents a number between 0 and 255 number from 0 to 255.

Basic Addressing
Each device on a network is assigned an IP address. Each IP address has two fundamental parts:
10.1.1.1

The network portion, which describes the physical wire the device is attached to. The host portion, which identifies the host on that wire. How can we tell the difference between the two sections?

00001010 00000001 00000001 00000001

Network

Host

Basic Addressing
The network mask shows us where to split the network and host sections. Each place there is a 1 in the network mask, that binary digit belongs to the network portion of the address. Each place there is a 0 in the network mask, that binary digit belongs to the host portion of the address.
10.1.1.1

00001010 00000001 00000001 00000001

11111111 11111111 11111111 00000000

Network
255.255.255.0

Host

Basic Addressing
An alternative set of terminology is:
The network portion of the address is called the prefix. The host portion of the address is called the host. The network mask is expressed as a prefix length, which is a count of the number of 1s in the subnet mask. 10.1.1.1

00001010 00000001 00000001 00000001

11111111 11111111 11111111 00000000

Prefix

Host

= 24

10.1.1.1/24

Basic Addressing
The network address is the IP address with all 0s in the host bits. The broadcast address is the IP address with all 1s in the host bits. Packets sent to either address will be delivered to all the hosts connected to the wire.
10 00001010
prefix

1 1 000000011 00000001

0/24 00000000
host

these bits are 0, so this is the network address 10 00001010 prefix 1 1 000000011 00000001 255/24 11111111 host

these bits are 1, so this is the broadcast address

Working with Addresses


Two of the most common questions you are going to face when dealing with IP addresses are:
Whats the network? Whats the host?

192.168.100.80/26 ????

How dow we figure this out?

Working with Addresses (The Hard Way)


First, convert the IP address into binary. This is easier than it looks. Work with one octet at a time. Divide by two, farm out the remainder on the side. The bottom is the binary MSD, the top the binary LSD.
192 96
divide by 2 remainder divide by 2 remainder divide by 2

0 0 0 0 0 0

48
24 12 6 3 1 0

remainder
divide by 2 remainder divide by 2 remainder divide by 2 remainder divide by 2 remainder divide by 2 remainder

Left

Right

Working with Addresses (The Hard Way)


Write down the IP address.

11000000 10101000 01100100 01010000 192 168 100 80

If you have a prefix length, just wrote down the number of 1s. If you have a network mask, computer the binary as with the IP address.
AND these two. Convert back to dotted decimal. This is the network address.

11111111 11111111 11111111 11000000 8 +8 +8 +2 == 26

11000000 10101000 01100100 01000000 192 168 100 64

Working with Addresses (The Hard Way)


Write down the IP address.

11000000 10101000 01100100 01010000 192 168 100 80

If you have a prefix length, just wrote down the number of 1s. If you have a network mask, computer the binary as with the IP address.
NOR these two. Convert back to dotted decimal. This is the host address.

11111111 11111111 11111111 11000000 8 +8 +8 +2 == 26

00000000 00000000 00000000 00010000 0 0 0 16

Working with Addresses (The Hard Way)


To convert from binary to decimal, use a simple chart. Add the number indicated for each 1 set in the binary number.
128 64 1 0 128 0

32
16 8 4 2 1

1
0 1 0 0 0

32
0 8 0 0 0 168

Working with Addresses (The Easy Way)


First, if you are using a network mask, convert it to a prefix length. For each octet in the network mask that is 255, add 8 to the prefix length. For the one octet that isnt 255, convert to binary and add the right number of bits--or use a chart!
192 == 11000000

255.255.255.192 8 +8 +8 +2 == 26

Working with Addresses (The Easy Way)


Take the prefix length and divide by 8. Take the resulting number, and ignore those octets out of the IP address--these are all part of the network address! Were going to use the remainder to find the fourth octet of the network address.
192.168.100.80/26

These three octets are part of the network 26/8 == 3 (remainder 2)

The remainder tells us what the network address in the fourth octet is

Working with Addresses (The Easy Way)


Take the remainder, and find the corresponding multiple on the chart; in this case, 64. The largest multiple of 64 that will fit into 80 is 64, so the network is 64. Add the three octets we set aside earlier, and the network (prefix!) is 192.168.100.64/26. 80 - 64 == 16, so the host address is 16.
Remainder == 2
8 7 6 5 4 3 2 1

1 2 4 8 16 32 64 128

64 x 1 == 64 64 x 2 == 128 Network is 64! 192.168.100.64/26 80 - 64 == 16 16 Hosts!

Working with Addresses (The Easy Way)


How many hosts are in this network? The remainder tells us there are 64 addresses, minus the network and broadcast addresses, so 62 hosts. To find the broadcast address, subtract 1 from the number of hosts, and add that number to the network address. The key is to work in octets, rather than trying to work with the entire IP address at once! Remainder == 2
8 7 6 5 4 3 2 1

1 2 4 8 16 32 64 128

64 addresses 64 - 2 == 62 hosts
64 + (64 - 1) == 127 192.168.100.127 is the broadcast address

Working with Addresses (The Easy Way)


What if the prefix length is less than 24?
192.168.100.80/22

Take the prefix length and divide by 8. Take the resulting number, and ignore those octets out of the IP address--these are all part of the network address! Were going to use the remainder to find the third octet of the network address.

These three octets are part of the network 22/8 == 2 (remainder 6)

The remainder tells us what the network address in the third octet is

Working with Addresses (The Easy Way)


Take the remainder, and find the corresponding multiple on the chart; in this case, 4. The largest multiple of 64 that will fit into 80 is 64, so the network is 64. Add the two octets we set aside earlier, and make any octets after the network 0s (the fourth octet). The network (prefix!) is 192.168.100.0/22.
Remainder == 6
8 7 6 5 4 3 2 1

1 2 4 8 16 32 64 128

4 x 25 == 100 4 x 26 == 104 Third octet is 100! Set the fourth octet to 0. 192.168.100.0/22

Working with Addresses (The Easy Way)


To find the number of hosts, take the number of octets set to 0, which is 1 in this case (the fourth octet), and multiply by 256. Next, take the number relating to the remainder from the chart, and multiple this by the number we just found above. Subtract two.
0 octets == 1 1 x 256 == 256 Remainder == 6
8 7 6 5 4 3 2 1

1 2 4 8 16 32 64 128

4 x 256 == 1024 1024 2 == 1022 hosts

Working with Addresses (The Easy Way)


The key is to work in octets, rather than trying to work with the entire IP address at once!

Summarization & Subnets


A single network address (prefix!) represents a set of hosts attached to a wire. We can abstract this, and simply say that a prefix represents a set of reachable addresses. We can say that weve summarized information about the hosts attached to the physical wire by referring to the entire group as a single network.
10.1.1.2 10.1.1.4 10.1.1.7 10.1.1.8

10.1.1.0/26

Summarization & Subnets


In effect, weve shortened the network part of the address (prefix!), and lengthened the host portion of the address, in effect describing more hosts (destinations) in a single address. If we can shorten the prefix length to describe multiple hosts with a single network address, why cant we shorten the prefix length so a single network address describes two networks? We can! Its called address summarization, or just summarization. 10.1.1.2/32 10.1.1.4/32 10.1.1.7/32 10.1.1.8/32 10.1.1.0/26 10.1.1.64/26 10.1.1.0/25 These networks are described by this network These host addresses are described by this network

Summarization & Subnets


10.1.1.0 through 10.1.1.31.

10.1.1.32 through 10.1.1.63.

00001010 10 11111111 00001010 10 11111111

00000001 1 11111111 00000001 1 11111111

00000001 1 11111111 00000001 1 11111111

00000000 0 11000000 01000000 64 11000000

10.1.1.0 through 10.1.1.63, so its the same space!

00001010 00000001 00000001 00000000 10 1 1 0 11111111 11111111 11111111 10000000

Changing the mask bit from 1 to 0, which shortens the prefix length, means the bit in the two networks that distinguish them from one another are now considered host bits!

Summarization & Subnets


A network which is a part of another network is called a subnet. There is another term, the supernet, but its definition depends on whether you are using VLSM subnetting, or calssful subnetting, so it will be defined in the next two sections.
10.1.1.2/32 10.1.1.4/32 10.1.1.7/32 10.1.1.8/32 10.1.1.0/26 10.1.1.64/26 10.1.1.0/25 These networks are subnets of this network These host addresses are subnets of this network

Вам также может понравиться