IP Addresses – Concepts, Formats, and Best Practices
1. What Is an IP Address?
An IP address (Internet Protocol address) is a unique numerical identifier assigned to every device on an IP-based network. It serves two fundamental purposes: identifying the host or network interface, and providing the location needed to route packets to that host across one or more networks.
IP stands for Internet Protocol — the foundational set of rules that governs how data is addressed, fragmented, and delivered across interconnected networks. An IP address works like a postal address: it tells routers where to deliver each packet.
Device A Device B
192.168.1.20 8.8.8.8
| |
[ Home Router ]---[ ISP ]---[ Internet ]---[ Google DNS ]
|
NAT translates 192.168.1.20 → Public IP for Internet routing
Related pages: Subnetting & VLSM | DHCP | NAT & PAT | IPv6 Overview | ARP & arp -a | MAC vs IP Address
2. IPv4 Address Format
IPv4 addresses are 32 bits long, written in dotted decimal notation as four octets (each 0–255) separated by dots. The total theoretical address space is 232 = approximately 4.3 billion addresses.
| Representation | Example |
|---|---|
| Dotted decimal (standard) | 192.168.1.1 |
| Binary (how devices see it) | 11000000.10101000.00000001.00000001 |
| Hexadecimal (used in low-level tooling) | 0xC0A80101 |
Each octet contributes 8 bits. The address is split into a network portion (identified by the subnet mask) and a host portion that identifies the individual device within that network. See Subnetting & VLSM for a full explanation of how network and host portions are determined.
3. IPv6 Address Format
IPv6 addresses are 128 bits long, written as eight groups of four hexadecimal digits separated by colons. The address space is 2128 — roughly 340 undecillion addresses, effectively eliminating exhaustion concerns. See IPv6 Overview and IPv6 Addressing for full details.
| Form | Example | Notes |
|---|---|---|
| Full notation | 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
All 32 hex digits written out |
| Leading-zero compression | 2001:db8:85a3:0:0:8a2e:370:7334 |
Leading zeros in each group can be omitted |
| Double-colon compression | 2001:db8:85a3::8a2e:370:7334 |
:: replaces one consecutive run of all-zero groups; used once per address |
| Loopback | ::1 |
Equivalent to 127.0.0.1 in IPv4 |
4. Why IPv6? – The Case for Transition
IPv4’s 4.3 billion addresses were officially exhausted at the IANA level in 2011, with regional registries running out shortly after. IPv6 was designed to solve this and brings several additional improvements:
- Vastly larger address space — 340 undecillion addresses eliminates NAT dependency
- Simplified header — fixed 40-byte header improves router processing speed
- No broadcast — replaced by multicast and anycast, reducing unnecessary traffic
- Stateless Address Autoconfiguration (SLAAC) — devices can self-configure without DHCP
- IPsec built-in — mandatory support for end-to-end encryption and authentication
- Better QoS — Flow Label field enables efficient traffic classification
5. Types of IP Addresses
5a. Public vs. Private Addresses
| Type | Description | Routable on Internet? | Ranges / Examples |
|---|---|---|---|
| Public IP | Globally unique; assigned by ISPs and regional registries (RIRs) | Yes | 8.8.8.8, 142.250.181.206 |
| Private IP — Class A | Large private networks (enterprises, cloud VPCs) | No — requires NAT | 10.0.0.0 – 10.255.255.255 (/8) |
| Private IP — Class B | Medium-sized corporate networks | No — requires NAT | 172.16.0.0 – 172.31.255.255 (/12) |
| Private IP — Class C | Home and small office networks | No — requires NAT | 192.168.0.0 – 192.168.255.255 (/16) |
5b. Static vs. Dynamic Addresses
| Type | How Assigned | Changes? | Typical Use |
|---|---|---|---|
| Static IP | Manually configured by an administrator | No — fixed permanently | Servers, routers, printers, network infrastructure. See Static Routing Configuration. |
| Dynamic IP | Automatically assigned by a DHCP server | Yes — may change on lease renewal | Laptops, phones, IoT devices, any client that does not need a fixed address. See How DHCP Works. |
5c. Unicast, Multicast, and Broadcast
| Type | Description | IPv4 Example | IPv6 Equivalent |
|---|---|---|---|
| Unicast | One-to-one: single sender to single receiver | 192.168.1.10 |
Global unicast, link-local. See IPv6 Addressing. |
| Multicast | One-to-many: single sender to a subscribed group | 224.0.0.5 (OSPF) |
ff02::1 (all nodes) |
| Broadcast | One-to-all: delivered to every host on the subnet | 192.168.1.255 |
Not supported — replaced by multicast |
| Anycast (IPv6) | One-to-nearest: routed to the topologically closest member of a group | N/A | Used for DNS root servers, CDN nodes. See IPv6 Overview. |
6. IP Address Classes (Classful Addressing)
Classful addressing was the original IPv4 allocation system, replaced by CIDR in 1993. Understanding classes remains important for the CCNA exam and for recognising private ranges.
| Class | First Octet Range | Default Subnet Mask | Network / Host Bits | Typical Use |
|---|---|---|---|---|
| A | 1 – 126 | 255.0.0.0 (/8) |
8 net / 24 host | Very large networks (ISPs, governments) |
| B | 128 – 191 | 255.255.0.0 (/16) |
16 net / 16 host | Medium-sized networks (universities, large enterprises) |
| C | 192 – 223 | 255.255.255.0 (/24) |
24 net / 8 host | Small networks (homes, SMBs) — max 254 hosts |
| D | 224 – 239 | N/A | N/A | Multicast groups (e.g., OSPF, EIGRP, video streaming) |
| E | 240 – 255 | N/A | N/A | Reserved / experimental — not used in production |
Note: 127.0.0.0/8 falls in the Class A range but is reserved entirely for loopback. Modern networks use classless CIDR rather than classful boundaries.
7. Subnetting and CIDR
Subnetting divides a large network block into smaller logical subnets, improving security, reducing broadcast domains, and simplifying management. The subnet mask (or CIDR prefix) defines which bits belong to the network and which identify the host. See Subnetting & VLSM for a complete guide, and Wildcard Masks for their use in ACLs and routing protocols.
| CIDR Prefix | Subnet Mask | Usable Hosts | Example Network |
|---|---|---|---|
| /24 | 255.255.255.0 |
254 | 192.168.1.0/24 |
| /25 | 255.255.255.128 |
126 | 192.168.1.0/25 and 192.168.1.128/25 |
| /26 | 255.255.255.192 |
62 | 192.168.1.0/26 |
| /30 | 255.255.255.252 |
2 | Point-to-point WAN links |
| /32 | 255.255.255.255 |
1 (host route) | Loopback interfaces, static host routes |
CIDR (Classless Inter-Domain Routing) replaced classful addressing
in 1993 (RFC 1519). It uses the address/prefix-length format
(e.g., 10.0.0.0/8) and enables route summarisation
(supernetting), dramatically reducing routing table size on the Internet.
8. IP Address Assignment Methods
| Method | How It Works | Best For |
|---|---|---|
| Static (manual) | Administrator configures IP, mask, gateway, and DNS directly on the device | Servers, printers, routers, access points, firewalls. See Static Routing Configuration. |
| DHCP (dynamic) | DHCP server automatically leases an address from a pool for a defined period. See How DHCP Works and DHCP Server Configuration. | Laptops, phones, IoT devices, any client that does not need a fixed address |
| APIPA (link-local) | Device self-assigns an address in 169.254.0.0/16 when DHCP fails |
Fallback only — not routable; indicates a DHCP problem. Use ping 127.0.0.1 to verify local TCP/IP stack is functional. |
| SLAAC (IPv6) | Device derives its own IPv6 address from the network prefix advertised by a router (RA) | IPv6 client devices; removes need for a DHCPv6 server |
9. Special IP Addresses
| Address / Range | Purpose | Notes |
|---|---|---|
127.0.0.1 (IPv4 loopback) |
Refers to the local device itself; used to test the TCP/IP stack with ping | Full range 127.0.0.0/8 is reserved; 127.0.0.1 is conventional |
::1 (IPv6 loopback) |
IPv6 equivalent of 127.0.0.1 |
Only one address, not a range |
Network address (e.g., 192.168.1.0) |
Identifies the subnet itself; never assigned to a host | Always the first address in the block (all host bits = 0). See Subnetting. |
Broadcast address (e.g., 192.168.1.255) |
Delivers a packet to all hosts in the subnet | Always the last address (all host bits = 1); not assignable to a host |
169.254.0.0/16 (APIPA) |
Automatic Private IP Addressing — self-assigned when DHCP is unreachable | Link-local only; signals a DHCP configuration problem |
0.0.0.0 |
Represents “any” or “unspecified” address; used in default routes and DHCP discovery | Not a valid host address |
255.255.255.255 |
Limited broadcast — sent to all hosts on the local segment; not forwarded by routers | Used by DHCP Discover before a client has an IP |
10. IP Address Resolution
IP addresses must ultimately be resolved to hardware (MAC) addresses for delivery on a local segment. Two protocols handle this at Layer 2/3:
| Protocol | Used With | How It Works |
|---|---|---|
| ARP (Address Resolution Protocol) | IPv4 | Broadcasts a “Who has IP x.x.x.x?” request on the local segment; the owner replies with its MAC address, which is cached in the ARP table. See ARP & arp -a for full details. |
| NDP (Neighbor Discovery Protocol) | IPv6 | Uses ICMPv6 Neighbor Solicitation/Advertisement messages sent to a solicited-node multicast address; no broadcasts required. See IPv6 Addressing. |
See also MAC vs IP Address for an explanation of how Layer 2 and Layer 3 addressing work together.
11. NAT and Private Addressing
NAT (Network Address Translation) allows many devices using private IP addresses to share a single public IP address. This was critical for extending the usable life of IPv4 and remains ubiquitous in home and enterprise networks today.
- Static NAT: One-to-one mapping of a private IP to a fixed public IP — used for servers that must be reachable from the Internet
- Dynamic NAT: Maps private IPs to a pool of public IPs on demand
- PAT (Port Address Translation / NAT Overload): Many private IPs share one public IP, differentiated by port number — the most common form used in homes and SMBs
12. Security Considerations
- IP Spoofing: Attackers forge source IP addresses to disguise identity or bypass access controls. Mitigate with ingress/egress filtering (BCP 38) at network edges.
- Private addressing: Keep internal devices on RFC 1918 ranges behind NAT to avoid direct Internet exposure.
- Firewalls and ACLs: Restrict which source/destination IP pairs are permitted to reach sensitive resources.
- VPNs: Encrypt traffic between endpoints so that IP-level eavesdropping reveals nothing useful.
- IPAM (IP Address Management): Track allocation of all IP addresses to detect rogue devices or exhausted subnets quickly.
13. Practical Examples
Example 1 — Assigning a Static IP to a Server
IP Address : 192.168.10.100
Subnet Mask : 255.255.255.0 (/24)
Gateway : 192.168.10.1
DNS Server : 8.8.8.8
Result: All 254 hosts in 192.168.10.0/24 can reach the server
directly; traffic to other networks exits via the gateway.
Example 2 — Dynamic Assignment with DHCP
1. Laptop broadcasts DHCP Discover (src 0.0.0.0 → dst 255.255.255.255)
2. DHCP server offers 10.0.2.23 / 255.255.255.0, lease 24h
3. Laptop sends DHCP Request to confirm
4. Server sends DHCP ACK — laptop is now configured automatically
See How DHCP Works (DORA) for the full exchange and DHCP Server Configuration for the lab.
Example 3 — Subnetting a /24 for Two Departments
Original : 192.168.1.0/24 (254 usable hosts)
Split at /25:
Sales : 192.168.1.0/25 → hosts .1 – .126, broadcast .127
Engineers : 192.168.1.128/25 → hosts .129 – .254, broadcast .255
Benefit: broadcast traffic in each subnet is halved; a firewall
or router can enforce policy between the two segments.
See Subnetting & VLSM for step-by-step subnetting calculations.
14. Key Points & CCNA Exam Tips
- IPv4 = 32 bits / dotted decimal; IPv6 = 128 bits / colon hex
- Private ranges (RFC 1918): 10/8, 172.16/12, 192.168/16 — memorise these
- CIDR prefix length = number of network bits (e.g., /24 = 255.255.255.0). See Subnetting and Wildcard Masks.
- Usable hosts = 2host-bits − 2 (subtract network and broadcast addresses)
- 127.0.0.1 = loopback (ping 127.0.0.1 tests local TCP/IP stack); 169.254.x.x = APIPA (DHCP failed)
- ARP resolves IPv4 → MAC; NDP resolves IPv6 → MAC. See MAC vs IP Address.
- Broadcast is IPv4-only; IPv6 uses multicast and anycast instead
- NAT/PAT allows private hosts to share a public IP for Internet access
- Use static IPs for infrastructure; DHCP for client endpoints
- CIDR enables route summarisation — reduces routing table size
- Protect IP addressing with firewalls, ACLs, and VPNs