Every bit-width that shows up across the stack, and what it's actually used for.
| Width | Used for | Possible values |
|---|---|---|
| 8-bit | One octet of an IPv4 address (e.g. the "192" in 192.168.1.1) | 2⁸ = 256 (0–255) |
| 16-bit | Port numbers; each field in a UDP header (source port, dest port, length, checksum) | 2¹⁶ = 65,536 (0–65,535) |
| 32-bit | An entire IPv4 address; TCP sequence/acknowledgement numbers | 2³² ≈ 4.3 billion |
| 128-bit | An entire IPv6 address | 2¹²⁸ ≈ 3.403 × 10³⁸ |
Visualizing a 16-bit port field
1 0 1 0 0 1 1 0 0 0 1 0 1 0 0 1
16 binary cells, each either 0 or 1 → 2¹⁶ total combinations ≈ 65,000 usable port numbers, split across the reserved (0–1023), registered (1024–49151), and dynamic/ephemeral (49152–65535) ranges.
Header sizes worth memorizing
| Header | Size |
|---|---|
| UDP header | 8 bytes (4 × 16-bit fields) |
| TCP header | 20 bytes minimum |
| IP packet header | 20 bytes |
| MAC address | 48 bits (12 hex digits) |
Data rate units
| Unit | Value |
|---|---|
| 1 kbps | 1,000 bits/sec |
| 1 Mbps | 1,000,000 bits/sec |
| 1 Gbps | 10⁹ bits/sec |
Address space scale, side by side
computer networks · field reference · compiled from course notes + whiteboard captures