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

BASIC IP

ADDRESSING
AND
SUBNETTING
By
John Abasiene

IP Addressing and
Classless Subnetting

OVERVIEW
IP Addresses.
IP versions and IPv4 addresses.
Classful Subnets.
Private Addresses.
IP address assignment.
Classless Subnetting
10/12/16

Introduction
An Internet Protocol address(IP address)
is a numerical label.
Each device participating in a computer
network that uses the Internet Protocol
for communication has this address
IP address serves to identify the host
and also a location address.
IP gives us three important paradigms:
Name-What we seek
(www.federalpolyede.edu.ng)
Address-The location of the resource
Route-How to get there
10/12/16

IP versions
IP has two versions. IPv4 and IPv6
IPv4 consists of 32bits divided into four
(4)octets separated by dots(.)
Bits are converted to decimals to yield
the conventional IP addresses.
IPv6 consists of 128bits divided into 8
groups of 16bits each and separated by
full colon (:)
Bits in each group are further converted
to hexadecimal to ease readability.
See examples of IPv4 and IPv6 in next
slide
10/12/16

IPv4

IPv6

10/12/16

Classful Subnets
IP addresses are divided into two parts
(Network address and Host
addresses).
Higher order bits make up the network
part.
The first three bits pattern defines the
various classes of the network address.
For IPv4, there are five classes of IP
Size
Addresses
Class Size
A, B,Number
C, D, EStart
Leadin
ofnetwork
Class

g
bits

numberbi
t field

ofrest
bit field

of
networks

address

End address

24

128 (27)

0.0.0.0

127.255.255.255

10

16

16

16,384
(214)

128.0.0.0

191.255.255.255

110

24

2,097,15
2 (221)

192.0.0.0

10/12/16
223.255.255.255

Private IP addresses
Due to security and the depleting IPv4
addresses, Private addresses were
reserved in each of the useable classes.
These addresses were not routed
through the internet.
When such private networks connect to
the Internet network address translation
(NAT) is used.
Start

End

No. of addresses

24-bit block (/8


prefix, 1 A)

10.0.0.0

10.255.255.255

16777216

20-bit block (/12


prefix, 16 B)

172.16.0.0

172.31.255.255

1048576

16-bit block (/16


prefix, 256 C)

192.168.0.0

192.168.255.255

65536

10/12/16

IP Address Assignment
There are two methods of assigning IP
addresses.
Static Addressing - IP addresses are
manually assigned to devices by an
administrator
Dynamic Addressing IP addresses are
assigned dynamically from a pool of
addresses in a Dynamic Host
Configuration Protocol (DHCP) server

10/12/16

Classless Subnetting
Network
172

Network

Network
16

Network

Host

Host

Subnet

Host

Subnetting is the process of borrowing bits from the HOST bits, in order
to divide the larger network into small subnets.
Subnetting does NOT give you more hosts, but actually costs you hosts.
You lose two host IP Addresses for each subnet, and perhaps one for the
subnet IP address and one for the subnet broadcast IP address.
You lose the last subnet and all of its hosts IP addresses as the
broadcast for that subnet is the same as the broadcast for the network.
In older networks, you would have lost the first subnet, as the subnet IP
address is the same as the network IP address. (This subnet can be
used in most networks.)
10

Analogy

Dividing the barrel of apples into small


barrels or baskets does not give us
any more apples

11

10 barrels x 10 apples = 100 apples

100
Apples
(10 * 10)

10

10

10

10

10

10

It is the same as taking a barrel of


100 apples and dividing it into 10
barrels of 10 apples each.

10

10

10

10

12

100 2 apples = 98 Usable Apples

98
Apples
(100 2)

Before subnetting:
In any network (or subnet)
we can not use all the IP
addresses for host
addresses.
We lose two addresses for
every network or subnet.
1. Network Address - One
address is reserved to that
of the network.
2. Broadcast Address One
address is reserved to
address all hosts in that
network or subnet.
13

10 barrels x 8 apples = 80 apples


8

8
(less 2)

80 Apples
10 * (10 2)

8
(less 2)

8
(less 2)

8
(less 2)

8
(less 2)

(less 2)

(less 2)

8
(less 2)

(less 2)

In subnetting we will see that we continue


to lose two apples per subnet, one for the
address and one for the broadcast.
14

10 barrels x 8 apples = 80 apples


--8

(less 2)

64 Apples
8 * (10 2)

8
(less 2)

