Class A: 8 bits (1 octet) fixed, 24 bits for your use Class B: 16 bits (2 octets) fixed, 16 bits for your use Class C: 24 bits (3 octets) fixed, 8 bits for your use Example: 12.0.0.0 is class A, so we have 8 fixed, 24 free Example: 152.23.0.0 is class B, so we have 16 fixed, 16 free Example: 227.78.1.0 is class C, so we have 24 fixed, 8 free
Example 1: we need 20 usable subnets. The closest N such that 2N-2 >= 20 is N=5, giving 32 subnets, 30 useable. We must borrow 5 bits from the host field.
Example 2: we need 500 machines per subnet. The closest N such that 2N-2 >= 500 is N=9, giving 512 hosts per subnet, 500 useable. We must leave 9 bits in the host field.
Example 1: Assume given network is 12.0.0.0 (8 bits fixed), and we have borrowed 5 bits from the host field. We have:
nnnn nnnn . ssss Shhh . hhhh hhhh . hhhh hhhh 1111 1111 . 1111 1000 . 0000 0000 . 0000 0000 255 . 248 . 0 . 0
Example 2: Assume given network is 152.23.0.0 (16 bits fixed), and we have left 9 in the host field i.e borrowed 7 bits. We have:
nnnn nnnn . nnnn nnnn . ssss ssSh . hhhh hhhh 1111 1111 . 1111 1111 . 1111 1110 . 0000 0000 255 . 255 . 254 . 0
Example 1: We borrowed 5 bits from the 24 bits in the host field, leaving 19 bits in the host field. Host numbers range from:
000 . 0000 0000 . 0000 0000 0.0.0 to 111 . 1111 1111 . 1111 1111 7.255.255
Example 2: We have 9 bits left in the host field. Host numbers range from:
0 . 0000 0000 0.0 to 1 . 1111 1111 1.255
Example 1: We borrowed 5 bits, creating 25 = 32 subnets. The lowest 1 bit in the network mask is worth 8 in the second octet. Therefore, we have subnets:
12.0.0.0, 12.8.0.0, 12.16.0.0, 12.24.0.0, 12.32.0.0, 12.40.0.0, 12.48.0.0, 12.56.0.0, 12.64.0.0, 12.72.0.0, 12.80.0.0, 12.88.0.0, 12.96.0.0, 12.104.0.0, 12.112.0.0, 12.120.0.0, 12.128.0.0, 12.136.0.0, 12.144.0.0, 12.152.0.0, 12.160.0.0, 12.168.0.0, 12.176.0.0, 12.184.0.0, 12.192.0.0, 12.200.0.0, 12.208.0.0, 12.216.0.0, 12.224.0.0, 12.232.0.0, 12.240.0.0, 12.248.0.0The first and last subnet are unusable.
Example 2: We borrowed 7 bits, creating 27 = 128 subnets. The lowest 1 bit in the network mask is worth 2 in the third octet. Therefore, we have subnets:
152.23.0.0, 152.23.2.0, 152.23.4.0, ..... .... , 152.23.252.0, 152.23.254.0The first and last subnet are unusable.
Example 1: nb. All hosts have netmask 255.248.0.0
Subnet Host Range Net # 12.0.0.0 12.0.0.0 to 12.7.255.255 #1 12.8.0.0 12.8.0.0 to 12.15.255.255 #2 ... 12.240.0.0 12.240.0.0 to 12.247.255.255 #31 12.248.0.0 12.248.0.0 to 12.255.255.255 #32
Example 2: nb. All hosts have netmask 255.255.254.0
Subnet Host Range Net # 152.23.0.0 152.23.0.0 to 152.23.1.255 #1 152.23.2.0 152.23.2.0 to 152.23.3.255 #2 .... 152.23.252.0 152.23.252.0 to 152.23.253.255 #127 152.23.254.0 152.23.254.0 to 152.23.255.255 #128
------------------------------------------------------------------------------------------------------------------
subnet mask:
The subnet mask (formal term: extended network prefix), is not an address, but determines which part of an IP address is the network field and which part is the host field. A subnet mask is 32 bits long and has 4 octets, just like an IP address.
To determine the subnet mask for a particular subnetwork IP address follow these steps.
(1) Express the subnetwork IP address in binary form.
(2) Replace the network and subnet portion of the address with all 1s.
(3) Replace the host portion of the address with all 0s.
(4) As the last step convert the binary expression back to dotted-decimal notation.
Note: The extended network prefix includes the class A, B, or C network number, plus the subnet field (or subnet number) that is being used to extend the routing information (which is otherwise just the network number).
|
|