Networking Basics
IP addresses, CIDR notation, and foundational networking concepts
1. What Is a Computer Network?
A computer network is two or more client machines connected together to share resources. A network can be logically partitioned into subnets. Networking requires a networking device (such as a router or switch) to connect all the clients together and enable communication between them.
2. IP Addresses
Each client machine in a network has a unique Internet Protocol (IP) address that identifies it. An IP address is a numerical label. Machines convert the decimal IP address to binary format to process it.
IPv4 Addresses
An IPv4 address is 32 bits. It is written as four decimal numbers separated by dots, for example: 192.0.2.0. Each of the four numbers represents 8 bits. Since 8 bits can represent values from 0 to 255 (28 = 256 values), each of the four octets is in the range 0–255.
11000000 . 00000000 . 00000010 . 00000000
4 octets × 8 bits = 32 bits total
IPv6 Addresses
An IPv6 address is 128 bits. It is written as eight groups of four hexadecimal characters separated by colons, for example: 2600:1f18:22ba:8c00:ba86:a05e:a5ba:00FF. Each of the eight groups represents 16 bits. IPv6 can accommodate vastly more devices than IPv4.
3. Classless Inter-Domain Routing (CIDR)
CIDR is a method for describing a group of consecutive IP addresses. A CIDR address is expressed as an IP address followed by a slash and a number: for example, 192.0.2.0/24.
- The IP address is the first address of the network.
- The number after the slash tells you how many bits are fixed (the routing prefix).
- The remaining bits are flexible and form the host identifier.
| CIDR | Bits Fixed | Bits Flexible | Available IPs |
|---|---|---|---|
| /16 | 16 | 16 | 216 = 65,536 |
| /24 | 24 | 8 | 28 = 256 |
| /28 | 28 | 4 | 24 = 16 |
4. Subnets
A subnet is a range of IP addresses within a network. Subnets allow you to segment a network into logical divisions for security, organization, and routing control.
- Each subnet has a CIDR block that is a subset of the network CIDR block.
- Subnet CIDR blocks within the same network cannot overlap.
- Each subnet resides in a single Availability Zone (in AWS).
- AWS reserves 5 IP addresses in every subnet for internal networking functions.
Example: If your VPC uses 10.0.0.0/16, you could create four subnets of /18 each, or hundreds of /24 subnets. The total of all subnet CIDR ranges must fit within the VPC CIDR range.
5. Quick Quiz
Test Your Understanding
Select one answer per question. You will receive immediate feedback.