IPv4 & IPv6
Addresses, notation, loopback, and dual-stack.
Learning objectives
- Write IPv4 dotted decimal and identify network vs host portions
- Read compressed IPv6 notation
- Know loopback, link-local, and when dual-stack matters
IPv4 — four octets
An IPv4 address is four numbers 0–255, written 192.168.1.10. Each number is 8 bits — 32 bits total. Roughly 4.3 billion addresses exist; that is not enough for every device on Earth, which is why NAT and IPv6 matter.
Special IPv4 ranges
| Address / range | Purpose |
|---|---|
127.0.0.1 | Loopback — “this machine” (localhost) |
10.0.0.0/8 | Private (RFC 1918) |
172.16.0.0/12 | Private |
192.168.0.0/16 | Private — common on home/small office routers |
203.0.113.0/24 | Documentation (TEST-NET-3) — used in textbooks |
IPv6 — 128 bits
IPv6 uses eight groups of four hex digits: 2001:db8:acad:1::10. Double colon (::) compresses consecutive zero groups once per address.
Workshop Co.’s Swift Host VPS might have:
- IPv4:
203.0.113.10 - IPv6:
2001:db8:113::10(example documentation prefix)
Many Canadian hosts run dual-stack — both IPv4 and IPv6. DNS can publish A and AAAA records. If only A exists, IPv6-only clients (rare today) cannot connect.
Worked example — shop PC address
Workshop Co.’s office PC gets 192.168.10.50 from the router. The subnet mask 255.255.255.0 (/24) means the first three octets are the network (192.168.10.0) and the last octet identifies the host (.1–.254 usable).
IPv4: 192.168.10.50
Mask: 255.255.255.0 (/24)
────────────────
Network: 192.168.10.0
Host: .50
Try it yourself — expand IPv6
Expand 2001:db8::1 to full eight-group form.
Answer
2001:0db8:0000:0000:0000:0000:0000:0001
Which is which?
Classify each: public routable, private, loopback, documentation.
10.5.5.1203.0.113.10127.0.0.1198.51.100.44(Workshop Co. WAN)
Answer
- Private
- Documentation (not routed on public internet)
- Loopback
- Public routable (TEST-NET-2 documentation block in examples — treat as their ISP-assigned public IP in our lab story)
Quick quiz
- How many bits in an IPv4 address?
- What does
::1mean in IPv6? - Why do we still use IPv4 if IPv6 exists?
Answers
- 32 bits (4 octets × 8).
- IPv6 loopback — equivalent to
127.0.0.1. - Legacy systems, NAT workaround, and gradual migration — dual-stack is the transition norm.