Net Practice Pro

Complete IP Addressing & Subnetting Guide

๐ŸŽฏ The Magic Decoder Chart

The single most important chart in networking - MEMORIZE THIS!

2โท
128
2โถ
64
2โต
32
2โด
16
2ยณ
8
2ยฒ
4
2ยน
2
2โฐ
1

๐Ÿ’ก 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

Example 1: Convert 11000000 to decimal
Position 128 64 32 16 8 4 2 1
Binary 1 1 0 0 0 0 0 0
Add 128 64 - - - - - -
128 + 64 = 192

Answer: 11000000 = 192

Example 2: Convert 10101100 to decimal
Position 128 64 32 16 8 4 2 1
Binary 1 0 1 0 1 1 0 0
Add 128 - 32 - 8 4 - -
128 + 32 + 8 + 4 = 172

Answer: 10101100 = 172

๐Ÿ”„ Decimal to Binary Conversion

Master both directions: Decimal โ†’ Binary and Binary โ†’ Decimal

Decimal to Binary Converter

Method: Decimal โ†’ Binary

1 Write the Magic Numbers

128, 64, 32, 16, 8, 4, 2, 1

2 Start from 128 - does it fit?

If YES โ†’ write "1" and subtract. If NO โ†’ write "0" and move on.

3 Repeat for each position until you reach 0
Example: Convert 207 to Binary

Start with: 207

# Power Value Fits? Bit Remainder
1 27 = 128 207 ✔ Yes 1 79
2 26 = 64 79 ✔ Yes 1 15
3 25 = 32 15 ✘ No 0 15
4 24 = 16 15 ✘ No 0 15
5 23 = 8 15 ✔ Yes 1 7
6 22 = 4 7 ✔ Yes 1 3
7 21 = 2 3 ✔ Yes 1 1
8 20 = 1 1 ✔ Yes 1 0
11001111

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

1 Look at the subnet mask

Example: 255.255.255.192

2 Find the "interesting octet" (the one that's not 255 or 0)

In this case: 192 (4th octet)

3 Subtract from 256
256 - 192 = 64

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
Example: Find all subnets in 192.168.1.0/26
1 Find the interval

Mask = 255.255.255.192
Interval = 256 - 192 = 64

2 Count by the interval in the interesting octet

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)

Example: 172.16.45.200/20 - Find all parameters
1 Convert /20 to subnet mask

/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

2 Find the interval (block size)

Interesting octet: 240 (3rd octet)
256 - 240 = 16

3 Find which subnet 45 falls into

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

4 Calculate all addresses
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

2^n โ‰ฅ Number of Subnets Needed

Where n = number of bits to borrow from the host portion

Example: Split 192.168.1.0/24 into 4 subnets
1 How many bits do we need?

2^1 = 2 (not enough)
2^2 = 4 (perfect!)
We need to borrow 2 bits

2 New CIDR notation

Original: /24
Add 2 borrowed bits: /24 + 2 = /26

3 New subnet mask

/26 = 255.255.255.192
Interval: 256 - 192 = 64

4 List all subnets
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

2โท
128
2โถ
64
2โต
32
2โด
16
2ยณ
8
2ยฒ
4
2ยน
2
2โฐ
1

๐Ÿ› ๏ธ Smart Unified Network Assistant

๐Ÿ’ก Fill in one or more fields above, then press Analyze & Solve

๐Ÿ“ Quick Reference Guide

CIDR to Everything Chart

CIDR Mask Wildcard Total IPs Usable Class C Equiv
/8255.0.0.00.255.255.25516,777,21616,777,214256 C
/16255.255.0.00.0.255.25565,53665,534256 C
/17255.255.128.00.0.127.25532,76832,766128 C
/18255.255.192.00.0.63.25516,38416,38264 C
/19255.255.224.00.0.31.2558,1928,19032 C
/20255.255.240.00.0.15.2554,0964,09416 C
/21255.255.248.00.0.7.2552,0482,0468 C
/22255.255.252.00.0.3.2551,0241,0224 C
/23255.255.254.00.0.1.2555125102 C
/24255.255.255.00.0.0.2552562541 C
/25255.255.255.1280.0.0.1271281261/2 C
/26255.255.255.1920.0.0.6364621/4 C
/27255.255.255.2240.0.0.3132301/8 C
/28255.255.255.2400.0.0.1516141/16 C
/29255.255.255.2480.0.0.7861/32 C
/30255.255.255.2520.0.0.342Point-to-point
/31255.255.255.2540.0.0.122P2P (no broadcast)
/32255.255.255.2550.0.0.011Host route

