Net Practice Pro
Complete IP Addressing & Subnetting Guide
๐ฏ The Magic Decoder Chart
The single most important chart in networking - MEMORIZE THIS!
๐ก The Pattern: Each position is double the previous โ 1, 2, 4, 8, 16, 32, 64, 128
๐ก Why It Matters: This chart converts binary to decimal AND solves subnet problems!
How to Use: Binary โ Decimal
Binary to Decimal Converter
| Position | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| Binary | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| Add | 128 | 64 | - | - | - | - | - | - |
Answer: 11000000 = 192
| Position | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| Binary | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
| Add | 128 | - | 32 | - | 8 | 4 | - | - |
Answer: 10101100 = 172
๐ Decimal to Binary Conversion
Master both directions: Decimal โ Binary and Binary โ Decimal
Decimal to Binary Converter
Method: Decimal โ Binary
128, 64, 32, 16, 8, 4, 2, 1
If YES โ write "1" and subtract. If NO โ write "0" and move on.
Start with: 207
| # | Power | Value | Fits? | Bit | Remainder |
|---|---|---|---|---|---|
| 1 | 27 = 128 | 207 | 1 | 79 | |
| 2 | 26 = 64 | 79 | 1 | 15 | |
| 3 | 25 = 32 | 15 | 0 | 15 | |
| 4 | 24 = 16 | 15 | 0 | 15 | |
| 5 | 23 = 8 | 15 | 1 | 7 | |
| 6 | 22 = 4 | 7 | 1 | 3 | |
| 7 | 21 = 2 | 3 | 1 | 1 | |
| 8 | 20 = 1 | 1 | 1 | 0 |
Decimal 207 = Binary 11001111
Common Subnet Mask Values
These appear constantly in networking - memorize them!
| Decimal | Binary | Common Use |
|---|---|---|
| 255 | 11111111 | Network portion (all 1s) |
| 254 | 11111110 | /31 mask |
| 252 | 11111100 | /30 mask (4 IPs, 2 usable) |
| 248 | 11111000 | /29 mask (8 IPs) |
| 240 | 11110000 | /28 mask (16 IPs) |
| 224 | 11100000 | /27 mask (32 IPs) |
| 192 | 11000000 | /26 mask (64 IPs) |
| 128 | 10000000 | /25 mask (128 IPs) |
| 0 | 00000000 | Host portion (all 0s) |
๐ฏ Pro Tips
| Binary | Decimal | Note |
|---|---|---|
| 11111111 | 255 | All bits on โ memorize! |
| 10000000 | 128 | Only the highest bit |
| 11000000 | 192 | 128 + 64 |
๐ก Remember: More 1s from the left = bigger number. Practice daily โ you'll get fast!
๐ IP Address Classes
Legacy system still used for understanding network size
| Class | Range | Default Mask | CIDR | Networks | Hosts/Network | Use |
|---|---|---|---|---|---|---|
| A | 1-126 | 255.0.0.0 | /8 | 126 | 16,777,214 | Huge orgs |
| B | 128-191 | 255.255.0.0 | /16 | 16,384 | 65,534 | Med orgs |
| C | 192-223 | 255.255.255.0 | /24 | 2,097,152 | 254 | Small nets |
| D | 224-239 | Multicast | ||||
| E | 240-255 | Experimental/Reserved | ||||
Why skip 127? The entire 127.0.0.0/8 range is reserved for loopback. 127.0.0.1 = localhost (your computer talking to itself)
Private IP Ranges (RFC 1918)
These are NOT routable on the public internet - use for internal networks
| Class | Private Range | CIDR | Total IPs | Common Use |
|---|---|---|---|---|
| A | 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | Large enterprises |
| B | 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | Medium orgs |
| C | 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | 65,536 | Home/small office |
Special Purpose Addresses
| Address/Range | Purpose | Example |
|---|---|---|
| 127.0.0.0/8 | Loopback | 127.0.0.1 (localhost) |
| 169.254.0.0/16 | APIPA (auto-config when DHCP fails) | 169.254.1.1 |
| 0.0.0.0/8 | This network / Default route | 0.0.0.0 |
| 255.255.255.255 | Limited broadcast | Broadcasts to local network |
๐ Subnet Intervals Explained
The "block size" or "magic number" for finding subnet boundaries
Interval Calculator
What is the Interval?
The interval (or block size) is how many IP addresses are in each subnet. It's the key to finding network boundaries quickly!
How to Calculate the Interval
Example: 255.255.255.192
In this case: 192 (4th octet)
The interval is 64!
Interval Table โ Memorize This!
| CIDR | Subnet Mask | Last Octet | Interval (256-X) | Total IPs | Usable |
|---|---|---|---|---|---|
| /24 | 255.255.255.0 | 0 | 256 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 128 | 128 | 126 |
| /26 | 255.255.255.192 | 192 | 64 | 64 | 62 |
| /27 | 255.255.255.224 | 224 | 32 | 32 | 30 |
| /28 | 255.255.255.240 | 240 | 16 | 16 | 14 |
| /29 | 255.255.255.248 | 248 | 8 | 8 | 6 |
| /30 | 255.255.255.252 | 252 | 4 | 4 | 2 |
Mask = 255.255.255.192
Interval = 256 - 192 = 64
Start at 0, count by 64: 0, 64, 128, 192
| Subnet | Network | First Usable | Last Usable | Broadcast |
|---|---|---|---|---|
| 1 | 192.168.1.0 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 2 | 192.168.1.64 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
| 3 | 192.168.1.128 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 |
| 4 | 192.168.1.192 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 |
๐ Subnet Block Divider
Watch a network block get divided into subnets in real time
Interactive Visualizer
๐งฎ Calculate Everything from a Mask
Given an IP and mask, find network, broadcast, and host range
Interactive Subnet Calculator
The Process (Step-by-Step)
/20 means 20 bits are "on" (1s)
First 2 octets: 255.255 (16 bits)
Third octet needs 4 more bits: 11110000 = 240
Mask: 255.255.240.0
Interesting octet: 240 (3rd octet)
256 - 240 = 16
Count by 16 in 3rd octet: 0, 16, 32, 48
45 is between 32 and 48, so it's in the subnet starting at 32
| Network Address: | 172.16.32.0 |
| First Usable: | 172.16.32.1 |
| Last Usable: | 172.16.47.254 |
| Broadcast: | 172.16.47.255 |
| Total Hosts: | 4,096 |
| Usable Hosts: | 4,094 |
๐ฏ Quick Formulas
| What | Formula |
|---|---|
| Network | Start of interval |
| Broadcast | (Start of next interval) โ 1 |
| First Usable | Network + 1 |
| Last Usable | Broadcast โ 1 |
| Total Hosts | 2(32 โ CIDR) |
| Usable Hosts | Total โ 2 |
๐ช How to Subnet a Network
Break one big network into smaller subnets
Interactive Subnet Creator
The Subnetting Formula
Where n = number of bits to borrow from the host portion
2^1 = 2 (not enough)
2^2 = 4 (perfect!)
We need to borrow 2 bits
Original: /24
Add 2 borrowed bits: /24 + 2 = /26
/26 = 255.255.255.192
Interval: 256 - 192 = 64
| Subnet | Network | Usable Range | Broadcast | Hosts |
|---|---|---|---|---|
| 1 | 192.168.1.0 | 192.168.1.1 - 192.168.1.62 | 192.168.1.63 | 62 |
| 2 | 192.168.1.64 | 192.168.1.65 - 192.168.1.126 | 192.168.1.127 | 62 |
| 3 | 192.168.1.128 | 192.168.1.129 - 192.168.1.190 | 192.168.1.191 | 62 |
| 4 | 192.168.1.192 | 192.168.1.193 - 192.168.1.254 | 192.168.1.255 | 62 |
Common Subnetting Scenarios
| Need X Subnets | Borrow Bits | Get Subnets | From /24 becomes |
|---|---|---|---|
| 2 subnets | 1 bit | 2 | /25 (128 hosts each) |
| 3-4 subnets | 2 bits | 4 | /26 (62 hosts each) |
| 5-8 subnets | 3 bits | 8 | /27 (30 hosts each) |
| 9-16 subnets | 4 bits | 16 | /28 (14 hosts each) |
| 17-32 subnets | 5 bits | 32 | /29 (6 hosts each) |
| 33-64 subnets | 6 bits | 64 | /30 (2 hosts each) |
๐ฏ The Magic Decoder Chart
๐ ๏ธ Smart Unified Network Assistant
๐ Quick Reference Guide
CIDR to Everything Chart
| CIDR | Mask | Wildcard | Total IPs | Usable | Class C Equiv |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 256 C |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | 256 C |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | 128 C |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | 64 C |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | 32 C |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | 16 C |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | 8 C |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | 4 C |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | 2 C |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | 1 C |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | 1/2 C |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | 1/4 C |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | 1/8 C |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | 1/16 C |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | 1/32 C |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Point-to-point |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | P2P (no broadcast) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Host route |
Powers of 2 (Essential!)
Memorize these for instant subnet calculations
| 2^n | Value | 2^n | Value | 2^n | Value |
|---|---|---|---|---|---|
| 2^0 | 1 | 2^8 | 256 | 2^16 | 65,536 |
| 2^1 | 2 | 2^9 | 512 | 2^17 | 131,072 |
| 2^2 | 4 | 2^10 | 1,024 | 2^18 | 262,144 |
| 2^3 | 8 | 2^11 | 2,048 | 2^19 | 524,288 |
| 2^4 | 16 | 2^12 | 4,096 | 2^20 | 1,048,576 |
| 2^5 | 32 | 2^13 | 8,192 | 2^24 | 16,777,216 |
| 2^6 | 64 | 2^14 | 16,384 | 2^32 | 4,294,967,296 |
| 2^7 | 128 | 2^15 | 32,768 |
Host / Mask Quick Picks
Use this table when an exam or design question says "I need X hosts" and you must choose the right subnet mask.
| Needed Hosts (min) | Smallest CIDR | Mask (last octet) | Total IPs | Usable Hosts |
|---|---|---|---|---|
| 2 | /30 | 255.255.255.252 | 4 | 2 |
| 4โ6 | /29 | 255.255.255.248 | 8 | 6 |
| 10โ14 | /28 | 255.255.255.240 | 16 | 14 |
| 20โ30 | /27 | 255.255.255.224 | 32 | 30 |
| 40โ62 | /26 | 255.255.255.192 | 64 | 62 |
| 80โ126 | /25 | 255.255.255.128 | 128 | 126 |
| 130โ254 | /24 | 255.255.255.0 | 256 | 254 |
๐ How to use this
- Step 1: Take the number of hosts you need.
- Step 2: Find the first row where "Usable Hosts" is โฅ your number.
- Step 3: That row gives you the CIDR and subnet mask to choose.
- Memory trick: /30 โ 2, /29 โ 6, /28 โ 14, /27 โ 30, /26 โ 62 (roughly double each time).
๐ TCP/IP Model Overview
The four-layer model that powers the modern Internet
| Layer # | TCP/IP Layer | OSI Equivalent | Primary Function | Key Protocols | Data Unit |
|---|---|---|---|---|---|
| 4 | Application | Application + Presentation + Session | User-facing services and data formatting | HTTP, HTTPS, FTP, SSH, DNS, DHCP, SMTP, POP3, IMAP, SNMP, Telnet | Data / Message |
| 3 | Transport | Transport | End-to-end delivery, reliability, flow control | TCP, UDP | Segment (TCP) / Datagram (UDP) |
| 2 | Internet | Network | Logical addressing and routing across networks | IP (v4/v6), ICMP, ARP, IGMP | Packet |
| 1 | Network Access | Data Link + Physical | Physical transmission and local delivery | Ethernet, Wi-Fi (802.11), PPP, Frame Relay | Frame / Bits |
๐ TCP vs UDP Comparison
When to use each transport protocol
| Feature | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) |
|---|---|---|
| Connection | Connection-oriented (3-way handshake) | Connectionless |
| Reliability | Guaranteed delivery (ACKs, retransmission) | Best-effort, no guarantee |
| Ordering | In-order delivery (sequence numbers) | No ordering |
| Flow Control | Yes (sliding window) | No |
| Error Checking | Checksum + retransmission | Checksum only (optional in IPv4) |
| Header Size | 20โ60 bytes | 8 bytes |
| Speed | Slower (overhead from reliability) | Faster (minimal overhead) |
| Use Cases | Web (HTTP/S), Email, FTP, SSH | DNS queries, VoIP, video streaming, gaming, DHCP |
2 SYN-ACK โ Server acknowledges and sends its own SYN back.
3 ACK โ Client acknowledges. Connection is now established.
๐ช Common Port Numbers
Essential ports every network engineer should know
| Port | Protocol | Service | Description |
|---|---|---|---|
| 20 | TCP | FTP Data | File transfer (data channel) |
| 21 | TCP | FTP Control | File transfer (command channel) |
| 22 | TCP | SSH | Secure remote login & file transfer (SCP/SFTP) |
| 23 | TCP | Telnet | Unencrypted remote login (legacy) |
| 25 | TCP | SMTP | Sending email between servers |
| 53 | TCP/UDP | DNS | Domain name resolution |
| 67/68 | UDP | DHCP | Dynamic IP address assignment (server/client) |
| 69 | UDP | TFTP | Trivial file transfer (no authentication) |
| 80 | TCP | HTTP | Web traffic (unencrypted) |
| 110 | TCP | POP3 | Retrieving email (downloads to client) |
| 143 | TCP | IMAP | Retrieving email (server-synced) |
| 161/162 | UDP | SNMP | Network device monitoring & management |
| 443 | TCP | HTTPS | Secure web traffic (TLS/SSL) |
| 3389 | TCP | RDP | Remote Desktop Protocol (Windows) |
๐ง Essential Network Protocols
Key protocols and what they do at each layer
Internet Layer Protocols
| Protocol | Full Name | Purpose |
|---|---|---|
| IP | Internet Protocol | Logical addressing and routing of packets across networks. IPv4 uses 32-bit addresses; IPv6 uses 128-bit. |
| ICMP | Internet Control Message Protocol | Error reporting and diagnostics (ping, traceroute). Sends messages like "Destination Unreachable" and "Time Exceeded." |
| ARP | Address Resolution Protocol | Maps a known IP address to a MAC address on the local network. Works via broadcast requests. |
| IGMP | Internet Group Management Protocol | Manages multicast group memberships on local network segments. |
Application Layer Protocols
| Protocol | Full Name | Purpose |
|---|---|---|
| DNS | Domain Name System | Translates domain names (e.g., google.com) into IP addresses. Uses hierarchical name servers (Root โ TLD โ Authoritative). |
| DHCP | Dynamic Host Configuration Protocol | Automatically assigns IP addresses, subnet masks, default gateways, and DNS servers to clients. Uses DORA: Discover โ Offer โ Request โ Acknowledge. |
| NAT | Network Address Translation | Translates private IP addresses to public IPs (and back) at a router. Enables multiple devices to share one public IP. Types: Static NAT, Dynamic NAT, PAT (Port Address Translation). |
| HTTP/S | HyperText Transfer Protocol (Secure) | Foundation of web communication. GET, POST, PUT, DELETE methods. HTTPS adds TLS encryption on port 443. |
| FTP | File Transfer Protocol | Transfers files between client and server. Uses two channels: control (port 21) and data (port 20). SFTP (over SSH) is the secure alternative. |
| SSH | Secure Shell | Encrypted remote access to devices. Replaced Telnet. Also used for tunneling and secure file transfer (SCP, SFTP). |
๐จ IPv4 Packet Header Structure
What's inside every IP packet
| Field | Size | Purpose |
|---|---|---|
| Version | 4 bits | IP version (4 for IPv4) |
| IHL | 4 bits | Header length in 32-bit words (min 5 = 20 bytes) |
| DSCP / ECN | 8 bits | Quality of Service (traffic prioritization) |
| Total Length | 16 bits | Entire packet size in bytes (max 65,535) |
| Identification | 16 bits | Fragment identification for reassembly |
| Flags + Offset | 16 bits | Fragmentation control (DF, MF) and fragment offset |
| TTL | 8 bits | Time To Live โ decremented at each hop, packet discarded at 0 |
| Protocol | 8 bits | Upper-layer protocol (6 = TCP, 17 = UDP, 1 = ICMP) |
| Header Checksum | 16 bits | Error detection for the header only |
| Source Address | 32 bits | Sender's IP address |
| Destination Address | 32 bits | Receiver's IP address |
| Options | Variable | Optional fields (rarely used; e.g., record route, timestamp) |
๐ Network Security Essentials
Core security concepts for network certification
| Concept | Description |
|---|---|
| Firewall | Filters traffic based on rules (source/destination IP, port, protocol). Types: stateless (packet filtering), stateful (tracks connections), application-layer (deep inspection). |
| ACL | Access Control List โ ordered set of permit/deny rules applied at router interfaces. Standard ACLs filter by source IP; Extended ACLs filter by source, destination, port, and protocol. |
| VPN | Virtual Private Network โ creates an encrypted tunnel over a public network. Common types: IPsec (site-to-site), SSL/TLS VPN (remote access), WireGuard. |
| TLS/SSL | Transport Layer Security โ encrypts data in transit. Used by HTTPS, SMTPS, IMAPS. Replaced the older SSL protocol. Uses certificates for authentication. |
| DMZ | Demilitarized Zone โ a perimeter network segment that exposes public-facing services (web, email) while shielding the internal LAN. |
| IDS / IPS | Intrusion Detection / Prevention System โ monitors network traffic for threats. IDS alerts; IPS actively blocks. Can be signature-based or anomaly-based. |
๐ก Network Device Reference
What each device does and where it operates
| Device | OSI Layer | Addresses Used | Function |
|---|---|---|---|
| Hub | Layer 1 (Physical) | None | Broadcasts all traffic to every port. No intelligence. Legacy device. |
| Switch | Layer 2 (Data Link) | MAC addresses | Forwards frames only to the correct port using a MAC address table. Creates separate collision domains. |
| Router | Layer 3 (Network) | IP addresses | Routes packets between different networks/subnets. Creates separate broadcast domains. Uses routing tables. |
| L3 Switch | Layer 2 + 3 | MAC + IP | Switch with routing capability. Can perform inter-VLAN routing at hardware speed. |
| Firewall | Layer 3โ7 | IP + Ports | Inspects and filters traffic based on security rules. Can be hardware or software. |
| Access Point | Layer 1โ2 | MAC addresses | Bridges wireless clients to a wired network. Manages Wi-Fi connections (802.11). |
| Load Balancer | Layer 4โ7 | IP + Ports | Distributes traffic across multiple servers for availability and performance. |
โก Networking Quick Formulas
Handy formulas for certification exams and daily work
๐ Exam Tips
| Topic | Tip |
|---|---|
| Subnetting shortcut | Find the "interesting" (non-255, non-0) octet in the mask. The block size in that octet determines all subnet boundaries. |
| AND operation | IP AND Mask = Network Address. Only AND the "interesting" octet; 255 octets stay the same, 0 octets become 0. |
| TTL values | Default TTL: 64 (Linux), 128 (Windows), 255 (Cisco). Useful for OS fingerprinting. |
| Private ranges | 10.0.0.0/8 ยท 172.16.0.0/12 ยท 192.168.0.0/16 โ never routed on the public Internet. |
| CIDR /31 | RFC 3021 โ point-to-point links, no broadcast address needed. |
๐ VLSM Calculator
Variable Length Subnet Masking โ allocate different-sized subnets from one network to minimize waste
Subnet Requirements
Add the subnets you need โ VLSM will sort by size and allocate optimally.
๐ What is VLSM?
Variable Length Subnet Masking (VLSM) allows you to use different subnet masks within the same network, unlike traditional subnetting which uses a single mask for all subnets.
Why use VLSM? It minimizes IP address waste. A department with 200 hosts gets a /24, while a point-to-point link with 2 hosts gets a /30 โ all from the same parent network.
Key rule: Always allocate the largest subnet first, then fit smaller ones into the remaining space.
| Hosts Needed | Host Bits | CIDR | Block Size | Usable Hosts |
|---|---|---|---|---|
| 1โ2 | 2 | /30 | 4 | 2 |
| 3โ6 | 3 | /29 | 8 | 6 |
| 7โ14 | 4 | /28 | 16 | 14 |
| 15โ30 | 5 | /27 | 32 | 30 |
| 31โ62 | 6 | /26 | 64 | 62 |
| 63โ126 | 7 | /25 | 128 | 126 |
| 127โ254 | 8 | /24 | 256 | 254 |
๐ง Network Tools
Practical utilities for network planning and troubleshooting
๐ Subnet Overlap Checker
Check if two or more subnets overlap in address space
๐ฆ Route Summarization (Supernetting)
Find the smallest CIDR block that covers multiple contiguous subnets
๐ฏ IP-in-Subnet Checker
Check if a specific IP address belongs to a given subnet
๐ Network Certification Drill
Timed practice questions to sharpen your subnetting skills under pressure
Press "Start Challenge" to begin!
๐ Session History
๐ Network Diagram Generator
Visualize subnets as an interactive hub-and-spoke topology diagram