Professional Documents
Culture Documents
Data Communication and Computer Networks: IP Addresses, Subnetting
Data Communication and Computer Networks: IP Addresses, Subnetting
Data Communication and Computer Networks: IP Addresses, Subnetting
Computer Networks
IP Addresses, Subnetting
◼ IP address
◼ Classful IP addressing
◼ Subnet mask
◼ Subnetting
2
IPv4 ADDRESSES
An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a device (for example, a
computer or a router) to the Internet.
3
Example
Change the following IPv4 addresses from
dotted-decimal notation to binary notation.
Solution
We replace each decimal number with its
binary equivalent.
4
Example
Change the following IPv4 addresses from
binary notation to dotted-decimal notation.
Solution
We replace each group of 8 bits with its
equivalent decimal number and add dots for
separation.
5
Example
Find the error, if any, in the following IPv4 addresses.
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
6
Hierarchy in Addressing
A 32-bit IPv4 address is hierarchical, but divided only into two parts.
The first part of the address, called the prefix, defines the network; the
second part of the address, called the suffix, defines the node
(connection of a device to the Internet). Figure shows the prefix and
suffix of a 32-bit IPv4 address. The prefix length is n bits and the suffix
length is (32 - n) bits.
7
Classful Addressing
When the Internet started, an IPv4 address was designed with a
fixed-length prefix, but to accommodate both small and large
networks, three fixed-length prefixes were designed instead of one (n
= 8, n = 16, and n = 24). The whole address space was divided into
five classes (class A, B, C, D, and E), as shown in Figure 18.18. This
scheme is referred to as classful addressing. Although classful
addressing belongs to the past, it helps us to understand classless
addressing, discussed later.
8
Classful Addressing
9
Example
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0.
This is a class C address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
10
Example
140.179.220.200
Written in binary form:
140 .179 .220 .200
12
Network vs. Host
14
140.179.220.200
◼ Our example is a Class B address
◼ By default, the Network part of the
address is defined by the first 2 octets:
140.179.x.x
◼ By default, the node part of the address is
defined by the last 2 octets: x.x.220.200
16
Subnet Mask
◼ Subnet masks are applied to an IP address
to identify the Network portion and the node
portion of the address.
Class A - 255.0.0.0
11111111.00000000.00000000.00000000
Class B - 255.255.0.0
11111111.11111111.00000000.00000000
Class C - 255.255.255.0
11111111.11111111.11111111.00000000
18
Logical Bitwise AND Operation
19
Logical Bitwise AND Operation
In Binary:
10001100.10110011.11110000.11001000
11111111.11111111.00000000.00000000
10001100.10110011.00000000.00000000
By doing this, the computer has found that
our Network Address is 140.179.0.0
20
Another Example:
Suppose we have the address of:
206.15.143.89? What class is it? Class C
What is the subnet
mask? 255.255.255.0
What is the Network
Address?
206.15.143.0
What is the host portion of the
address? 0.0.0.89
21
Another Example:
Suppose we have the address of:
202.15.141.40?
What class is it? Class C
What is the subnet
mask? 255.255.255.0
What is the Network
Address?
202.15.141.0
What is the host range, broadcast
address 1-254
255 22
Drawbacks of Classful Addressing
◼ Wastage of IP addresses
24
Why Do We Care!?
25
Subnetting