Powers of 2 (Essential!)

Memorize these for instant subnet calculations

2^n Value 2^n Value 2^n Value
2^01 2^8256 2^1665,536
2^12 2^9512 2^17131,072
2^24 2^101,024 2^18262,144
2^38 2^112,048 2^19524,288
2^416 2^124,096 2^201,048,576
2^532 2^138,192 2^2416,777,216
2^664 2^1416,384 2^324,294,967,296
2^7128 2^1532,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
๐Ÿ“ฆ Encapsulation flow: Data โ†’ Segment โ†’ Packet โ†’ Frame โ†’ Bits. Each layer wraps the data from the layer above with its own header (and sometimes trailer), then passes it down.

๐Ÿ”€ TCP vs UDP Comparison

When to use each transport protocol

Feature TCP (Transmission Control Protocol) UDP (User Datagram Protocol)
ConnectionConnection-oriented (3-way handshake)Connectionless
ReliabilityGuaranteed delivery (ACKs, retransmission)Best-effort, no guarantee
OrderingIn-order delivery (sequence numbers)No ordering
Flow ControlYes (sliding window)No
Error CheckingChecksum + retransmissionChecksum only (optional in IPv4)
Header Size20โ€“60 bytes8 bytes
SpeedSlower (overhead from reliability)Faster (minimal overhead)
Use CasesWeb (HTTP/S), Email, FTP, SSHDNS queries, VoIP, video streaming, gaming, DHCP
๐Ÿค TCP 3-Way Handshake:
1 SYN โ€” Client sends a synchronize request to the server.
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
20TCPFTP DataFile transfer (data channel)
21TCPFTP ControlFile transfer (command channel)
22TCPSSHSecure remote login & file transfer (SCP/SFTP)
23TCPTelnetUnencrypted remote login (legacy)
25TCPSMTPSending email between servers
53TCP/UDPDNSDomain name resolution
67/68UDPDHCPDynamic IP address assignment (server/client)
69UDPTFTPTrivial file transfer (no authentication)
80TCPHTTPWeb traffic (unencrypted)
110TCPPOP3Retrieving email (downloads to client)
143TCPIMAPRetrieving email (server-synced)
161/162UDPSNMPNetwork device monitoring & management
443TCPHTTPSSecure web traffic (TLS/SSL)
3389TCPRDPRemote Desktop Protocol (Windows)
Port ranges: Well-Known (0โ€“1023) are reserved for standard services. Registered (1024โ€“49151) are assigned to applications. Dynamic/Ephemeral (49152โ€“65535) are used by clients for temporary connections.

๐Ÿ”ง Essential Network Protocols

Key protocols and what they do at each layer

Internet Layer Protocols

Protocol Full Name Purpose
IPInternet ProtocolLogical addressing and routing of packets across networks. IPv4 uses 32-bit addresses; IPv6 uses 128-bit.
ICMPInternet Control Message ProtocolError reporting and diagnostics (ping, traceroute). Sends messages like "Destination Unreachable" and "Time Exceeded."
ARPAddress Resolution ProtocolMaps a known IP address to a MAC address on the local network. Works via broadcast requests.
IGMPInternet Group Management ProtocolManages multicast group memberships on local network segments.

Application Layer Protocols

