Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

07/09/2018

• IPv4 Addresses
• Basic Subnetting
• IPv6 Addresses

James N. Gikera

IPv4 Addresses

IPv4 Addresses

Introduction
• For devices in different networks to
communicate, they require a
logical address
• IP is one of the network layer
protocols used to provide logical
addressing
• An IP address serves two principal
functions:
• host or network interface
identification – it is a numeric
identifier assigned to each machine
on an IP network
• location addressing - It designates
the specific location of a device on
the network.

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera James N. Gikera

1
07/09/2018

IPv4 Addresses

Introduction
• There are two versions of IP currently in use:
• IPv4 - uses 32 bits (binary digits) to address hosts
E.g. 192.168.1.1

• IPv6 – uses hexadecimal digits to address hosts.


These digits = 128 bits
E.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses

Classful and Classless IP Addressing


• Classful IP addressing is a historic method assigning IP version 4
addresses based on address classes:
• Class A - for large multinationals
• Class B - for medium sized companies
• Class C - for small companies
• Class D and E are reserved address classes
• Classless IP addressing is a method assigning IP version 4
addresses without regard for address classes -A network prefix is
assigned together with the IP address as it determines how
many IPs are available in the given address space
• Today, classless IP addressing is used

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

2
07/09/2018

IPv4 Addresses

Classful IP Addressing
• Classful Addressing: The method divides the IP address space
for Internet Protocol version 4 (IPv4) into five address classes by
address range - A,B,C,D,E.
• Classes A, B, C are networks of three different network sizes, i.e.
number of unicast addresses for hosts.
• Class D is for multicast.
• The class E address range is reserved for future or experimental
purposes.
• NB: Classful addressing has been in used from 1981 until the introduction of Classless
Inter-Domain Routing (CIDR pronounced “cider”) in 1993.
• Unicast vs Multicast vs Broadcast
• What is a host?

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses

IPv4 Address Classes


Size Size
Number Addresses Total Default
Leading of network of rest Start CIDR
Class of per network addresses End address subnet
bits number bit bit field address notation
networks (-2 for hosts) in class mask
field (N) (H)

A 8 24 128 16,777,216 2,147,483,648


0 0.0.0.0 127.255.255.255 255.0.0.0 /8
0-127 N.H.H.H N.H.H.H (27) (224) H*3=24 (231) 32-1 L.bit=31

1,073,741,824
B 16 16 16,384 65,536
10 (230) 32-2 L.bit=30 128.0.0.0 191.255.255.255 255.255.0.0 /16
128-191 N.N.H.H N.N.H.H (214) (216) H*2=16

C 24 8 2,097,152 256 536,870,912 255.255.255.


110 192.0.0.0 223.255.255.255 /24
192-223 N.N.N.H N.N.N.H (221) (28) H*1=8 (229) 32-3 L.bit=29 0

D 268,435,456
1110 undefined undefined undefined undefined 224.0.0.0 239.255.255.255 undefined undefined
224-239 (228)

E 268,435,456
1111 undefined undefined undefined undefined 240.0.0.0 255.255.255.255 undefined undefined
240-254 (228)

IP addresses are described as consisting of two groups of bits in the address: the most significant bits (MSB)
are the network prefix, which identifies a whole network or subnet (N), and the least significant set forms
the host identifier (H), which specifies a particular interface of a host on that network. This division is used as
the basis of traffic routing between IP networks and for address allocation policies.
ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

3
07/09/2018

IPv4 Addresses

Network bits and Host bits

Class
A

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses

Leading bits, Network bits and Host bits

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

4
07/09/2018

IPv4 Addresses

Classful IP Addressing
• The number of addresses usable for addressing specific hosts in
each network is always 2h - 2, where
• h is the number of rest field bits, (in the case below h=8) and
• subtraction of 2 adjusts for the use of:-
• host portion for network address with all-bits-zero (e.g. below N.N.N.H) e.g
192.168.16.0 = 192.168.16.00000000
• And the broadcast address with all-bits-one. i.e 192.168.16.255=
192.168.16.11111111
• Thus, for a Class C address with h=8 bits available in the host field, the
number of hosts is 2h - 2 = 28 - 2 = 254.
Size Size
Number Addresses Total Default
Leading of network of rest Start CIDR
Class of per network addresses End address subnet
bits number bit bit field address notation
networks (-2 for hosts) in class mask
field (N) (H)

C 24 8 2,097,152 256 536,870,912 255.255.255.


110 192.0.0.0 223.255.255.255 /24
192-223 N.N.N.H N.N.N.H (221) (28) H*1=8 (229) 32-3 L.bit=29 0

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses

Classful IP Addressing - Bit-wise representation


In the table:

•n indicates a bit used


for the network ID.

•H indicates a bit used


for the host ID.

•X indicates a bit
without a specified
purpose.

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

5
07/09/2018

IPv4 Addresses

Private and Public Addresses


• Private IP Addresses -Used for local communications within a
private network
Address block Address range Number of
addresses
10.0.0.0/8 10.0.0.0–10.255.255.255 16,777,216 (224)
172.16.0.0/12 172.16.0.0–172.31.255.255 1,048,576
192.168.0.0/16 192.168.0.0–192.168.255.255 65,536 (216)

• Public addresses -routed over the internet and issued by an ISP


