# Quick Revision - Computer Networks
## OSI Model Layers
Layer 1 Physical - cables, signals, bits, hubs, repeaters
Layer 2 Data Link - frames, MAC addresses, switches, bridges, error detection CRC
Layer 3 Network - packets, IP addresses, routing, routers
Layer 4 Transport - segments, TCP UDP, ports, reliability, flow control
Layer 5 Session - session establishment and termination
Layer 6 Presentation - encryption, compression, data translation
Layer 7 Application - HTTP FTP DNS SMTP, user interface
Mnemonic bottom to top: Please Do Not Throw Sausage Pizza Away
## TCP/IP Model Layers
Network Access Layer - Ethernet WiFi, physical and data link functions
Internet Layer - IP addressing, routing, ICMP ARP
Transport Layer - TCP UDP, end to end communication
Application Layer - HTTP DNS DHCP SMTP FTP SSH
## Key Protocols and Ports
HTTP port 80
HTTPS port 443
FTP port 21 control port 20 data
SSH port 22
Telnet port 23
SMTP port 25
DNS port 53
DHCP port 67 server port 68 client
POP3 port 110
SNMP port 161
IMAP port 143
## IP Address Classes
Class A first octet 1 to 126, default mask 255.0.0.0 slash 8
Class B first octet 128 to 191, default mask 255.255.0.0 slash 16
Class C first octet 192 to 223, default mask 255.255.255.0 slash 24
Class D first octet 224 to 239, used for multicast
Class E first octet 240 to 255, reserved
## Private IP Ranges
10.0.0.0 to 10.255.255.255 Class A private
172.16.0.0 to 172.31.255.255 Class B private
192.168.0.0 to 192.168.255.255 Class C private
## Subnetting Formula
Number of subnets = 2 to the power of n where n is borrowed bits
Number of usable hosts = 2 to the power of h minus 2 where h is host bits
## TCP Three Way Handshake
Step 1: Client sends SYN
Step 2: Server sends SYN-ACK
Step 3: Client sends ACK
Connection established
## DHCP Process DORA
Discover - client broadcasts looking for DHCP server
Offer - server offers an IP address
Request - client requests the offered IP
Acknowledge - server confirms the assignment
## DNS Resolution Steps
Browser cache check
OS resolver cache check
Recursive resolver
Root name server
TLD name server
Authoritative name server
IP address returned
## Routing Protocols Summary
RIP - distance vector, hop count metric, max 15 hops, slow convergence
OSPF - link state, cost metric, fast convergence, uses Dijkstra algorithm
EIGRP - advanced distance vector, composite metric, DUAL algorithm
BGP - path vector, used between autonomous systems, internet routing protocol
## Error Detection Methods
Parity check - detects odd number of errors, simple but weak
Checksum - sum of data words, used in IP TCP UDP headers
CRC - polynomial division, most powerful, used in Ethernet
## Network Devices Summary
Hub - Layer 1, broadcasts to all ports
Switch - Layer 2, forwards based on MAC address
Router - Layer 3, routes based on IP address
Gateway - multiple layers, translates between different protocols
Firewall - security device, filters traffic based on rules
Access Point - wireless connectivity for wired networkBack to Subject