Tài liệu deep-dive và live demos về các network protocol.
Từ wire format đến production patterns — không chỉ "nó làm gì" mà "tại sao".
Tài liệu
Mỗi bài viết theo hướng bottom-up — wire format trước, abstractions sau. Có diagram SVG, bảng so sánh, và code ví dụ cho mỗi concept.
HTTP/1.0 → HTTP/1.1 → HTTPS → HTTP/2 → HTTP/3 — từng bước tiến hóa. Từ GET / HTTP/1.0 đến QUIC streams trên UDP.
Từ Protobuf wire format đến 4 streaming patterns, interceptors và production deployment. HTTP/2 + Protocol Buffers + code generation.
Đọc bài →HTTP Upgrade handshake → frame masking → backpressure → Redis pub/sub scaling. Full-duplex persistent connection trên một TCP duy nhất.
Đọc bài →NAT traversal → ICE/STUN/TURN → SDP negotiation → DTLS-SRTP → DataChannel. P2P video/audio trực tiếp giữa browser, không qua server.
Đọc bài →Wire format 2-byte → QoS 0/1/2 state machines → persistent sessions → drone fleet IoT patterns. Pub/sub sinh ra cho IoT từ năm 1999.
Đọc bài →Gợi ý thứ tự học: Mỗi bài độc lập, nhưng nếu mới bắt đầu hãy đọc theo thứ tự HTTP → gRPC → WebSocket → WebRTC → MQTT. Hiểu TCP và HTTP/1.1 trước giúp mọi bài sau dễ hơn rất nhiều.
Live Demos
Ứng dụng thực tế minh hoạ các protocol trong action. Static demos chạy trực tiếp trên GitHub Pages; Node.js demos cần chạy server riêng.
Multi-room real-time chat với file transfer, typing indicators, DMs, và presence. Full-stack: Node.js WS server + browser client.
Mở demo →Frame inspector, throughput benchmarks, và latency histograms. Visualize RFC 6455 frames ở bit level với real-time metrics.
Mở demo →7-step P2P connection flow trong browser: getUserMedia → SDP offer/answer → ICE → DTLS → SRTP. Không cần server — in-browser signaling.
Mở demo →Interactive HMM simulator: configure trạng thái (Khỏe/Sốt), observation sequences, và xem từng bước Viterbi decoding với visualization.
Coming soonSo sánh
Tổng quan nhanh — khi nào dùng cái nào.
| Tiêu chí | HTTP | gRPC | WebSocket | WebRTC | MQTT |
|---|---|---|---|---|---|
| Transport | TCP / QUIC | TCP (HTTP/2) | TCP | UDP (ICE) | TCP |
| Mô hình | Req / Resp | RPC + Stream | Full-duplex | P2P | Pub / Sub |
| Overhead | Medium | Thấp | Rất thấp | Cao (setup) | Tối thiểu |
| Binary? | H2/H3: Yes | Yes (Protobuf) | Tuỳ chọn | Yes (SRTP) | Yes |
| Server cần? | Origin server | gRPC server | WS server | Signaling only | MQTT broker |
| Dùng khi | REST API, CDN | Microservices | Chat, live UI | Video / P2P | IoT, drone |