IP addressing, or Internet Protocol addressing, is a system used to assign unique numerical identifiers to devices connected to an IP-based network. IP addresses enable devices to communicate with each other over a network, whether it’s a local area network (LAN) or the global Internet. In the context of IP addressing, there are two primary versions: IPv4 and IPv6.
IP addressing plays a crucial role in routing and delivering data across networks. Devices use IP addresses to send data packets to specific destinations, and routers use IP addresses to determine the best path for forwarding the packets. The Domain Name System (DNS) is used to map domain names, such as www.example.com, to their corresponding IP addresses, enabling easier access to network resources using human-readable names.
Overall, IP addressing provides a standardized and scalable system for identifying and communicating with devices in computer networks, enabling the vast interconnectedness of the internet and other IP-based networks.
IPv4 Addressing
IPv4 (Internet Protocol version 4)
IPv4 is the fourth version of the Internet Protocol and is the most widely used protocol for identifying and addressing devices on a network. IPv4 addresses consist of 32 bits, represented as four sets of numbers separated by periods (e.g., 192.168.0.1). Each set, also known as an octet, can range from 0 to 255. This allows for a total of approximately 4.3 billion unique IPv4 addresses.
However, with the rapid growth of the Internet and the increasing number of connected devices, IPv4 addresses have become scarce. Here are some key points about IPv4:
Structure
An IPv4 address consists of four sets of numbers separated by periods, with each set ranging from 0 to 255. For example, 192.168.0.1.
IPv4 addresses are divided into two parts, the network portion and the host portion. The network portion identifies the specific network that a device belongs to, while the host portion identifies the individual device within that network. IPv4 addresses are typically assigned in a hierarchical manner, with certain portions of the address indicating the network and the remaining portion identifying the host.
Address Classes
IPv4 addresses were originally divided into five classes (A, B, C, D, and E) based on the range of the first octet. However, classful addressing has been largely replaced by Classless Inter-Domain Routing (CIDR) for efficient address allocation.
IPv4 addressing also includes special address ranges, such as private IP addresses, which are reserved for use within private networks and are not globally routable on the Internet. Private IP addresses allow devices within a private network to communicate with each other without requiring unique public IP addresses for each device.
IPv4 addresses are categorized into different classes based on their range and purpose. The five address classes are:
Class A: The first octet represents the network portion, and the remaining three octets represent the host portion. Class A addresses have the range of 1.0.0.0 to 126.0.0.0 and are typically assigned to large networks.
Class B: The first two octets represent the network portion, and the remaining two octets represent the host portion. Class B addresses have the range of 128.0.0.0 to 191.0.0.0 and are often assigned to medium-sized networks.
Class C: The first three octets represent the network portion, and the last octet represents the host portion. Class C addresses have the range of 192.0.0.0 to 223.0.0.0 and are commonly used for small networks.
Class D: Class D addresses have the range of 224.0.0.0 to 239.0.0.0 and are reserved for multicast addresses, used for sending data to multiple recipients simultaneously.
Class E: Class E addresses have the range of 240.0.0.0 to 255.0.0.0 and are reserved for experimental purposes.
Special Address Ranges
IPv4 also has special address ranges designated for specific purposes.
Private IP Addresses: These addresses are reserved for use within private networks and are not globally routable. The three private IP address ranges are:
10.0.0.0 to 10.255.255.255 (Class A range)
172.16.0.0 to 172.31.255.255 (Class B range)
192.168.0.0 to 192.168.255.255 (Class C range)
Loopback Address: The loopback address, 127.0.0.1, is used to test network connectivity on the local device.
Broadcast Address: The broadcast address, represented as the last address within a network range (e.g., 192.168.0.255), is used to send a packet to all devices on a specific network.
Examples of IPv4 Addresses:
192.168.0.1 (Private IP address commonly used in home networks)
172.16.10.25 (Private IP address commonly used in medium-sized networks)
216.58.205.46 (Public IP address of Google’s website)
Address Exhaustion
Due to the limited address space, IPv4 addresses are running out. This led to the introduction and adoption of IPv6.
IPv6 Addressing
IPv6 (Internet Protocol version 6) is the newer and more advanced version of IP addressing. It was developed to address the limitations of IPv4, primarily the limited number of available addresses. IPv6 addresses consist of 128 bits, represented as eight groups of hexadecimal digits separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). With IPv6, the significantly larger address space allows for an astronomically larger number of unique addresses, approximately 340 undecillion (3.4×10^38) addresses.
IPv6 addresses also have a network portion and a host portion, but they are often represented differently than in IPv4. IPv6 addresses may include network prefixes, which indicate the routing prefix for the address and allow for efficient routing and aggregation of addresses. IPv6 also introduces the concept of link-local addresses, which are automatically assigned to devices within the same network segment for local communication.
Structure
IPv6 addresses consist of 128 bits, divided into eight groups of hexadecimal digits separated by colons. Each group represents 16 bits, and leading zeros within a group can be omitted. For example, an IPv6 address may look like: 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
Address Types and Formats
IPv6 addresses have different types and formats, including;
Unicast: An IPv6 address that identifies a single interface.
Multicast: An IPv6 address used for multicast communication to multiple interfaces.
Anycast: An IPv6 address that identifies a group of interfaces, and a packet is delivered to the nearest interface within that group.
Link-Local: Automatically assigned to interfaces within the same network segment for local communication. These addresses begin with the prefix fe80::.
Special Address Ranges
IPv6 includes special address ranges for specific purposes:
Global Unicast Addresses: These addresses are routable on the Internet and provide globally unique identification for devices.
Unique Local Addresses (ULA): Similar to private IPv4 addresses, ULAs are used within private networks and are not globally routable.
Loopback Address: The loopback address in IPv6 is ::1, similar to the IPv4 loopback address.
Examples of IPv6 Addresses:
2001:0db8:85a3:0000:0000:8a2e:0370:7334 (Example of a full IPv6 address)
2001:db8::1 (Abbreviated IPv6 address using double colons to represent consecutive groups of zeros)
fe80::1 (Link-local IPv6 address)