KEMBAR78
IP Addressing Guide | PDF
0% found this document useful (0 votes)
8 views15 pages

IP Addressing Guide

The document is a comprehensive guide on IP addressing and subnetting, covering topics such as IP address fundamentals, binary mathematics, subnet masks, CIDR notation, and IPv6. It explains the importance of subnetting for network organization, security, and efficient IP usage, along with practical examples and calculations for subnetting. Additionally, it includes sections on Network Address Translation (NAT) and practice problems with solutions to reinforce learning.

Uploaded by

SALIHU LABBO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
8 views15 pages

IP Addressing Guide

The document is a comprehensive guide on IP addressing and subnetting, covering topics such as IP address fundamentals, binary mathematics, subnet masks, CIDR notation, and IPv6. It explains the importance of subnetting for network organization, security, and efficient IP usage, along with practical examples and calculations for subnetting. Additionally, it includes sections on Network Address Translation (NAT) and practice problems with solutions to reinforce learning.

Uploaded by

SALIHU LABBO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 15
Complete IP Addressing & Subnetting Guide A self-explanatory guide to master networking fundamentals Table of Contents 1. IP Address Fundamentals 2. Binary Mathematics 3. IP Address Classes 4, Subnet Masks Explained 5. Subnetting Step-by-Step 6. CIDR Notation 7. Advanced Subnetting 8. IPV6 Fundamentals 9, Network Address Translation (NAT), 10. Practice Problems with Solutions 1. IP Address Fundamentals What is an IP Address? An IP (Internet Protocol) address is a unique identifier for devices on a network. Think of it ike a postal address for your computer. IPv4 Structure: * 32 bits total (4 bytes) * Written as 4 octets separated by dots * Each octet ranges from 0-255 «Example: (192.168.1.100) Why Do We Need Subnetting? Imagine you have a large office building, Instead of giving every room the same address, you divide it into floors and room numbers. Subnetting does the same thing for networks - it creates smaller, manageable network segments. Benefits: * Reduces broadcast traffic (less network congestion) * Improves security (isolates network segments) * Better organization (logical grouping of devices) * Efficient IP usage (no wasted addresses) 2. Binary Mathematics Understanding Binary Computers think in binary (0s and 1). To master subnetting, you need to understand binary. Dee all vs Binary: Decimal: 192 Binary: 11000000 How to convert Position: 128 64 32 16 8 4.21 Binay: 11000000 Values: 128 + 64 = 192 Binary Conversion Methods Method 1: Place Value Addition Example: Convert 11010110 to decimal Position: 128 64 32 16 8 4 2 1 Binay: 11010110 Values: 128+ 64+0+ 16+0+4+2+0=214 Method 2: Subtraction Method Example: Convert 214 to binary 214-128 = 86 — Bit7=1 86-64=22 + Bite= 22<32 © =BitS=0 22-16=6 —Bit4=1 6<8 — ~Bit3 6-4-2 +Bit2=1 2-2-0 ~Bitt=1 o<1 — +Bito=0 Result: 11010110 Quick Reference Table Decimal Binary Decimal Binary 0 0000000 128 10000000 1 00000001 192 11000000 3 (00000011 224 11100000 7 00000111 240 11110000 15 00001111 248 11111000 3 00011111 252 11111100 68 00111111 234 11111110 127 ona 255 wait 3. IP Address Classes Class A Networks Range: 1.0.0.0 to 126.255.255.255 Default Mask: 255.0.0.0 (/8) Structure: N.H.H.H (N=Network, H=Host) Example: 10.50.100.25 Network portion: 10 Host portion: 50.100.25 Hosts per network: 2424 - 2 = 16,777,214 Key Points: * 127.x.xx is reserved for loopback * 10.x.x.x is private (RFC 1918) © Used for very large networks Class B Networks Range: 128.0.0.0 to 191.255.255.255 Default Mask: 255.255.0.0 (/16) Structure: N.N.HH Example: 172.16.50.100 Network portion: 172.16 Host portion: 50.100 Hosts per network: 2916 - 2 = 65,534 Key Point © 172.16.0.0 - 172.31.255.255 is private ‘* Used for medium-sized networks Class C Networks Range: 192.0.0.0 to 223.255.255.255 Default Mask: 255.255.255.0 (/24) Structure: N.N.N.H Example: 192.168.1.100 Network portion: 192.168.1 Host portion: 100 Hosts per network: 298 - 2 = 254 Key Points: © 192.168.x.x is private * Used for small networks Special Address Ranges © Class D (224-239): Multicast * Class E (240-255): Experimental © 169.254.x.x APIPA (Automatic Private IP) © 127.x.xx: Loopback 4, Subnet Masks Explained What is a Subnet Mask? A subnet mask tells the computer which part of an IP address is the network and which part is the host. Think of it like this: IP Address: 192.168.1.100 Subnet Mask: 255.255.255.0 The mask says: "The first 3 octets (192.168.1) identify the network, and the last octet (100) identifies the host.” How Subnet Masks Work Subnet masks use a logical AND operation: IP Address: 192.168.1.100 = 11000000.10101000.00000001.01100100 Subnet Mask: 255.255.255.0 = 19111111.11111111.11111111.00000000 t ' Network bits Host bits Result (Network): 192.168.1.0 = 11000000.10107000.00000001.00000000 Common Subnet Masks IDR _| Decimal Mask ary (last octet) Hosts _| Subnets (from /24) [4 255.255.2550 00000000 254 1 RS 255.255.255.128 ‘10000000 126 2 [26 255.255.255.192 11000000 62 4 ‘(27 255.255.255.224 11100000 30 8 [28 255.255.255.240 11110000 14 16 Lg 255.255.255.248 11111000 6 32 730 255.255.255.252 41111100 2 6a 5. Subnetting Step-by-Step The Magic Formula 24n borrowed bits) 24h - 2 = Number of hosts (where h Block Size = 256 - subnet mask value Number of subnets (where remaining host bits) Example 1: Basic Subnetting Problem: Subnet 192.168.1.0/24 to create 4 subnets Step 1: Determine bits needed * Need 4 subnets * 24n2 4,son = 2 bits needed © Borrow 2 bits from host portion Step 2: Calculate new mask © Original: /24 (255.255.255.0) © New: /24 + 2 = /26 (255.255.255.192) Step 3: Calculate block size © Block size = 256 - 192 = 64 * Each subnet has 64 addresses Step 4: List the subnets Subnet 1: 192.168.1.0/26 (Range: 0-63) = Network: 192.168.1.0 First host: 192.168.1.1 ~ Last host: 192.168.1.62 ~ Broadcast: 192.168.1.63 Subnet 2: 192.168.1.64/26 (Range: 64-127) - Network: 192.168.1.64 - First host: 192.168.1.65 = Last host: 192.168.1.126 - Broadcast: 192.168.1.127 Subnet 3: 192,168.1.128/26 (Range: 128-191) Subnet 4: 192.168.1.192/26 (Range: 192-255) Example 2: Variable Length Subnet Masking (VLSM) Problem: You have 192.168.1.0/24 and need: * Network A: 50 hosts «Network B: 25 hosts ‘© Network C: 10 hosts * Network D: 2 hosts (point-to-point) Solution Strategy: Start with the largest requirement Network A (50 hosts): * Need 246 - 2 = 62 usable hosts © Use /26: 192.168.1.0/26 (0-63) Network B (25 hosts): * Need 245 - 2 = 30 usable hosts © Use /27: 192.168.1.64/27 (64-95) Network C (10 hosts): © Need 244 - 2 = 14 usable hosts © Use /28: 192.168.1.96/28 (96-111) Network D (2 hosts): © Need 242 - 2 = 2 usable hosts © Use /30: 192.168.1.112/30 (112-115) Remaining space: 192.168.1.116/30 through 192.168.1.252/30 6. CIDR Notation Understanding CIDR CIDR (Classless Inter-Domain Routing) eliminates the rigid class system. Format: Network/Prefix Length © Example: 192.168.1.0/24 © The "/24" means 24 bits for network, 8 bits for hosts CIDR Benefits 1. Flexible addressing - Not limited to /8, /16, /24 2, Route aggregation - Combine multiple routes 3. Efficient allocation - Use exactly what you need Route Summarization Example Individual routes: ~ 192,168.0,0/24 = 192.168.1.0/24 ~ 192.168.2.0/24 -192.168.3.0/24 Can be summarized as: ~ 192.168.0.0/22 (covers all four networks) Binary analysis 192.168.0x = 11000000.10101000,00000000 xo... 192.168.1.x = 11000000.10101000,00000001 ,o.0.000x% 192.168.2.x = 11000000.10101000,00000010.xxx0000xx 192.168.3.x = 11000000.10101000,0000001 1 xxxx000xx roroat Common bits = 22 7. Advanced Subnetting Supernetting Supernetting combines multiple networks into a larger one. Example: Combine: 172.16.0.0/16 and 172.17.0.0/16 Binary analysis: 172.16xx = 10101100,0001000030000000432000000K 172.17.xx = 10101100.00010007 90000%% 2000000 tort Commen bits Result: 172.16.0.0/15 (covers 172.16.0.0 through 172.17.255.255) Wildcard Masks (for Cisco ACLs) Formula: Wildcard = 255.255.255.255 - Subnet Mask Examples: Subnet Mask: 255.255.255.0 — Wildcard: 0.0.0.255 Subnet Mask: 255.255.255.192 ~+ Wildcard: 0.0.0.63 Subnet Mask: 255.255.2400 — Wildcard: 0.0.15.255 Calculating Hosts and Subnets Given network: 10.0.0.0/8, create subnets with at least 1000 hosts each Step 1: Determine host bits needed 24h -2 2 1000 2910 - 2 = 1022 hosts V Need 10 host bits Step 2: Calculate subnet bits Total bits: 32 Network bits (original: 8 Host bits needed: 10 Subnet bits: 32 - 8 - 10 = 14 Step 3: Results New mask: /8 + 14 = /22 Number of subnets: 2414 = 16,384 Hosts per subnet: 2410 - 2 = 1,022 8. IPv6 Fundamentals IPv6 Address Structure * 128 bits total (16 bytes) ‘* Written as 8 groups of 4 hexadecimal digits © Groups separated by colons + ample IPv6 Address Types 1. Global Unicast (2000::/3) Example: 2001:db8:1234'5678:1 Purpose: Internet routable addresses Scope: Global 2. Link-Local (fe80::/10) Example: fe80:1 Purpose: Local network communication Scope: Link only (not routed) 3. Multicast (ff00::/8) {02:1 - All nodes on link {102:2 - All routers on link {02:5 - All OSPF routers 4, Unique Local (fc00::/7) Example: fd12:3456:789a::1 Purpose: Private addressing (like RFC 1918) Scope: Organization IPv6 Compression Rules Original: 2001 :04b8:0000:0000:0000:0000:0000:0001 Rule 1 - Remove leading zeros: 2001:4b8:0:00.0:0:1 Rule 2 - Compress consecutive zeros (: once only) 2001:db8:1 IPv6 Subnetting Example: 2001:db8:1234:/48 network Subnet Structure: 2001:clb8:1234:SSSSiINEIILIIIIL tt Subnet Interface ID (16 bits) (64 bits) Common subnets: 2001:db8:1234:0000:/64 2001:db8:1234:0001:/64 2001:db8:1234:0002:/64 2001:db8:1 234: /64 Total possible subnets: 216 = 65,536 9. Network Address Translation (NAT) Why NAT? 1. IPv4 address conservation - Share public IPs 2. Security - Hide internal network structure 3. Flexil ity - Change internal addressing without affecting external NAT Types 1. Static NAT (1:1) Internal: 192.168.1.100 + External: 203.0.113.10 Internal: 192.168.1,101 = External: 203.0.113.11 Characteristics: ~ Permanent mapping - One-to-one relationship - Used for servers 2. Dynamic NAT (Many:Many) Internal Pool: 192.168.1.100-200 Extetnal Pool: 203.0.113.10-20 Process: 1. Internal host needs external access 2. Router assigns available public IP 3. Mapping removed when session ends PAT/NAT Overload (Many:1) Internal IPs + Single External IP using different ports 192.168.1.100:3000 + 203.0.113.10:20000 192.168.1.101:3001 — 203,0.113.10:20001 192.168.1.102:80 + 203.0.113.10:20002 Translation Table: Inside Local | Inside Global 192.168.1.100:3000 | 203.0.113.10:20000 192.168.1.101:3001 | 203.0.113.10:20001 10. Practice Problems with Solutions Problem 1: Basic Subnetting Question: Subnet 172.16.0.0/16 to create 8 subnets. List the first 3 subnets with their ranges. Solution: Step 1: Bits needed for 8 subnets 20n28 +n =3bits Step 2: New mask ING + 3 = /19 (255.255.2240) Step 3: Block size 256 - 224 = 32 (in 3rd octet) Step 4: Subnets Subnet 1: 172.16.0.0/19 (0.0 - 31.255) Subnet 2: 172.16.32.0/19 (32.0 - 63.255) Subnet 3: 172.16.64.0/19 (64.0 - 95.255) Problem 2: Host Requirements Question: You need exactly 500 usable hosts per subnet. What subnet mask should you use? Solution: Step 1: Determine host bits needed 24h -2 > 500 299-2=5102 S00V Need 9 host bits Step 2: Calculate network bits 32 - 9 = 23 network bits Answer: /23 or 255.255.254.0 Problem 3: Finding the Network Question: What network does the host 192.168.50.177/26 belong to? Solution: Step 1: Determine block size 226 = 255.255.255.192 Block size = 256 - 192 = 64 Step 2: Find which block contains 17 Blocks: 0-63, 64-127, 128-191, 192-255 177 falls in the 128-191 block Answer: 192.168.50.128/26 Problem 4: IPv6 Compression Question: Compress 2001:0db8:0000:0042:0000:8329:0000:0001 Solution: Step 1: Remove leading zeros 200 1:b8:0:42:0:8329:0:1 Step 2: Find longest consecutive zero sequence Only single zero groups, so compress any one: 2001:db8:0:42:8329:0:1 or 2001:db8:42:0:8329.0:1 2001:db8.0:42.0:8329:1 Best choice (first occurrence): 2001:db8::42:0:8329:0:1 Problem 5: Route Summarization Question: Summarize these routes: 10.1.16.0/24, 10.1.17.0/24, 10.1.18.0/24, 10.1.19.0/24 Solution: Step 1: Convert to binary (3rd octet) 16 = 00010000 17 = 00010001 18 = 00010010 19 = 00010011 Step 2: Find common bits (00010000 00010001 (00010010 0010011 mrt Common = 4 bits Step 3: Calculate summary Original /24 = 24 bits Lost 4 bits in 3rd octet = 24-4 = /20 Summary: 10.1.16.0/20 Key Formulas Reference Card Subnetting Formulas - Subnets = 2*(borrowed bits) - Hosts = 2(host bits) - 2 ~ Block size = 256 - (subnet mask octet) ~ Network increment = block size Binary Conversion - Decimal to Binary: Subtraction method or place values ~ Binary to Decimal: Add place values where bit = 1 Place values: 128, 64, 32, 16,8, 4,2, 1 CIDR Calculations 255.255.255.0 = 254 hosts 255.255.255.128 = 126 hosts = /26 = 255.255.255.192 = 62 hosts = /27 = 255.255.255.224 = 30 hosts = /28 = 255.255.255.240 = 14 hosts = /29 = 255.255.255.248 = 6 hosts ~ /30 = 255.255.255.252 = 2 hosts IPv6 Structure - 128 bits total - 8 groups of 16 bits each - /64 common subnet boundary - /48 common allocation boundary Troubleshooting Common Mistakes Mistake 1: Forgetting to Subtract 2 Wrong: /24 has 256 hosts Right: /24 has 254 USABLE hosts (256 - 2) Why subtract 27 ~ Network address (all host bits = 0) ~ Broadcast address (all host bits = 1) Mistake 2: Wrong Block Size Calculation Wrong: /26 block size = 192 Right: /26 block size = 256 - 192 = 64 Remember: Block size = 256 - (subnet mask value) Mistake 3: IPv6 Compression Confusion ‘Wrong: 2001:db8:0:0:0:0:0:1 = 2001:db8::1 Right: 2001:db8:0:0:0:0:0:1 = 2001:db8:-1 Rule: : can only be used ONCE per address Mistake 4: Wildcard Mask Confusion Wrong: /24 wildcard = 255,255.255.0 Right: /24 wildcard = 0.0.0.255 Formula: Wildcard = 255.255.255.255 - Subnet Mask This guide provides a complete foundation for understanding IP addressing and subnetting, Practice with real scenarios and gradually increase complexity to master these concepts!

You might also like