Computer Networks
Computer networks enable communication between devices. Understanding TCP/IP, DNS, HTTP, TLS, and routing is fundamental to building distributed systems and debugging network issues.
Contents 3 Sections
1The OSI & TCP/IP Model
TCP/IP Model (practical):
| Layer | Protocol | Function |
|---|---|---|
| Application | HTTP, HTTPS, DNS, FTP, SMTP | Application-level protocols |
| Transport | TCP, UDP | End-to-end communication |
| Network | IP, ICMP | Routing packets across networks |
| Link | Ethernet, Wi-Fi | Physical transmission |
- TCP vs UDP
- TCP connection-oriented, reliable, ordered delivery. Slower. Used by: HTTP, SSH, databases.
- UDP connectionless, no guarantee. Faster. Used by: DNS, video streaming, gaming, VoIP.
TCP Handshake (3-way) 1. Client → Server: SYN 2. Server → Client: SYN-ACK 3. Client → Server: ACK → connection established
- IP Addressing
- IPv4: 32-bit (192.168.1.1), ~4.3B addresses
- IPv6: 128-bit (2001:db8::1), 340 undecillion addresses
- CIDR: 192.168.0.0/24 = first 24 bits are network, last 8 are host (256 addresses)
2DNS, HTTP & TLS
DNS Resolution
``
Browser cache → OS cache → Recursive resolver (ISP) → Root nameserver → TLD (.com) → Authoritative nameserver → IP address
``
- HTTP/2 vs HTTP/3
- HTTP/1.1: one request per TCP connection, head-of-line blocking
- HTTP/2: multiplexing (multiple requests over one connection), header compression
- HTTP/3: runs on QUIC (UDP-based), eliminates TCP head-of-line blocking, faster mobile
TLS Handshake (HTTPS) 1. Client Hello supported TLS versions, cipher suites 2. Server Hello chosen cipher, certificate 3. Client verifies certificate against trusted CA 4. Key exchange → shared session key 5. Encrypted communication begins
Common Ports | Port | Protocol | |---|---| | 80 | HTTP | | 443 | HTTPS | | 22 | SSH | | 5432 | PostgreSQL | | 3306 | MySQL | | 6379 | Redis | | 27017 | MongoDB |
3HTTP/2, HTTP/3 & WebSockets
HTTP Version Comparison | Feature | HTTP/1.1 | HTTP/2 | HTTP/3 | |---|---|---|---| | Protocol | TCP | TCP | QUIC (UDP) | | Multiplexing | ❌ | ✅ | ✅ | | Header compression | ❌ | ✅ HPACK | ✅ QPACK | | Head-of-line blocking | TCP + app | TCP only | ❌ Eliminated | | Server push | ❌ | ✅ | ✅ | | Connection setup | 1.5 RTT | 1 RTT | 0-1 RTT | | Best for | Legacy | Most apps | Mobile, high loss |
WebSocket Protocol ```javascript // Server (Node.js) const { WebSocketServer } = require('ws'); const wss = new WebSocketServer({ port: 8080 });
wss.on('connection', (ws, req) => { const userId = authenticate(req); ws.on('message', (data) => { const msg = JSON.parse(data); // Broadcast to all connected clients wss.clients.forEach(client => { if (client.readyState === WebSocket.OPEN) { client.send(JSON.stringify({ from: userId, text: msg.text, timestamp: Date.now() })); } }); }); ws.on('close', () => removeUser(userId)); ws.on('error', (err) => console.error(err)); // Heartbeat to detect stale connections const heartbeat = setInterval(() => { if (ws.readyState === WebSocket.OPEN) ws.ping(); }, 30_000); ws.on('close', () => clearInterval(heartbeat)); });
// Client const ws = new WebSocket('wss://example.com/ws'); ws.onopen = () => console.log('connected'); ws.onmessage = (e) => console.log(JSON.parse(e.data)); ws.onerror = (e) => console.error(e); ws.onclose = () => setTimeout(reconnect, 3000);
function send(text) { if (ws.readyState === WebSocket.OPEN) { ws.send(JSON.stringify({ text })); } } ```
Explore the Full Portfolio
This is the complete portfolio of Sufi Khan Sulaiman, a technology leader specialising in B2B commerce and digital automation. Start from the Home page for the overview, then move through two decades of career experience across FLIR Systems, Lorex Technology, and 1c Platform, and the full catalogue of project case studies spanning headless commerce migrations, AI recommendation engines, and multi-channel fulfilment systems.
The skills and certifications page maps the technical and leadership capabilities behind the work, while the articles and the knowledge base break down the thinking into actionable frameworks. For hands-on learning, the tutorials and applications sections cover practical builds from front-end fundamentals to full-stack web apps.
For consulting engagement, the expertise page outlines service offerings, the ecommerce hub covers platform architecture and automation strategy, and the ecommerce guide (PDF) is a downloadable 55-page field manual. When you are ready to talk, the contact page is the direct line.