What is an IP Address?

Let’s start with the basics.

IP Address Classes

  • Class A
    • Public range of to
    • Subnet mask:
    • Number of Networks: 126
    • Number of hosts per network 16,777,214
  • Class B
    • Public range of to
    • Subnet mask:
    • Number of Networks: 16,382
    • Number of hosts per network 65,534
  • Class C
    • Public range of to
    • Subnet mask:
    • Number of Networks: 2,097,150
    • Number of hosts per network 254
  • Class D
    • Public range of to
    • Number of Networks: n/a
    • Number of hosts per network multicasting
  • Class E
    • Range: to
    • First octet value range from 240 to 255
    • Number of Networks: N/A
    • Number of Hosts per Network: Research/Reserved/Experimental

So, what does all this mean?

For each class, there is a range of IP addresses that are possible based on the subnet - Don’t worry, I will go into detail on what a subnet is and how it works.

Each class has a range of IPs reserved for private, internal use. Example, Class C has the public range to Many home routers and bundled modem/router combo units use the IP range to or to This range is not accessible outside the router.


So, where do subnets come into play? Well, if you look up, each class of IPs can reserve a lot of IP addresses. And, in the past, companies were able to buy a Class A or B IP address and have all the corresponding IP addresses. To alleviate this problem, Subnets were introduced to limit the range of possible IP addresses. Here is how:

Let’s say we have an IP with the following domain: This is how the subnet and subsequent IP range is calculated.

Convert the IP octets to binary 108 = 1101100 45 = 00101101 34 = 00100010 9 = 00001001

255 = 11111111 255 = 11111111 255 = 11111111 0 = 00000000

To calculate the range, you AND the bits

01101100 00101101 00100010 00001001 11111111 11111111 00000000 00000000

01101100 00101101 00000000 00000000 -> The 0 is the network host and is unusable. -> The 0 is the network broadcast and is unusable.

So, the IP range is to

Simple, right? Now, doesn’t writing seem annoying and a waste of typing?

CIDR To The Rescue!

CIDR was introduced to replace the class system for 2 reasons:

  • Simplify writing IP ranges assigned to an entity
  • Reduce the size of the IP address range an entity can reserve

Taking the previous example: can now be written as: where the 16 means how many bits from the left are ON to match the subnet mask ANDing:

16 = 11111111 11111111 00000000 00000000 => From the above example

I hope that clears things up for you :)