First an explanation of an IPv4 Address, "IP Address", format; IPv6 exists but isn't supported today in a VPC. Don't get too attached because CIDR notation requires an understanding of an IP Address format but represents something slightly different. Start of my picturing a cypher game where one thing represents another. The format of an IP Address is much like that, but in computer terms. An IP Address consists of four (4) three (3) digit series of numbers. Each number series, separated by a period, is called an octet and the numbers can be between 0 and 255. The zero based range of values covers 256 total numbers. In that range or any future subdivision of that range, the first and last numbers are reserved and can't be assigned to a server. An octet represents eight (8), hence the name octet, binary number positions called bits, each with a state of 0 (off) or 1 (on). That's a total of 32 binary number positions in a IPv4 address or a 32-bit value. Each bit represents a value of two (2) to the power of zero (0) through seven (7). The value represented by an octet is the sum of values represented by bits in the on state. This may be easier to understand in the below "Single Octet Example"
The below table is a breakdown of a single octet representing the value of one hundred thirty (130).
| Position 1 | Position 2 | Position 3 | Position 4 | Position 5 | Position 6 | Position 7 | Position 8 | |
|---|---|---|---|---|---|---|---|---|
| 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | |
| Position Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Binary Representation | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
With four octets separated by a period we can represent an IPv4 address.
| Octet 1 | Octet 2 | Octet 3 | Octet 4 | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | . | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | . | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | . | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 255 | 255 | 255 | 0 | |||||||||||||||||||||||||||||||
A CIDR block is a higher level abstraction of this concept. In a CIDR block, only a single bit within an octet can be on at any time and instead of representing a specific IP address, it represents a fixed prefix within an IP address.