Skip to main Content

CCNA v1.1: IPv4 Address Classes

Global Knowledge

This week we'll review the IPv4 Address Classes including subnet masks, examples of Class C, Class B, and Class A subnet masks, and planning IPv4 addresses.




















































ClassNetwork (N) and Host(H) Octets1st Bits in 1st OctetNumerical Range of 1st OctetNumber of NetworksNumber of Hosts per Network
AN.H.H.H0xxx1-126*12616,777,214
BN.N.H.H10xx128-19116,38465,534
CN.N.N.H110x192-2232,097,152254
D**N/A111x224-239N/AN/A
E**N/A1111240-255N/AN/A

* 0 is reserved; 127 is reserved for the loopback address.
** Class D is used for multicast group addressing, and Class E is reserved for research use only.

Private IPv4 Addresses


The private IPv4 addresses are as follows:

  • 10.0.0.0 through 10.255.255.255

  • 172.16.0.0 through 172.31.255.255

  • 192.168.0.0 through 192.168.255.255


Subnet Masks


Subnet bits are “borrowed” from host bits. The subnet mask indicates how to interpret the IP address; every address has a subnet mask as an “interpreter”:


    • A binary “1” in the subnet mask indicates that the corresponding bit in the IP address is a subnet or network bit. The number of network bits is determined by the address class.

    • A binary “0” in the subnet mask indicates that the corresponding bit in the IP address is a host bit.



With “s“ subnet bits, the number of subnets is 2s.
With “h“host bits, the number of hosts per subnet is: 2h– 2.

Default Subnet Masks


Default Class A (N.H.H.H) mask: 255.0.0.0
Default Class B (N.N.H.H) mask: 255.255.0.0
Default Class C (N.N.N.H) mask: 255.255.255.0

Example of Class C Subnet Masks




























































Decimal MaskSubnet Bits (s)Host Bits (h)Number if Subnets = 2sNumber of Hosts = 2h-2
255.255.255.0080254
255.255.255.128172126
255.255.255.19226462
255.255.255.22435830
255.255.255.240441614
255.255.255.24853326
255.255.255.25262642

Example of Class B Subnet Masks



























































Decimal MaskSubnet Bits (s)Host Bits (h)Number if Subnets = 2sNumber of Hosts = 2h-2
255.255.0.0016065,534
255.255.128.0115232,766
255.255.192.0214416,382
255.255.255.088256254
255.255.255.12897512126
255.255.255.2401244,09614
255.255.255.25214216,3842

Example of Class A Subnet Masks



























































Decimal MaskSubnet Bits (s)Host Bits (h)Number if Subnets = 2sNumber of Hosts = 2h-2
255.0.0.0024016,777,214
255.128.0.012328,388,606
255.192.0.022244,194,302
255.255.255.016865,536254
255.255.255.192186262,14462
255.255.255.2402041,048,57614
255.255.255.2522224,194,3042

Steps for Planning IPv4 Addresses





      1. Determine the address space to use (either public or private).

      2. Determine the number of subnets and number of host (device) addresses per subnet required.

      3. From #2, determine the number of subnet bits to use (s where 2s = # subnets).

      4. From #3, determine the subnet mask to use.

      5. Apply the subnet mask (from #4) to the IP address space (from #1) to determine the subnet and host (device) addresses.

      6. Assign the host (device) addresses to specific device interfaces.




Given a device IPv4 address and its subnet mask:



      1. Write the address in binary.

      2. Write the mask in binary, below the address.

      3. Draw a vertical line between the 1s and the 0s in the mask; extend this line up into the address bits. This line divides the network/subnet bits from the host bits in the address.

      4. Make four copies of the address bits that are above the 1s in the mask; these are network/subnet bits.

      5. In the first of these copies, fill in all the bits to the right of these bits with 0s. This is the address of the subnet.

      6. In the last of these copies, fill in all the bits to the right of these bits with 1s. This is the address of the directed broadcast on the subnet.

      7. In the second of these copies, fill in all the bits to the right of these bits with 0s, except put a 1 in the last bit. This is the address of the first host on the subnet. In the third of these copies, fill in all the bits to the right of these bits with 1s, except put a 0 in the last bit. This is the address of the last host on the subnet.

      8. To determine the address of the next subnet, increment the subnet bits by 1.




IPv4 VLSM Example


Variable length subnet mask (VLSM) means to use a different (variable length) subnet mask on different subnets of the same major network (a given class A, B, or C network). VLSM allows the address space to be used more efficiently.

For example, you are given the address space 172.17.0.0/16, and you need to address some LANs that may have up to 300 device addresses and some point-to-point WANs. For the LANs you need 9 host bits (29 – 2 = 510 host addresses) and for the WANs you need 2 host bits (22 – 2 = 2 host addresses). Therefore, for the LANs you can use 16 – 9 = 7 subnet bits, which would allow 27 = 128 subnets. The addresses of these subnets are as follows (with the subnet bits in red):
172.17.00000000.00000000 = 172.17.0.0/23
172.17.00000010.00000000 = 172.17.2.0/23
172.17.00000100.00000000 = 172.17.4.0/23
And so on, up to the last subnet:
172.17.11111110.00000000 = 172.17.254.0/23

The first of these can be used for addressing the LANs. Any unused subnet can be further subnetted for the WANs. For example, if the last subnet is not used for a LAN, it can be further subnetted for the WANs. Since only 2 host bits are required for the WANs, 9 – 2 = 7 subnet bits can be used, which would allow 27 = 128 WAN subnets. The addresses of these subnets are as follows (with the WAN subnets in red):
172.17.11111110.00000000 = 172.17.254.0/30
172.17.11111110.00000100 = 172.17.254.4/30
172.17.11111110.00001000 = 172.17.254.8/30
And so on, up to the last subnet:
172.17.11111111.11111100 = 172.17.255.252/30

Next week we'll start on IPv6.

Excerpted and available for download from Global Knowledge White Paper: CCNA v1.1 Exam Review: Critical Concepts of the 640-802 CCNA Exam

Resources:
CCNA Cert Check
CCNA Exam Prep Mobile App

Related Courses:
ICND1 — Interconnecting Cisco Network Devices 1
ICND2 — Interconnecting Cisco Network Devices 2
CCNAX — CCNA Boot Camp v1.1