+91 91524 45255

IP Address Fundamentals

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: identification and location addressing.

IP Address Fundamentals

What Is an IP Address?

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: identification and location addressing.

1

Primary Functions

  • Identification – Uniquely identifies a device (host) on a network.
  • Location addressing – Helps in routing packets from the source to the destination.
2

IP Address Format

When data travels across a network, it's broken into packets. The IP layer ensures each packet is tagged with:

Packet Structure:

  • Source IP (where it came from)
  • Destination IP (where it's going)

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).

3

OSI Model Context

IP operates at the Network Layer (Layer 3) of the OSI model, providing logical addressing and routing services between different networks.

4

Checking IP Address in Linux

You can check your IP address in Linux using the ifconfig command:

OSI diagram

Command:

ifconfig

This command displays the network interface configuration, including IP addresses, subnet masks, and other network settings for each interface.

ISP (Internet Service Provider)

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.

1

Why Was IP Needed?

Before the IP protocol, there was no standardized way for machines across different networks to identify each other and communicate. IP was developed to:

  • Enable communication across heterogeneous systems
  • Support scalability beyond local networks
  • Establish a uniform addressing scheme
  • Provide network-layer packet delivery

With the internet growing from a few hosts to billions of devices, IP became the backbone of modern digital communication.

ISP Services
2

Types of IP: IPv4 vs IPv6

Types of IP: IPv4 vs IPv6

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
3

IPv4 vs. IPv6: Why Two Versions?

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.

4

Breaking Down an IP Address (IPv4)

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

What Is an Octet? An octet is simply 8 bits (1 byte). Each octet can represent a number from 2² (1) to 2⁸ – 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

Why 2⁸? Each bit has 2 possible values: 0 or 1. So:

  • 1 bit → 2 values
  • 2 bits → 2² = 4 values
  • 3 bits → 2³ = 8 values
  • ...
  • 8 bits (an octet) → 2⁸ = 256 values (from 0 to 255)
5

IPv4 Address Classes (A–E)

IPv4 Address Classes (A–E)

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

Class Descriptions:

  • Class A: Starts with binary 0, reserved for large organizations or ISPs, first octet: 1–126 (127 is loopback)
  • Class B: Starts with binary 10, balanced between network and host bits, often used by universities, medium orgs
  • Class C: Starts with binary 110, supports many small networks, default choice for small businesses
  • Class D: Starts with binary 1110, reserved for multicast (1-to-many) communication
  • Class E: Starts with binary 1111, reserved for research, experimental use only

Each IP address is typically divided into:

  • Network part: Identifies the network
  • Host part: Identifies the device on that network

Depending on the subnet mask, the bits are split to define what portion is network vs. host.

Example:

For example, with 192.168.1.1/24:

/24 means the first 24 bits are for the network (192.168.1)

Last 8 bits (.1) are for the host

5

Subnet Masks for IP Classes

Subnet Masks for IP Classes

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)

What Does a Subnet Mask Do?

  • Separates the IP address into network and host portions
  • Helps routers and devices determine if the destination device is local (same subnet) or remote (needs to go through a gateway/router)

Examples:

Class A: IP: 10.0.0.5, Mask: 255.0.0.0 → Only first octet is the network (10.x.x.x)

Class B: IP: 172.16.34.10, Mask: 255.255.0.0 → First two octets define the network

Class C: IP: 192.168.1.100, Mask: 255.255.255.0 → First three octets define the network

6

Custom Subnetting: Making Networks Fit Your Needs

Custom Subnetting: Making Networks Fit Your Needs

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

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.

How It Works 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.

Example: Subnetting 192.168.1.0

Default mask: /24 → 255.255.255.0

Hosts per subnet: 2⁸ − 2 = 254

Custom subnet: /26 → 255.255.255.192

2 bits borrowed → 2² = 4 subnets

Hosts per subnet: 2⁶ − 2 = 62

Now your single /24 network becomes four smaller ones:

NAT (Network Address Translation)

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.

1

Public vs. Private IP Addresses

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.
2

Special IPv4 Address Ranges

Special IPv4 Address Ranges

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 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)

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.

DHCP Process
1

DHCP Discovery Process

When a device joins a network, it sends a broadcast to find available DHCP servers. The first DHCP server to respond offers an available IP and configuration options.

2

Security Considerations

However, DHCP lacks authentication. There's no built-in mechanism to verify the identity of the DHCP server or client. This makes it vulnerable to spoofing attacks where a rogue DHCP server can assign incorrect settings to mislead or intercept traffic.

DHCP Flow (DORA process)

The DHCP process follows a standard four-step sequence:

1

Client → DHCP Discover (Broadcast)

Client sends a broadcast to find available DHCP servers.

2

Server → DHCP Offer

One or more servers respond with an available IP and configuration options.

3

Client → DHCP Request

Client requests the offered IP from a specific DHCP server (based on the offer it chooses).

4

Server → DHCP Acknowledgment (ACK)

Server confirms lease of the IP and provides full network configuration.

5

Additional DHCP Messages

Beyond the basic DORA process, DHCP includes several other important message types:

  • DHCP NAK: If the server denies the request (e.g., IP conflict), it sends a negative acknowledgment.
  • Lease Renewal: Client will later re-request lease before it expires (handled via unicast, not broadcast).
  • DHCP Decline: If the client detects that the offered IP is already in use, it may send a decline message.

ICMP (Internet Control Message Protocol)

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.

1

Key Functions

  • Inform source IP when delivery of packets fails (e.g., destination unreachable, time exceeded).
  • Helps identify problems like routing failures or unreachable hosts.
  • Operates at Network Layer alongside IP.
2

ICMP and Traceroute

Traceroute uses ICMP to map the path packets take across an IP network. Each router that decrements the TTL to 0 sends back a "Time Exceeded" ICMP message, revealing its IP address along the route.

This allows users to trace where delays or failures occur in the network path between source and destination.

Conclusion

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.

Ready to Master IP Addressing?

Contact us for advanced network security assessments and IP management.

GET ASSESSMENT