Networking Fundamentals and Protocols
Models and encapsulation
Memorize the OSI seven layers top-down: Application, Presentation, Session, Transport, Network, Data Link, Physical. Map devices to layers: hub/repeater = Layer 1, switch/bridge with MAC addressing = Layer 2, router with IP addressing = Layer 3, most firewalls = Layer 3/4, proxies = Layer 7. Encapsulation builds data → segment (TCP/UDP) → packet (IP) → frame (MAC) → bits.
Transport: TCP vs UDP
TCP is connection-oriented: three-way handshake (SYN, SYN-ACK, ACK), sequencing, retransmission, flow control. UDP is connectionless and best-effort - used by DNS queries, DHCP, TFTP, SNMP and voice/video, where low latency beats reliability.
Addressing and core protocols
Know well-known ports: 20/21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 80 HTTP, 110 POP3, 143 IMAP, 161 SNMP, 389 LDAP, 443 HTTPS, 445 SMB, 3389 RDP. ARP maps IP→MAC and only resolves hosts inside the local subnet (remote traffic resolves the gateway MAC). DHCP uses DORA: Discover, Offer, Request, Acknowledge. ICMP carries ping and traceroute. Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16; a 169.254.x.x (APIPA) address means DHCP failed.
Traps
Layer/device mismatches, swapped port numbers, and “ping works but the website won’t load” (ICMP permitted, TCP/443 blocked). Also remember NAT, VLANs, and subnetting are not security controls by themselves.
Worked example
192.168.10.0/26: mask 255.255.255.192, block size 64, so subnets start at .0, .64, .128, .192 and each holds 62 usable hosts (2^6 − 2). Rule of thumb: usable hosts = 2^(32 − prefix) − 2.