Chapter 2
Chapter 2
Subnetting
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Outline
❑The Binary Number System
❑Dotted Decimal Notation
❑Subnetting ▪
▪ Advantages of Subnetting
▪ Default Subnet mask ▪
2
4.1 INTRODUCTION
▪ The identifier used in the IP layer of the TCP/IP protocol
suite to identify each device connected to the Internet is
called the Internet address or IP address.
▪ An IP address is a 32-bit address that uniquely and
universally defines the connection of a host or a router to
the Internet.
▪ IP addresses are unique. They are unique in the sense that
each address defines one, and only one, connection to the
Internet.
▪ Two devices on the Internet can never have the same
address.
3
TCP/IP Protocol Suite 4
TCP/IP Protocol Suite 5
Note 1:
9
Note 2:
10
Note 3:
11
Figure 4.1 Dotted-decimal notation
12
Note:
13
Example 1
a. 129.11.11.239 b. 193.131.27.255
c. 231.219.139.111 d. 249.155.251.15
14
Example 2
Solution
We replace each decimal number with its binary equivalent:
a. 01101111 00111000 00101101 01001110
b. 11011101 00100010 00000111 01010010
c. 11110001 00001000 00111000 00001100
d. 01001011 00101101 00100010 01001110
15
Example 3
Solution
a. There are no leading zeroes in dotted-decimal notation (045).
b. We may not have more than four numbers in an IP address.
c. In dotted-decimal notation, each number is less than or equal
to 255; 301 is outside this range.
d. A mixture of binary notation and dotted-decimal notation is not
allowed.
16
Example 4
• IP addresses, when started a few decades ago, used the concept of classes.
• However, part of the Internet is still using classful addressing, but the
18
Figure 4.2 Occupation of the address space
19
Table 4.1 Addresses per class
20
Figure 4.3 Finding the class in binary notation
21
Example 5
Solution
Solution
Solution
a. The first byte is 227 (between 224 and 239); the class is D.
b. The first byte is 193 (between 192 and 223); the class is C.
c. The first byte is 14 (between 0 and 127); the class is A.
d. The first byte is 252 (between 240 and 255); the class is E.
e. The first byte is 134 (between 128 and 191); the class is B.
.225
Given the network address 17.0.0.0, find the class?, the block?,
and the range of the addresses?
Solution
Given the network address 132.21.0.0, find the class, the block,
and the range of the addresses.
Solution
1. The class is B because the first byte is between 128 and 191.
2. The block has a netid of 132.21.
3. The addresses range from 132.21.0.0 to 132.21.255.255.
Solution
1. The class is C because the first byte is between 192 and 223.
2. The block has a netid of 220.34.76.
3. The addresses range from 220.34.76.0 to 220.34.76.255.
Solution
1. The default mask is 255.0.0.0, which means that only the first byte is preserved and the
other 3 bytes are set to 0s.
2. The network address is 23.0.0.0.
Solution
The default mask is 255.255.0.0, which means that the first 2
bytes are preserved and the other 2 bytes are set to 0s.
The network address is 132.6.0.0.
Solution
The default mask is 255.255.255.0, which means that the first 3
bytes are preserved and the last byte is set to 0. The network
address is 201.180.56.0.
128 64 32 16 8 4 2 1 256
1 1 0 0 0 0 0 0 192
AND
Operation
0 1 0 0 1 0 0 0 72
0 1 0 0 0 0 0 0 64
128 64 32 16 8 4 2 1 256
1 1 0 0 0 0 1 0 192
AND
Operation
0 1 0 0 0 1 1 0 70
0 1 0 0 0 0 1 0 66
130.15.66.0
130.15.70.1 130.15.0.0
255.255.194.0
130.15.66.0
130.15..70.1
Solution
We apply the AND operation on the address and the subnet
mask.
Address ➡ 11001000 00101101 00100010 00111000
Subnet Mask ➡ 11111111 11111111 11110000 00000000
Subnetwork Address ➡ 11001000 00101101 00100000 00000000.
47
Disadvantages of Subnetting
▪ Subnetting increases the network's complexity.
▪ More subnets mean more IP addresses are wasted because each
subnet has its own network address and broadcast address.
▪ We have to face a loss of IP Addresses.
I. This is because two IP Addresses are wasted for each subnet.
II. One IP address is wasted for its network address.
III. Other IP Address is wasted for its direct broadcasting address
48
Implementing VLAN
➢ What is LAN?
➢ What is VLAN?
➢ Why do we need VLAN?
➢ How to configure VLAN?
0
◼ A LAN includes all devices in the same broadcast
domain.
the frame.
Switch
VLAN Basics
◼ With VLANs, a switch can put some interfaces into
one broadcast domain and some into another,
creating multiple broadcast domains
VLAN Basics by TD
Benefits of VLANs: These are just a few reasons
for separating hosts into different VLANs.
1. To create more flexible designs that group users by
by physical location.
56
▪ To separate traffic sent by an IP phone from traffic
sent by PCs connected to the phones(Better
performance)
▪ Cost reduction