|
How to sub-net an IP Address: |
|
IP Addressing Basics:
|
 |
32 Bits in an IP address |
|
 |
4 Octets in
an IP address |
|
 |
4 Bytes make
up an IP address |
|
 |
8 Bits per
each octet |
|
|
|
Class |
Start |
End |
# of Networks |
# of Hosts |
Max # of Bits
Borrowed |
|
A |
0 |
126 |
126 |
16,777,214 |
24 |
|
B |
128 |
191 |
16,384 |
65,534 |
14 |
|
C |
192 |
223 |
2,097,152 |
254 |
6 |
|
D E |
224, 240 |
239, 254 |
N/A |
N/A |
N/A |
|
|
Binary Conversion Place Values
|
|
Place Value |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
2^ by Place Value |
2^7 |
2^6 |
2^5 |
2^4 |
2^3 |
2^2 |
2^1 |
2^0 |
|
Decimal Value |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
|
|
All possible
Subnets and Hosts
in
a
Class C
Address
|
|
# of Bits Borrowed from the IP
Address |
1 |
2 |
3 |
4 |
5 |
6 |
|
Total Number of
Subnets *
2^n |
2 |
4 |
8 |
16 |
32 |
64 |
|
Total Available
Number of Subnets
**2^n-2 |
0 |
2 |
6 |
14 |
30 |
62 |
|
Total Number of Host
Addresses
***2^n |
128 |
64 |
32 |
16 |
8 |
4 |
|
Total Number of
Available Hosts
****2^n-2 |
126 |
62 |
30 |
14 |
6 |
2 |
|
-
*Total number of Subnets is calculated
by raising 2 to the power of the number of bits borrowed (n)
-
**Total
number of Available Subnets is calculated the same as above except you subtract
2 for the unusable addresses of all ones and all zeros
-
***Total number of Host Address is calculated by
raising 2 the power of the number of bits remaining in the IP Address after you
have borrowed some to make sub nets
-
****Total Available number of Hosts Addresses
is calculated the same as above except you subtract 2 for the unusable hosts
|
|
Sub Net Masking
A Subnet mask is a binary number designed to
separate the Network ID from the Host ID on an IP address.
|
|
Why Subnet?
Organizing departments, use of different physical media (like Ethernet, FDDI, and WAN's), and conserve on
address space, security, and reducing network traffic.
|
|
Rules for Sub-netting
|
|
Example
I will borrow 3 bits from the last octet of a Class C Address, leaving
5 bits, of which 3 bits are used for host address and 2 bits for the Network ID.
Subnet numbers that are all one's
and zero's can not be used, they are reserved for
broadcasting and specifying the network address.
|
|
How To Make Subnet Numbers from an IP Address
First
Convert
the IP Address to a Binary Number so you can
borrow the bits from the last octet. The links
below can be used in this conversion process.
When Borrowing 3 bits from the subnet host
portion of the last octet,
always borrow from the
Most Significant Bit (MSB)
which is the
far left side of
the last octet or host field (00000000)
|
|
Second
Place the Binary Representation of N in
the first three bits of the last octet
after the dot
and before the remaining
binary numbers.
|
|
|
Third
Create Sub Networks using the number of bits you borrowed, by
writing a numeric list of the number of subnets you plan to create and write the
binary number for the numeric subnet number only using the binary bits you
borrowed.
Quick Example: If I
borrow 2 bits from a class C address, then I can make my subnet list using 0-3
which represents the number of new subnets I will have.
Subnet
0
1
2
3
Now I have to convert these four numbers in to binary format only
using 2 bits
Subnet
Binary Format
0
00
1
01
2
10
3
11
Now add back the remaining 6 bits of the binary number you
borrowed from to create the new binary number.
Subnet Binary
Format New Binary Number
0
00
00000000
1
01
01000000
2
10
10000000
3
11
11000000
Now
convert the
New Binary Number to
a decimal
New Binary Number New
Decimal Number
00000000
0
01000000
64
10000000
128
11000000
192
The
Host Addresses
are the numbers that fall between two subnet numbers,
64-128 and 128-192
|
|
Class C Address
Creating New Sub Network ID's
IP
Address: 193.1.1.0
Binary:
1000001.00000001.00000001.00000000
|
|
Subnet # |
Create a Binary IP Address |
Covert
to
Decimal |
|
0 |
11000001.00000001.00000001.00000000 |
193.1.1.0 |
|
1 |
11000001.00000001.00000001.00100000 |
193.1.1.32 |
|
2 |
11000001.00000001.00000001.01000000 |
193.1.1.64 |
|
3 |
11000001.00000001.00000001.01100000 |
193.1.1.96 |
|
4 |
11000001.00000001.00000001.10000000 |
193.1.1.128 |
|
5 |
11000001.00000001.00000001.10100000 |
193.1.1.160 |
|
6 |
11000001.00000001.00000001.11000000 |
193.1.1.192 |
|
7 |
11000001.00000001.00000001.11100000 |
193.1.1.224 |
|
|
|
|
More Rules:
-
You cannot use the all
ones or the all zeros sub net numbers
-
All ones are used for
specifying all hosts on network or broadcasting
-
All zeros are used for
specifying the local network
-
Subtract 2 from the total number of
subnets to find total usable subnets
|
|
HOST ADDRESSING:
Borrowing 3 bits from the host portion of
the IP address, leaves 5 bits to
create hosts. The number of bits not borrowed (or unmasked bits)
when raising 2 to a power:
Example: 23 - 2 = 30
-
There are 30 Host addresses
available per subnet work
-
Each subnet can have Hosts assigned to any
address between the Subnet Address and the Broadcast
Address
-
There are 32 Values between each subnet in a
Class C Address
|
|
Range |
Valid
#'s |
Network Address |
Range |
Valid
#'s |
Network Address |
|
0-31 |
Not Valid |
|
129-158 |
129-158 |
128 |
|
32-63 |
33-63 |
32 |
160-190 |
161-190 |
160 |
|
64-94 |
65-94 |
64 |
192-223 |
193-222 |
192 |
|
96-127 |
97-126 |
96 |
224-255 |
Not Valid |
|
|
|
|
|
HOW TO FIND THE NETWORK NUMBER USING ANDING:
|
 |
Applying a subnet mask to an IP
Address allows you to identify the network and the host parts of the address
|
|
 |
This is
accomplished by performing a bit wise logical AND operation between the IP
address and the subnet mask.
|
|
 |
The Logical AND
operation compares 2 bits, (one from IP address
and one from subnet mask), if they are both “1”, then the
answer will be “1”, other wise the result is zero.
|
 |
Example:
0 0 0
1 0 1
0 0 1
|
|
|
|
Address |
Dotted Decimal
Notation |
Binary Representation |
|
IP Address
|
192.168.16.42 |
11000000.10101000.00010000.00101010
|
|
Subnet Mask
|
255.255.255.0 |
11111111.11111111.11111111.00000000
|
|
Network ID
|
192.168.16.0 |
11000000.10101000.00010000.00000000 |
|
|
By ANDing together the senders IP address
and the subnet mask, and then ANDing together the destination IP
address with the senders subnet mask, and comparing the two
results, you can tell if the destination is local (in same
network) or remote (sent to a default gateway)
|
|
How to determine which host ID belongs to
which IP Address:
|
|
Private Addresses:
|