Introduction

IP addressing: logical identification scheme for devices in an internetwork. Purpose: enable packet routing, ensure unique host identification. Core of network layer operations. Two main versions: IPv4 and IPv6. Addresses: numerical, hierarchical, structured for efficient routing. Essential for internet and private networks.

"An IP address is the fundamental building block of internetwork communication, providing device identity and routing capability." -- Andrew S. Tanenbaum

IP Address Structure

Address Format

IP address: binary numeric identifier. Divided into network and host portions. Network portion: identifies subnet or network. Host portion: identifies device within network. Format differs by IP version.

Address Length

IPv4: 32 bits, dotted decimal notation (4 octets). IPv6: 128 bits, hexadecimal colon-separated notation (8 blocks). Length impacts address space size and complexity.

Address Representation

IPv4: 4 decimal numbers (0-255) separated by dots. IPv6: 8 groups of 4 hex digits separated by colons, zero compression allowed.

Address Classes (IPv4)

Class-based division: A, B, C, D, E. Defines default network and host bits. Deprecated but foundational.

Special Address Types

Includes loopback, broadcast, multicast, anycast, and private addresses. Each serves distinct functional purposes.

Address TypePurpose
LoopbackInternal host communication
BroadcastSend to all hosts on subnet
MulticastSend to multiple specific hosts
AnycastSend to nearest one of many hosts
PrivateNon-routable internal networks

IPv4 Addressing

Address Format

32-bit address divided into 4 octets. Notation: decimal numbers separated by dots (e.g., 192.168.1.1). Each octet: 8 bits.

Address Classes

Five classes: A (1-126), B (128-191), C (192-223), D (224-239 multicast), E (240-254 reserved). Defines network/host bits.

Subnet Masks

32-bit mask identifying network portion. Used with IP to separate network and host bits. Written in dotted decimal or prefix notation.

Special Addresses

0.0.0.0 (default), 127.0.0.1 (loopback), 255.255.255.255 (broadcast), private ranges (e.g., 10.0.0.0/8).

Address Exhaustion

Limited space (approx. 4.3 billion addresses). Led to IPv6 adoption and CIDR.

IPv4 Address Example:11000000.10101000.00000001.00000001192 .168 .1 .1Network bits: depends on class or subnet maskHost bits: remaining bits

IPv6 Addressing

Address Format

128-bit address written as 8 groups of 4 hexadecimal digits separated by colons (e.g., 2001:0db8:85a3::8a2e:0370:7334).

Address Types

Unicast: single interface. Multicast: group of interfaces. Anycast: nearest interface. No broadcast addresses.

Address Abbreviation

Leading zeros omitted. Consecutive zero groups compressed with "::" once per address.

Subnetting

Prefix length notation (e.g., /64). Allows massive subnetting and hierarchical allocation.

Address Scope

Link-local, unique local, global unicast. Defines address reachability and routing.

Address TypePrefix / RangeDescription
Unicast Link-localFE80::/10Local link communication only
Unique LocalFC00::/7Private networks
Global Unicast2000::/3Internet routable

Subnetting

Purpose

Divide a network into smaller subnetworks. Improves routing efficiency, reduces broadcast domains.

Subnet Mask

Mask identifies network bits. Example: 255.255.255.0 or /24. Used to extract network and host portions.

Subnetting Process

Borrow bits from host portion to create subnets. Number of subnets = 2^n, where n = borrowed bits.

Subnetting Calculation

Determine subnet mask, calculate subnet addresses, host ranges, broadcast addresses.

Example

Network: 192.168.1.0/24Subnet mask: 255.255.255.0Borrow 2 bits for subnetting:New mask: 255.255.255.192 (/26)Subnets: 4Hosts per subnet: 62 (2^6 - 2)

Classful Addressing

Definition

Addressing system dividing IP space into fixed classes (A-E). Each class has fixed network/host division.

Class A

First bit 0. Network: 7 bits, host: 24 bits. Range: 1.0.0.0 to 126.255.255.255. Supports 128 networks, 16 million hosts each.

Class B

First bits 10. Network: 14 bits, host: 16 bits. Range: 128.0.0.0 to 191.255.255.255. Supports 16,384 networks, 65,534 hosts each.

Class C

