subnet for novice

Upload: asim-roy

Post on 03-Apr-2018

236 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Subnet For Novice

    1/14

    Subnet for Novice

    Network

    Class

    1st Octet MSD # ofNetwork bit

    # of Host

    bit

    Assignable

    IP ranges

    Assignable

    IP ranges

    Broadcast

    Address

    Subnet Mask

    A 0 - 127 0 8 24 N.H.H.H 1 - 126 127 255.0.0.0

    B 128 - 191 10 16 16 N.N.H.H 129 - 190 191 255.255.0.0

    C 192 - 223 110 24 8 N.N.N.H 193 - 222 223 255.255.255.0D 224 239 Reserved for IP Multicasting 225 - 238 238 N/A

    E 240 254 Reserved for R & D 241 - 253 254 N/A

    N = network address bits; H = host/node address bits (s+h, where s= # of subnet bits and h= # of host bits)

    Class A Addressing Guide

    CIDR Subnet Mask # of bits

    Borrowed

    Total # of Subnets Total # of Hosts Total Assignable

    Hosts

    /32 255.255.255.255 This is a single host route

    /31 255.255.255.254 2 0

    /30 255.255.255.252 22 4,194,304 4 2

    /29 255.255.255.248 21 2,097,152 8 6

    /28 255.255.255.240 20 1,048,576 16 14

    /27 255.255.255.224 19 524,288 32 30

    /26 255.255.255.192 18 262,144 64 62

    /25 255.255.255.128 17 131,072 128 126

    /24 255.255.255.0 16 65,536 256 254

    /23 255.255.254.0 15 32,768 512 510

    /22 255.255.252.0 14 16,384 1024 1022

    /21 255.255.248.0 13 8192 2048 2046

    /20 255.255.240.0 12 4096 4096 4094

    /19 255.255.224.0 11 2048 8192 8190

    /18 255.255.192.0 10 1024 16,384 16,382

    /17 255.255.128.0 9 512 32,768 32,766

    /16 255.255.0.0 8 256 65,536 65,534

    /15 255.254.0.0 7 128 131,072 131,070/14 255.252.0.0 6 64 262,144 262,142

    /13 255.248.0.0 5 32 524,288 524,286

    /12 255.240.0.0 4 16 1,048,576 1,048,574

    /11 255.224.0.0 3 8 2,097,152 2,097,150

    /10 255.192.0.0 2 4 4,194,304 4,194,302

    /9 255.128.0.0 1 2 8,388,608 8,388,606

    /8 255.0.0.0 0 1 16,777,216 16,777,214

    Class B Addressing Guide

    CIDR Subnet Mask # of bits

    Borrowed

    Total # of Subnets Total # of Hosts Total Assignable

    Hosts

    /30 255.255.255.252 14 16,384 4 2

    /29 255.255.255.248 13 8192 8 6

    /28 255.255.255.240 12 4096 16 14

    1

  • 7/28/2019 Subnet For Novice

    2/14

    /27 255.255.255.224 11 2048 32 30

    /26 255.255.255.192 10 1024 64 62

    /25 255.255.255.128 9 512 128 126

    /24 255.255.255.0 8 256 256 254

    /23 255.255.254.0 7 128 512 510

    /22 255.255.252.0 6 64 1024 1022

    /21 255.255.248.0 5 32 2048 2046

    /20 255.255.240.0 4 16 4096 4094/19 255.255.224.0 3 8 8192 8190

    /18 255.255.192.0 2 4 16,384 16,382

    /17 255.255.128.0 1 2 32,768 32,766

    /16 255.255.0.0 0 1 65,536 65,534

    Class C Addressing Guide

    CIDR Subnet Mask # of bits

    Borrowed

    Total # of Subnets Total # of Hosts Total Assignable

    Hosts

    /30 255.255.255.252 6 64 4 2

    /29 255.255.255.248 5 32 8 6

    /28 255.255.255.240 4 16 16 14

    /27 255.255.255.224 3 8 32 30

    /26 255.255.255.192 2 4 64 62

    /25 255.255.255.128 1 2 128 126

    /24 255.255.255.0 0 1 256 254

    2

  • 7/28/2019 Subnet For Novice

    3/14

    IP Addressing Guide Class A, Class B, Class C

    CIDR Subnet Mask # of bit borrowed

    S = CIDR - N

    Total Subnets = 2**S

    or 2**(24-H/16-H/8-H)

    Total Hosts Total Hosts

    Assignable

    /32 255.255.255.255 A B C A B C

    /31 255.255.255.254

    /30 255.255.255.252 22 14 6 4194304 16384 64 4 2

    /29 255.255.255.248 21 13 5 2097152 8192 32 8 6/28 255.255.255.240 20 12 4 1048576 4096 16 16 14

    /27 255.255.255.224 19 11 3 524288 2048 8 32 30

    /26 255.255.255.192 18 10 2 262144 1024 4 64 62

    /25 255.255.255.128 17 9 1 131072 510 2 128 126

    /24 255.255.255.0 16 8 0 65536 256 256 254

    /23 255.255.254.0 15 7 32768 128 512 510

    /22 255.255.252.0 14 6 16384 64 1024 1022

    /21 255.255.248.0 13 5 8192 32 2048 2046

    /20 255.255.240.0 12 4 4096 16 4096 4094

    /19 255.255.224.0 11 3 2048 8 8192 8190

    /18 255.255.192.0 10 2 1024 4 16,384 16,382

    /17 255.255.128.0 9 1 512 2 32,768 32,766

    /16 255.255.0.0 8 0 256 65,536 65,534/15 255.254.0.0 7 128 131,072 131,070

    /14 255.252.0.0 6 64 262,144 262,142

    /13 255.248.0.0 5 32 524,288 524,286

    /12 255.240.0.0 4 16 1,048,576 1,048,574

    /11 255.224.0.0 3 8 2,097,152 2,097,150

    /10 255.192.0.0 2 4 4,194,304 4,194,302

    /9 255.128.0.0 1 2 8,388,608 8,388,606

    /8 255.0.0.0 0 16,777,216 16,777,214

    Mask Subnet Boundary

    /30 252 248 244 240 236 232 228 224 220 216 212 208 204 200 196 192

    188 184 180 176 172 168 164 160 156 152 148 144 140 136 132 128

    124 120 116 112 108 104 100 96 92 88 84 80 76 72 68 64

    60 56 52 48 44 40 36 32 28 24 20 16 12 8 4 0

    /29 248 240 232 224 216 208 200 192 184 176 168 160 152 144 136 128

    120 112 104 96 88 80 72 64 56 48 40 32 24 16 8 0

    /28 240 224 208 192 176 160 144 128 112 96 80 64 48 32 16 0

    /27 224 192 160 128 96 64 32 0

    /26 192 128 64 0

    /25 128 0

    Note: A subnet address of a network always starts at boundary. A subnet address cannot starts in between two

    boundaries.

    Network Addresses are always EVEN Broadcast addresses are always ODD

    First usable addresses are always ODD Last usable addresses are always EVEN

    No host/node address can have (octets 2,3,4 or octets 3,4 or octet 4 containing) all 0s or all 1s

    Octets containing all 0s are called Gateway address

    3

  • 7/28/2019 Subnet For Novice

    4/14

    Octets containing all 1s are called Broadcast address

    Host/node address cannot be represented by octets containing all 0s or all 1s

    Subnet X = Not necessarily 1 network rather consists of a range/group of networks with sequential IP address

    Number of bits (N) for subnet X = 2 ** N < = X or Strip of all leading zeros and count # of remaining digits of X binary

    CIDR = Mask Bits = # of leading 1s in 32 bits subnet mask

    Total Number of Hosts = 2 ** (32 CIDR #) (including network and broadcast IP address)

    Total number of assignable hosts = 2 ** (32 CIDR #) - 2

    Number of Subnet = Class A: 2**(24 h) or 2**s || Class B: 2**(16 h) or 2**s || Class C: 2**(8 h) or 2**s

    Calculating Subnets and its IP ranges in a Class A Network

    Example 1

    Given network IP address (25.0.0.0), get 14 subnets and its IP address ranges.

    Network IP address (25.0.0.0) represents a class A network because 1st octet (e.g. 25) is within 0 127.

    For class A network, 1st octet (e.g. 25) represents network address and octets 2, 3, 4 (e.g. 0.0.0) represent host/node address.

    For subnetting a class A network address 25.0.0.0, we need to consider the 1st host/node octet (2nd octet of the network

    address) and find out # of lower bits required to represent 14 (required # of subnet).

    The binary representation of the 1st host/node octet or the 2nd octet of the network IP address (e.g. 0) is

    0 0 0 0 0 0 0 0

    128 64 32 16 8 4 2 1

    Therefore, lower order 4 bits (8+4+2+1=15) are required to get 14 subnets.

    To get the corresponding subnet mask, add 4 higher order bits (128+64+32+16) = 240

    Therefore, the subnet mask of network address 25.0.0.0 for having 14 subnets is 25.240.0.0.

    Please note that, in general, the subnet mask for the class A network is 255.0.0.0. But since the network IP address 25.0.0.0

    has been subneted to 14 subnets the corresponding subnet mask is 25.240.0.0. The subnet mask 25.240.0.0 indicates that

    the class A network IP address 25.0.0.0 contains max of 2**4 2 = 14 subnets.

    The added high order bits used in determining the subnet mask are 128, 64, 32, 16. The lowest of the high order bits is used

    in determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the

    2nd octet of the given network address, that is 25.16.0.0. The subsequent subnet address will be determined just by adding16 to the 2nd octet of the previous subnet address. Therefore, the 14 subnet addresses are:

    25.16.0.0 25.32.0.0 25.48.0.0 25.64.0.0 25.80.0.0 25.96.0.0 25.112.0.0

    25.128.0.0 25.144.0.0 25.160.0.0 25.176.0.0 25.192.0.0 25.208.0.0 25.224.0.0

    The number of host/node IP addresses in each subnet = 2**(24 4) 2 = 1048576 2 = 1048574

    The IP ranges of individual subnet are as follows.

    4

  • 7/28/2019 Subnet For Novice

    5/14

    Subnet # Subnet Addr Start Addr End Addr Broadcast Addr

    1 25.16.0.0 25.16.0.1 25.31.255.254 25.31.255.255

    2 25.32.0.0 25.32.0.1 25.47.255.254 25.47.255.255

    3 25.48.0.0 25.48.0.1 25.63.255.254 25.63.255.255

    4 25.64.0.0 25.64.0.1 25.79.255.254 25.79.255.255

    5 25.80.0.0 25.80.0.1 25.95.255.254 25.95.255.255

    6 25.96.0.0 25.96.0.1 25.111.255.254 25.111.255.255

    7 25.112.0.0 25.112.0.1 25.127.255.254 25.127.255.255

    8 25.128.0.0 25.128.0.1 25.143.255.254 25.143.255.255

    9 25.144.0.0 25.144.0.1 25.159.255.254 25.159.255.255

    10 25.160.0.0 25.160.0.1 25.175.255.254 25.175.255.255

    11 25.176.0.0 25.176.0.1 25.191.255.254 25.191.255.255

    12 25.192.0.0 25.192.0.1 25.207.255.254 25.207.255.255

    13 25.208.0.0 25.208.0.1 25.223.255.254 25.223.255.255

    14 25.224.0.0 25.224.0.1 25.239.255.254 25.239.255.255

    Example 2

    Given network IP address (100.24.0.0), get 25 subnets and its IP address ranges.

    For class A network, one octet (1st octet) (e.g. 100) represents the network address

    For class A network, 3 octets (octets 2, 3, 4) (e.g. 20.0.0) represent host/node address.

    For subnetting class A network of address 100.20.0.0, we need to consider the 1st host/node octet (2nd octet of the network

    address) and find out # of lower bits are required for 25 (required # of subnet).

    The binary representation of the 1st host/node octet or the 2nd octet of the network IP address (that is 20) is

    0 0 0 1 0 1 0 0

    128 64 32 16 8 4 2 1

    Therefore, lower order 5 bits (16+8+4+2+1=31) are required to get 25 subnets.

    To get the corresponding subnet mask, add 5 higher order bits (128+64+32+16+8) = 248

    Therefore, the subnet mask of 100.24.0.0 for having 25 subnets is 100.248.0.0.

    Please note that, in general, the subnet mask for the class A network is 255.0.0.0. But since the network IP address

    100.20.0.0 has been subneted to 25 subnets the corresponding subnet mask is 100.248.0.0.. The subnet mask 100.248.0.0

    indicates that the class A network IP address 100.24.0.0 contains max of 2**5 2 = 30 subnets.

    The added high order bits used in determining the subnet mask are 128, 64, 32, 16, 8. The lowest of the high order bits is

    used in determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to

    the 2nd octet of the given network address, that is 100.20.0.0. The subsequent subnet address will be determined just by

    adding 8 to the 2nd octet of the previous subnet address. Therefore, the 25 subnet addresses are

    5

  • 7/28/2019 Subnet For Novice

    6/14

    100.32.0.0 100.40.0.0 100.48.0.0 100.56.0.0 100.64.0.0

    100.72.0.0 100.80.0.0 100.88.0.0 100.96.0.0 100.104.0.0

    100.112.0.0 100.120.0.0 100.128.0.0 100.136.0.0 100.144.0.0

    100.152.0.0 100.160.0.0 100.168.0.0 100.176.0.0 100.184.0.0

    100.192.0.0 100.200.0.0 100.208.0.0 100.216.0.0 100.224.0.0

    The number of host/node IP addresses in each subnet = 2**(24 5) 2 = 131072 2 = 131070

    The IP ranges of individual subnet are as follows.

    Subnet # Subnet Addr Start Addr End Addr Broadcast Addr

    1 100.32.0.0 100.32.0.1 100.35.255.254 100.35.255.255

    2 100.40.0.0 100.40.0.1 100.43.255.254 100.43.255.255

    3 100.48.0.0 100.48.0.1 100.44.255.254 100.51.255.255

    4 100.56.0.0 100.56.0.1 100.59.255.254 100.59.255.255

    5 100.64.0.0 100.64.0.1 100.75.255.254 100.75.255.255

    .. . . .. ..

    .. . . .. ..

    24 100.216.0.0 100.216.0.1 100.229.255.254 100.229.255.255

    25 100.224.0.0 100.224.0.1 100.237.255.254 100.237.255.255

    Calculating Subnets and its IP ranges in a Class B Network

    Example 3

    Given network IP address (131.100.0.0), get 13 subnets and its IP address ranges.

    For class B network, octet 1st, 2nd (e.g. 131.100) represent the network address.

    For class C network, octet 3rd, 4th (e.g. 0.0) represents host/node address.

    For subnetting class B network of address 131.100.0.0 we need to consider the 1st host/node octet (3rd octet of the network

    address) and find out # of lower bits are required for 13 (required # of subnet).

    The binary representation of the 1st host/node octet or the 4th octet of the network IP address (that is 15) is

    0 0 0 0 1 1 1 1

    128 64 32 16 8 4 2 1

    Therefore, lower order 4 bits (8+4+2+1=15) are required to get 13 subnets.

    To get the corresponding subnet mask, add 4 higher order bits (128+64+32+16) = 240

    Therefore, the subnet mask of network address 131.100.0.0 for having 13 subnets is 255.255.240.0.

    6

  • 7/28/2019 Subnet For Novice

    7/14

    Please note that, in general, the subnet mask for the class B network is 255.255.0.0. But since the network IP address

    131.100.0.0 has been subneted to 13 subnets the corresponding subnet mask is 255.255.240.0. The subnet mask

    255.255.240.0 indicates that the class C network IP address 131.100.0.0 contains max of 2**4 2 = 14 subnets.

    The added high order bits used in determining the subnet mask are 128, 64, 32, 16. The lowest of the high order bits is used

    in determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the

    3rd octet of the given network address (131.100.0.0). The subsequent subnet address will be determined just by adding 16 to

    the 3rd

    octet of the previous subnet address. Therefore, the 13 subnet addresses are:

    131.100.16.0 131.100.32.0 131.100.48.0 131.100.64.0 131.100.80.0

    131.100.96.0 131.100.112.0 131.100.128.0 131.100.144.0 131.100.160.0

    131.100.176.0 131.100.192.0 131.100.208.0

    The number of host/node IP addresses in each subnet = 2**(16 4) 2 = 4096 - 2 = 4094

    The IP ranges of individual subnet are as follows.

    Subnet # Subnet Addr Start Addr End Addr Broadcast Addr

    1 131.100.16.0 131.100.16.1 131.100.31.254 131.100.31.255

    2 131.100.32.0 131.100.32.1 131.100.47.254 131.100.47.255

    3 131.100.48.0 131.100.48.1 131.100.63.254 131.100.63.255

    ----- ---- ---- ----

    ----- ---- ---- ----

    12 131.100.192.0 131.100.192.1 131.100.207.254 131.100.207.255

    13 131.100.208.0 131.100.208.1 131.100.223.254 131.100.223.255

    The last subnet is

    14 131.100.224.0 131.100.224.1 131.100.239.254 131.100.239.255

    Calculating Subnets and its IP ranges in a Class C Network

    Example 5

    Given network IP address (195.20.45.15), get 5 subnets and its IP address ranges.

    For class C network, octet 1st, 2nd, 3rd (e.g. 195.20.45) represent the network address.

    For class C network, octet 4th (e.g. 15) represents host/node address.

    For subnetting class C network of address 195.20.45.15 we need to consider the 1st host/node octet (4th octet of the network

    address) and find out # of lower bits are required for 5 (required # of subnet).

    The binary representation of the 1st host/node octet or the 4th octet of the network IP address (that is 15) is

    0 0 0 0 1 1 1 1

    128 64 32 16 8 4 2 1

    Therefore, lower order 3 bits (4+2+1=7) are required to get 5 subnets..

    To get the corresponding subnet mask, add 3 higher order bits (128+64+32) = 224

    7

  • 7/28/2019 Subnet For Novice

    8/14

    Therefore, the subnet mask of network address 195.20.45.15 for having 5 subnets is 195.20.45.239.

    Please note that, in general, the subnet mask for the class C network is 255.255.255.0. But since the network IP address

    195.20.45.15 has been subneted to 5 subnets the corresponding subnet mask is 195.20.45.239. The subnet mask

    195.20.45.239 indicates that the class C network IP address 195.20.45.15 contains max of 2**3 2 = 6 subnets.

    The added high order bits used in determining the subnet mask are 128, 64, 32. The lowest of the high order bits is used in

    determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the 4 th

    octet of the given network address (195.20.45.15). The subsequent subnet address will be determined just by adding 32 to

    the 4th octet of the previous subnet address. Therefore, the 5 subnet addresses are:

    195.20.45.47 195.20.45.79 195.20.45.111 195.20.45.143 195.20.45.175

    The number of host/node IP addresses in each subnet = 2**(8 3) 2 = 32 2 = 30

    The IP ranges of individual subnet are as follows.

    Subnet # Subnet Addr Start Addr End Addr Broadcast Addr

    1 195.20.45.47 195.20.45.48 195.20.45.77 195.20.45.78

    2 195.20.45.79 195.20.45.80 195.20.45.109 195.20.45.110

    3 195.20.45.111 195.20.45.112 195.20.45.141 195.20.45.142

    4 195.20.45.143 195.20.45.144 195.20.45.173 195.20.45.174

    5 195.20.45.175 195.20.45.176 195.20.45.208 195.20.45.209

    The last subnet is

    6 195.20.45.210 195.20.45.211 195.20.45.240 195.20.45.241

    Loss of Usable IP address

    The loss of usable IP address in the class C network due to subneting is a lot. That loss depends on # of subnets are created.

    The smaller number subnet creation means more loss of usable IP address and the bigger number subnet creation means

    less loss of usable IP address.

    For this particular example, you lost two usable IP address in each subnet (subnet address, broadcast address) plus all

    address in between 195.20.45.15 and 195.20.45.47.

    Example 6

    Given network IP address (220.10.55.0), get 2 subnets and its IP address ranges.

    For class C network, octet 1st, 2nd, 3rd (e.g. 220.10.55) represent the network address.

    For class C network, octet 4th (e.g. 0) represents host/node address.

    For subnetting class C network of address 220.10.55.0, we need to consider the higher order host/node octet (here is 4 th

    octet of the network address) and find out # of lower bits required for 2 (required # of subnet).

    The binary representation of the 1

    st

    host/node octet or the 4

    th

    octet of the network IP address (that is 0) is0 0 0 0 0 0 0 0

    128 64 32 16 8 4 2 1

    Therefore, lower order 2 bits (2+1=3) are required to get 2 subnets..

    To get the corresponding subnet mask, add 2 higher order bits (128+64) = 192

    8

  • 7/28/2019 Subnet For Novice

    9/14

    Therefore, the subnet mask of network address 220.10.55.0 for having 2 subnets is 220.10.55.192.

    Please note that, in general, the subnet mask for the class C network is 255.255.255.0. But since the network IP address

    220.10.55.0 has been subneted to 2 subnets the corresponding subnet mask is 220.10.55.192. The subnet mask

    220.10.55.192 indicates that the class C network IP address 220.10.55.0 contains max of 2**2 2 = 2 subnets.

    The added high order bits used in determining the subnet mask are 128, 64. The lowest of the high order bits is used in

    determining the subnet address. The first subnet address is determined by adding the lowest of the high order bits to the 4 th

    octet of the given network address (220.10.55.0). The subsequent subnet address will be determined just by adding 64 to

    the 4th octet of the previous subnet address. Therefore, the 2 subnet addresses are:

    220.10.55.64 195.20.45.128

    The number of host/node IP addresses in each subnet = 2**(8 2) 2 = 64 2 = 62

    The IP ranges of individual subnet are as follows.

    Subnet # Subnet Addr Start Addr End Addr Broadcast Addr

    1 220.10.55.64 220.10.55.65 220.10.55.126 220.10.55.127

    2 220.10.55.128 220.10.55.129 220.10.55.190 220.10.55.191

    Loss of Usable IP address

    The loss of usable IP address in the class C network due to subneting is a lot. That loss depends on # of subnets are created.

    The smaller number subnet creation means more loss of usable IP address and the bigger number subnet creation means

    less loss of usable IP address.

    For this particular example, you lost two usable IP address in each subnet (subnet address, broadcast address) plus all

    address in between 220.10.55.0 and 220.10.55.64.

    Mask to CIDR Conversion

    Problem 1: Find CIDR when Subnet Mask is 255.255.248.0

    The binary representation of subnet mask 255.255.248.0 is

    11111111 11111111 11111000 00000000

    # of leading 1s 8 8 5

    Total # of leading 1s = 8 + 8 + 5 = 21

    Therefore, CIDR = /21

    Problem 2: Find CIDR when Subnet Mask is 255.255.255.192

    The binary representation of subnet mask 255.255.255.192 is

    11111111 11111111 11111111 11000000

    # of leading 1s 8 8 8 2

    Total # of leading 1s = 8 + 8 + 8 + 2 = 26

    9

  • 7/28/2019 Subnet For Novice

    10/14

    Therefore, CIDR = /26

    CIDR to Mask Conversion

    Problem 3: Find subnet mask when CIDR is /23

    23/8 = 2 with remainder 7

    Mask = 8 leading 1 in 1st octet, 8 leading 1 in 2nd octet, 7 leading 1 in 3rd octet, 0 leading 1 in 4th octet

    The binary representation of Mask is 11111111 11111111 11111110 00000000

    The decimal representation of Mask is 255.255.254.0

    Problem 4: Find subnet mask when CIDR is /29

    29/8 = 3 with remainder 5

    Mask = 8 leading 1 in 1st octet, 8 leading 1 in 2nd octet, 8 leading 1 in 3rd octet, 5 leading 1 in 4th octet

    The binary representation of Mask is 11111111 11111111 11111111 11111000

    The decimal representation of Mask is 255.255.255.248

    Problem 5: Given a network address and subnet mask Find # of subnets and # of hosts per subnet.

    Given the address - 172.16.0.0 /22

    First we list the binary representation of network IP address and then the subnet mask.

    Network IP address 10101100 00010000 00000000 00000000 Class B

    |--------network--------| |-----------host----------|

    Subnet mask = /22 (8+8+6+0) 11111111 11111111 11111100 00000000

    |--------|-----------------|

    p=6 q=10

    Number of subnets:For class B network, 1st host octet or 3rd network IP address octet is used for subnet calculation. We look for # of high

    order non zero in sequence bits in the 3rd octet of the mask or # of high order non zero in sequence bits in the host.

    That is 6 ( /22 = 8 + 8 + 6).

    Formula: = 2**p 2, where p = 6 is # of high order non zero in sequence bits in the 3rd octet in the mask

    Therefore, the # of subnets = 2**6 2 = 64-2 = 62.

    Number of hosts per subnet:

    Formula: 2**q 2, where q is # of bits available for hosts = 10 (/22: 32 - 22 = 10)

    or # of low order zero in sequence bits in the mask = 10

    Therefore, # of hosts per subnet = 2**10 - 2 = 1024 - 2 = 1022

    Problem 6: Given a network address (172.16.0.0 ), # of subnets, and hosts per subnet, Find the customers subnets.

    (Requirements: need 6 departments with 2000 hosts per department)

    First we list the network address and then the mask in binary:

    10

  • 7/28/2019 Subnet For Novice

    11/14

    Network address 10101100 00010000 00000000 00000000 172.16.0.0 Class B

    Network mask 11111111 11111111 00000000 00000000 255.255.0.0 Default class B net mask

    For class B network, octet 1st, 2nd (e.g. 172.16) represent the network address.

    For class B network, octet 3rd, 4th (e.g. 0.0) represents host/node address.

    For subnetting class B network of address 172.16.0.0, we need to consider the higher order host/node octet (here is 3 rd octetof the network address) and find out # of lower bits required for 6 (required # of department which is same as subnet).

    The binary representation of the 1st host/node octet or the 3rd octet of the network IP address (that is 0) is

    0 0 0 0 0 0 0 0

    128 64 32 16 8 4 2 1

    Therefore, lower order 3 bits (4+2+1=7) are required to get 6 subnets.

    To get the corresponding subnet mask, take 3 higher order non-zero in-sequence bits and add them (128+64+32) = 224

    Therefore, the subnet mask of network address 172.16.0.0 is 172.16.224.0 that can be represented by 172.16.0.0/19The # of host per subnet = 2**(total host bits in class B - # of higher bits used for subnet) - 2

    = 2**(16 3) 2 = 8192 2 = 8190 ------- enough host per subnet as requirement.

    Problem 7: Given a network address (172.16.0.0) and subnet mask (255.255.224.0), list the valid subnets

    First we list the mask then the address in binary:

    First we list the network address and then the mask in binary:

    Network address 10101100 00010000 00000000 00000000 172.16.0.0 Class B

    Network mask 11111111 11111111 11100000 00000000 255.255.224.0

    |---|-------|

    3 5

    As we know, for class B network the corresponding to the 1st host octet or corresponding to the 3 rd network octet of the

    mask play an important role for calculating subnet ranges (# of subnets). Here, mask used 3 extra bits (3 non-zero

    high order in-sequence bits) and 5 zero in-sequence bits. This 5 non-zero in-sequence bits signifies the subnet

    ranges. Therefore, 2**5 = 32 is the range of subnet address or the subnet address interval. Therefore, we need to add

    32 to the 1st host octet in order to subnet ranges. Therefore, the valid subnets are:

    172.16.32.0 172.16.64.0 172.16.96.0 172.16.128.0 172.16.160.0 172.16.192.0 172.16.224.0

    An even simpler way to do this is list the mask, say 255.255.255.224

    As the fourth octet has been manipulated we subtract 224 from 256 = 32 so our networks will increment in 32's, 32,

    64, 96 etc

    Problem 8: Given a network address (192.168.1.44 ) and subnet mask (255.255.255.192) identify which subnet the

    address belongs to (here address means 192.168.1.44).

    First we covert the network address and then the subnet mask to binary

    11

  • 7/28/2019 Subnet For Novice

    12/14

    Network addr 11000000 10101000 00000001 00101100 192.168.1.44 class C network

    Network mask 11111111 11111111 11111111 11000000 255.255.255.292

    Next we do a logical AND, where we compare the subnet mask to the address and where there is a 1 and a 1 we list

    1, where there is a 1 and a 0 we list as 0, and where is a 0 and a 0 we list 0

    So adding our two values we get:

    11000000 10101000 00000001 00000000Converting our address back to binary we get: 192.168.1.0 - which is the subnet our address belongs to

    Class C Subnet at a Glance

    Example: /25 Network

    Network/Subnet mask = /25; Total Subnet = 2; IP Addr per subnet = 128; Hosts per subnet = 126

    Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved

    Subnet # Subnet Network Addr Subnet GW Addr Subnet Start Addr Subnet End Addr Broadcast Addr

    1 195.20.45.0 195.20.45.1 195.20.45.2 195.20.45.126 195.20.45.127

    2 195.20.45.128 195.20.45.129 195.20.45.130 195.20.45.254 195.20.45.255

    Example: /26 Network

    Network/Subnet mask = /26; Total Subnet = 4; IP Addr per subnet = 64; Hosts per subnet = 62

    Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved

    Subnet # Subnet Network Addr Subnet GW Addr Subnet Start Addr Subnet End Addr Broadcast Addr

    1 195.20.45.0 195.20.45.1 195.20.45.2 195.20.45.62 195.20.45.63

    2 195.20.45.64 195.20.45.65 195.20.45.66 195.20.45.126 195.20.45.127

    3 195.20.45.128 195.20.45.129 195.20.45.130 195.20.45.190 195.20.45.191

    4 195.20.45.192 195.20.45.193 195.20.45.194 195.20.45.254 195.20.45.255

    Example: /27 Network

    Network/Subnet mask = /27; Total Subnet = 8; IP Addr per subnet = 32; Hosts per subnet = 30

    Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved

    Subnet # Subnet Network Addr Subnet GW Addr Subnet Start Addr Subnet End Addr Broadcast Addr

    1 195.20.45.0 195.20.45.1 195.20.45.2 195.20.45.30 195.20.45.31

    2 195.20.45.32 195.20.45.33 195.20.45.34 195.20.45.62 195.20.45.63

    3 195.20.45.64 195.20.45.65 195.20.45.66 195.20.45.94 195.20.45.95

    4 195.20.45.96 195.20.45.96 195.20.45.98 195.20.45.126 195.20.45.127

    5 195.20.45.128 195.20.45.129 195.20.45.130 195.20.45.158 195.20.45.159

    6 195.20.45.160 195.20.45.161 195.20.45.162 195.20.45.190 195.20.45.191

    7 195.20.45.192 195.20.45.193 195.20.45.194 195.20.45.222 195.20.45.223

    12

  • 7/28/2019 Subnet For Novice

    13/14

    8 195.20.45.224 195.20.45.225 195.20.45.226 195.20.45.254 195.20.45.255

    Example: /28 Network

    Network/Subnet mask = /28; Total Subnet = 16; IP Addr per subnet = 16; Hosts per subnet = 14

    Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved

    Subnet # Subnet Network Addr Subnet GW Addr Subnet Start Addr Subnet End Addr Broadcast Addr

    1 195.20.45.0 195.20.45.1 195.20.45.2 195.20.45.14 195.20.45.15

    2 195.20.45.16 195.20.45.17 195.20.45.18 195.20.45.30 195.20.45.31

    3 195.20.45.32 195.20.45.33 195.20.45.34 195.20.45.46 195.20.45.47

    4 195.20.45.48 195.20.45.49 195.20.45.50 195.20.45.62 195.20.45.63

    5 195.20.45.64 195.20.45.65 195.20.45.66 195.20.45.78 195.20.45.79

    6 195.20.45.80 195.20.45.81 195.20.45.82 195.20.45.94 195.20.45.95

    7 195.20.45.96 195.20.45.97 195.20.45.98 195.20.45.110 195.20.45.111

    8 195.20.45.112 195.20.45.113 195.20.45.114 195.20.45.126 195.20.45.127

    9 195.20.45.128 195.20.45.129 195.20.45.130 195.20.45.142 195.20.45.143

    10 195.20.45.144 195.20.45.145 195.20.45.146 195.20.45.158 195.20.45.159

    11 195.20.45.160 195.20.45.161 195.20.45.162 195.20.45.174 195.20.45.175

    12 195.20.45.176 195.20.45.177 195.20.45.178 195.20.45.190 195.20.45.191

    13 195.20.45.192 195.20.45.193 195.20.45.194 195.20.45.206 195.20.45.207

    14 195.20.45.208 195.20.45.209 195.20.45.210 195.20.45.222 195.20.45.223

    15 195.20.45.224 195.20.45.225 195.20.45.226 195.20.45.238 195.20.45.239

    16 195.20.45.240 195.20.45.241 195.20.45.242 195.20.45.254 195.20.45.255

    Example: /29 Network

    Network/Subnet mask = /29; Total Subnet = 32; IP Addr per subnet = 8; Hosts per subnet = 6

    Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved

    Subnet # Subnet Network Addr Subnet GW Addr Subnet Start Addr Subnet End Addr Broadcast Addr

    1 195.20.45.0 195.20.45.1 195.20.45.2 195.20.45.6 195.20.45.7

    2 195.20.45.8 195.20.45.9 195.20.45.10 195.20.45.14 195.20.45.15

    3 195.20.45.16 195.20.45.17 195.20.45.18 195.20.45.22 195.20.45.23

    4 195.20.45.24 195.20.45.25 195.20.45.26 195.20.45.30 195.20.45.31

    .. .. .. .. .. ..

    30 195.20.45.232 195.20.45.233 195.20.45.234 195.20.45.238 195.20.45.239

    31 195.20.45.240 195.20.45.241 195.20.45.242 195.20.45.246 195.20.45.247

    32 195.20.45.248 195.20.45.249 195.20.45.250 195.20.45.254 195.20.45.255

    13

  • 7/28/2019 Subnet For Novice

    14/14

    Example: /30 Network

    Network/Subnet mask = /30; Total Subnet = 64; IP Addr per subnet = 4; Hosts per subnet = 2

    Subnet Network Addr, Subnet GW Addr, and Broadcast Addr are generally reserved

    Subnet # Subnet Network Addr Subnet GW Addr Subnet Start Addr Subnet End Addr Broadcast Addr

    1 195.20.45.0 195.20.45.1 195.20.45.2 195.20.45.2 195.20.45.3

    2 195.20.45.4 195.20.45.5 195.20.45.6 195.20.45.6 195.20.45.7

    3 195.20.45.8 195.20.45.9 195.20.45.10 195.20.45.10 195.20.45.11

    4 195.20.45.12 195.20.45.13 195.20.45.14 195.20.45.14 195.20.45.15

    .. .. .. .. .. ..

    62 195.20.45.244 195.20.45.245 195.20.45.246 195.20.45.246 195.20.45.247

    63 195.20.45.248 195.20.45.249 195.20.45.250 195.20.45.250 195.20.45.251

    64 195.20.45.252 195.20.45.253 195.20.45.254 195.20.45.254 195.20.45.255

    14