CS fundamentals

Computer Networks

From the OSI model to TCP, DNS, routing and web protocols, one layer at a time.

  • Handwritten-style
  • Diagrams and tables
  • Worked examples

Who this notebook is for

Students and freshers preparing for networking questions, and developers who want to understand what happens between a browser and a server.

What you will be able to do

  • Walk through what happens when you type a web address and press enter
  • Do IPv4 subnetting and CIDR questions by hand
  • Explain the TCP handshake, retransmission and congestion control
  • Describe how DNS, HTTP and TLS fit on top of the lower layers

What's inside

Pick a chapter and the notebook opens right there.

  1. Networking Foundations & ModelsOSI 7-Layer vs TCP/IP 4-Layer, PDU Encapsulation & MultiplexingStart here
  2. Physical Layer & Signal MathematicsNyquist & Shannon Capacity, Baud vs Bit Rate, Line Coding & CDMAStart here
  3. Data Link Layer & Error MechanicsFraming, CRC-32 Polynomial Math, Hamming Codes & ARQ ProtocolsStart here
  4. Medium Access Control & EthernetALOHA, CSMA/CD, Binary Exponential Backoff, CSMA/CA & Wi-FiStart here
  5. Layer 2 Switching & Spanning TreeMAC Learning, VLANs (802.1Q), STP (802.1D) & Clos Switch FabricsStart here
  6. Network Layer & IPv4 SubnettingIPv4 Header Fields, CIDR Subnetting Math, VLSM & TCAM Route LookupStart here
  7. ARP, NAT, PAT & IPv6 ArchitectureARP Cache Poisoning, NAT/PAT Table Translations, IPv6 SLAAC & NDPStart here
  8. Unicast Routing Protocols (RIP/OSPF)Bellman-Ford vs Dijkstra SPF, Multi-Area OSPF Link-State AdvertisementsStart here
  9. Inter-Domain Routing & BGPAutonomous Systems, eBGP/iBGP Peering, Path Vector & Route SelectionStart here
  10. Transport Layer & UDP InternalsUDP Header Anatomy, Pseudo-Header Checksum, WebRTC & UDP SocketsStart here
  11. TCP Handshake & State Machine3-Way Handshake, SYN Cookies, 4-Way Teardown, 11-State TCP FSMStart here
  12. TCP Reliability & Sliding WindowGo-Back-N vs SR, Flow Control rwnd, Jacobon's RTO, SACK & Fast RetransmitStart here
  13. TCP Congestion Control & AlgorithmsAIMD, Slow Start, ssthresh, Tahoe vs Reno, TCP CUBIC, Google BBR & ECNStart here
  14. Application Layer & Domain Name SystemRoot Server Topology, Recursive vs Iterative DNS, DNSSEC, DoH & GSLBStart here
  15. Modern Web Protocols (HTTP/1 to HTTP/3)HTTP/1.1 HoL, HTTP/2 Binary Framing & HPACK, HTTP/3 QUIC over UDPStart here
  16. Network Security & CryptographyAES-GCM, Diffie-Hellman / ECDHE, X.509 PKI, TLS 1.3, SSH & WireGuardStart here
  17. Socket Programming & Linux DiagnosticsBerkeley C Sockets, epoll Event Loop, tcpdump, ss, curl & Triage FlowchartStart here
  18. FAANG Interview Drills & Cheat SheetMath Formulae, 'What happens on google.com', TIME_WAIT, PMTU & Top 15 Q&AStart here

Practice this

Put it to work on LakeBench.

Common questions

Is this notebook only for exam preparation?
No. It is written to explain how networks really work, and it also ends with interview drills, so it serves both exams and real jobs.
Do I need a networking background?
No. It starts with the layered model and builds up one layer at a time.
Can I read a sample before I commit?
Yes. The contents pages and the first pages of every notebook can be read online, so you can judge the style before going further.

More in CS fundamentals

All notebooks