IP Addresses: IPv4, Subnet Masks, and CIDR Explained

Share

Summary

This article explains the fundamentals of IP addresses, focusing on IPv4 structure, subnet masks, and Classless Inter-Domain Routing (CIDR). It clarifies how devices are identified and communicate within and across networks.

IP Addresses: IPv4, Subnet Masks, and CIDR Explained

Highlights

Introduction to IP Addresses

IP addresses (IPv4/IPv6) are crucial for communication across different networks, analogous to a postal address for a building, while MAC addresses identify devices within a single network, like a specific apartment. Each IP address must be unique within its network, though a single IP can address multiple receivers (broadcasting) or a device can use multiple IP addresses.

IPv4 Structure and Classification

IPv4 addresses are 32-bit binary numbers, commonly represented as four 8-bit groups (octets) in dotted-decimal notation (e.g., 127.0.0.1). There are approximately 4.3 billion unique IPv4 addresses. Each network interface has a unique IP. IP addresses are divided into a network part (managed by administrators like IANA) and a host part. Historically, IPv4 addresses were categorized into classes A, B, C, D, and E, each with different allocations for network and host bits.

Subnet Masking

Subnet masks are used to further divide IP address ranges into smaller subnetworks. A subnet mask, like an IPv4 address, is 32 bits long and indicates which part of an IP address corresponds to the network and which to the host. For example, a Class C network typically uses a subnet mask of 255.255.255.0, where the first three octets represent the network.

Network, Gateway, and Broadcast Addresses

Within any network, two IP addresses are reserved: the network address and the broadcast address. The network address identifies the network itself, while the broadcast address allows a host to send a message to all other devices in that network simultaneously. The default gateway is the router's IPv4 address, acting as the entry/exit point for traffic to other networks, typically assigned the first or last assignable IP in a subnet.

Binary System in IPv4

IPv4 addresses are fundamentally binary numbers. Each of the four octets is an 8-bit binary number, ranging from 0 to 255 in decimal. The article provides an example of converting the IPv4 address 192.168.10.39 into its binary form (11000000.10101000.00001010.00100111) and demonstrates how each octet's decimal value is derived from its binary representation.

Classless Inter-Domain Routing (CIDR)

CIDR is a modern method that replaced the older class-based system for IPv4 address allocation. It allows for more flexible and efficient division of IP address space into subnets of varying sizes. CIDR uses a 'CIDR suffix' (e.g., /24) to indicate the number of bits from the beginning of the IP address that belong to the network portion. This suffix directly corresponds to the number of '1' bits in the subnet mask.

Recently Summarized Articles

Loading...