What is an IP Address?
Definition of IP Address
An IP address (Internet Protocol address) is a unique identifier assigned to each device on a network, enabling it to send and receive data across IP-based networks such as the Internet or private LANs.
IP stands for Internet Protocol—the set of rules governing data transfer over the internet. An IP address acts like a "home address" ensuring packets reach the correct destination.
Purpose and Function
- Addressing: Uniquely identifies each device.
- Routing: Guides packets from source to destination across networks.
- Communication: Enables devices to exchange information locally or globally.
Example: John’s laptop (192.168.1.20) sends a request to google.com (142.250.181.206) via the network using these IP addresses.
IPv4 Address Format
IPv4 addresses are 32 bits long, written in dotted decimal notation with four octets (0–255) separated by dots.
Example: 192.168.1.1
Binary representation: 11000000.10101000.00000001.00000001
IPv6 Address Format
IPv6 addresses are 128 bits long, represented as eight groups of four hexadecimal digits separated by colons.
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Consecutive zeros can be abbreviated using ::
once per address.
Abbreviated example: 2001:db8::8a2e:370:7334
Why IPv6?
IPv4 addresses were running out, while IPv6 offers a vastly expanded address space to accommodate the growth of the Internet and modern technologies.
Types of IP Addresses
1. Public vs. Private Addresses
Type | Description | Example |
---|---|---|
Public IP | Globally unique and routable on the Internet. | 8.8.8.8 |
Private IP | Used within local networks; not routable on the Internet. |
|
2. Static vs. Dynamic Addresses
- Static IP: Manually assigned, fixed address; used for servers, printers, routers.
- Dynamic IP: Automatically assigned (usually via DHCP); common for client devices.
3. Unicast, Multicast, Broadcast
- Unicast: One-to-one communication (e.g., PC to server).
- Multicast: One-to-many communication to a group.
- Broadcast: One-to-all on a local network segment (IPv4 only).
IP Address Classes (Classful Addressing)
Class | First Octet Range | Default Subnet Mask | Typical Use |
---|---|---|---|
A | 1 – 126 | 255.0.0.0 | Very large networks |
B | 128 – 191 | 255.255.0.0 | Medium-sized networks |
C | 192 – 223 | 255.255.255.0 | Small networks (homes, SMBs) |
D | 224 – 239 | N/A | Multicast |
E | 240 – 255 | N/A | Experimental |
Note: Modern networks use classless addressing (CIDR) for flexibility.
Subnetting and CIDR
Subnetting: Divides a larger network into smaller logical subnets to improve security, reduce broadcast traffic, and ease management.
Example:
- Original network: 192.168.1.0/24 (254 hosts)
- Subnetted into: 192.168.1.0/25 and 192.168.1.128/25 (126 hosts each)
CIDR (Classless Inter-Domain Routing): Replaces classful addressing, using a format like IP address/prefix length
, e.g., 192.168.1.0/24.
IP Address Assignment Methods
- Static Assignment: Manually set by administrator for devices needing fixed addresses.
- Dynamic Assignment: Automatically assigned by DHCP servers, typical for client devices.
Special IP Addresses
- Loopback: 127.0.0.1 (localhost; refers to the device itself)
- Network Address: The first address in a subnet (e.g., 192.168.1.0/24)
- Broadcast Address: The last address in a subnet (e.g., 192.168.1.255 for /24)
IP Address Resolution
- IPv4: Uses ARP (Address Resolution Protocol) to map IP addresses to MAC addresses.
- IPv6: Uses Neighbor Discovery Protocol (NDP) for similar purposes.
Security Considerations
- IP spoofing: Attackers may forge source IP addresses to disguise identity.
- Best practices: Use firewalls, restrict public IP exposure, manage private IP ranges carefully, and secure communication with VPNs.
Examples
1. Assigning IP to a Server:
- IP: 192.168.10.100 (static)
- Subnet Mask: 255.255.255.0
- Gateway: 192.168.10.1 (router’s IP)
- Result: Devices in subnet can reach the server via this IP.
2. Dynamic Assignment with DHCP:
- John’s laptop connects to office Wi-Fi.
- DHCP server assigns IP: 10.0.2.23
3. Using Loopback:
- John tests software by pinging 127.0.0.1.
- Successful ping confirms network stack is working locally.
Key Points & Exam Tips
- IP address uniquely identifies network devices.
- IPv4 addresses are 32-bit; IPv6 addresses are 128-bit.
- Types: Public/private, static/dynamic, unicast/multicast/broadcast.
- CIDR replaced classful addressing for flexibility.
- Special addresses include loopback, broadcast, and network addresses.
- Address resolution: ARP for IPv4, NDP for IPv6.
- Security involves NAT, firewalls, and private addressing.
- Use static IPs for fixed devices; dynamic IPs for clients.