IPv4 Header RFC 791
| Field | Size | Description |
Version | 4 bits | Always 4 for IPv4 |
IHL | 4 bits | Header length in 32-bit words (min: 5) |
TOS | 8 bits | Type of Service / DSCP + ECN |
Total Length | 16 bits | Entire packet size in bytes (max: 65535) |
TTL | 8 bits | Hop limit, decremented by each router |
Protocol | 8 bits | Encapsulated protocol number |
Protocol Numbers IANA Assigned
| Number | Protocol | Description |
1 | ICMP | Internet Control Message Protocol |
2 | IGMP | Internet Group Management Protocol |
6 | TCP | Transmission Control Protocol |
17 | UDP | User Datagram Protocol |
41 | IPv6 | IPv6 encapsulation |
47 | GRE | Generic Routing Encapsulation |
50 | ESP | Encapsulating Security Payload |
89 | OSPF | Open Shortest Path First |
TTL Defaults Time To Live
| Operating System | Default TTL |
| Linux | 64 |
| macOS | 64 |
| Windows | 128 |
| Cisco IOS (routers) | 255 |
| Solaris | 255 |
# Received TTL can fingerprint sender OS
# 64 - (64 - received) = hops traversed
# Example: TTL=52 means 12 hops from Linux host
Address Classes Classful (Historical)
| Class | First Octet | Default Mask | Networks |
| A | 1-126 | /8 (255.0.0.0) | 128 |
| B | 128-191 | /16 (255.255.0.0) | 16,384 |
| C | 192-223 | /24 (255.255.255.0) | 2,097,152 |
| D | 224-239 | Multicast | N/A |
| E | 240-255 | Reserved | N/A |
CIDR Notation RFC 4632
| CIDR | Subnet Mask | Hosts | Common Use |
/32 | 255.255.255.255 | 1 | Single host |
/30 | 255.255.255.252 | 2 | Point-to-point link |
/24 | 255.255.255.0 | 254 | Small network |
/16 | 255.255.0.0 | 65,534 | Medium network |
/8 | 255.0.0.0 | 16,777,214 | Large network |
/0 | 0.0.0.0 | All | Default route |
Special Addresses RFC 5735
| Address | Range | Purpose |
0.0.0.0 | 0.0.0.0/8 | "This" network, default route |
127.0.0.1 | 127.0.0.0/8 | Loopback (localhost) |
255.255.255.255 | - | Limited broadcast |
10.0.0.0 | 10.0.0.0/8 | Private (Class A) |
172.16.0.0 | 172.16.0.0/12 | Private (Class B) |
192.168.0.0 | 192.168.0.0/16 | Private (Class C) |
169.254.0.0 | 169.254.0.0/16 | Link-local (APIPA) |
224.0.0.0 | 224.0.0.0/4 | Multicast |
Fragmentation Flags Field
| Flag | Value | Meaning |
DF | 0 | May fragment |
DF | 1 | Don't fragment (drop if too large) |
MF | 0 | Last fragment |
MF | 1 | More fragments follow |
# Default MTU (Maximum Transmission Unit)
Ethernet: 1500 bytes
PPPoE: 1492 bytes
VPN: ~1400 bytes (varies by overhead)