IPv4 addresses are 32-bit identifiers displayed in dot-decimal notation: four octets (0-255) separated by periods (e.g., 192.168.1.1). Each octet represents 8 bits, so 192.168.1.1 in binary is 11000000.10101000.00000001.00000001. The 32-bit address space supports 4.3 billion unique addresses (2^32), though many ranges are reserved for special purposes (private networks, multicast, loopback). IPv4 addresses enable internet routing, identifying network interfaces and facilitating packet delivery from source to destination across networks.
IP address classes divide the address space into ranges based on network size requirements. Class A (0.0.0.0 - 127.255.255.255) supports huge networks with few hosts, Class B (128.0.0.0 - 191.255.255.255) balances network and host portions, Class C (192.0.0.0 - 223.255.255.255) supports many small networks. Private address ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are non-routable on the public internet, reserved for internal networks. Generating random IPs for testing should avoid reserved ranges (0.x, 127.x, 224.x-255.x) unless specifically testing those edge cases.
Random IP generation creates addresses by independently generating four random octets (0-255) and joining with periods. For example, generating random values [203, 45, 182, 91] produces 203.45.182.91. This naive approach may generate reserved addresses (127.0.0.1 loopback, 0.0.0.0 unspecified, 255.255.255.255 broadcast). For realistic test data, filter reserved ranges or generate from specific classes (e.g., Class C private: 192.168.X.X). For security testing, include edge cases (0.0.0.0, 255.255.255.255) to validate input validation and boundary handling.