IP addressing is a fundamental concept in computer networking that involves assigning unique numerical labels to devices participating in a network. These numerical labels, known as IP addresses, serve two main purposes:
IP addresses come in two main versions: IPv4 (Internet Protocol version 4) and IPv6 (Internet Protocol version 6).
IPv4 addresses are composed of 32 bits and are expressed as four sets of numbers separated by dots (e.g., 192.168.1.1).
Class A (1.0.0.0 to 126.255.255.255):
Class B (128.0.0.0 to 191.255.255.255):
Class C (192.0.0.0 to 223.255.255.255):
Class D (224.0.0.0 to 239.255.255.255) – Reserved for multicast groups
IP Addressing Basics Video
IP Addressing Binary Conversion Video
Classful addressing, however, had limitations, especially in terms of address utilization. CIDR was introduced to address these limitations by allowing more flexible allocation of address space, breaking away from the strict boundaries defined by classes. In CIDR, the subnet mask can have a variable length, allowing for more efficient use of IP addresses. CIDR notation is expressed as an IP address followed by a slash and the subnet mask length, like this: IP_address/Prefix_Length (e.g., 192.168.1.1/24).
A subnet mask is a 32-bit number that divides an IP address into network and host portions. It is used in conjunction with IP addresses to create subnetworks (subnets) within a larger network. The subnet mask consists of a series of consecutive ‘1’ bits followed by ‘0’ bits.
The primary purpose of a subnet mask is to determine which portion of an IP address identifies the network and which portion identifies the specific device on that network. When an IP packet is sent over a network, the destination IP address is compared with the subnet mask to determine whether the destination is on the local subnet or if routing to another network is necessary.
Common subnet mask examples include:
Public and private IP addressing are concepts related to the visibility and accessibility of IP addresses on the Internet. These terms help distinguish between addresses that can be used globally and those that are reserved for use within private networks.
Public IP Address
A public IP address is a globally unique address assigned to a device or a network interface that is directly connected to the Internet. Public IP addresses are routable across the Internet, allowing devices with these addresses to communicate with other devices on a global scale.
They are typically assigned by Internet Service Providers (ISPs) and are used for identifying and routing traffic over the Internet.
Examples of public IP addresses include the ones associated with web servers, email servers, or any device directly accessible from the Internet.
Private IP Address
A private IP address is used within a private network and is not directly accessible from the Internet. Private IP addresses are reserved for use in internal networks, such as those within homes, businesses, or organizations.
These addresses are defined by certain address ranges, including:
Devices within a private network use private IP addresses for local communication, and a router or gateway device with a public IP address is responsible for translating between private and public addresses when communicating with the Internet.
The use of private IP addressing helps alleviate the shortage of available IPv4 addresses by allowing many devices to share a small pool of public addresses. Network Address Translation (NAT) is often employed by routers to map multiple private IP addresses to a single public IP address, allowing internal devices to access the Internet using a smaller number of public addresses.
Watch this video to understand NAT
Published by Active Learning, Dec 2023