Protocol Full Name Purpose
DNSDomain Name SystemTranslates domain names (e.g., google.com) into IP addresses. Uses hierarchical name servers (Root โ†’ TLD โ†’ Authoritative).
DHCPDynamic Host Configuration ProtocolAutomatically assigns IP addresses, subnet masks, default gateways, and DNS servers to clients. Uses DORA: Discover โ†’ Offer โ†’ Request โ†’ Acknowledge.
NATNetwork Address TranslationTranslates 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/SHyperText Transfer Protocol (Secure)Foundation of web communication. GET, POST, PUT, DELETE methods. HTTPS adds TLS encryption on port 443.
FTPFile Transfer ProtocolTransfers files between client and server. Uses two channels: control (port 21) and data (port 20). SFTP (over SSH) is the secure alternative.
SSHSecure ShellEncrypted 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
Version4 bitsIP version (4 for IPv4)
IHL4 bitsHeader length in 32-bit words (min 5 = 20 bytes)
DSCP / ECN8 bitsQuality of Service (traffic prioritization)
Total Length16 bitsEntire packet size in bytes (max 65,535)
Identification16 bitsFragment identification for reassembly
Flags + Offset16 bitsFragmentation control (DF, MF) and fragment offset
TTL8 bitsTime To Live โ€” decremented at each hop, packet discarded at 0
Protocol8 bitsUpper-layer protocol (6 = TCP, 17 = UDP, 1 = ICMP)
Header Checksum16 bitsError detection for the header only
Source Address32 bitsSender's IP address
Destination Address32 bitsReceiver's IP address
OptionsVariableOptional fields (rarely used; e.g., record route, timestamp)
Minimum IPv4 Header = 20 bytes (5 ร— 32-bit words)  |  Maximum = 60 bytes (15 ร— 32-bit words with options)

๐Ÿ”’ Network Security Essentials

Core security concepts for network certification

Concept Description
FirewallFilters traffic based on rules (source/destination IP, port, protocol). Types: stateless (packet filtering), stateful (tracks connections), application-layer (deep inspection).
ACLAccess 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.
VPNVirtual Private Network โ€” creates an encrypted tunnel over a public network. Common types: IPsec (site-to-site), SSL/TLS VPN (remote access), WireGuard.
TLS/SSLTransport Layer Security โ€” encrypts data in transit. Used by HTTPS, SMTPS, IMAPS. Replaced the older SSL protocol. Uses certificates for authentication.
DMZDemilitarized Zone โ€” a perimeter network segment that exposes public-facing services (web, email) while shielding the internal LAN.
IDS / IPSIntrusion 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
HubLayer 1 (Physical)NoneBroadcasts all traffic to every port. No intelligence. Legacy device.
SwitchLayer 2 (Data Link)MAC addressesForwards frames only to the correct port using a MAC address table. Creates separate collision domains.
RouterLayer 3 (Network)IP addressesRoutes packets between different networks/subnets. Creates separate broadcast domains. Uses routing tables.
L3 SwitchLayer 2 + 3MAC + IPSwitch with routing capability. Can perform inter-VLAN routing at hardware speed.
FirewallLayer 3โ€“7IP + PortsInspects and filters traffic based on security rules. Can be hardware or software.
Access PointLayer 1โ€“2MAC addressesBridges wireless clients to a wired network. Manages Wi-Fi connections (802.11).
Load BalancerLayer 4โ€“7IP + PortsDistributes traffic across multiple servers for availability and performance.

โšก Networking Quick Formulas

Handy formulas for certification exams and daily work

Usable Hosts = 2(32 โˆ’ CIDR) โˆ’ 2
Number of Subnets = 2bits borrowed
Magic Number (Block Size) = 256 โˆ’ subnet mask octet value
Broadcast Address = Network Address + Block Size โˆ’ 1  (in the relevant octet)
Wildcard Mask = 255.255.255.255 โˆ’ Subnet Mask
Throughput = Window Size รท RTT  (basic TCP throughput estimate)

๐ŸŽ“ 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โ€“22/3042
3โ€“63/2986
7โ€“144/281614
15โ€“305/273230
31โ€“626/266462
63โ€“1267/25128126
127โ€“2548/24256254

๐Ÿ”ง 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

0 Streak
0 Correct
0 Attempted

Press "Start Challenge" to begin!

๐Ÿ“ˆ Session History

๐Ÿ“Š Network Diagram Generator

Visualize subnets as an interactive hub-and-spoke topology diagram