Architecture, Implementation, Delivery and Production Operations
Part I: Foundations
Chapter 1: Introduction: Why Build Your Own CDN and WAF
- The Problem with Trusting Black Boxes
- What a CDN and WAF Actually Are
- The Aegis Edge Reference Architecture
- Scope, Assumptions and How to Read This Book
- What Software Can and Cannot Do
Chapter 2: The Edge Network: TCP/IP, Routing and Internet Plumbing
- The TCP/IP Stack Revisited for Edge Engineers
- TCP State Machine, Congestion Control and Latency
- IP Routing, ASes and BGP in Plain Terms
- Anycast: One Address, Many Places
- Measuring and Reasoning About Latency
- Key Takeaways for Aegis Edge
Chapter 3: The HTTP Stack: From 1.1 Semantics to QUIC
- HTTP/1.1: Request/Response, Headers and Semantics
- Caching Headers and Conditional Requests
- HTTP/2: Framing, Streams and Multiplexing
- QUIC and HTTP/3: Datagrams, 0-RTT and Why CDNs Adopted It
- HTTP Version Negotiation and Upgrade Paths
- Key Takeaways for Aegis Edge
Chapter 4: DNS: The Global Traffic Control System
- DNS Protocol Mechanics: Queries, Responses, Records
- Authoritative, Recursive and the Root System
- TTLs, Caching and Propagation
- EDNS, DNSSEC and DoH/DoT
- DNS as a Traffic Control Plane
- Integration with the Control Plane
- Key Takeaways for Aegis Edge
Chapter 5: TLS 1.3: Secure Transport and the Certificate Lifecycle
- The TLS 1.3 Handshake and Record Layer
- Cipher Suites, Forward Secrecy and Key Exchange
- X.509 Certificates, Chains and PKI
- ACME: Automated Certificate Issuance and Renewal
- TLS Performance: Resumption, Session Tickets and Termination Trade-offs
- Key Takeaways for Aegis Edge
Chapter 6: Distributed Systems Principles for Edge Engineers
- Consistency Models: From Strong to Eventually Consistent
- Replication, Sharding and Consistent Hashing
- Failure Detection, Heartbeats and the Split-Brain Problem
- Consensus and Leader Election: Raft in Practice
- Idempotency, Retries and Backpressure at the Edge
- Key Takeaways for Aegis Edge
Part II: The Data Plane
Chapter 7: The Reference Architecture: Designing Aegis Edge
- Data Plane, Control Plane and the Boundary Between Them
- Why Go: Technology Selection and Trade-offs
- Component Map and Communication Contracts
- Repository Layout, Build System and Local Development
- Configuration Model: Declarative, Versioned, Pushed
- Key Takeaways for Aegis Edge
Chapter 8: The Reverse Proxy: Connection Handling and Request Routing
- Connection Acceptance and the Goroutine-per-Connection Model
- HTTP Request Parsing and Validation
- The Routing Table and Host-Based Routing
- Request Lifecycle, Timeouts and Error Handling
- Response Streaming and Chunked Transfer
- Integration with the Edge Binary
- Failure Modes and Operational Considerations
Chapter 9: Upstream Orchestration: Load Balancing, Health Checks and Pooling
- Load Balancing Algorithms and Their Trade-offs
- Health Checks: Active, Passive and Composite
- Connection Pooling and Keep-Alive to Origins
- Circuit Breakers and Fault Isolation
- Upstream Failover and Retry Semantics
- Origin Shielding Preparation
- Key Takeaways for Aegis Edge
Chapter 10: Multi-Tier Caching, Content Optimization and Invalidation
- Cache Keys, Vary and Cache-Control Semantics
- The Memory Tier: Sharded LRU with TTL
- The Disk Tier and Cold Storage
- The Multi-Tier Cache Interface
- Stale-While-Revalidate, Request Coalescing and the Thundering Herd
- Purge APIs, Invalidation and Cache Warming
- Compression, Image Optimization and Bandwidth Economics
- Origin Shielding and Inter-Node Cache Coordination
- Key Takeaways for Aegis Edge
Chapter 11: Terminating TLS at the Edge: SNI, Certificates and ACME Automation
- SNI, Virtual Hosting and Certificate Selection
- TLS Configuration Hardening at the Edge
- The Certificate Store and Rotation
- ACME Integration: Issuance, Renewal and Verification
- Origin TLS and Mutual Authentication
- Key Takeaways for Aegis Edge
Part III: Control Plane and Global Topology
Chapter 12: Points of Presence, Anycast and BGP Peering
- PoP Design: Sizing, Topology and Redundancy
- Anycast in Practice: Routing, BGP and Failover
- Peering, Transit and the Economics of Bandwidth
- Getting Traffic to Your Edge: Delegation and Handoff
- The Limits of Self-Hosted Anycast
- Key Takeaways for Aegis Edge
Chapter 13: Global Traffic Steering: Geo, Latency and Policy-Based Routing
- The dnsrouter Component: Authoritative Server Design
- Geo and Latency-Based Answer Selection
- Health-Checked Steering and Failover
- TTL Strategy and Client-Cache Interactions
- Policy-Based Routing and Weighted Splitting
- Integration with the Control Plane
- Key Takeaways for Aegis Edge
Chapter 14: The Control Plane: Configuration, Discovery and State
- Control Plane Architecture and the Config API
- PostgreSQL Schema and the Versioned Config Model
- gRPC Streaming: Pushing Config to the Edge
- Service Discovery with etcd and Node Registration
- Distributed State: Redis, Locks and Purge Fan-Out
- Key Takeaways for Aegis Edge
Part IV: The Web Application Firewall
Chapter 15: The Detection Pipeline: Parsing, Normalization and Hardening
- Where the WAF Sits in the Edge Pipeline
- Hardened HTTP Parsing: Avoiding the Parser Bugs
- Normalization: Making Attacker Input Predictable
- Request Limits, Body Limits and Early Rejection
- Protocol Anomalies and Request Smuggling Detection
- Key Takeaways for Aegis Edge
Chapter 16: The Rule Engine: Semantics, Execution and the OWASP Core Rule Set
- Rule Semantics: Phases, Actions and Variables
- The Rule Compiler and Evaluator
- Loading and Translating OWASP Core Rule Set Rules
- Rule Performance: Compiles, Short-Circuits and Profiling
- Rule Management: Versioning, Testing and Rollback
- Key Takeaways for Aegis Edge
Chapter 17: Threat Detection in Depth: From Signatures to Behavioral Analysis
- Injection Attacks: SQLi, Command Injection and Template Injection
- XSS, Path Traversal and SSRF
- Malicious Payloads, File Uploads and Deserialization
- Signature Design, Tuning and False Positive Management
- IP Reputation, Threat Intelligence and Anomaly Detection
- Security Event Logging and Correlation
- Key Takeaways for Aegis Edge
Chapter 18: Bot Management, Rate Limiting and API Protection
- Bot Classification: Good, Bad and Everything Between
- Fingerprinting, Behavioral Signals and Challenges
- Rate Limiting Algorithms and Distributed Implementation
- API Protection: Schemas, Auth and Abuse Prevention
- Custom Security Policies and Customer Rules
- Key Takeaways for Aegis Edge
Part V: DDoS Defense
Chapter 19: The DDoS Threat Landscape: Anatomy of Modern Attacks
- The DDoS Taxonomy: Volumetric, Protocol, Application
- Amplification and Reflection: Turning Small Probes into Tsunamis
- Application-Layer Attacks and Botnets
- How Attacks Target CDNs and What Survives
- The Economics and Evolution of DDoS
- Key Takeaways for Aegis Edge
Chapter 20: DDoS Mitigation: Layered Defense from Kernel to Cloud
- Layered Defense: Where Each Layer Wins
- Kernel and Network Tuning: SYN Cookies, Limits, Shaping
- Application-Layer Mitigation: Challenges and Proving Work
- Anycast Diffusion and Upstream Scrubbing
- When Software Is Not Enough: The ISP and Transit Relationship
- Key Takeaways for Aegis Edge
Part VI: Production Operations
Chapter 21: Observability: Metrics, Logging and Distributed Tracing
- Structured Logging: Fields, Levels and Retention
- Metrics: RED, USE and the Prometheus Endpoint
- Distributed Tracing Across the Edge
- Dashboards, Alerting and On-Call
- Security Telemetry and Event Correlation
- Key Takeaways for Aegis Edge
Chapter 22: Reliability Engineering: SLOs, Failure Modes and Incident Response
- SLIs, SLOs and Error Budgets for Edge Services
- Capacity Planning and Load Modeling
- Failure Mode Analysis: Nodes, PoPs, Regions
- Incident Response and Runbooks
- Chaos Engineering and Failover Drills
- Key Takeaways for Aegis Edge
Chapter 23: Deployment at Scale: Containers, Orchestration and Automation
- Containerization and the Edge Image
- Kubernetes Deployment: Manifests, Upgrades and Scaling
- Zero-Downtime Deploys and Canary Releases
- Secrets Management, Access Control and Hardening
- Supply-Chain Security and Vulnerability Management
- Backup, Disaster Recovery and Cost Modeling
- Key Takeaways for Aegis Edge
Part VII: Synthesis
Chapter 24: The Integrated Platform: End-to-End Walkthroughs and Evaluation
- The Complete Reference Architecture
- Traffic Walkthrough: Static Content, Cache Hit
- Traffic Walkthrough: Dynamic Content, WAF Inspection, Failover
- Traffic Walkthrough: WAF Block
- Traffic Walkthrough: Cache Purge
- Traffic Walkthrough: Failover
- Traffic Walkthrough: DDoS Attack
- Performance Evaluation and Production Readiness
- Key Takeaways for Aegis Edge
Chapter 25: The Reality Check: Limits, Trade-offs and the Road Ahead
- Software vs. the Physical Network: What You Cannot Control
- Educational Build, Self-Hosted Platform, or Commercial Service
- The Cost and Operational Burden of Running an Edge
- Where the Industry Is Heading
- A Roadmap for Extending Aegis Edge
- Final Thoughts