Skip to content

Instantly share code, notes, and snippets.

@hemangsk
Created May 7, 2025 08:32
Show Gist options
  • Save hemangsk/b4bef1e3b1f5082479af3f76272a8a38 to your computer and use it in GitHub Desktop.
Save hemangsk/b4bef1e3b1f5082479af3f76272a8a38 to your computer and use it in GitHub Desktop.
CN Study Plan

🧭 6-Month Plan: Learn Networking From First Principles to Code

Each month follows this structure:

Section Focus
❓ WHY The real-world motivation for the month
πŸ“˜ Concepts What to learn & understand
πŸ§ͺ Labs Visuals, experiments, and tools
πŸ’» Code Hands-on programming
πŸ“š Resources Only curated, non-boring content

πŸ”΅ Month 1: Why Networking Exists – From Wires to the Web

❓ WHY

Why can I Google anything instantly from my phone? How does my laptop even know where Google's server is?

πŸ“˜ Concepts

  • What is a network? Why do computers need to talk?
  • The Internet is not just a website: it’s a system of rules + layers
  • MAC address vs IP address (street name vs phone number analogy)
  • Layers: Like a courier system (You β†’ Post office β†’ Truck β†’ Delivery)

πŸ§ͺ Labs

  • Run: ping, traceroute, ipconfig / ifconfig
  • Draw your home network + devices
  • Wireshark: capture and examine a single ping packet

πŸ’» Code

  • C++ program to list available network interfaces
  • Log your own IP and MAC address via system calls

πŸ“š Resources


πŸ”΅ Month 2: How Data Finds Its Way – IP, Subnets, Routing

❓ WHY

When I visit a website, how does the request reach the right server? Why do some devices have 192.168.x.x addresses?

πŸ“˜ Concepts

  • IP addressing (v4, v6), Public vs Private IP
  • Subnets and CIDR (helps break big networks into pieces)
  • Routing: How routers act like traffic cops
  • ARP, DNS, DHCP explained through daily device usage

πŸ§ͺ Labs

  • Subnetting drills by hand + subnettingpractice.com
  • Wireshark: capture ARP, DNS, DHCP traffic
  • Set up a 3-device network in Cisco Packet Tracer

πŸ’» Code

  • C++ ARP request + parse response (via raw sockets)
  • Write a subnet calculator CLI

πŸ“š Resources


πŸ”΅ Month 3: How Conversations Happen – TCP vs UDP, Sockets

❓ WHY

How does Zoom or WhatsApp call work in real-time? What makes downloads reliable even with network issues?

πŸ“˜ Concepts

  • Ports, multiplexing, and socket lifecycle
  • TCP: Handshake, reliable streams
  • UDP: Fire-and-forget, used in games/calls
  • NAT and Port forwarding (home router behavior)

πŸ§ͺ Labs

  • Simulate connection using telnet, netcat
  • Wireshark: trace a TCP 3-way handshake + UDP DNS query

πŸ’» Code

  • TCP echo server + client in C++
  • UDP chat app in C++
  • Log dropped/retransmitted packets using socket options

πŸ“š Resources


πŸ”΅ Month 4: Anatomy of a Packet – Crafting, Sniffing, Decoding

❓ WHY

What’s really inside a packet? Can I make my own? What if I want to build a ping tool from scratch?

πŸ“˜ Concepts

  • Ethernet, IP, TCP, UDP headers (bit by bit)
  • Checksums, fragmentation, TTL
  • ICMP (used in ping, traceroute)
  • Packet crafting: building your own packets

πŸ§ͺ Labs

  • Wireshark: decode full packet (Ethernet β†’ IP β†’ TCP β†’ HTTP)
  • Simulate packet loss using tc on Linux
  • Craft TCP SYN packets using scapy

πŸ’» Code

  • Send an ICMP echo using raw sockets
  • Craft and send UDP packet by manually setting headers
  • Parse incoming packet headers

πŸ“š Resources


πŸ”΅ Month 5: Build Your Own TCP/IP Stack

❓ WHY

Can I create a computer that talks to others without relying on the OS's network stack?

πŸ“˜ Concepts

  • Userspace networking
  • Mini-stack structure: Ethernet β†’ ARP β†’ IP β†’ UDP β†’ handler
  • Buffering, routing, local IP tables

πŸ’» Project (Stack Core)

  • Create:

    • Ethernet + ARP decoder
    • IP + UDP parsing
    • Routing table + port handler
  • Build a small CLI that listens on a UDP port using your own stack

πŸ“š Resources


πŸ”΅ Month 6: Real-world Protocols & Final Project

❓ WHY

What makes HTTPS secure? How do VPNs or BGP work in big-scale internet routing?

πŸ“˜ Concepts

  • TLS, HTTPS basics
  • NAT traversal (P2P, STUN)
  • BGP and Internet-scale routing
  • Performance: RTT, jitter, congestion

πŸ’» Final Projects (Pick 1–2)

  • 🌐 Your Own DNS Resolver
  • πŸ“‘ UDP Chat with Your Stack
  • πŸ“Š Custom Packet Sniffer with libpcap
  • 🧾 Minimal HTTP Client using raw TCP

πŸ“š Resources


🧰 Bonus Tools

Tool Purpose
Wireshark Inspect traffic deeply
Scapy Craft & send packets
tcpdump CLI packet sniffer
iptables, tc Simulate network conditions
libpcap Build sniffing tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment