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

IP ADDRESSING

& SUBNETTING
ENGR. CARLO FERDINAND C. CALMA, CCNA
Overview

IP Address
 Types of IP Addresses
 Classes of IP Addresses

Subnet
 Advantages & Disadvantages
 Utilization
 Application in network
Internet Protocol

What is IP?
IP is a connectionless,
unreliable, best-effort delivery
protocol.
IP accepts whatever data is
passed down to it from the
upper layers and forwards the
data in the form of IP Packets.
All the nodes are identified
using an IP address.
Packets are delivered from
the source to the destination
using IP address
Internet Protocol

IP Address
IP address is for the INTERFACE of a host.
is an address used to uniquely identify a device on
an IP network.
used by routers, to select best path from source to
destination, across networks and internetworks
The address is made up of 32 binary bits which can
be divisible into a network portion and host portion
with the help of a subnet mask.
32 binary bits are broken into four octets (1 octet =
8 bits)
Address 0.0.0.0, 127.0.0.1 and 255.255.255.255
carries special meaning.
Network Masks
 Distinguishes which portion of the address identifies the
network and which portion of the address identifies the
node.
 Default masks:
 Class A: 255.0.0.0
 Class B: 255.255.0.0
 Class C: 255.255.255.0
Internet Protocol

IP Address, Subnet Mask


and Gateway
IP Address and Subnet Mask define the Subnet
For Example IP address 172.31.1.0 and Subnet Mask of
255.255.240.0 means that the subnet address ranges
from 172.31.0.0 to 172.31.15.255
Another notation is 172.31.1.0/28
The first Address is the Network Address and the last
Address is the Broadcast Address. They are reserved
and cannot be assigned to any node.
The Gateway Address is the Address of the router where
the packet should be sent in case the destination host
does not belong to the same subnet
Internet Protocol

IP Address Classes
Class D : Begins with 1110, multicast addresses
(224.0.0.0-to-239.255.255.255)
Class E : Begins with 11110, unused
Types of IP address

 Static IP address
 manually input by network administrator
 manageable for small networks
 requires careful checks to avoid duplication

 Dynamic IP address
 examples - BOOTP, DHCP
 assigned by server when host boots
 derived automatically from a range of addresses
 duration of ‘lease’ negotiated, then address released
back to server
Internet Protocol

IP Configuration of an Interface
Static DHCP
Internet Protocol

IPv6
Internet Protocol Version 4 is the most popular protocol
in use today, although there are some questions about
its capability to serve the Internet community much
longer.
IPv4 was finished in the 1970s and has started to show its
age.
The main issue surrounding IPv4 is addressing—or, the
lack of addressing—because many experts believe
that we are nearly out of the four billion addresses
available in IPv4.
Although this seems like a very large number of
addresses, multiple large blocks are given to
government agencies and large organizations.
IPv6 could be the solution to many problems posed by
IPv4
Internet Protocol

IPv6
IPv6 uses 128 bit address instead of 32 bit address.
The IPv6 addresses are being distributed and are
supposed to be used based on geographical
location.
SUBNETTING
Definition
 Creates multiple logical networks that exist within a single Class A, B, or C
network by dividing computer network into groups of computers that
have a common, designated IP address routing prefix.
 If you do not subnet, you will only be able to use one network from your
Class A, B, or C network, which is unrealistic
 You can only subnet the host 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 host addresses:


 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 subnets

Why would you want to subnet?


 Limit layer 2 and layer 3 broadcasts to their subnet.
 Better management of traffic.
Advantages
 Allows a single shared network address to split it up into many
smaller networks.
 Without subnets, organizations would require many network
addresses
 Limited number of Network addresses available
 Alleviates traffic
 Smaller routing tables
 Alleviates excessive packet collision and congestion
 Simplified management
 Better Security
 Separating departments with highly sensitive material
 Accounting and Administration
 Optimized network performance
 Facilitated spanning of large geographical distances
 reduce broadcast domain, improve network efficiency
Disadvantages

 Doesn’t allocate IP address proportionately per


subnet
 Limited by the number of IP address
 Need to buy hardware such as routers
SubNetted Networks

 The network portion of the address is extended by


splitting up the host number

 Borrowing 1 or more bits from the host bit portion


restrictions on borrowed bits

 reserved addresses
 all 0’s= network address, all 1’s broadcast address
 minimum of 2 bits borrowed from host portion
 minimum of 2 bits left for host portion
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.
Class C Subnetting
# of Subnets # of NetMask 4th Octet CIDR Notation
Hosts/Subnet
2 126 255.255.255.128 10000000 /25

4 62 255.255.255.192 11000000 /26

8 30 255.255.255.224 11100000 /27

16 14 255.255.255.240 11110000 /28

32 6 255.255.255.248 11111000 /29

64 2 255.255.255.252 11111100 /30


Practice Example #1C:
255.255.255.128 (/25)
Network 192.168.10.0
 How many subnets? Since 128 is 1 bit on (10000000), the
answer would be 21= 2.
 How many hosts per subnet? We have 7 host bits off
(10000000), so the equation would be 27– 2 = 126 hosts.
 What are the valid subnets? 256 – 128 = 128. Remember,
we’ll start at zero and count in our block size, so our subnets
are 0, 128.
 What’s the broadcast address for each subnet? The number
right before the value of the next subnet is all host bits turned
on and equals the broadcast address. For the zero subnet,
the next subnet is 128, so the broadcast of the 0 subnet is
127.
 What are the valid hosts? These are the numbers between
