Chapter 7 IP Addressing_July 2023
Chapter 7 IP Addressing_July 2023
IP Addressing
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 1
Chapter 7
7.1 IPv4 Network Addresses
7.2 IPv6 Network Addresses
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 2
7.1 IPv4 Address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 3
IPV4 Addresses
▪ The Internet Protocol Address (or IP Address)
is a unique address that computing devices such as personal
computers, tablets, and smartphones use to identify itself and
communicate with other devices in the IP network.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 4
▪ Each node in the network will have an IP address to identify
it.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 5
IPV4 Addresses
6
Each decimal ranges from 0 to 255
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 6
IPv4 Address Structure
Binary Number System
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 7
Revision number base conversion
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 8
IPv4 Address Structure
Converting a Binary Address to Decimal
• What is 1011 0000 in decimal ?
• What is 1111 1111 in decimal?
Practice
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 9
IPv4 Address Structure
Converting from Decimal to Binary
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 10
IPv4 Address Structure
Converting from Decimal to Binary Conversions
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 11
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 12
Page 1
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 13
Page 2
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 14
Subnet Mask
▪ An IP address serves two main functions:
host or network interface identification and
location addressing (network address) .
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 15
▪ To define the network and host portions of an address,
a devices use a separate 32-bit pattern called a subnet
mask
Example
Given the following IP address and the subnet mask, find the
network and host portion
192.168.10.10
Subnet mask 255.255.255.0 or /24
10.1.1.3
Subnet mask 255.0.0.0 or /8
172.24.5.6
Subnet mask 255.255.0.0 or /16
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 16
IPv4 Subnet Mask
Network Portion and Host Portion of an IPv4 Address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 17
Examples of Subnet Masks
Valid Subnet Masks
In dotted decimal In binary In CIDR
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 18
Which is network portion and host portion?
10.1.1.3
Subnet mask 255.0.0.0 or /8
172.24.5.6
Subnet mask 255.255.0.0 or /16
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 19
With different subnet mask …
10.1.1.3
Subnet mask 255.248.0.0 or /13
172.24.5.6
Subnet mask 255.255.252.0 or /22
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 20
Some more examples
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 21
Another example
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 22
Yes another example
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 23
Take note
▪ A network address MUST specify with a subnet mask.
▪ An IP address of a host need not specify subnet mask IF the
network address and mask is already indicated.
▪ However, if the network address is not present, then an IP
address of a host NEEDS to have a subnet mask
accompanying.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 24
Some formula and theories…
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 25
Number of total IP addresses :dependent on the
mask length
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 26
Find the network addresses and stuff
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 27
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 28
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 29
IPv4 Subnet Mask
Finding Network and Broadcast Address
When host portion/bits
Change to 0 network address
Change to 1 broadcast address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 30
IPv4 Subnet Mask
Finding First Host and Last Host Addresses
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 31
example
▪ How many total IP addresses in this network?
▪ How many usable IP addresses in this network ?
10.1.1.3/24
How large your network is
192.168.2.200/28
172.16.5.24/17
Is depending on the size/length
of subnet mask
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 32
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 33
For maths lovers : Logical AND operation
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 34
IPv4 Subnet Mask
Bitwise AND Operation
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 36
IPv4 Unicast, Broadcast, and Multicast
Assigning a Static IPv4 Address to a Host
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 37
IPv4 Unicast, Broadcast, and Multicast
Assigning a Dynamic IPv4 Address to a Host
Verification
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 38
Unicast, multicast, broadcast
In an IPv4 network, the hosts can communicate one of three different
ways:
▪ Unicast –one host to another host
▪ Multicast – one host send to a few selected host
▪ Broadcast – one host send to all the host
39
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 39
IPv4 Unicast, Broadcast, and Multicast
Unicast Transmission
1. Unicast - the process of sending a packet from one host to an
individual host.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 40
IPv4 Unicast, Broadcast, and Multicast
Broadcast Transmission
2. Broadcast - the process of sending a packet from one host
to all hosts in the network
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 41
IPv4 Unicast, Broadcast, and Multicast
Multicast Transmission
• Multicast - the process of sending a packet from one host to
a selected group of hosts, possibly in different networks
• Reduces traffic
• Reserved for addressing multicast groups - 224.0.0.0 to
239.255.255.255.
• Link local - 224.0.0.0 to 224.0.0.255 (Example: routing
information exchanged by routing protocols)
• Globally scoped addresses - 224.0.1.0 to 238.255.255.255
(Example: 224.0.1.1 has been reserved for Network Time
Protocol)
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 42
Private and Public IP address
▪ Public IP address – are those available for internet use
▪ Private IP addresses are those on private networks and are
not revealed to the internet
43
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 43
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 44
NAT – Network Address Translation
- translate address from one address space to another
45
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 45
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 46
Types of IPv4 Address
Special Use IPv4 Addresses
▪ Network and Broadcast addresses - within each network
the first and last addresses cannot be assigned to hosts
▪ Loopback address - 127.0.0.1 a special address that hosts
use to direct traffic to themselves (addresses 127.0.0.0 to
127.255.255.255 are reserved)
▪ Link-Local address - 169.254.0.0 to 169.254.255.255
(169.254.0.0/16) addresses can be automatically assigned to
the local host
▪ TEST-NET addresses - 192.0.2.0 to 192.0.2.255
(192.0.2.0/24) set aside for teaching and learning purposes,
used in documentation and network examples
▪ Experimental addresses - 240.0.0.0 to 255.255.255.254
are listed as reserved
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 47
Legacy Classful address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 48
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 49
Types of IPv4 Address
New Classless Addressing
Classless Addressing
• Formal name is Classless Inter-Domain Routing (CIDR,
pronounced “cider
• Created a new set of standards that allowed service
providers to allocate IPv4 addresses on any prefix length
• Do not adhere to class A, B, or C address class nor default
subnet masks
Example
192.168.2.3 /16
10.1.1.12/24
10.1.1.12/7
172.25.6.7/21
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 50
Types of IPv4 Address
Assignment of IP Addresses
Regional Internet Registries (RIRs)
The major registries are:
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 51
Types of IPv4 Address
Assignment of IP Addresses
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 52
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 53
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 54
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 55
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 56
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 57
For these networks
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 58
Assigning IP addresses
Given
192.168.1.2/24
Assign IP addresses to
the devices shown
Hint:
Find the range of IP for
hosts for this network.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 59
7.2 IPv6 Address
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 60
IPv4 Issues
The Need for IPv6
▪ Depletion of IPv4 addresses
❑ Projections show that all five RIRs will run out of IPv4 addresses between 2015 and
2020
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 61
IPv6 Addressing
▪ Composed of 128 bits
▪ 3.4×1038 (340
undecillion) addresses
Example:
FE22:00FF:002D:0000:0000:0000:3012:CCE3
62
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 62
IPv6 Addressing
Hexadecimal Number System
▪ Hexadecimal is a
base sixteen system
▪ Base 16 numbering
system uses the
numbers 0 to 9 and
the letters A to F
▪ Four bits (half of a
byte) can be
represented with a
single hexadecimal
value
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 63
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 64
IPv6 Addressing
IPv6 Address Representation
▪ 128 bits in length and written as a string of hexadecimal
values
▪ In IPv6, 4 bits represents a single hexadecimal digit, 32
hexadecimal values = IPv6 address
2001:0DB8:0000:1111:0000:0000:0000:0200
FE80:0000:0000:0000:0123:4567:89AB:CDEF
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 66
IPv6 Addressing
Rule 2- Omitting All 0 Segments
▪ A double colon (::) can replace any single, contiguous string
of one or more 16-bit segments (hextets) consisting of all 0’s
▪ Double colon (::) can only be used once within an address
otherwise the address will be ambiguous
▪ Known as the compressed format
▪ Incorrect address - 2001:0DB8::ABCD::1234
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 67
IPv6 Addressing
Rule 2- Omitting All 0 Segments
▪ Examples
#1
#2
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 68
Types of IPv6 Addresses
IPv6 Address Types
There are three types of IPv6 addresses:
• Unicast
❑ Global address
Can be routed on the internet
❑ Link local address
Used for communicating with nodes in the same link
• Multicast
❑ Delivers to all nodes in the targeted , multicast group
• Anycast.
❑ Identify multiple destinations, with the packets delivered to the
closest destination.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 69
IPv4 Issues
IPv4 and IPv6 Coexistence
The migration techniques can be divided into three
categories:
#1
#2
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 71
IPv4 Issues
IPv4 and IPv6 Coexistence
The migration techniques can be divided into three
categories:
#3
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 73
PING (Packet Internet Groper)
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 74
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 75
▪ Ping operates by sending Internet Control Message Protocol (ICMP)
echo request packets to the target host and waiting for an ICMP echo
reply.
▪ It reports errors, packet loss, and a statistical summary of the results,
typically including the minimum, maximum, the mean round-trip times,
and standard deviation of the mean.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 76
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 77
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 78
Testing and Verification
Ping - Testing the Local Stack
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 79
Testing and Verification
Ping – Testing Connectivity to the Local LAN
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 80
Testing and Verification
Ping – Testing Connectivity to Remote
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 81
Testing and Verification
Traceroute – Testing the Path
Traceroute (tracert)
• Generates a list of hops that were successfully reached
along the path
• Provides important verification and troubleshooting
information
• If the data reaches the destination, then the trace lists the
interface of every router in the path between the hosts
• If the data fails at some hop along the way, the address of
the last router that responded to the trace can provide an
indication of where the problem or security restrictions are
found
• Provides round trip time for each hop along the path and
indicates if a hop fails to respond
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 82
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 83
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 84
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 85