The OSI Model

LayerNameExamplesAWS Service
7ApplicationHTTP, HTTPS, FTP, DNSAPI Gateway, CloudFront
6PresentationSSL/TLS, JPEGACM (TLS certs)
5SessionNetBIOS, RPC
4TransportTCP, UDPNLB (Layer 4)
3NetworkIP, ICMPVPC, Route Tables
2Data LinkEthernet, MACDirect Connect (physical)
1PhysicalCables, fiberDirect Connect
⚠ AWS Exam Tip

ALB = Layer 7. NLB = Layer 4. GLB = Layer 3. Frequently tested!

TCP vs UDP

TCP

  • Connection-oriented (3-way handshake)
  • Reliable, ordered delivery
  • Flow control & congestion control
  • Use for: HTTP, SSH, FTP, SMTP

UDP

  • Connectionless — fire and forget
  • No guarantee of delivery or order
  • Very low latency overhead
  • Use for: DNS, VoIP, video streaming, gaming

IP Addressing

32-bit IPv4 address in 4 octets: 192.168.1.100

Private IP Ranges (RFC 1918)

10.0.0.0/8        → AWS VPC default range
172.16.0.0/12     → AWS default VPC (172.31.0.0/16)
192.168.0.0/16    → Home networks
☁️ AWS Context

AWS VPCs must use private IP ranges. The default VPC uses 172.31.0.0/16.

CIDR & Subnetting

CIDR notation combines an IP with a prefix length: 10.0.0.0/16

CIDRTotal IPsAWS Usable
/1665,53665,531
/24256251
/25128123
/266459
/273227
/281611
⚠ AWS Reserves 5 IPs Per Subnet

Network address, VPC router, DNS, future use, and broadcast. A /24 gives 251 usable IPs, not 254. Frequently tested!

# Quick formula: Total IPs = 2^(32 - prefix)
/24 = 2^8 = 256 IPs
/16 = 2^16 = 65,536 IPs

Key Protocols & Ports

ProtocolPortTransport
HTTP80TCP
HTTPS443TCP
SSH22TCP
RDP3389TCP
DNS53UDP/TCP
DHCP67/68UDP
SMTP25/587TCP
MySQL/Aurora3306TCP
PostgreSQL5432TCP
Redis (ElastiCache)6379TCP
NFS (EFS)2049TCP

DNS Record Types

RecordPurposeExample
ADomain → IPv4example.com → 93.184.216.34
CNAMEAlias to another domainwww → example.com
MXMail servermail.example.com
TXTText info (SPF, verification)"v=spf1..."
NSName servers for zonens1.aws.com
Alias (Route 53)AWS-specific; map to AWS resourceapex.com → ALB DNS
⚠ CNAME vs Alias

You cannot use CNAME at the zone apex (naked domain like example.com). Use Route 53 Alias records instead — they point to AWS resources and are free of charge.

NAT Gateway vs NAT Instance

NAT Gateway (Managed)

  • Fully managed, highly available per AZ
  • Private subnet → internet outbound only
  • Requires Elastic IP in public subnet
  • Scales to 45 Gbps automatically

NAT Instance (Legacy)

  • EC2 instance doing NAT manually
  • Must disable Source/Destination Check
  • You manage patching and HA
  • Can double as a bastion host

Load Balancers

TypeOSI LayerProtocolBest For
ALB7HTTP, HTTPS, gRPCWeb apps, microservices, path-based routing
NLB4TCP, UDP, TLSUltra-low latency, static IP, gaming, IoT
GLB3IPInline virtual appliances (firewalls, IDS)

Security Groups vs Network ACLs

Security Groups

  • Instance level (ENI)
  • Stateful — return traffic auto-allowed
  • ALLOW rules only
  • Default: deny all inbound, allow all outbound

Network ACLs

  • Subnet level
  • Stateless — must allow both directions
  • ALLOW and DENY rules
  • Rules evaluated lowest number first

AWS VPC Overview

A VPC (Virtual Private Cloud) is your isolated network in AWS.

  • VPC — logical isolation; CIDR block (e.g., 10.0.0.0/16)
  • Subnets — subdivide VPC; tied to one AZ
  • Internet Gateway (IGW) — enables internet access for public subnets
  • Route Tables — control where traffic goes
  • NAT Gateway — outbound internet for private subnets
  • VPC Peering — connect two VPCs (no transitive routing)
  • Transit Gateway — hub-and-spoke for many VPCs (transitive)
  • VPC Endpoints — private access to AWS services (no internet)
💡 Public vs Private Subnet

A public subnet has a route to an Internet Gateway (0.0.0.0/0 → igw-xxx). A private subnet has no such route. It's all in the route table!

📋 Study Checklist

Progress0%
  • Name all 7 OSI layers and their functions
  • Explain the difference between TCP and UDP
  • Calculate the number of IPs in a CIDR block
  • Identify private IP ranges (RFC 1918)
  • Know why AWS reserves 5 IPs per subnet
  • Explain DNS record types: A, CNAME, MX, TXT, Alias
  • Know common ports: 22, 80, 443, 3306, 5432, 3389
  • Explain NAT Gateway vs NAT Instance
  • Explain ALB vs NLB vs GLB differences
  • Explain Security Groups vs Network ACLs (stateful vs stateless)
  • Understand VPC components: IGW, Route Tables, Subnets
  • Explain VPC Peering vs Transit Gateway
  • Understand VPC Endpoints (Gateway vs Interface)
  • Explain Site-to-Site VPN vs Direct Connect
  • Know what makes a subnet public vs private