8
(less 2)

8
(less 2)

8
(less 2)

(less 2)

(less 2)

8
(less 2)

We might also lose the last basket of apples,


subnet, as it contains the broadcast address for
the entire network.
In older networks, we might also lost the first
basket, subnet, as it contained the address of the
entire network, but this is usually no longer the
case.

(less 2)

X
15

--8

Subnet Example

Network address 172.16.0.0 with /16 network mask


Network
172

Network
16

Host

Host

16

Subnet Example
Network address 172.16.0.0 with /16 network mask
Network
172

Network
16

Host

Host

Using Subnets: subnet mask 255.255.255.0 or /24


Network

Network

Subnet

Host

Network Mask:
255.255.0.0 or /16

11111111

11111111

00000000

00000000

Subnet Mask:
255.255.255.0 or /24

11111111

11111111

11111111

00000000

Applying a mask which is larger than the default subnet


mask, will divide your network into subnets.
Subnet mask used here is 255.255.255.0 or /24

17

Subnet Example
Network address 172.16.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24
Network

Network

Subnet

Host
Subnets

172

16

Host

172

16

Host

172

16

Host

172

16

Host

255
Subnets

172

16

Etc.

Host

28 - 1

172

16

254

Host

172

16

255

Host

Cannot use last


subnet as it
contains
broadcast
18
address

Subnet Example
Network address 172.16.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24
Network

Network

Subnet

Host
Subnets
Addresses

172

16

172

16

172

16

172

16

255
Subnets

172

16

Etc.

28 - 1

172

16

254

172

16

255

Cannot use
last subnet as
it contains
broadcast 19
address

Subnet Example
Class B address 172.16.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24
Network

Network

Subnet

Hosts

Hosts
Addresses

172

16

254

172

16

254

172

16

254

172

16

254

172

16

Etc.

254

172

16

254

254

172

16

255

Host

Each subnet
has 254 hosts,
20
28 2

Subnet Example
Network address 172.16.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24
Network

Network

Subnet

Host
Broadcast
Addresses

172

16

255

172

16

255

172

16

255

172

16

255

255
Subnets

172

16

Etc.

255

28 - 1

172

16

254

255

172

16

255

255

Cannot use last


subnet as it
contains 21
broadcast

Subnet Example
Network address 172.16.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24
172.16.0.0/24

172.16.5.0/24

172.16.10.0/24

172.16.25.0/24

22

Important things to remember about


Subnetting
You can only subnet the host portion, you do not have
control of the network portion.
Subnetting does not give you more hosts, it only allows
you to divide your larger network into smaller networks.
When subnetting, you will actually lose hosts:
For each subnet you lose the address of that subnet
For each subnet you lose the broadcast address of
that subnet
You may lose the first and last last subnets
(coming)
Analogy: Large barrel of 100 apples.
Why subnet?
Divide larger network into smaller network.
Limit layer 2 and layer 3 broadcasts to their subnet.
Better management of traffic.

23

Subnetting Example #1 (on the board)


Host IP Address: 172.16.18.33
Network Mask: 255.255.0.0
Subnet Mask: 255.255.255.0
Given the following Host IP Address, Network Mask and Subnet
mask find the following information:
Major Network Information
Major Network Address
Major Network Broadcast Address
Range of Hosts if not subnetted
Subnet Information
Subnet Address
Range of Host Addresses (first host and last host)
Broadcast Address
Other Subnet Information
Total number of subnets
24
Number of hosts per subnet

Subnetting Example #2
Host IP Address: 138.101.114.250
Network Mask: 255.255.0.0
Subnet Mask: 255.255.255.192
Given the following Host IP Address, Network Mask and Subnet
mask find the following information:
Major Network Information
Major Network Address
Major Network Broadcast Address
Range of Hosts if not subnetted
Subnet Information
Subnet Address
Range of Host Addresses (first host and last host)
Broadcast Address
Other Subnet Information
Total number of subnets
25
Number of hosts per subnet

Host IP Address:
138.101.114.250
Network Mask:
255.255.0.0
Subnet Mask:
255.255.255.192

Major Network
Address: 138.101.0.0
Major Network
Broadcast Address:
138.101.255.255
Range of Hosts if not
Subnetted: 138.101.0.1
to 138.101.255.254

Major
Network
Information

26

128 64 32 16 8 4 2 1

IP Address
Mask

138.
10001010
11111111
255.

101.
01100101
11111111
255.

114.
01110010
11111111
255.

250
11111010
11000000
192

Step 1: Convert
to Binary
Step 1:
Translate Host IP Address and Subnet Mask into binary
notation

27

IP Address
Mask
Network

138.
10001010
11111111
10001010
138

101.
01100101
11111111
01100101
101

114.
01110010
11111111
01110010
114

250
11111010
11000000
11000000
192

Step 2: Find the


Step 2:
Subnet
Determine the Network (or Subnet)
whereAddress
this Host
address lives:
1. Draw a line under the mask
2. Perform a bit-wise AND operation on the IP Address and the
Subnet Mask
Note: 1 AND 1 results in a 1, 0 AND anything results in a 0
3. Express the result in Dotted Decimal Notation
4. The result is the Subnet Address of this Subnet or Wire
which is 138.101.114.192
28

IP Address
Mask
Network

138.
10001010
11111111
10001010
138

101.
01100101
11111111
01100101
101

114.
01110010
11111111
01110010
114

250
11111010
11000000
11000000
192

Step 2: Find the


Subnet Address

Step 2:
Determine the Network (or Subnet) where this Host
address lives:
Quick method:
1. Find the last (right-most) 1 bit in the subnet mask.
2. Copy all of the bits in the IP address to the Network Address
3. Add 0s for the rest of the bits in the Network Address
29

G.D.
IP Address
Mask
Network

10001010
11111111
10001010

01100101
11111111
01100101

S.D.
01110010
11 111010
11111111
11 000000
01110010
11 000000
subnet
host
counting range
counting
range

Step 3: Subnet
Range / Host
Step 3:
Range
Determine which bits in the address contain Network
(subnet) information and which contain Host
information:
Use the Network Mask: 255.255.0.0 and divide (Great
Divide) the from the rest of the address.
Use Subnet Mask: 255.255.255.192 and divide (Small
Divide) the subnet from the hosts between the last 1 and
the first 0 in the subnet mask.
30

Step 4: First Host / Last Host


G.D.

S.D.

IP Address
Mask
Network

10001010
11111111
10001010

01100101
11111111
01100101

01110010
11 111010
11111111
11 000000
01110010
11 000000
subnet
host
counting range
counting
range

First Host

10001010
138

01100101
101

01110010
114

11

000001
193

Last Host

10001010
138

01100101
101

01110010
114

11

111110
254

Broadcast

10001010
138

01100101
101

01110010
114

11

111111
255

Host Portion
Subnet Address: all 0s
First Host: all 0s and a 1
Last Host: all 1s and a 0
Broadcast: all 1s

31

G.D.

S.D.

IP Address
Mask
Network

10001010
11111111
10001010

01100101
11111111
01100101

01110010
11 111010
11111111
11 000000
01110010
11 000000
subnet
host
counting range
counting
range

First Host

10001010
138

01100101
101

01110010
114

11

000001
193

Last Host

10001010
138

01100101
101

01110010
114

11

111110
254

Broadcast

10001010
138

01100101
101

01110010
114

11

111111
255

Total number of subnets


Number of subnet bits 10
Step 5: Total
210 = 1,024
Number of
1,024 total subnets
Subtract one if all-zeros subnet cannot be usedSubnets
Subtract one if all-ones subnet cannot be used

32

G.D.

S.D.

IP Address
Mask
Network

10001010
11111111
10001010

01100101
11111111
01100101

01110010
11 111010
11111111
11 000000
01110010
11 000000
subnet
host
counting range
counting
range

First Host

10001010
138

01100101
101

01110010
114

11

000001
193

Last Host

10001010
138

01100101
101

01110010
114

11

111110
254

10001010
138
Total number of hosts per subnet

01100101
101

01110010
114

11

111111
255

Broadcast

Number of host bits 6


26 = 64
64 host per subnets
Subtract one for the subnet address
Subtract one for the broadcast address
62 hosts per subnet

Step 6: Total
Number of
Hosts per

33

Problem 1
Host IP Address:
10.10.10.193
Network Mask: 255.255.0.0
Subnet Mask: 255.255.255.0
Problem 2
Host IP Address:
10.10.10.193
Network Mask: 255.255.255.0
Subnet Mask:
255.255.255.240

Your Turn!

Problem 3
Host IP Address:
10.10.10.193
Network Mask: 255.255.255.0
Subnet Mask:
255.255.255.252
34

QUESTIONS

35

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