OSI Model — All 7 Layers
#
LAYER
DEVICES / PROTOCOLS / KEY FACTS
7ApplicationHTTP, HTTPS, FTP, SMTP, DNS, SNMP, Telnet, SSH · User-facing layer
6PresentationEncryption, decryption, compression, formatting · SSL/TLS negotiation starts here
5SessionNetBIOS, RPC, PPTP · Establishes, maintains, terminates sessions
4TransportTCP, UDP · Segments/datagrams · Port numbers · Flow control · Error recovery
3NetworkIP, ICMP, OSPF, BGP, RIP · Routers · Packets · Logical (IP) addressing
2Data LinkEthernet, Wi-Fi, ARP, STP · Switches, Bridges, NICs · Frames · MAC addressing
1PhysicalCables, Hubs, Repeaters · Bits · Voltages, frequencies, connectors
Mnemonic top→down: "All People Seem To Need Data Processing" · PDU: Data→Data→Data→Segment→Packet→Frame→Bits
TCP/IP Model (4 Layers)
| TCP/IP Layer | Maps to OSI |
| Application | OSI 5, 6, 7 |
| Transport | OSI 4 |
| Internet | OSI 3 |
| Network Access | OSI 1, 2 |
TCP vs UDP
| TCP | UDP |
| Connection | Connection-oriented | Connectionless |
| Reliability | Guaranteed delivery | Best-effort |
| Order | Ordered | Not guaranteed |
| Speed | Slower | Faster |
| Uses | HTTP, SSH, FTP, Email | DNS, DHCP, VoIP, Video |
| Handshake | 3-way (SYN/SYN-ACK/ACK) | None |
Critical Ports — Must Memorize
| Port | Protocol | TCP/UDP |
| 20/21 | FTP (data/control) | TCP |
| 22 | SSH / SCP / SFTP | TCP |
| 23 | Telnet (insecure) | TCP |
| 25 | SMTP (send email) | TCP |
| 49 | TACACS+ | TCP |
| 53 | DNS | TCP+UDP |
| 67/68 | DHCP (server/client) | UDP |
| 69 | TFTP | UDP |
| 80 | HTTP | TCP |
| 88 | Kerberos | TCP+UDP |
| 110 | POP3 | TCP |
| 119 | NNTP | TCP |
| 123 | NTP | UDP |
| 143 | IMAP | TCP |
| 161/162 | SNMP (agent/trap) | UDP |
| 389 | LDAP | TCP |
| 443 | HTTPS | TCP |
| 445 | SMB | TCP |
| 500 | IKE / ISAKMP (IPSec) | UDP |
| 514 | Syslog | UDP |
| 587 | SMTP (submission, STARTTLS) | TCP |
| 636 | LDAPS (secure) | TCP |
| 989/990 | FTPS (data/control) | TCP |
| 993 | IMAPS (secure) | TCP |
| 995 | POP3S (secure) | TCP |
| 1433 | MS SQL | TCP |
| 1701 | L2TP | UDP |
| 1723 | PPTP VPN | TCP |
| 1812/1813 | RADIUS (auth/accounting) | UDP |
| 3306 | MySQL | TCP |
| 3389 | RDP | TCP |
| 5060/5061 | SIP (VoIP, unsecure/secure) | TCP/UDP |
IPSec also uses protocol numbers, not ports: ESP = 50, AH = 51 · GRE = protocol 47
IPv4 — Address Classes
| Class | Range | Default Mask | Use |
| A | 1–126 | /8 | Large networks |
| B | 128–191 | /16 | Medium networks |
| C | 192–223 | /24 | Small networks |
| D | 224–239 | N/A | Multicast |
| E | 240–255 | N/A | Experimental |
127.x.x.x = loopback (not Class A in practice)
Private IP Ranges (RFC 1918)
- 10.0.0.0/8Class A private
- 172.16.0.0/12Class B private
- 192.168.0.0/16Class C private
- 127.0.0.1Loopback
- 169.254.x.xAPIPA (no DHCP found)
Subnet Quick Reference
| CIDR | Subnet Mask | Hosts |
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
| /31 | 255.255.255.254 | 2 (P2P links, RFC 3021) |
| /32 | 255.255.255.255 | 1 (host route) |
Hosts = 2^(32-CIDR) - 2 · Always subtract 2 for network+broadcast (except /31, which has no network/broadcast address)
IPv6 — Everything
- Length128-bit, 8 groups of hex
- Global Unicast2000::/3 — public routable
- Link-LocalFE80:: — auto-assigned, local
- Loopback::1 — like 127.0.0.1
- Unique LocalFC00::/7 — private
- MulticastFF00::/8 — one-to-many group
- UnicastOne-to-one
- AnycastOne-to-nearest (same address on multiple nodes)
- No BroadcastDoesn't exist in IPv6
- SLAACAuto-config without DHCP
- NDPReplaces ARP
- EUI-64Host ID derived from MAC address
- No NAT neededEnough addresses for all devices
Network Services
- DNSResolves names to IPs · Port 53
- DHCPAuto-assigns IPs · Ports 67/68
- NATTranslates private→public IPs
- PATNAT with port numbers (overloading)
- NTPSyncs time across network · Port 123
- SNMPMonitors network devices · 161/162
- SyslogCentral log collection · Port 514
- LDAPDirectory services · Port 389
- RADIUSAAA for network access
- TACACS+Cisco AAA — encrypts full packet
DNS Record Types
- AIPv4 address
- AAAAIPv6 address
- CNAMEAlias to another hostname
- MXMail server for domain
- PTRReverse DNS (IP → name)
- NSName server for domain
- SOAStart of Authority — zone info
- TXTText records (SPF, DKIM)
- SRVService location
Network Topologies
- StarAll connect to central switch — most common
- MeshEvery device connected to every other
- BusSingle cable, legacy — collisions
- RingCircular path — token passing
- HybridMix of topologies
- Point-to-pointDirect link between two nodes
- Point-to-multipointOne node to many (wireless)
Cloud & Virtualization
- IaaSInfrastructure as a Service — VMs, storage
- PaaSPlatform as a Service — dev environment
- SaaSSoftware as a Service — apps (Office 365)
- Public CloudAWS, Azure, GCP — shared
- Private CloudOn-prem, dedicated
- Hybrid CloudMix of public + private
- Multi-cloudUses more than one cloud provider
- SDNSoftware Defined Networking — separates control/data plane
- NFVNetwork Function Virtualization
- vSwitchVirtual switch inside hypervisor
- VXLANVirtual overlay network — extends VLANs
- VPCVirtual Private Cloud — isolated cloud network segment
- NSG / Security GroupCloud-native firewall on a subnet or instance
- ElasticityAuto-scales resources up/down with demand
- ScalabilityAbility to grow to meet increased demand
- MultitenancyMultiple customers share the same infrastructure
Network Types & Sizes
- PANPersonal Area Network — Bluetooth range
- LANLocal Area Network — single site/building
- WLANWireless LAN
- CANCampus Area Network — multiple buildings, one site
- MANMetropolitan Area Network — city-wide
- WANWide Area Network — spans cities/countries
- SANStorage Area Network — high-speed block storage
- IntranetPrivate network, internal only
- ExtranetPrivate network shared with select outside parties
- Ad hoc / MeshPeer-to-peer wireless, no central AP
Datacenter Network Architecture
- Three-tierCore → Distribution → Access layers
- Core layerHigh-speed backbone — routes between distribution
- Distribution layerAggregates access switches, applies policy/routing
- Access layerWhere end devices connect
- Spine-and-leafCollapsed 2-tier — every leaf connects to every spine
- Top-of-Rack (ToR)Switch mounted in each server rack
- North-South trafficIn/out of the datacenter (client↔server)
- East-West trafficBetween servers inside the datacenter
Spine-leaf minimizes hop count and is built for heavy east-west traffic (common in virtualized/cloud datacenters)
Storage Networking
- SANBlock-level storage on its own high-speed network
- NASFile-level storage, accessed over the LAN (SMB/NFS)
- iSCSISCSI commands over IP/Ethernet — cheap SAN option
- Fibre Channel (FC)Dedicated high-speed storage fabric — needs FC switches
- FCoEFibre Channel over Ethernet — converges FC onto Ethernet
- Jumbo FramesMTU > 1500 bytes (up to ~9000) — reduces overhead for storage traffic