You are on page 1of 48

Subnet Mask

Subnet Mask
A subnet mask is a 32-bit number applied to an IP address It facilitates identification of network address & node address of host A value of 1 is assigned to any bit that is part of Network address A value of 0 is assigned to any bit that is part of Node address
In subnetting, a network is divided into smaller subnets with each
subnet having its own subnet address. Each IP address is a pair : (netid, hostid) Network address is the Netid with Hostid=0

NETID

HOSTID

Masking
Masking is the process to extract the netid from an IP address Logical AND operation is used

141.14.2.21 IP Address 1s Mask


255.255.0.0

141.14.0.0 Network Address 0s

Subnetting

Subnetting
Used in IP networks to break up larger networks into smaller subnetworks

To create subnetworks, you take bits from the host portion of the IP address and reserve them to define the subnet address

Reasons for Subnetting


Most IP address assignments were not used very efficiently. Broadcast problem. Many sites were requesting multiple network numbers due to variable amounts of networks at their sites.

Benefits of subnetting
Reduced network traffic Simplified management Smaller broadcast domains

Network Before Subnetting

Network After Subnetting

Subnet Mask

A subnet mask is a 32-bit value that allows the recipient of IP packets to distinguish the network ID portion of the IP address from the host ID portion of the IP address

DEFAULT SUBNET MASK


ADDRESS CLASS DEFAULT SUBNET MASK

A B C

255.0.0.0 255.255.0.0 255.255.255.0

Before Subnetting
1. Determine the number of required network IDs: 2. Determine the number of required host IDs per

Based on the above requirement, create the following:


One subnet mask for your entire network A unique subnet ID for each physical segment A range of host IDs for each subnet

Classless Inter-Domain Routing (CIDR)


Classless Inter-Domain Routing (CIDR) is basically the method that ISPs (Internet Service Providers) use to allocate an amount of addresses to a company, a homea customer. They provide addresses in a certain block size

When you receive a block of addresses from an ISP, what you get will look something like this: 210.212.51.16/29 The slash notation (/) means how many bits are turned on (1s). /29 255.255.255.248

CIDR Values
Subnet Mask 255.0.0.0 255.128.0.0 255.192.0.0 255.224.0.0 255.240.0.0 255.248.0.0 255.252.0.0 255.254.0.0 255.255.0.0 255.255.128.0 255.255.192.0 255.255.224.0 255.255.240.0 255.255.248.0 255.255.252.0 CIDR Value /8 /9 /10 /11 /12 /13 /14 /15 /16 /17 /18 /19 /20 /21 /22

CIDR Values
255.255.254.0 255.255.255.0 255.255.255.128 255.255.255.192 255.255.255.224 255.255.255.240 255.255.255.248 255.255.255.252 /23 /24 /25 /26 /27 /28 /29 /30

Subnetting a Class C Address

How many subnets does the chosen subnet mask produce? How many valid hosts per subnet are available? Whats the broadcast address of each subnet? What are the valid hosts in each subnet?

255.255.255.192 (/26)
192.168.10.0 = Network address 255.255.255.192 = Subnet mask

How many subnets?


Since 192 is 2 bits on (11000000), the answer would be 22 2 = 2

How many hosts per subnet?


We have 6 host bits off (11000000), so the answer would be 26 2 = 62 hosts.

What are the valid subnets?


Ist Subnet IInd Subnet Invalid Subnet

256 192 = 64 64+64=128 128+64=192

Our two valid subnets are, 64 and 128

255.255.255.224 (/27)
192.168.10.0 = Network address 255.255.255.224 = Subnet mask

How many subnets? How many hosts? What are the valid subnets?
so 23 2 = 6. 25 2 = 30.

224 is 11100000,

256 224 = 32. subnets are 32, 64, 96, 128, 160, and 192.

Practice
Problem 1: 192.168.10.0 255.255.255.240 (/28) Problem 2:

192.168.10.0 255.255.255.252 (/30)

255.255.255.128
128 is 10000000 in binary, there is only 1 bit for subnetting. This bit can be either off or on, the two available subnets are 0 and 128 Subnet 0 128 First host 1 129 Last host 126 254 Broadcast 127 255

Subnetting a Class B Address

255.255.192.0 (/18)
172.16.0.0 = Network address 255.255.192.0 = Subnet mask Subnets? 22 2 = 2. Hosts? 214 2 = 16,382. (6 bits in the third octet, and 8 in the fourth.)

Valid subnets?

256 192 = 64. 64 + 64 = 128

Practice Example #2B: 255.255.240.0 (/20)


172.16.0.0 = Network address 255.255.240.0 = Subnet address Subnets? 24 2 = 14. Hosts? 212 2 = 4094. Valid subnets? 256 240 = 16, 32, 48, etc., up to 224.

Practice
Problem 1: 172.16.0.0 = Network address 255.255.254.0 = Subnet address

Subnetting a Class A Address

255.255.0.0 (/16)
Subnets? 28 2 = 254. Hosts? 216 2 = 65,534. Valid subnets? 256 255 = 1, 2, 3, etc.

(all in the second octet). The subnets would be 10.1.0.0, 10.2.0.0, 10.3.0.0, etc., up to 10.254.0.0.