First bits 110. Network: 21 bits, host: 8 bits. Range: 192.0.0.0 to 223.255.255.255. Supports 2 million networks, 254 hosts each.

Limitations

Rigid structure wastes address space. Inefficient for variable network sizes. Supplanted by CIDR.

Classless Addressing (CIDR)

Concept

Classless Inter-Domain Routing (CIDR): flexible allocation of IP addresses. No fixed classes. Uses prefix length notation.

Notation

IP address followed by slash and prefix length (e.g., 192.168.0.0/22). Prefix length: bits for network portion.

Aggregation

Route aggregation or supernetting reduces routing table size. Combines multiple networks into single prefix.

Benefits

Efficient address utilization. Scalability. Simplifies routing hierarchies.

Example

192.168.0.0/22 includes:192.168.0.0/24192.168.1.0/24192.168.2.0/24192.168.3.0/24

Address Allocation and Management

Authority

Internet Assigned Numbers Authority (IANA) controls global address allocation. Regional Internet Registries (RIRs) distribute addresses locally.

Public vs Private

Public addresses globally routable. Private addresses reserved for internal use, non-routable on internet.

Dynamic vs Static

Static: fixed assignment, used for servers, infrastructure. Dynamic: assigned temporarily via protocols like DHCP.

Address Exhaustion Solutions

IPv6 adoption. CIDR for efficient use. NAT to extend private networks.

Address Lease

DHCP leases addresses for limited time. Ensures reuse and efficient allocation.

Network Address Translation (NAT)

Purpose

Maps multiple private IP addresses to a single public IP. Conserves public address space. Enables internal network security.

Types

Static NAT: one-to-one mapping. Dynamic NAT: many-to-many. PAT (Port Address Translation): many-to-one using ports.

Operation

Translates source/destination IP and ports in packet headers. Maintains translation tables.

Limitations

Breaks end-to-end connectivity. Complicates protocols embedding IP addresses. Requires NAT traversal techniques.

Example

Internal IP: 192.168.1.10:1234Mapped to Public IP: 203.0.113.5:5678NAT translates source address and port during outbound traffic

Dynamic Host Configuration Protocol (DHCP)

Function

Automates IP address assignment. Provides configuration parameters: IP, subnet mask, gateway, DNS.

Process

Discover, offer, request, ack (DORA) sequence. Client broadcasts request, server assigns address.

Lease

Temporary assignment. Lease time controls duration. Renewals possible before expiration.

Benefits

Simplifies network management. Reduces configuration errors. Supports mobile hosts.

Security

Vulnerable to spoofing. DHCP snooping and authentication mitigate risks.

Routing and IP Addressing

Role of IP Address

Identifies source and destination for routing decisions. Enables hierarchical routing.

Routing Tables

Stores network prefixes and next hops. Uses IP prefixes for longest prefix match.

Static vs Dynamic Routing

Static: manual routes configured. Dynamic: protocols like OSPF, BGP update routes automatically.

Impact of Subnetting and CIDR

Facilitates route aggregation. Reduces routing table size. Improves scalability.

Address Resolution Protocol (ARP)

Maps IP addresses to MAC addresses on local network. Essential for packet delivery within subnet.

Security Considerations

IP Spoofing

Attacker forges source IP to impersonate trusted host. Enables attacks like DoS, session hijacking.

Mitigation Techniques

Ingress filtering, packet filtering, use of authentication protocols.

IPsec

Protocol suite providing authentication and encryption at IP layer. Secures IP packets end-to-end.

Private Addressing

Reduces exposure of internal hosts. Requires NAT for internet access.

DHCP Security

Prevents rogue DHCP servers. DHCP snooping enforces trusted sources.

References

  • Andrew S. Tanenbaum, David J. Wetherall, "Computer Networks," 5th Edition, Pearson, 2010, pp. 45-89.
  • Douglas E. Comer, "Internetworking with TCP/IP, Volume 1: Principles, Protocols, and Architecture," 6th Edition, Pearson, 2013, pp. 123-150.
  • W. Richard Stevens, "TCP/IP Illustrated, Volume 1: The Protocols," Addison-Wesley, 1994, pp. 223-270.
  • RFC 791, "Internet Protocol," J. Postel, IETF, 1981.
  • RFC 2460, "Internet Protocol, Version 6 (IPv6) Specification," S. Deering, R. Hinden, IETF, 1998.