0% found this document useful (0 votes)
19 views85 pages

Chapter 7 IP Addressing_July 2023

Lecture Note for Introduction to Networking

Uploaded by

black hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views85 pages

Chapter 7 IP Addressing_July 2023

Lecture Note for Introduction to Networking

Uploaded by

black hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

Chapter 7:

IP Addressing

IPv4 and IPv6 address

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.

▪ Any device connected to the IP network must have a unique


IP address within the network.
▪ Encapsulated at Network Layer (Layer 3)
▪ Layer 3 address

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

network portion host portion

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

255.255.255.240 1111 1111.1111 1111.1111 1111. 1111 0000 /28

255.255.192.0 1111 1111.1111 1111.1100 0000.0000 0000 /18

255.255.248.0 1111 1111.1111 1111.1111 1000. 0000 0000 /21

255.255.255.248 1111 1111.1111 1111.1111 1111. 1111 1000 /29


255.192.0.0 1111 1111.1100 0000.0000 0000.0000 0000 /10

Just count how many ‘1’s

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

0000 1010 . 0000 0001. 0000 0001. 0000 0011


1111 1111 . 0000 0000. 0000 0000. 0000 0000

172.24.5.6
Subnet mask 255.255.0.0 or /16

1010 1100. 0001 1000. 0000 0101. 0000 0110


1111 1111 . 1111 1111. 0000 0000. 0000 0000

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

0000 1010 . 0000 0001. 0000 0001. 0000 0011


1111 1111 . 1111 1000. 0000 0000. 0000 0000

172.24.5.6
Subnet mask 255.255.252.0 or /22

1010 1100. 0001 1000. 0000 0101. 0000 0110


1111 1111 . 1111 1111. 1111 1100. 0000 0000

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…

What is a network address?


What is a broadcast address ?
How big is the network (how many total IP addresses?)

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 25
Number of total IP addresses :dependent on the
mask length

▪ How many total IP addresses in the network ?


Formula = 2^h
(h is the number of host bits)

▪ How many usable IP addresses in the network ? (same as


how many number of hosts in the network)
Formula = 2^h – 2
(h is the number of host bits)
(minus 2 as network address and broadcast address cannot be
assigned to a host)

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

Logical AND truth table


Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 35
How to assign IP address to device
▪ Two methods
• Static (Manually set)
• Automatically using DHCP

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

LAN Interface Properties Configuring a Static IPv4 Address

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

DHCP - preferred method of “leasing” IPv4 addresses to hosts on large


networks, reduces the burden on network support staff and virtually
eliminates entry errors

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

Routers do not Directed broadcast


forward a • Destination
limited 172.16.4.255
broadcast! • Hosts within the
172.16.4.0/24
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

IP addresses are categorized into classed


depending on the first octet

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

ISPs are large national


or international ISPs that
are directly connected to
the Internet backbone.

Tier 2 ISPs generally


focus on business
customers.

Tier 3 ISPs often bundle Tier 3 ISPs purchase


Internet connectivity as a part of their Internet service
network and computer service
contracts for their customers. from Tier 2 ISPs.

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

1. What is the network address


2. Find the broadcast address
3. What are the IP range for host?
4. How many hosts are there in the network ?
5. How many total IPs are there in this network (network size)

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

▪ IPv6 is designed to be the successor to IPv4


❑ increasing Internet population,
❑ a limited IPv4 address space, 4.2 + billion address not enough
❑ issues with NAT and
❑ an Internet of things
❑ IPv6 fixes the limitations of IPv4 and include additional enhancements such as
ICMPv6

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 61
IPv6 Addressing
▪ Composed of 128 bits
▪ 3.4×1038 (340
undecillion) addresses

▪ Eight 16-bit fields


▪ Typically represented in
hexadecimal numbers
Separated by a colon

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

▪ Hextet used to refer to a segment of 16 bits or four


hexadecimals
▪ Can be written in either lowercase or uppercase
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 65
IPv6 Addressing
Rule 1- Omitting Leading 0s
▪ The first rule to help reduce the notation of IPv6 addresses is
any leading 0s (zeros) in any 16-bit section or hextet can be
omitted
▪ 01AB can be represented as 1AB
▪ 09F0 can be represented as 9F0
▪ 0A00 can be represented as A00
▪ 00AB can be represented as AB

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

Dual-stack: Allows IPv4 and IPv6 to


coexist on the same network. Devices run
both IPv4 and IPv6 protocol stacks
simultaneously.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 70
IPv4 Issues
IPv4 and IPv6 Coexistence
The migration techniques can be divided into three
categories:

#2

Tunnelling: A method of transporting an IPv6


packet over an IPv4 network. The IPv6 packet
is encapsulated inside an IPv4 packet.

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

Translation: Network Address Translation 64 (NAT64)


allows IPv6-enabled devices to communicate with IPv4-
enabled devices using a translation technique similar to
NAT for IPv4. An IPv6 packet is translated to an IPv4
packet, and vice versa. 72
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
PING and Traceroute

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 73
PING (Packet Internet Groper)

▪ Ping is a computer network administration software utility


used to test the reachability of a host on an Internet Protocol
(IP) network
▪ Send echo request and echo reply message
▪ Ping measures the round-trip time for messages sent from
the originating host to a destination computer that are echoed
back to the source
▪ Command : Ping IP address or host name
▪ Example
ping 192.168.1.1 or ping www.google.com

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

You might also like