and will have number ranges from 1 to 191 in the first octet,
with the exception of the private address ranges above.

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses
Other IPv4 Addresses
• The following addresses are not assigned to hosts on a network:
Address block Address range Number of Scope Description
addresses
0.0.0.0/8 0.0.0.0– 16,777,216 Software Default Routing Current network (only
0.255.255.255 (224) valid as source address).
127.0.0.0/8 127.0.0.0– 16,777,216 Host Used for loopback addresses to the local
127.255.255.255 (224) host.
192.0.0.0/24 192.0.0.0– 256 Private network IETF Protocol Assignments.
192.0.0.255
192.0.2.0/24 192.0.2.0– 256 Documentation Assigned as TEST-NET-1, documentation
192.0.2.255 and examples.
192.88.99.0/24 192.88.99.0– 256 Internet Reserved. Formerly used for IPv6 to IPv4
192.88.99.255 relay. (Included IPv6 address block
2002::/16).
198.51.100.0/24 198.51.100.0– 256 Documentation Assigned as TEST-NET-2, documentation
198.51.100.255 and examples.
203.0.113.0/24 203.0.113.0– 256 Documentation Assigned as TEST-NET-3, documentation
203.0.113.255 and examples.
224.0.0.0/4 224.0.0.0– 268435456 Internet In use for IP multicast. (Former Class D
239.255.255.255 network).
240.0.0.0/4 240.0.0.0– 268435456 Internet Reserved for future use. (Former Class E
255.255.255.254 network).
255.255.255.255/ 255.255.255.255
Which other1special use Subnet IPv4 addresses Reserved can you for the of?
think "limited broadcast"
32 ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera
destination address.

6
07/09/2018

IPv4 Addresses

Public and Private Addresses


• Private addresses –used within private networks, not routed over the
internet .

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses

Types of Addresses found on a Network


• Network address– uniquely identifies or groups together hosts
on the same network or subnet
• Host address – uniquely identifies a device/host on a network
• Broadcast address – used to send a message to all devices on
the same network segment/ subnet

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

7
07/09/2018

IPv4 Addresses

Broadcast Address
• A broadcast address
is an address used to
indicate that
information being
sent out should be
delivered to every
client on the local
area network.
• These addresses are
always the highest
number possible in a
particular network
address or subnet.
ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses

CIDR Notation
• CIDR notation is a compact way to represent an IP address along with its
associated subnet mask and routing prefix.
• Because CIDR notation is expressed as an IP address with a slash character and a
decimal number appended to the end of the IP address, it is sometimes referred
to as slash notation. e.g. 192.168.12.0/24.
• CIDR is useful in subnetting because it is like shorthand: it provides a clean and
easy way to express how a network IP ranges are partitioned.
• CIDR notation makes it possible to specify in the IP address itself the number of
significant bits that make up the network ID portion of the address. For example,
CIDR notation might look like this: 192.168.12.0/24. The /24 tells you that the first
24 bits of the IP address are used for network routing, and also that of the subnet
mask contains 24 binary bits set to 1 (255.255.255.0) i.e This also holds true for
each IP address on the same subnet.
11111111.11111111.11111111.00000000
Size Size
Number Addresses Total Default
Leading of network of rest Start CIDR
Class of per network addresses End address subnet
bits number bit bit field address notation
networks (-2 for hosts) in class mask
field (N) (H)

C 24 8 2,097,152 256 536,870,912 255.255.255.


110 192.0.0.0 223.255.255.255 /24
192-223 N.N.N.H N.N.N.H
ICS 2103: (2 ) / BTC 1203:
21
Computer Networks (2 ) Introduction(2to Computer
8 H*1=8 )
29 32-3 L.bit=29
Networks James N. Gikera 0

8
07/09/2018

IPv4 Addresses

Why Classless IP Addressing?


• Using a classful IP addressing format worked well when the Internet
was relatively small. But as the number of networks on the Internet
grew, the limitations of classful addresses became apparent.
• The Class A address space contains only 125 usable networks in the
range 0–127 because networks 0 and 127 are reserved, and network
10 is used for private addressing. Each of these 125 Class A networks
could theoretically contain 224 – 2 or 16,777,214 hosts, but it's not
realistic to have more than 16 million hosts on the same network.
Therefore, in the early 1990s, the Internet moved away from a classful
address space to a classless address space.
• In other words, the number of bits used for the network portion of an
IP address became variable instead of fixed. Thus CIDR is based on
the variable-length subnet masking (VLSM) technique which allows a
network to be divided into variously sized subnets, providing the
opportunity to size a network more appropriately for local needs.
ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera

IPv4 Addresses

Quiz
IPv4 uses binary digits to address hosts (binary)
IPv6 uses hexadecimal digits to address hosts (hexadecimal)
An IPv4 address has 32 number of bits. (32)
An IPv4 address has 128 number of bits. (128)
Classes D and E are reserved address classes
Class D address range is used for multicast
Class E address range is reserved for future or experimental purposes.
172.168.1.0 belongs to Class B address range.
0.0.0.0/8 address block is reserved for the default route
127.0.0.0/8) address block is reserved for loopback testing/local host
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are used for local communications within a
private network.
Give an example of a Class B IP address.
Give an example of a private Class A IP address.
Give 3 reasons for subnetting.
Classless IP addressing is a method assigning IP version 4 addresses without regard for address
classes
A Network address uniquely identifies or groups together hosts on the same network or subnet
A Host address uniquely identifies a device/host on a network
A Broadcast address is used to send a message to all devices on the same network segment/
subnet

ICS 2103: Computer Networks / BTC 1203: Introduction to Computer Networks James N. Gikera James N. Gikera

You might also like