Addressing
Malaka Pathirana
MSc – Cyber Security (Reading), BSc in IT | Cisco Certified CCNA Instructor
TCP/IP Protocol Suite
Addressing
▪ We observed logical communications between pairs of layers.
▪ Any communication that involves two parties needs two addresses:
the source address and destination address.
▪ Four levels of addresses are used in an Internet employing the TCP/IP protocol
suit.
a. Physical Addresses / Linked-layer Addresses
a. Logical Addresses
b. Port Addresses / Port Numbers
c. Specific Addresses / Names
▪ Each address type is related to a particular TCP/IP Architecture layer.
Addressing…
a.Physical Addresses
▪ Lowest level address, also known as Link Address.
▪ Included in a header used by the data link layer.
▪ When a datagram passes from the network layer to the data-link layer, the
datagram will be encapsulated in a frame, and two data-link addresses are
added to the frame header.
▪ These two addresses are changed every time the frame moves from one link to
another.
▪ ARP is used to determine the destination link address.
Try getmac command on cmd
b.Logical Addresses
▪ Physical addresses are inadequate in internetwork, as different networks have
different address formats.
▪ Logical addresses are used to identify hosts, regardless of the underlying
physical network uniquely.
▪ IP address: Currently a 32-bit address.
▪ No two publicly addressed and visible hosts on the Internet can have the same
IP address.
192.248.48.9
Try ipconfig command on cmd
c. Port Addresses
▪ Arrival at the destination host is not the final objective of the data communications
on the Internet.
Identify a particular application or service on a system
▪ A process of one host should be able to communicate with a process of another
host. (Process-to-Process Communication)
▪ Today, computers can run multiple processes at the same time.
For example, Host A communicates with Host B using TELNET. At the same time,
Host A can communicate with Host B using FTP.
▪ In TCP/IP, the addresses given for each process to receive data
simultaneously are known as Port Addresses. (16 bits in length)
TELNET - port number 23
FTP - port numbers 20 and 21
c. Port Addresses…
▪ Port numbers are integers
between 0 and 65,535 (16 bits).
▪ This port number cannot be
chosen randomly.
▪ TCP/IP has decided to use
universal port numbers for
servers; these
are called well-known port
numbers.
d.Specific Addresses/ Names
▪ To identify an entity, TCP/IP protocols use the IP address, which
uniquely identifies the connection of a host to the Internet.
▪ However, people prefer to use names instead of numeric addresses.
▪ User-friendly addresses.
e.g.
E-mail addresses (abc@sdfv.edu)
URLs (www.fffvv.com)
Logical Addressing
▪ Communication at Network Layer is host-to-host (Source computer to the destination
computer).
▪ Usually, computers communicate through the Internet.
▪ For this level, a global addressing scheme known as IP addresses is used.
▪ The IP address is the address of the connection, not the address of the host or the
router. If the device is moved to another network, the IP address may be changed.
▪ IPv4 addresses are 32 bits in length.
▪ Provides 232 number of unique addresses. (IPv4 - IP version 4)
▪ But with the need for more addresses, IPv6 was introduced.
▪ IPv6 addresses are 128 bits in length.
IPv4 Addresses
▪ The IP address space is managed globally by the Internet Assigned Numbers Authority (IANA)
▪ Address Space
▪ Total number of addresses used by the protocol.
▪ If a protocol uses N bits to define an address, the address space is 2𝑁.
▪ 232 = 4,294,967,296 (More than 4 billion addresses)
▪ Notations
▪ Binary Notation (base 2) | 10000000 00001011 00000011 00011111
▪ Dotted Decimal Notation (base 256) | 128.11.3.31
▪ Hexadecimal Notation (base 16) | 80 0B 03 1F
▪ An IP address consists of two parts:
▪ The first part of an Internet address identifies the network on which the host
resides, while the second part identifies the particular host on the given network.
Every machine on the same network shares the same network address as part of
its IP address. In the IP address 192.168.10.15.
Ex - 192.168.10. is the network address. The Host address is assigned to identify
each machine on a network uniquely. In this example, 15 is the host address.
IPv4 Address Classes
Subnet Mask
▪ Blocks part of the IP address to distinguish the network ID from the HostID. This
will determine if the TCP/IP clients are on the same network or on a
remote/different network. An improper Subnet mask can cause connectivity
problems.
Public and Private IPv4 Addresses
• As defined in RFC 1918, public IPv4 addresses are globally routed between
internet service provider (ISP) routers.
Network
Address and RFC 1918 Private Address Range
• Private addresses are common Prefix
blocks of addresses used by most
organizations to assign IPv4 10.0.0.0/8 10.0.0.0 - 10.255.255.255
addresses to internal hosts.
172.16.0.0/12 172.16.0.0 - 172.31.255.255
• Private IPv4 addresses are not
unique and can be used internally 192.168.0.0/16 192.168.0.0 - 192.168.255.255
within any network.
• However, private addresses are not globally routable.
Routing to the Internet
• Network Address Translation (NAT) translates private IPv4 addresses
to public IPv4 addresses.
• NAT is typically enabled
on the edge router
connecting to the
internet.
• It translates the internal
private address to a
public global IP address.
Network, Host, and Broadcast Addresses
• Within each network are three types of IP addresses:
o Network address
o Host addresses
o Broadcast address
Network Addresses
• The network address is the first address in the block.
• The network address defines the network to the rest of the Internet.
• Given the network address, we can find the class of the address, the
block, and the range of the addresses in the block
Determining the Network: Logical AND
• A logical AND Boolean operation is used in determining the network
address.
• Logical AND is the comparison of two bits where only a 1 AND 1 produces a 1
and any other combination results in a 0.
• 1 AND 1 = 1, 0 AND 1 = 0, 1 AND 0 = 0, 0 AND 0 = 0
• 1 = True and 0 = False
• To identify the network address, the
host IPv4 address is logically
ANDed, bit by bit, with the subnet
mask to identify the network
address.
Host
Network Portion Host Bits
Portion
Subnet mask 255 255 255 0
255.255.255.0 or /24 11111111 11111111 11111111 00000000
Network address 192 168 10 0
All 0s
192.168.10.0 or /24 11000000 10100000 00001010 00000000
First address 192 168 10 1
All 0s and a 1
192.168.10.1 or /24 11000000 10100000 00001010 00000001
Last address 192 168 10 254
All 1s and a 0
192.168.10.254 or /24 11000000 10100000 00001010 11111110
Broadcast address 192 168 10 255
All 1s
192.168.10.255 or /24 11000000 10100000 00001010 11111111
Classful addressing, which is almost obsolete (outdated), is replaced with
classless addressing
CIDR
• Classless Inter-Domain Routing, an IP addressing scheme that replaces the
older system based on classes A, B, and C
• A single IP address can be used to designate many unique IP addresses with
CIDR
• A CIDR IP address looks like a normal IP address except that it ends with a
slash followed by a number, called the IP network prefix
• The IP prefix identifies the number of significant bits used to identify a network.
Ex - 192.9.205.22 /18 means the first 18 bits are used to represent the
network, and the remaining 14 bits are used to identify hosts.
Common prefixes are 8, 16, 24, and 32.
The Prefix Length
• A prefix length is a less cumbersome method to identify a subnet mask address.
Prefix
Subnet Mask 32-bit Address
Length
• The prefix length is the 255.0.0.0 11111111.00000000.00000000.00000000 /8
number of bits set to 1 in
255.255.0.0 11111111.11111111.00000000.00000000 /16
the subnet mask.
255.255.255.0 11111111.11111111.11111111.00000000 /24
• It is written in “slash 255.255.255.128 11111111.11111111.11111111.10000000 /25
notation” therefore, count 255.255.255.192 11111111.11111111.11111111.11000000 /26
the number of bits in the
255.255.255.224 11111111.11111111.11111111.11100000 /27
subnet mask and prepend it
with a slash. 255.255.255.240 11111111.11111111.11111111.11110000 /28
255.255.255.248 11111111.11111111.11111111.11111000 /29
255.255.255.252 11111111.11111111.11111111.11111100 /30
Subnetting
Reasons for Segmenting Networks
• Subnetting reduces overall network traffic and improves network
performance.
• It can be used to implement security policies between subnets.
• Subnetting reduces the number of devices affected by abnormal broadcast
traffic.
• Subnets are used for a variety of reasons, including by:
Location Group or Function Device Type
Subnet on an Octet Boundary
• Networks are most easily subnetted at the octet boundary of /8, /16, and /24.
• Notice that using longer prefix lengths decreases the number of hosts per
subnet.
# of hosts
Prefix
Subnet Mask Subnet Mask in Binary (n = network, h = host) 2h – 2
Length
(h = # of host bits)
nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
/8 255.0.0.0 16,777,214
11111111.00000000.00000000.00000000
nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
/16 255.255.0.0 65,534
11111111.11111111.00000000.00000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
/24 255.255.255.0 254
11111111.11111111.11111111.00000000
Subnet within an Octet Boundary
• Refer to the table to see six ways to subnet a /24 network.
# of hosts
Subnet Mask in Binary # of subnets 2h – 2
Prefix Length Subnet Mask
(n = network, h = host) 2n (h = # of host
bits)
nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 2 126
11111111.11111111.11111111.10000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 4 62
11111111.11111111.11111111.11000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 8 30
11111111.11111111.11111111.11100000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 16 14
11111111.11111111.11111111.11110000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 32 6
11111111.11111111.11111111.11111000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 64 2
11111111.11111111.11111111.11111100
Create Subnets with a Slash 16 prefix
Prefix Length Subnet Mask Network Address (n = network, h = host) # of subnets # of hosts
nnnnnnnn.nnnnnnnn.nhhhhhhh.hhhhhhhh
/17 255.255.128.0 2 32766
11111111.11111111.10000000.00000000
nnnnnnnn.nnnnnnnn.nnhhhhhh.hhhhhhhh
/18 255.255.192.0 4 16382
11111111.11111111.11000000.00000000
nnnnnnnn.nnnnnnnn.nnnhhhhh.hhhhhhhh
/19 255.255.224.0 8 8190
11111111.11111111.11100000.00000000
nnnnnnnn.nnnnnnnn.nnnnhhhh.hhhhhhhh
/20 255.255.240.0 16 4094
11111111.11111111.11110000.00000000
nnnnnnnn.nnnnnnnn.nnnnnhhh.hhhhhhhh
/21 255.255.248.0 32 2046
11111111.11111111.11111000.00000000
nnnnnnnn.nnnnnnnn.nnnnnnhh.hhhhhhhh
/22 255.255.252.0 64 1022
11111111.11111111.11111100.00000000
nnnnnnnn.nnnnnnnn.nnnnnnnh.hhhhhhhh
/23 255.255.254.0 128 510
11111111.11111111.11111110.00000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
/24 255.255.255.0 256 254
11111111.11111111.11111111.00000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 512 126
11111111.11111111.11111111.10000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 1024 62
11111111.11111111.11111111.11000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 2048 30
11111111.11111111.11111111.11100000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 4096 14
11111111.11111111.11111111.11110000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 8192 6
11111111.11111111.11111111.11111000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 16384 2
11111111.11111111.11111111.11111100
Subnetting Process
When calculating subnets, the following process should be used. Each step of the process will
be described in detail.
1. Determine the assigned IP address space
2. Determine the number of subnets required for each department in the organization based
on the existing network design and structure.
3. Based on the class of the IP address space and the number of required subnets,
determine how many host bits need to be borrowed. Also, determine how many hosts
each subnet can support
4. Calculate the decimal value and prefix value of the new subnet mask
5. Calculate each subnet's network address, broadcast address, and IP range using the
assigned IP address and subnet mask.
6. Assign IP addresses to all devices, including router interfaces that are connected to that
subnet
Possible Number of Subnets
To calculate the number of possible subnets, use the formula 2n where n equals the
number of host bits borrowed
For example, if 3 host bits are borrowed, then n=3. 23= 8, so eight
subnets are possible if 3 host bits are borrowed.
Determine How Many Host Bits Need to be
Borrowed
• To complete the third step of the subnetting process, determine how many host
bits need to be borrowed and rewrite the formula as 2n > (number of required
subnets).
Ex- if the number of required subnets is 18, then write the formula as 2n > 18
• Solve for n by getting as close to the number of required subnets as
possible without going under.
• In this example, n = 5 (25 = 32). This means that to create at least 18 subnets, 5
host bits must be borrowed
Subnet a Slash 16 and a Slash 8 Prefix
Create 100 Subnets with a Slash 16 prefix
Consider a large enterprise that requires at least
100 subnets and has chosen the private address
172.16.0.0/16 as its internal network address.
• The figure displays the number of subnets that
can be created when borrowing bits from the
third and fourth octets.
• Notice there are now up to 14 host bits that can
be borrowed (i.e., the last two bits cannot be
borrowed).
To satisfy the requirement of 100 subnets for the
enterprise, 7 bits (i.e., 27 = 128 subnets) would
need to be borrowed (for a total of 128 subnets).
VLSM
IPv4 Address Conservation
Given the topology, 7 subnets are required (i.e, four LANs and three WAN links) and
the largest number of host is in Building D with 28 hosts.
• A /27 mask would provide 8 subnets of 30 host IP addresses and therefore
support this topology.
IPv4 Address Conservation (Cont.)
The point-to-point WAN links only require two addresses and
therefore waste 28 addresses each for a total of 84 unused
addresses.
• Applying a traditional subnetting scheme to this scenario is inefficient and
wasteful.
• VLSM was developed to avoid wasting addresses by enabling us to
subnet a subnet.
VLSM
• The left side displays the traditional subnetting
scheme while the right side illustrates how VLSM
can be used to subnet a subnet and divide the
last subnet into eight /30 subnets.
• When using VLSM, always begin by satisfying
the host requirements of the largest subnet
and continue subnetting until the host
requirements of the smallest subnet are satisfied.
• The resulting topology with VLSM applied.
VLSM Topology Address Assignment
• Using VLSM subnets, the LAN and inter-router networks can be
addressed without unnecessary waste, as shown in the logical topology
diagram.
Exercise
You have been assigned the IP address 192.168.100.0/24 for a new
network. Design a subnetting scheme to accommodate 03 subnets with the
following requirements:
Subnet A: 60 hosts
Subnet B: 30 hosts
Subnet C: 12 hosts
Provide the following details for each subnet:
I. Network address
II. Subnet mask
III. Usable IP range
IV. Broadcast address
Subnet A:
Network address: 192.168.100.0
Subnet mask: 255.255.255.192 (/26)
Usable IP range: 192.168.100.1 to 192.168.100.62
Broadcast address: 192.168.100.63
Subnet B:
Network address: 192.168.100.64
Subnet mask: 255.255.255.224 (/27)
Usable IP range: 192.168.100.65 to 192.168.100.94
Broadcast address: 192.168.100.95
Subnet C:
Network address: 192.168.100.96
Subnet mask: 255.255.255.240 (/28)
Usable IP range: 192.168.100.97 to 192.168.100.110
Broadcast address: 192.168.100.111
Explanation:
Subnet A requires at least 60 hosts, so a /26 subnet is used.
Subnet B requires at least 30 hosts, so a /27 subnet is used.
Subnet C requires at least 12 hosts, so a /28 subnet is used.
Each subnet has a range of usable IP addresses determined by
subtracting 2 from the total addresses in the subnet. The first address is
reserved as the subnet address, and the last address is reserved as the
broadcast address. The remaining addresses are available for hosts.
IPv6 Addressing
IPv6 Address Representation
▪ 128 bits in length and written as a string of hexadecimal values
▪ 4 bits represent a single hexadecimal digit, 32 hexadecimal value =
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 hexadecimal
▪ Can be written in either lowercase or uppercase
IPv6 Address Representation (cont.)
Rule 1- Omitting Leading 0s
▪ The first rule to reduce the notation of IPv6 addresses is to omit any
leading 0s in any 16-bit section or hextet.
▪ 01AB can be represented as 1AB.
▪ 09F0 can be represented as 9F0.
▪ 0A00 can be represented as A00.
▪ 00AB can be represented as AB.
Rule 2 - Omitting All 0 Segments
▪ A contiguous string of one or more 16-bit segments of all 0's can be
replaced with a double colon (::).
▪ 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.
Rule 2 - Omitting All 0 Segments (cont.)
Example #1
Example #2
IPv6 Prefix Length
▪ IPv6 does not use the dotted-decimal subnet mask notation
▪ Prefix length indicates the network portion of an IPv6 address
using the following format:
▪ IPv6 address/prefix length
▪ Prefix length can range from 0 to 128
▪ Typical prefix length is /64
Static Configuration of a Global Unicast
Address
Static Configuration of an IPv6 Global Unicast Address
(cont.)
Windows
IPv6
Setup
Dynamic Configuration of a Global Unicast Address using
SLAAC
Stateless Address Autoconfiguration (SLAAC)
▪ A method that allows a device to obtain its prefix, prefix length and default
gateway from an IPv6 router
▪ No DHCPv6 server needed
▪ Rely on ICMPv6 Router Advertisement (RA) messages
IPv6 routers
▪ Forwards IPv6 packets between networks
▪ Can be configured with static routes or a dynamic IPv6 routing protocol
▪ Sends ICMPv6 RA messages
Dynamic Configuration of a Global Unicast Address using
SLAAC (cont.)
▪ The IPv6 unicast-routing command enables IPv6 routing.
▪ RA message can contain one of the following three options:
▪ SLAAC Only – Uses the information contained in the RA message.
▪ SLAAC and DHCPv6 – Uses the information contained in the RA message and gets
other information from the DHCPv6 server, stateless DHCPv6 (for example, DNS).
▪ DHCPv6 only – The device should not use the information in the RA, stateful DHCPv6.
▪ Routers send ICMPv6 RA messages using the link-local address as the source IPv6
address
Questions?
Thank You