Networking 104: Understanding IP Addresses

An IP address (Internet Protocol address) is a numerical label assigned to every device on a network that uses the Internet Protocol for communication. It serves two primary purposes:
When data travels across a network, it's broken into packets. The IP layer ensures each packet is tagged with:
This system allows routers and devices to decide the best path for forwarding each packet. Importantly, IP doesnβt care if a packet arrives or not it just handles addressing and routing. Reliability is the job of other protocols (like TCP).
Using ifconfig
: Checking IP address in Linux.
An ISP (Internet Service Provider) is a company or organization that provides access to the internet. It connects your home or business network to the broader internet infrastructure through technologies like fiber, DSL, cable, or wireless. ISPs assign public IP addresses, manage data routing, and often provide DNS services. They act as the gateway between your local network and the global internet, ensuring your requests reach external servers and responses return to you correctly. Without an ISP, you wouldn't be able to access websites, stream content, or communicate online.
Before the IP protocol, there was no standardized way for machines across different networks to identify each other and communicate. IP was developed to:
With the internet growing from a few hosts to billions of devices, IP became the backbone of modern digital communication.
Feature | IPv4 | IPv6 |
---|---|---|
Full Name | Internet Protocol version 4 | Internet Protocol version 6 |
Address Format | 32-bit numeric, written in decimal | 128-bit hexadecimal, written in colon-separated blocks |
Notation Example | 192.168.1.1 | 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
Address Length | 4 numbers (0β255), separated by dots | 8 blocks of 4 hex digits, separated by colons |
Address Space | ~4.3 billion addresses | ~340 undecillion addresses |
Header Complexity | Simpler | More fields, supports options like QoS, flow labels |
Security (native) | Not built-in | IPSec is mandatory |
Broadcast Support | Yes | No (uses multicast/anycast instead) |
Adoption | Widely used, but running out of space | Adoption growing, especially in modern systems |
IPv4 was the first widely deployed version of the Internet Protocol, but with only about 4.3 billion unique addresses, it couldnβt scale to support the explosive growth of devices. To address this, IPv6 was developed, offering a virtually unlimited address space and modern enhancements such as built-in security, automatic configuration, and improved mobility support.
IPv4 and IPv6 are not directly interoperable; they use completely different addressing formats and packet structures. Some dual-stack systems can handle both, but in general, IPv6 is not backward compatible with IPv4.
IPv4 is simpler, more widespread, and better supported by legacy systems. IPv6, while more complex, enables true end-to-end connectivity, eliminates NAT in many cases, and is better suited for the future of networking.
An IPv4 address is a 32-bit binary number, written in human-readable decimal form as four βoctetsβ separated by dots. Each octet represents 8 bits, making a total of 32 bits:
Example: 192.168.1.1
IPv4 = 32 bits β 4 octets
An octet is simply 8 bits (1 byte). Each octet can represent a number from:
22 (1) to 28 β 1 = 255
So each octet can hold values from 0 to 255, giving 256 total possible values per octet.
Example in Binary:
Decimal: 192.168.1.1
Binary: 11000000.10101000.00000001.00000001
Each bit has 2 possible values: 0 or 1. So:
Hereβs a complete breakdown of IP address classes with binary prefix, address ranges, bit distribution, and purpose plus a short description for each.
Class | Starting Bits | Address Range | Network Bits | Host Bits | Number of Networks | Hosts per Network | Usage |
---|---|---|---|---|---|---|---|
A | 0 | 0.0.0.0 β 127.255.255.255 | 8 bits | 24 bits | 128 (0β127) | ~16 million | Very large networks |
B | 10 | 128.0.0.0 β 191.255.255.255 | 16 bits | 16 bits | 16,384 | ~65,000 | Medium-sized networks |
C | 110 | 192.0.0.0 β 223.255.255.255 | 24 bits | 8 bits | ~2 million | 254 | Small networks |
D | 1110 | 224.0.0.0 β 239.255.255.255 | β | β | β | β | Multicast |
E | 1111 | 240.0.0.0 β 255.255.255.255 | β | β | β | β | Experimental |
Each IP address is typically divided into:
Depending on the subnet mask, the bits are split to define what portion is network vs. host.
For example, with 192.168.1.1/24:
A subnet mask defines how many bits in an IP are used for network portion vs. the host portion. The natural mask (also called default subnet mask) refers to the default bit boundaries for each IP class when no custom subnetting is applied.
CIDR (Classless Inter-Domain Routing) uses the /x suffix to indicate how many bits are for the network.
Example: 192.168.10.0/28 β 16 total IPs, 14 usable
Class | Default Subnet Mask | CIDR Notation | Network Bits | Host Bits | Max Hosts per Network |
---|---|---|---|---|---|
A | 255.0.0.0 | /8 | 8 | 24 | 16,777,214 |
B | 255.255.0.0 | /16 | 16 | 16 | 65,534 |
C | 255.255.255.0 | /24 | 24 | 8 | 254 |
Formula for usable hosts: 2^host bits β 2 (network + broadcast reserved)
Subnetting is the process of dividing a large network into smaller, more manageable pieces called subnets. Instead of sticking to the default class sizes (like Class Cβs 254 hosts), you can create custom subnet sizes to better match the number of devices you need to support.
Every subnet mask tells us how many bits are used for the network and how many for hosts. When we borrow bits from the host part, we create more subnets but get fewer hosts per subnet.
Default mask: /24 β 255.255.255.0
Custom subnet: /26 β 255.255.255.192
Now your single /24 network becomes four smaller ones:
Subnet | Usable IPs |
---|---|
192.168.1.0/26 | 192.168.1.1 β .62 |
192.168.1.64/26 | 192.168.1.65 β .126 |
192.168.1.128/26 | 192.168.1.129 β .190 |
192.168.1.192/26 | 192.168.1.193 β .254 |
NAT (Network Address Translation) allows devices using private IP addresses to communicate over the internet. Since private IPs arenβt routable on public networks, NAT translates them into a single public IP usually provided by the ISP.
This means multiple devices in a home or office can share one public IP address, making efficient use of limited IPv4 space. NAT keeps track of which internal device sent which request so that replies from the internet are routed back correctly. Without NAT, private IPs couldn't reach public servers.
IP addresses are divided into two broad categories: public (globally routable) and private (used inside local networks). Devices on a private network need a public IP to communicate over the internet usually handled via NAT (Network Address Translation).
Public: Globally unique IPs assigned by your ISP, visible on the internet.
Private: IPs reserved for local use within LANs, not routable on the public internet.
IP Range | Purpose | Subnet Mask | Description |
---|---|---|---|
10.0.0.0 β 10.255.255.255 | Private Network | 255.0.0.0(/8) | Used for large internal networks. Not routable on the public internet. |
172.16.0.0 β 172.31.255.255 | Private Network | 255.240.0.0(/12) | Medium-sized private networks (Class B range). |
192.168.0.0 β 192.168.255.255 | Private Network | 255.255.0.0(/16) | Common for home and small office networks. |
127.0.0.0 β 127.255.255.255 | Loopback | 255.0.0.0(/8) | Used to test local system networking (e.g., 127.0.0.1 = localhost). |
169.254.0.0 β 169.254.255.255 | Link-Local | 255.255.0.0(/16) | Auto-assigned if DHCP fails. Only used for communication within local link. |
DHCP (Dynamic Host Configuration Protocol) is used to automatically assign IP addresses and network settings to devices on a network. Instead of manually configuring each device, DHCP handles it centrally providing an IP address, subnet mask, default gateway, and DNS server information.
When a device joins the network, it sends a DHCP discovery request. The first DHCP server to respond offers the configuration. This can be a router, a computer, or any system running DHCP services.
However, DHCP lacks authentication. There's no built-in mechanism to verify the identity of the DHCP server or the client. This makes it vulnerable to spoofing attacks where a rogue DHCP server can assign incorrect settings to mislead or intercept traffic.
ICMP (Internet Control Message Protocol) is used by network devices, especially routers, to send error messages and operational feedback about IP packet processing. Itβs not used for data transfer only for diagnostics and error reporting.
This allows users to trace where delays or failures occur in the network path between source and destination.
IP addressing is the backbone of network communication. It allows devices to be uniquely identified, ensures data reaches the correct destination, and supports everything from small private networks to the global internet. Whether through static configuration or dynamic assignment, and whether using IPv4 or IPv6, the principles behind IP help maintain order and reliability in digital communication. A solid grasp of these concepts is essential for anyone working with or securing networked systems.