Lesson
IPv4 Addressing
Learning objective
Read dotted-decimal addresses and prefixes and distinguish network, host, private, public, loopback, link-local, and documentation ranges.
Learning objective
Read an IPv4 address and prefix, separate its network and host portions, and recognize addresses that have special local purposes.
Read an IPv4 address
Where the address sits in an IPv4 packet
Swipe sideways to see all fields
| Version · 4 bits | IHL · 4 bits | DSCP + ECN · 8 bits | Total length · 16 bits | ||||||||
| Identification · 16 bits | Flags + fragment offset · 16 bits | ||||||||||
| TTL · 8 bits | Protocol · 8 bits | Header checksum · 16 bits | |||||||||
| Source IPv4 address · 32 bits | |||||||||||
| Destination IPv4 address · 32 bits | |||||||||||
| Options + padding · optional | |||||||||||
| Payload · variable | |||||||||||
IPv4 identifies an interface with 32 bits. People normally write those bits as four octets, such as 192.0.2.44. Each octet contains eight bits and therefore ranges from 0 to 255. An address identifies a logical attachment to an IP network; it is not a permanent identity for the whole device.
Dotted decimal and binary
The positions in one octet have values 128, 64, 32, 16, 8, 4, 2, 1. Add the positions whose bits are 1. For example, 11000000 is 128 + 64, or 192. Dotted decimal is only a readable representation of the same binary value routers process.
Interactive binary explorer
Build one IPv4 octet
Each switch represents one binary place value. Toggle it and watch the decimal octet change.
192 = 11000000
Prefixes, network and host portions
The prefix length tells you how many leading bits form the network portion. The remaining bits form the host portion. In 192.0.2.44/24, the first 24 bits identify 192.0.2.0/24; the last eight select an address inside it. A prefix is not optional decoration—it changes the boundary.
Interactive address boundary
Reveal the network boundary
192.0.2.44/24
Special address ranges
Not every syntactically valid address is a normal internet destination. Private ranges are commonly used inside organizations and are not globally routed by default. 127.0.0.0/8 is loopback for the local host. 169.254.0.0/16 is IPv4 link-local, often indicating that normal configuration failed. The documentation ranges 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 are safe for examples. Public addresses are not automatically reachable, owned by you, or safe to expose.
Inspect address evidence
Use Windows ipconfig or Get-NetIPConfiguration, and Linux ip address, to verify the address and prefix on the interface that actually carries the traffic. Record the interface, address, prefix, gateway, and source of configuration. Do not assume that seeing an address proves the gateway or destination is reachable.
Troubleshoot addressing
- Confirm the active interface and its operational state.
- Validate every octet and the prefix length.
- Decide whether the destination is on-link or requires a gateway.
- Compare with a working neighbour instead of guessing.
- Treat a
169.254.x.xaddress as evidence to investigate automatic configuration—not as the root cause by itself.
Interview scenario
Show answer and reasoning
10.20.30.40/16, while its peers use /24. Explain how the longer perceived on-link scope can prevent it from sending some destinations to the gateway, then identify the smallest safe correction.