An IP address is a unique identifier assigned to every device connected to a network, enabling devices to locate and communicate with each other efficiently.
IPv4 address structure
IPv4, or Internet Protocol version 4, is the original and still most widely used version of the Internet Protocol. It uses a 32-bit address format, providing approximately 4.3 billion unique IP addresses. These addresses allow data to be routed between devices on different networks.
Binary and decimal representation
IPv4 addresses are structured in four 8-bit sections, known as octets. Each octet represents a number from 0 to 255 and is separated by dots.
Example in binary:
11000000.10101000.00000001.00000001Converted to decimal:
192.168.1.1
Each octet in this format corresponds to a segment of 8 binary bits. Since each bit can be 0 or 1, the maximum number each octet can represent is 255 (which is 2^8 - 1).
Network and host identifiers
An IPv4 address is divided into two parts:
Network identifier (Network ID): Specifies the network a device belongs to.
Host identifier (Host ID): Identifies the specific device within that network.
The boundary between the network and host sections is determined using a subnet mask.
Practice Questions
FAQ
IPv6 uses hexadecimal notation to represent its 128-bit address space more compactly and readably. Writing 128 bits in binary would require 128 digits, making addresses extremely long and prone to human error when configuring systems or reading logs. Decimal, while familiar from IPv4, is not ideal for 128-bit addresses because converting between binary and decimal is more complex than between binary and hexadecimal. Each hexadecimal digit represents exactly four binary bits, so there’s a direct and efficient mapping. This means that an IPv6 address can be neatly broken down into 32 hexadecimal digits, which are further grouped into eight 16-bit segments (each segment is four hex digits). This structure improves both visual clarity and data processing efficiency. For example, the address 2001:0db8:0000:0000:0000:ff00:0042:8329 in binary would be a string of 128 ones and zeroes, whereas in hexadecimal it’s far easier to read, recognise, and work with.
If two devices on the same network are assigned the same IPv4 address, an IP address conflict occurs. This conflict prevents normal communication, as routers and switches cannot distinguish between the two devices. When a device attempts to send data to the conflicting IP address, the network cannot determine which of the two devices is the correct destination, leading to packet loss and disrupted connections. Most modern operating systems detect conflicts through a process called ARP (Address Resolution Protocol) checking, which listens for other devices using the same IP. If a conflict is detected, the operating system typically issues a warning and may disable network connectivity until the conflict is resolved. This problem commonly arises in networks where static IP addresses are manually configured without proper coordination. Using DHCP helps prevent these conflicts by dynamically assigning unique IPs from a managed pool. Proper network design and address planning are crucial to avoid such issues.
No, an IPv6-only device cannot directly communicate with an IPv4-only device because they use fundamentally different address formats and protocols. IPv4 addresses are 32-bit and represented in decimal, while IPv6 addresses are 128-bit and written in hexadecimal. There is no built-in compatibility between the two protocols. To enable communication between such devices, transition mechanisms must be used. These include:
Dual stack: Devices and networks are configured to support both IPv4 and IPv6 simultaneously.
Tunnelling: IPv6 packets are encapsulated within IPv4 packets to traverse IPv4 infrastructure.
Translation: Protocol translators (such as NAT64 or DNS64) convert IPv6 packets to IPv4 and vice versa.
These technologies ensure that IPv6 devices can still access legacy IPv4 systems while the world transitions to full IPv6 adoption. However, without such mechanisms, communication between IPv4-only and IPv6-only hosts is not possible, emphasising the need for backward compatibility in modern network infrastructure.
IPv6 supports Stateless Address Auto-Configuration (SLAAC), allowing a device to generate its own address without needing a DHCP server. When a device connects to a network, it first assigns itself a link-local address (starting with fe80::) and uses Neighbour Discovery Protocol (NDP) to check for address uniqueness. It then listens for Router Advertisements (RAs) from local routers, which provide the network prefix (e.g., 2001:db8:abcd::/64). The device combines this prefix with a 64-bit interface identifier, often based on its MAC address or randomly generated, to form a complete global address. This method reduces configuration complexity and dependency on external servers. In contrast, IPv4 usually relies on DHCP, which assigns IPs from a central pool and manages leases and renewals. DHCPv6 exists for more controlled environments, but SLAAC provides decentralised, immediate configuration suitable for most IPv6 networks, making it especially useful for mobile and large-scale deployments.
Link-local addresses are essential in IPv6 because they enable communication between devices on the same local network segment without relying on a router. Every IPv6-enabled interface must have a link-local address, even if it also has a global unicast address. These addresses begin with the prefix fe80::/10, and the rest of the address is typically generated using the device’s MAC address or a randomised identifier. Link-local addresses are used for essential network operations such as Router Discovery, Neighbour Discovery Protocol (NDP), and automatic address configuration. Routers themselves use link-local addresses to communicate with each other and with hosts during routing decisions. Unlike IPv4’s private addresses, link-local addresses are not routable beyond the local link, ensuring they remain isolated to their segment. Their automatic generation and critical role in IPv6 network functions make them a core component of IPv6 communication, even when global or unique local addresses are also in use.
