diff --git a/src/lib/content/cidr.ts b/src/lib/content/cidr.ts new file mode 100644 index 0000000..06f588b --- /dev/null +++ b/src/lib/content/cidr.ts @@ -0,0 +1,76 @@ +export const cidrContent = { + title: "CIDR Notation Explained", + description: "Complete guide to CIDR notation - what it is, why it replaced IP classes, and how to read network prefixes.", + + sections: { + whatIs: { + title: "What is CIDR?", + content: `CIDR (Classless Inter-Domain Routing) is a method for describing IP networks using a slash followed by a number. The number after the slash tells you how many bits are used for the network portion of the address. + +For example, in 192.168.1.0/24, the "/24" means the first 24 bits identify the network, and the remaining 8 bits identify individual hosts within that network.` + }, + + whyReplaced: { + title: "Why CIDR Replaced IP Classes", + content: `The old class system (Class A, B, C) was too rigid and wasteful. It only allowed networks of fixed sizes: + +- Class A: 16 million addresses (way too big for most needs) +- Class B: 65,536 addresses (often too big) +- Class C: 256 addresses (often too small) + +CIDR lets you create networks of any size by choosing exactly how many network bits you need.` + }, + + howToRead: { + title: "How to Read CIDR Notation", + content: `The number after the slash is the "prefix length" - it counts the network bits from left to right: + +- /8 = 8 network bits (24 host bits) +- /16 = 16 network bits (16 host bits) +- /24 = 24 network bits (8 host bits) +- /30 = 30 network bits (2 host bits)` + } + }, + + examples: [ + { + cidr: "192.168.0.0/24", + description: "Home network - 254 usable addresses", + hosts: "254 hosts" + }, + { + cidr: "10.0.0.0/8", + description: "Large private network - 16 million addresses", + hosts: "16,777,214 hosts" + }, + { + cidr: "172.16.0.0/12", + description: "Medium private network - 1 million addresses", + hosts: "1,048,574 hosts" + }, + { + cidr: "2001:db8::/32", + description: "IPv6 network - massive address space", + hosts: "2^96 addresses" + } + ], + + prefixTable: [ + { prefix: "/8", mask: "255.0.0.0", hosts: "16,777,214", typical: "ISP allocation" }, + { prefix: "/16", mask: "255.255.0.0", hosts: "65,534", typical: "Large enterprise" }, + { prefix: "/20", mask: "255.255.240.0", hosts: "4,094", typical: "Medium business" }, + { prefix: "/24", mask: "255.255.255.0", hosts: "254", typical: "Small office/home" }, + { prefix: "/25", mask: "255.255.255.128", hosts: "126", typical: "Small subnet" }, + { prefix: "/26", mask: "255.255.255.192", hosts: "62", typical: "Point-to-point" }, + { prefix: "/30", mask: "255.255.255.252", hosts: "2", typical: "Router links" }, + { prefix: "/32", mask: "255.255.255.255", hosts: "1", typical: "Single host" } + ], + + keyPoints: [ + "Smaller prefix numbers = bigger networks (more hosts)", + "Larger prefix numbers = smaller networks (fewer hosts)", + "/24 is the most common size for small networks", + "IPv6 commonly uses /64 for end-user networks", + "CIDR allows efficient use of IP address space" + ] +}; \ No newline at end of file diff --git a/src/lib/content/common-ports.ts b/src/lib/content/common-ports.ts new file mode 100644 index 0000000..e62a721 --- /dev/null +++ b/src/lib/content/common-ports.ts @@ -0,0 +1,88 @@ +export const commonPortsContent = { + title: "Common TCP/UDP Ports", + description: "Quick reference for the most frequently used TCP and UDP port numbers.", + + wellKnown: [ + { port: 20, protocol: "TCP", service: "FTP Data", description: "File Transfer Protocol data channel" }, + { port: 21, protocol: "TCP", service: "FTP Control", description: "File Transfer Protocol control channel" }, + { port: 22, protocol: "TCP", service: "SSH", description: "Secure Shell remote login" }, + { port: 23, protocol: "TCP", service: "Telnet", description: "Telnet remote login (insecure)" }, + { port: 25, protocol: "TCP", service: "SMTP", description: "Simple Mail Transfer Protocol" }, + { port: 53, protocol: "TCP/UDP", service: "DNS", description: "Domain Name System" }, + { port: 67, protocol: "UDP", service: "DHCP Server", description: "Dynamic Host Configuration Protocol server" }, + { port: 68, protocol: "UDP", service: "DHCP Client", description: "Dynamic Host Configuration Protocol client" }, + { port: 69, protocol: "UDP", service: "TFTP", description: "Trivial File Transfer Protocol" }, + { port: 80, protocol: "TCP", service: "HTTP", description: "Hypertext Transfer Protocol" }, + { port: 110, protocol: "TCP", service: "POP3", description: "Post Office Protocol v3" }, + { port: 123, protocol: "UDP", service: "NTP", description: "Network Time Protocol" }, + { port: 143, protocol: "TCP", service: "IMAP", description: "Internet Message Access Protocol" }, + { port: 161, protocol: "UDP", service: "SNMP Agent", description: "Simple Network Management Protocol" }, + { port: 162, protocol: "UDP", service: "SNMP Manager", description: "SNMP trap messages" }, + { port: 443, protocol: "TCP", service: "HTTPS", description: "HTTP over TLS/SSL" }, + { port: 993, protocol: "TCP", service: "IMAPS", description: "IMAP over TLS/SSL" }, + { port: 995, protocol: "TCP", service: "POP3S", description: "POP3 over TLS/SSL" } + ], + + registered: [ + { port: 179, protocol: "TCP", service: "BGP", description: "Border Gateway Protocol" }, + { port: 389, protocol: "TCP", service: "LDAP", description: "Lightweight Directory Access Protocol" }, + { port: 636, protocol: "TCP", service: "LDAPS", description: "LDAP over TLS/SSL" }, + { port: 989, protocol: "TCP", service: "FTPS Data", description: "FTP over TLS/SSL data" }, + { port: 990, protocol: "TCP", service: "FTPS Control", description: "FTP over TLS/SSL control" }, + { port: 1433, protocol: "TCP", service: "MS SQL Server", description: "Microsoft SQL Server" }, + { port: 1521, protocol: "TCP", service: "Oracle DB", description: "Oracle Database" }, + { port: 1723, protocol: "TCP", service: "PPTP", description: "Point-to-Point Tunneling Protocol" }, + { port: 3306, protocol: "TCP", service: "MySQL", description: "MySQL Database" }, + { port: 3389, protocol: "TCP", service: "RDP", description: "Remote Desktop Protocol" }, + { port: 5432, protocol: "TCP", service: "PostgreSQL", description: "PostgreSQL Database" }, + { port: 5900, protocol: "TCP", service: "VNC", description: "Virtual Network Computing" } + ], + + dynamic: [ + { port: 8080, protocol: "TCP", service: "HTTP Alt", description: "Alternative HTTP port" }, + { port: 8443, protocol: "TCP", service: "HTTPS Alt", description: "Alternative HTTPS port" }, + { port: 9090, protocol: "TCP", service: "Web Admin", description: "Common web admin interface" } + ], + + categories: { + web: [ + { ports: "80, 8080", service: "HTTP", secure: false }, + { ports: "443, 8443", service: "HTTPS", secure: true } + ], + email: [ + { ports: "25", service: "SMTP", secure: false }, + { ports: "587", service: "SMTP (submission)", secure: true }, + { ports: "110", service: "POP3", secure: false }, + { ports: "995", service: "POP3S", secure: true }, + { ports: "143", service: "IMAP", secure: false }, + { ports: "993", service: "IMAPS", secure: true } + ], + remote: [ + { ports: "22", service: "SSH", secure: true }, + { ports: "23", service: "Telnet", secure: false }, + { ports: "3389", service: "RDP", secure: false }, + { ports: "5900+", service: "VNC", secure: false } + ], + database: [ + { ports: "1433", service: "SQL Server", secure: false }, + { ports: "1521", service: "Oracle", secure: false }, + { ports: "3306", service: "MySQL", secure: false }, + { ports: "5432", service: "PostgreSQL", secure: false } + ] + }, + + ranges: [ + { range: "0-1023", name: "Well-Known Ports", description: "System/privileged services, require root" }, + { range: "1024-49151", name: "Registered Ports", description: "Registered with IANA for specific services" }, + { range: "49152-65535", name: "Dynamic/Private", description: "Ephemeral ports for client connections" } + ], + + tips: [ + "Ports below 1024 typically require administrator privileges", + "HTTPS is HTTP + TLS/SSL encryption (port 443)", + "SSH (22) is the secure replacement for Telnet (23)", + "Email uses multiple ports: 25 (SMTP), 110 (POP3), 143 (IMAP)", + "Add 'S' suffix for secure versions: HTTPS, FTPS, IMAPS, POP3S", + "Database ports are often targeted by attackers - secure them well" + ] +}; \ No newline at end of file diff --git a/src/lib/content/ipv6-address-types.ts b/src/lib/content/ipv6-address-types.ts new file mode 100644 index 0000000..6c86b9d --- /dev/null +++ b/src/lib/content/ipv6-address-types.ts @@ -0,0 +1,156 @@ +export const ipv6AddressTypesContent = { + title: "IPv6 Address Types & Key Prefixes", + description: "Complete guide to IPv6 address types including unicast, multicast, anycast, and special-use prefixes.", + + sections: { + overview: { + title: "IPv6 Address Categories", + content: `IPv6 addresses are organized into three main categories: + +- **Unicast**: One-to-one communication (most common) +- **Multicast**: One-to-many communication +- **Anycast**: One-to-nearest communication + +Unlike IPv4, IPv6 has no broadcast addresses. Multicast handles broadcast-like functions.` + } + }, + + unicastTypes: [ + { + type: "Global Unicast", + prefix: "2000::/3", + range: "2000:: to 3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + description: "Internet-routable addresses, like IPv4 public addresses", + usage: "Public websites, servers, internet-facing devices", + example: "2001:db8:85a3::8a2e:370:7334" + }, + { + type: "Unique Local (ULA)", + prefix: "fc00::/7", + range: "fc00:: to fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + description: "Private addresses for local networks, like IPv4 RFC 1918", + usage: "Internal networks, VPNs, private communication", + example: "fd12:3456:789a::1" + }, + { + type: "Link-Local", + prefix: "fe80::/10", + range: "fe80:: to febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + description: "Auto-configured on every interface, not routed beyond local link", + usage: "Neighbor discovery, router advertisements, local communication", + example: "fe80::1%eth0" + } + ], + + specialAddresses: [ + { + address: "::1/128", + name: "Loopback", + description: "IPv6 equivalent of 127.0.0.1", + usage: "Testing, local services" + }, + { + address: "::/128", + name: "Unspecified", + description: "IPv6 equivalent of 0.0.0.0", + usage: "Default route, uninitialized addresses" + }, + { + address: "::/0", + name: "Default Route", + description: "Matches all addresses", + usage: "Default gateway route" + }, + { + address: "::ffff:0:0/96", + name: "IPv4-Mapped", + description: "IPv4 addresses mapped into IPv6 space", + usage: "Dual-stack applications, IPv4 compatibility" + } + ], + + multicastTypes: [ + { + prefix: "ff00::/8", + scope: "All", + description: "All multicast addresses start with ff", + examples: [] + }, + { + prefix: "ff01::/16", + scope: "Interface-Local", + description: "Multicast within single interface", + examples: ["ff01::1 - All nodes (interface-local)"] + }, + { + prefix: "ff02::/16", + scope: "Link-Local", + description: "Multicast within local network segment", + examples: [ + "ff02::1 - All nodes (link-local)", + "ff02::2 - All routers (link-local)", + "ff02::5 - OSPFv3 routers", + "ff02::6 - OSPFv3 designated routers" + ] + }, + { + prefix: "ff05::/16", + scope: "Site-Local", + description: "Multicast within entire site/organization", + examples: ["ff05::2 - All routers (site-local)"] + }, + { + prefix: "ff0e::/16", + scope: "Global", + description: "Internet-wide multicast", + examples: ["ff0e::1 - All nodes (global)"] + } + ], + + anycast: { + title: "Anycast Addresses", + description: `Anycast addresses look identical to unicast addresses but are assigned to multiple devices. Traffic goes to the "nearest" device with that address. + +There's no special prefix for anycast - they use the same ranges as unicast addresses.`, + + commonUses: [ + "DNS root servers (multiple servers, same IP)", + "Content delivery networks (CDNs)", + "Load balancing across geographic locations", + "Subnet router anycast (all routers on a subnet)" + ], + + example: "2001:db8::1 could be anycast if assigned to multiple servers" + }, + + reservedRanges: [ + { prefix: "0000::/8", purpose: "Reserved (includes ::1 and IPv4-mapped)" }, + { prefix: "0100::/8", purpose: "Reserved" }, + { prefix: "0200::/7", purpose: "Reserved" }, + { prefix: "0400::/6", purpose: "Reserved" }, + { prefix: "0800::/5", purpose: "Reserved" }, + { prefix: "1000::/4", purpose: "Reserved" }, + { prefix: "4000::/3", purpose: "Reserved" }, + { prefix: "6000::/3", purpose: "Reserved" }, + { prefix: "8000::/3", purpose: "Reserved" }, + { prefix: "a000::/3", purpose: "Reserved" }, + { prefix: "c000::/3", purpose: "Reserved" }, + { prefix: "e000::/4", purpose: "Reserved" }, + { prefix: "f000::/5", purpose: "Reserved" }, + { prefix: "f800::/6", purpose: "Reserved" }, + { prefix: "fc00::/7", purpose: "Unique Local Addresses" }, + { prefix: "fe00::/9", purpose: "Reserved" }, + { prefix: "fe80::/10", purpose: "Link-Local Addresses" }, + { prefix: "fec0::/10", purpose: "Reserved (deprecated site-local)" }, + { prefix: "ff00::/8", purpose: "Multicast" } + ], + + quickTips: [ + "Most public IPv6 addresses start with 2 or 3", + "If you see fe80::, it's link-local (not routed)", + "If you see fd or fc, it's unique local (private)", + "If you see ff, it's multicast", + "::1 is IPv6 loopback (like 127.0.0.1)", + ":: means all zeros (like 0.0.0.0)" + ] +}; \ No newline at end of file diff --git a/src/lib/content/special-use-ipv4.ts b/src/lib/content/special-use-ipv4.ts new file mode 100644 index 0000000..d0fa144 --- /dev/null +++ b/src/lib/content/special-use-ipv4.ts @@ -0,0 +1,135 @@ +export const specialIPv4Content = { + title: "Special-Use IPv4 Blocks (RFC 6890)", + description: "Complete reference of reserved IPv4 address blocks and their specific purposes.", + + ranges: [ + { + network: "0.0.0.0/8", + purpose: "This host on this network", + rfc: "RFC 1122", + routable: false, + description: "Used for default routes and unspecified addresses" + }, + { + network: "10.0.0.0/8", + purpose: "Private-Use Networks", + rfc: "RFC 1918", + routable: false, + description: "Private addresses for internal networks (Class A)" + }, + { + network: "100.64.0.0/10", + purpose: "Shared Address Space (CGNAT)", + rfc: "RFC 6598", + routable: false, + description: "Carrier-Grade NAT, ISP shared addressing" + }, + { + network: "127.0.0.0/8", + purpose: "Loopback", + rfc: "RFC 1122", + routable: false, + description: "localhost addresses, typically 127.0.0.1" + }, + { + network: "169.254.0.0/16", + purpose: "Link Local (APIPA)", + rfc: "RFC 3927", + routable: false, + description: "Auto-assigned when DHCP fails" + }, + { + network: "172.16.0.0/12", + purpose: "Private-Use Networks", + rfc: "RFC 1918", + routable: false, + description: "Private addresses for internal networks (Class B)" + }, + { + network: "192.0.0.0/24", + purpose: "IETF Protocol Assignments", + rfc: "RFC 6890", + routable: true, + description: "Special protocol use, some addresses globally routable" + }, + { + network: "192.0.2.0/24", + purpose: "TEST-NET-1", + rfc: "RFC 5737", + routable: false, + description: "Documentation and example code" + }, + { + network: "192.88.99.0/24", + purpose: "6to4 Relay Anycast", + rfc: "RFC 3068", + routable: true, + description: "IPv6 to IPv4 relay (deprecated)" + }, + { + network: "192.168.0.0/16", + purpose: "Private-Use Networks", + rfc: "RFC 1918", + routable: false, + description: "Private addresses for internal networks (Class C)" + }, + { + network: "198.18.0.0/15", + purpose: "Network Interconnect Device Benchmark Testing", + rfc: "RFC 2544", + routable: false, + description: "Performance testing between network devices" + }, + { + network: "198.51.100.0/24", + purpose: "TEST-NET-2", + rfc: "RFC 5737", + routable: false, + description: "Documentation and example code" + }, + { + network: "203.0.113.0/24", + purpose: "TEST-NET-3", + rfc: "RFC 5737", + routable: false, + description: "Documentation and example code" + }, + { + network: "224.0.0.0/4", + purpose: "Multicast", + rfc: "RFC 1112", + routable: true, + description: "IPv4 multicast addresses" + }, + { + network: "240.0.0.0/4", + purpose: "Reserved for Future Use", + rfc: "RFC 1112", + routable: false, + description: "Reserved block, not usable" + }, + { + network: "255.255.255.255/32", + purpose: "Limited Broadcast", + rfc: "RFC 919", + routable: false, + description: "Broadcast to all hosts on local network" + } + ], + + categories: { + private: ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"], + testing: ["192.0.2.0/24", "198.51.100.0/24", "203.0.113.0/24"], + special: ["127.0.0.0/8", "169.254.0.0/16", "224.0.0.0/4"], + cgnat: ["100.64.0.0/10"] + }, + + quickTips: [ + "Private addresses (10.x, 172.16-31.x, 192.168.x) never appear on the public internet", + "100.64.x.x means your ISP is using Carrier-Grade NAT", + "169.254.x.x means DHCP failed and the device auto-configured", + "TEST-NET addresses are safe to use in documentation", + "224.x.x.x and above are multicast or reserved", + "Never use 240.x.x.x - it's reserved and may not work" + ] +}; \ No newline at end of file diff --git a/src/lib/content/supernetting.ts b/src/lib/content/supernetting.ts new file mode 100644 index 0000000..a607e4b --- /dev/null +++ b/src/lib/content/supernetting.ts @@ -0,0 +1,111 @@ +export const supernetContent = { + title: "Route Summarization / Supernetting", + description: "Learn how to aggregate multiple networks into a single route for more efficient routing tables.", + + sections: { + whatIs: { + title: "What is Supernetting?", + content: `Supernetting (also called route aggregation or summarization) combines multiple smaller networks into one larger network announcement. Instead of advertising many routes, you advertise just one route that covers them all. + +This reduces routing table size and makes networks more manageable.` + }, + + howWorks: { + title: "How Route Summarization Works", + content: `When you have multiple contiguous networks, you can often summarize them into a single route by using a shorter prefix length. + +The key is finding the common bits shared by all the networks you want to summarize.` + }, + + requirements: { + title: "Requirements for Summarization", + content: `Two main requirements must be met: + +1. **Contiguous Address Space**: The networks must be adjacent to each other +2. **Power of Two**: You need exactly 2, 4, 8, 16, etc. networks to summarize cleanly + +If you have 3 or 5 networks, you cannot create a perfect summary without including unused space.` + } + }, + + examples: [ + { + title: "Basic Example: Two /24s", + networks: ["192.168.0.0/24", "192.168.1.0/24"], + summary: "192.168.0.0/23", + explanation: "Two adjacent /24 networks combine into one /23", + addresses: "512 total addresses (2 × 256)" + }, + { + title: "Four /24s", + networks: ["10.1.0.0/24", "10.1.1.0/24", "10.1.2.0/24", "10.1.3.0/24"], + summary: "10.1.0.0/22", + explanation: "Four adjacent /24 networks combine into one /22", + addresses: "1,024 total addresses (4 × 256)" + }, + { + title: "Eight /27s", + networks: ["172.16.0.0/27", "172.16.0.32/27", "172.16.0.64/27", "172.16.0.96/27", "172.16.0.128/27", "172.16.0.160/27", "172.16.0.192/27", "172.16.0.224/27"], + summary: "172.16.0.0/24", + explanation: "Eight adjacent /27 networks combine into one /24", + addresses: "256 total addresses (8 × 32)" + } + ], + + stepByStep: { + title: "Step-by-Step Process", + steps: [ + "List all networks you want to summarize", + "Convert network addresses to binary", + "Find the common bits from left to right", + "Count the common bits to get your new prefix length", + "Verify the summary covers all your networks", + "Check if any unwanted networks are included" + ] + }, + + binaryExample: { + title: "Binary Example", + scenario: "Summarizing 192.168.0.0/24 and 192.168.1.0/24", + binary: [ + { network: "192.168.0.0", binary: "11000000.10101000.00000000.00000000" }, + { network: "192.168.1.0", binary: "11000000.10101000.00000001.00000000" } + ], + analysis: "First 23 bits are identical, so summary is 192.168.0.0/23" + }, + + benefits: [ + "Smaller routing tables mean faster lookups", + "Reduced memory usage on routers", + "Less routing protocol overhead", + "Simpler network management", + "Better network stability (fewer route changes)" + ], + + pitfalls: [ + { + title: "Including Unwanted Networks", + problem: "Summary might include networks you don't own or want to advertise", + example: "Summarizing 192.168.0.0/24 and 192.168.2.0/24 as 192.168.0.0/22 also includes 192.168.1.0/24 and 192.168.3.0/24" + }, + { + title: "Non-Contiguous Networks", + problem: "Trying to summarize networks that aren't adjacent", + example: "Cannot cleanly summarize 10.1.0.0/24 and 10.1.5.0/24 without including unwanted space" + }, + { + title: "Wrong Powers of Two", + problem: "Having 3, 5, 6, 7 networks instead of 2, 4, 8, 16", + example: "Three /24s cannot be perfectly summarized without wasting addresses" + } + ], + + quickReference: [ + { networks: "2 × /24", summary: "/23", saves: "1 route" }, + { networks: "4 × /24", summary: "/22", saves: "3 routes" }, + { networks: "8 × /24", summary: "/21", saves: "7 routes" }, + { networks: "16 × /24", summary: "/20", saves: "15 routes" }, + { networks: "2 × /23", summary: "/22", saves: "1 route" }, + { networks: "4 × /23", summary: "/21", saves: "3 routes" } + ] +}; \ No newline at end of file diff --git a/src/lib/content/vlsm.ts b/src/lib/content/vlsm.ts new file mode 100644 index 0000000..b88bc64 --- /dev/null +++ b/src/lib/content/vlsm.ts @@ -0,0 +1,94 @@ +export const vlsmContent = { + title: "VLSM in Plain English", + description: "Variable Length Subnet Masking explained - when to use it, how it works, and common pitfalls to avoid.", + + sections: { + whatIs: { + title: "What is VLSM?", + content: `VLSM (Variable Length Subnet Masking) lets you divide a network into subnets of different sizes. Instead of making all subnets the same size, you can create exactly the right size for each need. + +Think of it like cutting a pizza: instead of cutting it into equal slices, you cut bigger pieces for hungry people and smaller pieces for those who want less.` + }, + + whenWhy: { + title: "When and Why to Use VLSM", + content: `Use VLSM when different parts of your network need different numbers of hosts: + +- Server farm needs 50 addresses +- Office network needs 200 addresses +- Point-to-point links need only 2 addresses + +Without VLSM, you would waste many addresses by making all subnets big enough for your largest need.` + }, + + howItWorks: { + title: "How VLSM Works", + content: `VLSM works by subdividing networks step by step: + +1. Start with your main network +2. Identify your largest subnet needs first +3. Create subnets for the largest needs +4. Subdivide remaining space for smaller needs +5. Keep point-to-point links for last (they only need /30)` + } + }, + + example: { + title: "Worked Example", + scenario: "You have 192.168.1.0/24 and need:", + requirements: [ + { name: "Sales Department", hosts: 100, needsPrefix: "/25" }, + { name: "IT Department", hosts: 50, needsPrefix: "/26" }, + { name: "Guest WiFi", hosts: 30, needsPrefix: "/27" }, + { name: "Router Links", hosts: 2, needsPrefix: "/30" } + ], + solution: [ + { subnet: "192.168.1.0/25", hosts: "126 hosts", use: "Sales Department" }, + { subnet: "192.168.1.128/26", hosts: "62 hosts", use: "IT Department" }, + { subnet: "192.168.1.192/27", hosts: "30 hosts", use: "Guest WiFi" }, + { subnet: "192.168.1.224/30", hosts: "2 hosts", use: "Router Link 1" }, + { subnet: "192.168.1.228/30", hosts: "2 hosts", use: "Router Link 2" }, + { subnet: "192.168.1.232/30", hosts: "2 hosts", use: "Router Link 3" } + ] + }, + + pitfalls: [ + { + title: "Address Fragmentation", + problem: "Creating subnets in the wrong order leaves unusable gaps", + solution: "Always allocate largest subnets first, then work down to smaller ones" + }, + { + title: "Poor Planning", + problem: "Not leaving room for growth", + solution: "Plan for 25-50% growth in each subnet" + }, + { + title: "Alignment Issues", + problem: "Subnet boundaries don't align properly", + solution: "Use online calculators or tools to verify your subnetting" + }, + { + title: "Routing Complexity", + problem: "Too many small subnets create routing table bloat", + solution: "Use route summarization where possible" + } + ], + + bestPractices: [ + "Document your subnetting plan before implementing", + "Leave room for growth in each subnet", + "Use consistent naming conventions", + "Start with largest subnets and work down", + "Reserve some address space for future expansion", + "Test your design in a lab before production" + ], + + tips: [ + "A /25 gives you 126 hosts, /26 gives 62, /27 gives 30, /28 gives 14", + "Point-to-point links between routers only need /30 (2 hosts)", + "Loopback interfaces only need /32 (1 host)", + "Always verify your subnets don't overlap", + "Use VLSM calculators to check your work" + ] +}; \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index cff4508..589bcbd 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -2,6 +2,7 @@ import '../styles/base.scss'; import '../styles/variables.scss'; import '../styles/components.scss'; + import '../styles/ref-pages.scss'; import favicon from '$lib/assets/favicon.svg'; diff --git a/src/routes/reference/+page.svelte b/src/routes/reference/+page.svelte new file mode 100644 index 0000000..3ce1936 --- /dev/null +++ b/src/routes/reference/+page.svelte @@ -0,0 +1,132 @@ + + + + Networking Reference Guide | {site.title} + + + + + + + +
+
+
+

Networking Reference Guide

+

Quick guides and cheat sheets for networking concepts, IP addressing, and common protocols

+
+ +
+

Available References

+
+ {#each referencePages as page} + +
+ + {page.title} +
+
{page.description}
+
+ {/each} +
+
+ +
+

How to Use These References

+

Each reference page provides:

+
    +
  • Plain English explanations - No confusing jargon
  • +
  • Practical examples - Real-world scenarios you'll encounter
  • +
  • Quick reference tables - Easy to scan and find what you need
  • +
  • Common pitfalls - Mistakes to avoid
  • +
  • Best practices - How to do things right
  • +
+ +
+
+ + Tip +
+
+ These references pair perfectly with the calculators and tools on this site. Use them to understand the concepts, then use the tools to do the calculations. +
+
+
+ +
+

More References Coming Soon

+

We're continuously adding more networking references. Coming soon:

+
    +
  • IPv6 Prefix Lengths Guide
  • +
  • Multicast Addressing Basics
  • +
  • NAT Types Explained
  • +
  • Wildcard Masks for ACLs
  • +
  • Common MTU/MSS Values
  • +
  • And more...
  • +
+
+
+
+ + \ No newline at end of file diff --git a/src/routes/reference/cidr/+page.svelte b/src/routes/reference/cidr/+page.svelte new file mode 100644 index 0000000..771f4a1 --- /dev/null +++ b/src/routes/reference/cidr/+page.svelte @@ -0,0 +1,107 @@ + + + + {cidrContent.title} | {site.title} + + + + + + + +
+
+
+

{cidrContent.title}

+

{cidrContent.description}

+
+ +
+

{cidrContent.sections.whatIs.title}

+

{cidrContent.sections.whatIs.content}

+ +
+
+ + Quick Example +
+
+ In 192.168.1.0/24, the network is 192.168.1.0 and there are 254 usable host addresses (192.168.1.1 through 192.168.1.254). +
+
+
+ +
+

{cidrContent.sections.whyReplaced.title}

+

{cidrContent.sections.whyReplaced.content}

+
+ +
+

{cidrContent.sections.howToRead.title}

+

{cidrContent.sections.howToRead.content}

+
+ +
+

Common Examples

+
+
Network Examples
+ {#each cidrContent.examples as example} +
+ {example.cidr} + → + {example.hosts} +
{example.description}
+
+ {/each} +
+
+ +
+

Prefix Length Reference Table

+ + + + + + + + + + + {#each cidrContent.prefixTable as row} + + + + + + + {/each} + +
PrefixSubnet MaskUsable HostsTypical Use
{row.prefix}{row.mask}{row.hosts}{row.typical}
+
+ +
+

Key Points to Remember

+
    + {#each cidrContent.keyPoints as point} +
  • {point}
  • + {/each} +
+ +
+
+ + Remember +
+
+ The first and last addresses in any network are reserved (network address and broadcast address), so the usable host count is always 2 less than the total addresses. +
+
+
+
+
+ diff --git a/src/routes/reference/ipv6-address-types/+page.svelte b/src/routes/reference/ipv6-address-types/+page.svelte new file mode 100644 index 0000000..508f357 --- /dev/null +++ b/src/routes/reference/ipv6-address-types/+page.svelte @@ -0,0 +1,144 @@ + + + + {ipv6AddressTypesContent.title} | {site.title} + + + + + + + +
+
+
+

{ipv6AddressTypesContent.title}

+

{ipv6AddressTypesContent.description}

+
+ +
+

{ipv6AddressTypesContent.sections.overview.title}

+

{ipv6AddressTypesContent.sections.overview.content}

+
+ +
+

Unicast Address Types

+ {#each ipv6AddressTypesContent.unicastTypes as type} +
+
{type.type}
+
+
Prefix: {type.prefix}
+
Range: {type.range}
+
Description: {type.description}
+
Usage: {type.usage}
+
Example: {type.example}
+
+
+ {/each} +
+ +
+

Special Addresses

+ + + + + + + + + + + {#each ipv6AddressTypesContent.specialAddresses as addr} + + + + + + + {/each} + +
AddressNameDescriptionUsage
{addr.address}{addr.name}{addr.description}{addr.usage}
+
+ +
+

Multicast Address Scopes

+

All multicast addresses start with ff. The second byte indicates scope:

+ + {#each ipv6AddressTypesContent.multicastTypes as scope} +
+
{scope.scope} Scope
+
+
Prefix: {scope.prefix}
+
Description: {scope.description}
+ {#if scope.examples.length > 0} +
Common Addresses:
+ {#each scope.examples as example} +
{example}
+ {/each} + {/if} +
+
+ {/each} +
+ +
+

{ipv6AddressTypesContent.anycast.title}

+

{ipv6AddressTypesContent.anycast.description}

+ +
+
+ + Example +
+
+ {ipv6AddressTypesContent.anycast.example} +
+
+ +

Common Anycast Uses

+
    + {#each ipv6AddressTypesContent.anycast.commonUses as use} +
  • {use}
  • + {/each} +
+
+ +
+

Reserved Address Ranges

+ + + + + + + + + {#each ipv6AddressTypesContent.reservedRanges as range} + + + + + {/each} + +
PrefixPurpose
{range.prefix}{range.purpose}
+
+ +
+

Quick Recognition Tips

+
+
Remember These Patterns
+ {#each ipv6AddressTypesContent.quickTips as tip} +
+
{tip}
+
+ {/each} +
+
+
+
+ diff --git a/src/routes/reference/ports/+page.svelte b/src/routes/reference/ports/+page.svelte new file mode 100644 index 0000000..18b063a --- /dev/null +++ b/src/routes/reference/ports/+page.svelte @@ -0,0 +1,162 @@ + + + + {commonPortsContent.title} | {site.title} + + + + + + + +
+
+
+

{commonPortsContent.title}

+

{commonPortsContent.description}

+
+ +
+

Port Ranges

+ + + + + + + + + + {#each commonPortsContent.ranges as range} + + + + + + {/each} + +
RangeNameDescription
{range.range}{range.name}{range.description}
+
+ +
+

Well-Known Ports (0-1023)

+ + + + + + + + + + + {#each commonPortsContent.wellKnown as port} + + + + + + + {/each} + +
PortProtocolServiceDescription
{port.port}{port.protocol}{port.service}{port.description}
+
+ +
+

Registered Ports (1024-49151)

+ + + + + + + + + + + {#each commonPortsContent.registered as port} + + + + + + + {/each} + +
PortProtocolServiceDescription
{port.port}{port.protocol}{port.service}{port.description}
+
+ +
+

Common Service Categories

+ +
+
+
Web Services
+ {#each commonPortsContent.categories.web as service} +
{service.ports} - {service.service}
+
+ {service.secure ? 'Secure' : 'Not secure'} +
+ {/each} +
+ +
+
Email Services
+ {#each commonPortsContent.categories.email as service} +
{service.ports} - {service.service}
+
+ {service.secure ? 'Secure' : 'Not secure'} +
+ {/each} +
+ +
+
Remote Access
+ {#each commonPortsContent.categories.remote as service} +
{service.ports} - {service.service}
+
+ {service.secure ? 'Secure' : 'Not secure'} +
+ {/each} +
+ +
+
Database Services
+ {#each commonPortsContent.categories.database as service} +
{service.ports} - {service.service}
+
+ {service.secure ? 'Secure' : 'Not secure'} +
+ {/each} +
+
+
+ +
+

Important Security Tips

+
+
Remember These
+ {#each commonPortsContent.tips as tip} +
+
{tip}
+
+ {/each} +
+ +
+
+ + Security Note +
+
+ Many services have both secure and insecure versions. Always use the secure versions (HTTPS, SSH, FTPS, etc.) when possible, especially over untrusted networks. +
+
+
+
+
+ diff --git a/src/routes/reference/special-use-ipv4/+page.svelte b/src/routes/reference/special-use-ipv4/+page.svelte new file mode 100644 index 0000000..a941d88 --- /dev/null +++ b/src/routes/reference/special-use-ipv4/+page.svelte @@ -0,0 +1,116 @@ + + + + {specialIPv4Content.title} | {site.title} + + + + + + + +
+
+
+

{specialIPv4Content.title}

+

{specialIPv4Content.description}

+
+ +
+

Complete Special-Use IPv4 Ranges

+ + + + + + + + + + + + {#each specialIPv4Content.ranges as range} + + + + + + + + {/each} + +
NetworkPurposeRFCRoutableDescription
{range.network}{range.purpose}{range.rfc} + {#if range.routable} + Yes + {:else} + No + {/if} + {range.description}
+
+ +
+

Common Address Categories

+ +
+
+
Private Networks (RFC 1918)
+ {#each specialIPv4Content.categories.private as network} +
{network}
+ {/each} +
Never routed on the public internet
+
+ +
+
Test Networks (RFC 5737)
+ {#each specialIPv4Content.categories.testing as network} +
{network}
+ {/each} +
Safe for documentation and examples
+
+ +
+
Carrier-Grade NAT
+ {#each specialIPv4Content.categories.cgnat as network} +
{network}
+ {/each} +
ISP shared addressing space
+
+ +
+
Special Purpose
+ {#each specialIPv4Content.categories.special as network} +
{network}
+ {/each} +
Loopback, link-local, multicast
+
+
+
+ +
+

Quick Recognition Tips

+
+
What Each Range Means
+ {#each specialIPv4Content.quickTips as tip} +
+
{tip}
+
+ {/each} +
+ +
+
+ + Important Note +
+
+ If you see 100.64.x.x addresses, your ISP is using Carrier-Grade NAT (CGNAT). This can cause issues with port forwarding, gaming, and some applications that require direct connectivity. +
+
+
+
+
+ diff --git a/src/routes/reference/supernetting/+page.svelte b/src/routes/reference/supernetting/+page.svelte new file mode 100644 index 0000000..136bcd9 --- /dev/null +++ b/src/routes/reference/supernetting/+page.svelte @@ -0,0 +1,150 @@ + + + + {supernetContent.title} | {site.title} + + + + + + + +
+
+
+

{supernetContent.title}

+

{supernetContent.description}

+
+ +
+

{supernetContent.sections.whatIs.title}

+

{supernetContent.sections.whatIs.content}

+ +
+
+ + Main Goal +
+
+ Reduce the number of routes in routing tables while maintaining connectivity to all networks. +
+
+
+ +
+

{supernetContent.sections.requirements.title}

+

{supernetContent.sections.requirements.content}

+
+ +
+

Summarization Examples

+ {#each supernetContent.examples as example} +
+
{example.title}
+
+
Individual Networks:
+ {#each example.networks as network} +
{network}
+ {/each} +
↓ Summarizes to ↓
+
{example.summary}
+
{example.explanation} - {example.addresses}
+
+
+ {/each} +
+ +
+

{supernetContent.stepByStep.title}

+
    + {#each supernetContent.stepByStep.steps as step} +
  1. {step}
  2. + {/each} +
+
+ +
+

{supernetContent.binaryExample.title}

+

{supernetContent.binaryExample.scenario}

+ + + + + + + + + + {#each supernetContent.binaryExample.binary as row} + + + + + {/each} + +
NetworkBinary Representation
{row.network}{row.binary}
+ +
+
+ + Analysis +
+
+ {supernetContent.binaryExample.analysis} +
+
+
+ +
+

Benefits of Route Summarization

+
    + {#each supernetContent.benefits as benefit} +
  • {benefit}
  • + {/each} +
+
+ +
+

Common Pitfalls

+ {#each supernetContent.pitfalls as pitfall} +
+
+ + {pitfall.title} +
+
+

Problem: {pitfall.problem}

+

Example: {pitfall.example}

+
+
+ {/each} +
+ +
+

Quick Reference Table

+ + + + + + + + + + {#each supernetContent.quickReference as row} + + + + + + {/each} + +
Input NetworksSummary PrefixRoutes Saved
{row.networks}{row.summary}{row.saves}
+
+
+
+ diff --git a/src/routes/reference/vlsm/+page.svelte b/src/routes/reference/vlsm/+page.svelte new file mode 100644 index 0000000..53de0f0 --- /dev/null +++ b/src/routes/reference/vlsm/+page.svelte @@ -0,0 +1,111 @@ + + + + {vlsmContent.title} | {site.title} + + + + + + + +
+
+
+

{vlsmContent.title}

+

{vlsmContent.description}

+
+ +
+

{vlsmContent.sections.whatIs.title}

+

{vlsmContent.sections.whatIs.content}

+
+ +
+

{vlsmContent.sections.whenWhy.title}

+

{vlsmContent.sections.whenWhy.content}

+ +
+
+ + Key Benefit +
+
+ VLSM prevents IP address waste by letting you create subnets that are exactly the right size for each purpose. +
+
+
+ +
+

{vlsmContent.sections.howItWorks.title}

+

{vlsmContent.sections.howItWorks.content}

+
+ +
+

{vlsmContent.example.title}

+

{vlsmContent.example.scenario}

+ +
+
+
Requirements
+
    + {#each vlsmContent.example.requirements as req} +
  • {req.name}: {req.hosts} hosts (needs {req.needsPrefix})
  • + {/each} +
+
+ +
+
VLSM Solution
+
    + {#each vlsmContent.example.solution as subnet} +
  • {subnet.subnet} - {subnet.use} ({subnet.hosts})
  • + {/each} +
+
+
+
+ +
+

Common Pitfalls and Solutions

+ {#each vlsmContent.pitfalls as pitfall} +
+
+ + {pitfall.title} +
+
+

Problem: {pitfall.problem}

+

Solution: {pitfall.solution}

+
+
+ {/each} +
+ +
+

Best Practices

+
    + {#each vlsmContent.bestPractices as practice} +
  • {practice}
  • + {/each} +
+
+ +
+

Quick Tips

+
+
Remember These
+ {#each vlsmContent.tips as tip} +
+
{tip}
+
+ {/each} +
+
+
+
+ diff --git a/src/styles/ref-pages.scss b/src/styles/ref-pages.scss new file mode 100644 index 0000000..5e2cced --- /dev/null +++ b/src/styles/ref-pages.scss @@ -0,0 +1,272 @@ +// Reference pages shared styles +// Used across all /reference/* pages for consistent styling + +.ref-page { + max-width: 800px; + margin: 0 auto; + + .ref-header { + text-align: center; + margin-bottom: var(--spacing-xl); + + h1 { + font-size: var(--font-size-2xl); + font-weight: 700; + color: var(--color-primary); + margin-bottom: var(--spacing-sm); + } + + .subtitle { + color: var(--text-secondary); + font-size: var(--font-size-lg); + } + } + + .ref-section { + background: var(--bg-secondary); + border: 1px solid var(--border-primary); + border-radius: var(--radius-lg); + padding: var(--spacing-lg); + margin-bottom: var(--spacing-lg); + + h2 { + color: var(--text-primary); + font-size: var(--font-size-xl); + font-weight: 600; + margin-bottom: var(--spacing-md); + border-bottom: 1px solid var(--border-primary); + padding-bottom: var(--spacing-sm); + } + + h3 { + color: var(--text-primary); + font-size: var(--font-size-lg); + font-weight: 600; + margin: var(--spacing-lg) 0 var(--spacing-sm) 0; + } + + p { + color: var(--text-primary); + line-height: 1.6; + margin-bottom: var(--spacing-md); + } + + ul, ol { + color: var(--text-primary); + padding-left: var(--spacing-lg); + margin-bottom: var(--spacing-md); + + li { + margin-bottom: var(--spacing-xs); + line-height: 1.5; + } + } + + code { + background: var(--bg-tertiary); + border: 1px solid var(--color-primary); + color: var(--text-primary); + font-family: var(--font-mono); + font-weight: 600; + padding: 0.25rem 0.5rem; + border-radius: var(--radius-sm); + font-size: 0.9em; + } + + pre { + background: var(--bg-tertiary); + border: 1px solid var(--border-primary); + border-radius: var(--radius-md); + padding: var(--spacing-md); + margin: var(--spacing-md) 0; + overflow-x: auto; + + code { + background: transparent; + border: none; + padding: 0; + } + } + } + + .ref-table { + width: 100%; + border-collapse: collapse; + margin: var(--spacing-md) 0; + background: var(--bg-tertiary); + border-radius: var(--radius-md); + overflow: hidden; + + th, td { + padding: var(--spacing-sm) var(--spacing-md); + text-align: left; + border-bottom: 1px solid var(--border-primary); + } + + th { + background: var(--color-primary); + color: var(--bg-primary); + font-weight: 600; + font-size: var(--font-size-sm); + } + + td { + color: var(--text-primary); + font-size: var(--font-size-sm); + + code { + font-size: 0.85em; + } + } + + tr:last-child td { + border-bottom: none; + } + + tr:hover { + background: var(--bg-secondary); + } + } + + .ref-highlight { + background: var(--bg-info); + border: 1px solid var(--border-info); + border-radius: var(--radius-md); + padding: var(--spacing-md); + margin: var(--spacing-md) 0; + + .highlight-title { + color: var(--color-info-dark); + font-weight: 600; + margin-bottom: var(--spacing-sm); + display: flex; + align-items: center; + gap: var(--spacing-xs); + } + + .highlight-content { + color: var(--color-info-dark); + } + } + + .ref-warning { + background: var(--bg-warning); + border: 1px solid var(--border-warning); + border-radius: var(--radius-md); + padding: var(--spacing-md); + margin: var(--spacing-md) 0; + + .warning-title { + color: var(--color-warning-dark); + font-weight: 600; + margin-bottom: var(--spacing-sm); + display: flex; + align-items: center; + gap: var(--spacing-xs); + } + + .warning-content { + color: var(--color-warning-dark); + } + } + + .ref-examples { + background: var(--bg-tertiary); + border: 1px solid var(--border-primary); + border-radius: var(--radius-md); + padding: var(--spacing-md); + margin: var(--spacing-md) 0; + + .examples-title { + color: var(--text-primary); + font-weight: 600; + margin-bottom: var(--spacing-sm); + } + + .example-item { + margin-bottom: var(--spacing-sm); + + .example-input { + font-family: var(--font-mono); + color: var(--color-primary); + font-weight: 600; + } + + .example-arrow { + color: var(--text-secondary); + margin: 0 var(--spacing-xs); + } + + .example-output { + font-family: var(--font-mono); + color: var(--text-primary); + font-weight: 600; + } + + .example-description { + color: var(--text-secondary); + font-size: var(--font-size-sm); + margin-top: var(--spacing-xs); + } + } + } + + .ref-grid { + display: grid; + gap: var(--spacing-md); + margin: var(--spacing-md) 0; + + &.two-col { + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + } + + &.three-col { + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + } + + .grid-item { + background: var(--bg-tertiary); + border: 1px solid var(--border-primary); + border-radius: var(--radius-md); + padding: var(--spacing-md); + + .item-title { + color: var(--text-primary); + font-weight: 600; + margin-bottom: var(--spacing-xs); + } + + .item-code { + font-family: var(--font-mono); + color: var(--color-primary); + font-weight: 600; + font-size: var(--font-size-sm); + margin-bottom: var(--spacing-xs); + } + + .item-description { + color: var(--text-secondary); + font-size: var(--font-size-sm); + } + } + } +} + +@media (max-width: 768px) { + .ref-page { + .ref-table { + font-size: var(--font-size-xs); + + th, td { + padding: var(--spacing-xs) var(--spacing-sm); + } + } + + .ref-grid { + &.two-col, + &.three-col { + grid-template-columns: 1fr; + } + } + } +} \ No newline at end of file