See your own network setup
CN: IP addressing, subnets, MACShow your IP address, subnet, and network adapters, the identity of your machine on the network.
# Windows
ipconfig /all
# Linux / macOS
ip addr # (or: ifconfig)
Look for your IPv4 address, subnet mask, default gateway (your router), and MAC (physical) address.
Watch DNS resolve a name to an IP
CN: DNS, application layerDNS turns a name like github.com into an IP address. These let you watch it happen and see which DNS server answered.
# Windows
nslookup github.com
# Linux / macOS
dig github.com # detailed
host github.com # short
Try nslookup github.com 8.8.8.8 to ask Google's DNS specifically, and compare the answer.
Test if a host is reachable (ICMP)
CN: ICMP, round-trip timePing sends small ICMP packets and times the round trip, the simplest "is it alive and how far away" test.
# Windows (4 packets by default)
ping github.com
# Linux / macOS (Ctrl+C to stop)
ping github.com
The time in milliseconds is latency. High or wildly varying times hint at network congestion or distance.
Trace the path packets take
CN: routing, hops, TTLEvery packet hops through multiple routers to reach its destination. This reveals each hop on the way, routing made visible.
# Windows
tracert github.com
# Linux / macOS
traceroute github.com # install if needed: sudo apt install traceroute
Each line is one router (a "hop"). This is the TTL field in action, decremented at every hop until the packet arrives.
See open ports and live connections
CN: ports, TCP states, socketsEvery network service listens on a port. See what is listening and which connections are currently open on your machine.
# Windows
netstat -ano
# Linux / macOS
ss -tulpn # modern (or: netstat -tulpn)
Notice TCP states like LISTEN and ESTABLISHED, that is the TCP connection lifecycle you read about, live.
Talk to a web server by hand (HTTP)
CN: HTTP, TCP, application layerA web request is just text sent over TCP. These make an HTTP request and show you the raw response headers, the protocol demystified.
# Any OS with curl
curl -I https://github.com # headers only
curl -v https://example.com # verbose: see the TCP + TLS + HTTP steps
The -v flag shows the DNS lookup, TCP connect, TLS handshake, and HTTP exchange in order, the whole stack in one command.
Check if a specific port is open
CN: ports, TCP handshakeUseful for "is the server up on port 443?" Tries to open a TCP connection to one port.
# Linux / macOS (netcat)
nc -zv github.com 443
# Windows PowerShell
Test-NetConnection github.com -Port 443
A success means the TCP three-way handshake completed. A timeout usually means a firewall or a closed port.
Mini challenge: trace a full request
Put it together. Pick any website and, in order:
- Resolve its name with
nslookupordig(DNS). - Ping it to measure latency (ICMP).
- Trace the route to see the hops (routing).
- Run
curl -vand watch DNS, TCP, TLS, and HTTP happen.
You just walked the exact path of the classic interview question "what happens when you type a URL and press enter?", except you watched it for real. That is the fastest way to make it stick.
Copy-paste AI prompts
Paste these into any AI chatbot (or this site's โฆ Ask AI) to go deeper. Fill in the brackets.
I ran [command, e.g. "traceroute github.com"] and got this output: [paste].
Explain what each part means in plain English, and which Computer Networks concept
(routing, DNS, TCP, etc.) it demonstrates.
My [website / server / connection] is [slow / unreachable]. Give me a step-by-step
checklist of safe, read-only commands (Windows and Linux) to diagnose it, from DNS
to routing to ports, and how to interpret each result.
Quiz me on Computer Networks for a fresher SDE interview. Ask one question at a time
(OSI/TCP-IP, TCP vs UDP, HTTP, DNS, "what happens when you type a URL"). After my
answer, tell me if I'm right and add one crisp follow-up.
What to do next
Open a terminal and run these as you read, every command has a Copy button. Each one is tagged with the Computer Networks concept it demonstrates, so theory and practice reinforce each other. For the theory itself, keep the CS Fundamentals guide (Computer Networks section) open alongside. All commands are safe and read-only on your own machine.