the subnet and broadcast address
Practice Example #1B: 255.255.128.0
(/17)
Network 172.16.0.0
 Subnets? 21 = 2
 Hosts? 215– 2 = 32,766 (7 bits in the third octet, and
8 in the fourth)
 Valid subnets? 256 – 128 = 128. 0, 128. Remember
that subnetting is performed in the third octet, so
the subnet numbers are really 0.0 and 128.0, as
shown in the next table
 Broadcast address for each subnet?
 Valid hosts?
CIDR

 Classless Interdomain Routing


 Improve address space utilization
 Routing scalability in the Internet
 For example, if an ISP owns network 172.16.0.0/16,
then the ISP can offer 172.16.1.0/24,
172.16.2.0/24,and so on to customers. Yet, when
advertising to other providers, the ISP only needs
to advertise 172.16.0.0/16
Subnet Example
Network address 172.19.0.0 with /16 network mask

Network Network Host Host


172 19 0 0
Subnet Example
Network address 172.19.0.0 with /16 network mask
Network Network Host Host
172 19 0 0
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
Subnet Example
Network address 172.19.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24

Network Network Subnet Host

172 19 0 Host Subnets


172 19 1 Host
172 19 2 Host
255
172 19 3 Host Subnets

172 19 etc. Host 28 - 1

172 19 254 Host


Cannot use last
172 19 255 Host subnet as it
contains broadcast
address
Subnet Example
Network address 172.19.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24

Network Network Subnet Host

172 19 0 0 Subnets
Addresses
172 19 1 0
172 19 2 0
255
172 19 3 0 Subnets

172 19 etc. 0 28 - 1

172 19 254 0
Cannot use last
172 19 255 0 subnet as it
contains broadcast
address
Subnet Example
Network address 172.19.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24
172.19.0.0/24 172.19.10.0/24

172.19.5.0/24 172.19.25.0/24
Subnetting – Example
 Host IP Address: 138.101.114.250
 Network Mask: 255.255.0.0 (or /16)
 Subnet Mask: 255.255.255.192 (or /26)

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
 Number of hosts per subnet
Major Network Information

 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
Variable Length Subnet
Mask(VLSM)
Subnet with requirements
shown?
Variable Length Subnet
Mask(VLSM)
Subnet with requirements
shown?
 5 subnets needed
 Can be assigned as follows:
 netA: 204.15.5.0/27 host address range 1 to 30
 netB: 204.15.5.32/27 host address range 33 to 62
 netC: 204.15.5.64/27 host address range 65 to 94
 netD: 204.15.5.96/27 host address range 97 to 126
 netE: 204.15.5.128/27 host address range 129 to 158
How to create subnets

 Determine the number of required network IDs:


 One for each subnet
 One for each wide area network connection
 Determine the number of required host IDs per
subnet:
 One for each TCP/IP host
 One for each router interface
 Based on the above requirements, create the
following:
 One subnet mask for your entire network
 A unique subnet ID for each physical segment
 A range of host IDs for each subnet
Step 1: Convert to Binary
128 64 32 16 8 4 2 1

138. 101. 114. 250


IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
255. 255. 255. 192

Step 1:
Translate Host IP Address and Subnet Mask into binary notation
Step 2: Find the Subnet
Address
IP Address
138.
10001010
101.
01100101
114.
01110010
250
11111010
Mask 11111111 11111111 11111111 11000000
Network 10001010 01100101 01110010 11000000
138 101 114 192

Step 2:
Determine the Network (or Subnet) where 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
Step 2: Find the Subnet
Address
IP Address
138.
10001010
101.
01100101
114.
01110010
250
11111010
Mask 11111111 11111111 11111111 11000000
Network 10001010 01100101 01110010 11000000
138 101 114 192

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 0’s for the rest of the bits in the Network Address
Step 3: Subnet Range /
Host Range
G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range
Step 3:
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.
Step 4: First Host / Last Host G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range

First Host 10001010 01100101 01110010 11 000001


138 101 114 193

Last Host 10001010 01100101 01110010 11 111110


138 101 114 254

Broadcast 10001010 01100101 01110010 11 111111


138 101 114 255

Host Portion
 Subnet Address: all 0’s
 First Host: all 0’s and a 1 in rightmost bit
 Last Host: all 1’s and a 0 in rightmost bit
 Broadcast: all 1’s
Step 5: Total Number of
Subnets
G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range

 Total First
numberHost of subnets
10001010 01100101 01110010 11 000001
138 101 114 193
 Number of subnet bits 10
 210Last Host
= 1,024 10001010 01100101 01110010 11 111110
138 101 114 254
 1,024 total subnets
Broadcast 10001010 01100101 01110010 11 111111
 Subtract one “if”138
all-zeros subnet101
cannot be used
114 255
 Subtract one “if” all-ones subnet cannot be used
Step 6: Total Number of
Hosts per Subnet
G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range

 Total First
numberHost of hosts per subnet
10001010 01100101 01110010 11 000001
138 101 114 193
 Number of host bits 6
 26Last
= 64Host 10001010 01100101 01110010 11 111110
138 101 114 254
 64 host per subnets
Broadcast 10001010 01100101 01110010 11 111111
 Subtract one for 138
the subnet address
101 114 255
 Subtract one for the broadcast address
 62 hosts per subnet