IP Addressing
Class A 00000000 01111111 1-126 0 Assignable
Class B 10000000 10111111 128-191 10 Assignable
Class C 11000000 11011111 192-223 110 Assignable
Class D 11100000 11101111 224-239 1110 Multicast
Class E 11110000 11110111 240-247 11110 InterNIC
Classes Total Number
of Network per Class (Assignable only)
Network
Class A 01111111.00000000.00000000.00000000 = 2 to the 7th power = 126 Net.H.H.H
Class B 10111111.11111111.00000000.00000000 = 2 to the 14th power = 16,384 Net.Net.H.H
Class C 11011111.11111111.11111111.00000000 = 2 to the 21st power = 2,097,152 Net.Net.Net.H
Classes Total Number
of Host per Class (Assignable only)
Host
Class A 00000000.11111111.11111111.11111111 = 2 to the 24th power -2 = 16,777,214 x.255.255.255
Class B 00000000.00000000.11111111.11111111 = 2 to the 16th power -2 = 65,534 x.y.255.255
Class C 00000000.00000000.00000000.11111111 = 2 to the 8th power - 2 = 254 x.y.z.255
Reserved Address Space = *RFC 1166 and 1918 = Private
(Internal use only) address space
Netblock
Special Use
Reference
10.x.x.x Private RFC 1918
127.x.x.x Loopback Diagnostics
172.(16-31).x.x Private RFC 1918
192.0.0.x Reserved JBP
192.0.1.x Backbone-Test-C RH6
192.0.2.x Internet-Test-C JBP
192.0.(3-255).x Unassigned NIC
192.1.(0-1).x Backbone Local Nets SGC
192.1.2.x Backbone Fiber Nets SGC
192.1.3.x Backbone Apollo Nets SGC
192.168.x.x Private RFC 1918
Think of subnetting as stealing from Peter to give to Paul.
You have a maximum number of bits (determined by class) to play with and if you overlap, it won't work.
Steal host bits moving from Left to Right to acquire more Subnets.
Steal subnet bits moving from Right to Left to acquire more Hosts per sub.
Left-to-Right: Use Network n bits (2n) - 2 = x to get x total number of Subnets per stolen Host bit.
Example: Steal 3 Host bits out of total 8 for Subnets on a Class C (see below)
Answer: This means you can have (23) - 2 = (8-2) = 6 Subnets from this 3-bit Mask.
Note: The leading 3 bits (11100000) = 128 + 64 + 32 = 224 Decimal Subnet Mask.
Right-to-Left: Use remaining Host h bits (2h) - 2 = x to get total x number of Hosts per Subnet.
Example: There are 5 Host bits remaining out of 8 after using 3 for Subnets on Class C (see above)
Answer: This means you can have (25) - 2 = (32-2) = 30 Hosts per Subnet.
Note: The Subnet Mask answer would be either slash notation /27 or decimal 255.255.255.224 you are
using a Class C address, with 3 bits of subnetting, and 5 host bits remaining.
Bits
Subnets
Subnets
Hosts Per Hosts
Per
Slash
Masks
Sub
(n)
(2n-2)
(Decimal)
(2(24-n)-2)
(Decimal)
(Notation)
(Decimal)
(Slice)
1
(21)-2
2-2=0
(223)-2
8,388,606
/9
255.128.0.0
Subnet 0
2
(22)-2 4-2=2
(222)-2
4,194,302
/10
255.192.0.0
Sub 1/7
3
(23)-2
8-2=6
(221)-2
2,097,150
/11
255.224.0.0
Sub 2/7
4
(24)-2
16-2=14
(220)-2
1,048,574
/12
255.240.0.0
Sub 3/7
5
(25)-2
32-2=30
(219)-2
524,286
/13
255.248.0.0
Sub 4/7
6 (26)-2
64-2=62
(218)-2
262,142
/14
255.252.0.0
Sub 5/7
7*
(27)-2
128-2=126
(217)-2
131,070
/15
255.254.0.0
Sub 6/7
8*
(28)-2
256-2=254
(216)-2
65,534
/16
255.255.0.0
Sub 7/7
* = 7 subs valid for Class A or B in 1st octet.
Class C has only 5 valid - the last 2 are binary all 1.
Bits
Subnets
Subnets
Hosts Per Hosts
Per
Slash
Masks
Sub
(n)
(2n-2)
(Decimal)
(2(16-n)-2)
(Decimal)
(Notation)
(Decimal)
(Slice)
1
(21)-2
2-2=0
(215)-2
32,766
/17
255.255.128.0
Subnet 0
2
(22)-2
4-2=2
(214)-2
16,382
/18 255.255.192.0
Sub 1/7
3
(23)-2
8-2=6
(213)-2
8,190
/19
255.255.224.0
Sub 2/7
4
(24)-2
16-2=14
(212)-2
4,094
/20
255.255.240.0
Sub 3/7
5
(25)-2
32-2=30
(211)-2
2,046
/21
255.255.248.0
Sub 4/7
6
(26)-2
64-2=62
(210)-2
1,022
/22
255.255.252.0
Sub 5/7
7*
(27)-2
128-2=126
(29)-2
510
/23
255.255.254.0
Sub 6/7
8*
(28)-2
256-2=254
(28)-2
254
/24
255.255.255.0
Sub 7/7
* = 7 subs valid for Class A or B in 1st octet.
Class C has only 5 valid - the last 2 are binary all 1.
Bits
Subnets Subnets
Hosts
Per
Hosts Per
Slash
Masks
Sub
(n)
(2n-2)
(Decimal)
(2(8-n)-2)
(Decimal)
(Notation)
(Decimal)
(Slice)
1
(21)-2
2-2=0
(27)-2
0
/25
255.255.255.128
Subnet 0
2
(22)-2
4-2=2
(26)-2
62
/26
255.255.255.192 Sub
1/7
3
(23)-2
8-2=6
(25)-2
30
/27
255.255.255.224 Sub
2/7
4
(24)-2
16-2=14
(24)-2
14
/28
255.255.255.240 Sub
3/7
5
(25)-2
32-2=30
(23)-2
6
/29
255.255.255.248 Sub
4/7
6
(26)-2
64-2=62
(22)-2
2
/30
255.255.255.252 Sub
5/7
Given: You have address 132.7.0.0. You need 5 equal-size Subnets with 1,500 Hosts per Sub.
Objective: Compute the following information, in the following order.
A. Using the powers of 2, first see how many bits you need to steal from Hosts to acquire 5 subnets.
Weighted Values
Most Significant Bit Least Significant Bit
Subs 128 64 32 16 8 4 2 1 Hosts
1 1 1 0 0 0 0 0
B. Using powers of 2, next see how many Host bits you have remaining.
C. Using the Weighted Values Chart, find out what the decimal Subnet Mask will be.
D. Using the Decimal Mask, or the last Network Bit's Weighted Value, find the Incremental Value.
E. Using the Incremental Value, count up and find the First Host IP, Broadcast for that Sub, and the Last Host IP.
Notes: There are (23) - 2 = 6 subnets created. The - 2 is important, because you cannot use all 0 or all 1 subnets. The special all 0 address is the network ID for that subnet, and will be used by a router in its routing table. The special all 1 address is the network broadcast for all subnets on this wire.
Range 0 x 32 0 Subnet #0 Subnet Zero should be considered invalid.
Range 1 x 32 32 Subnet #1 Increment 32 = Subnet ID used by Routing Table
First Host = 33
Last Host = 62
Subnet Broadcast = 63
Range 2 x 32 64 Subnet #2 Increment 64 = Subnet ID used by Routing Table
First Host = 65
Last Host = 94
Subnet Broadcast = 95
Range 3 x 32 96 Subnet #3 Increment 96 = Subnet ID used by Routing Table
First Host = 97
Last Host = 126
Subnet Broadcast = 127
Range 4 x 32 128 Subnet #4 Increment 128 = Subnet ID used by Routing Table
First Host = 129
Last Host = 158
Subnet Broadcast = 159
Range 5 x 32 160 Subnet #5 Increment 160 = Subnet ID used by Routing Table
First Host = 161
Last Host = 190
Subnet Broadcast = 191
Range 6 x 32 192 Subnet #6 Increment 192 = Subnet ID used by Routing Table
First Host = 193
Last Host = 222
Subnet Broadcast = 223
Range 7 x 32 224 Subnet #7 Broadcast Reserved.