skills:network
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| skills:network [2026/06/17 13:18] – phong2018 | skills:network [2026/06/17 13:29] (current) – phong2018 | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| **Purpose: | **Purpose: | ||
| - | **Examples | + | **Application-layer protocols** |
| + | |||
| + | These protocols operate at the **Application Layer (Layer 7)** and define how applications exchange data. | ||
| + | |||
| + | ^ Protocol | ||
| + | | HTTP | HyperText Transfer Protocol | TCP | Web pages, REST APIs | | ||
| + | | HTTPS | HTTP over TLS/SSL | TCP | Secure web pages, secure APIs | | ||
| + | | WebSocket | Full-duplex web communication protocol | TCP | Real-time chat, notifications, | ||
| + | | RESP | Redis Serialization Protocol | TCP | Communication between Redis clients and servers | | ||
| + | | AMQP | Advanced Message Queuing Protocol | TCP | Message brokers such as RabbitMQ | | ||
| + | | Kafka Protocol | Apache Kafka binary protocol | TCP | Event streaming and distributed messaging | | ||
| + | | SMTP | Simple Mail Transfer Protocol | TCP | Sending email | | ||
| + | | FTP | File Transfer Protocol | TCP | File uploads and downloads | | ||
| + | | DNS | Domain Name System | UDP (mostly), TCP (sometimes) | Domain name resolution | | ||
| + | | MQTT | Message Queuing Telemetry Transport | TCP | IoT devices and lightweight messaging | | ||
| + | |||
| + | ===== Notes ===== | ||
| + | |||
| + | * These are **application-layer protocols**, | ||
| + | * Most application protocols rely on **TCP** because they require reliable and ordered delivery. | ||
| + | * **DNS** primarily uses **UDP** for low latency, but switches to **TCP** for large responses and zone transfers. | ||
| + | * **HTTPS** is essentially: | ||
| + | |||
| + | < | ||
| + | HTTPS = HTTP + TLS + TCP | ||
| + | </ | ||
| + | |||
| + | * **WebSocket** starts with an HTTP handshake, then upgrades to a persistent TCP connection. | ||
| + | |||
| + | < | ||
| + | Client | ||
| + | ↓ | ||
| + | Application Protocol (HTTP, MQTT, AMQP, RESP) | ||
| + | ↓ | ||
| + | Transport Protocol (TCP or UDP) | ||
| + | ↓ | ||
| + | IP | ||
| + | ↓ | ||
| + | Ethernet / Wi-Fi | ||
| + | </ | ||
| + | |||
| + | ===== Examples ===== | ||
| + | |||
| + | < | ||
| + | HTTP/1.1 → TCP → IP → Ethernet | ||
| + | |||
| + | WebSocket → TCP → IP → Ethernet | ||
| + | |||
| + | DNS → UDP → IP → Ethernet | ||
| + | |||
| + | MQTT → TCP → IP → Ethernet | ||
| + | |||
| + | Kafka → TCP → IP → Ethernet | ||
| + | |||
| + | HTTPS → TLS → TCP → IP → Ethernet </ | ||
| - | * HTTP / HTTPS | ||
| - | * WebSocket | ||
| - | * Redis Protocol (RESP) | ||
| - | * AMQP (RabbitMQ) | ||
| - | * Kafka Protocol | ||
| - | * SMTP | ||
| - | * FTP | ||
| - | * DNS | ||
| - | * MQTT | ||
| **Examples of messages:** | **Examples of messages:** | ||
| Line 76: | Line 121: | ||
| **Purpose: | **Purpose: | ||
| + | ^ Feature ^ TCP ^ UDP ^ | ||
| + | | Full Name | Transmission Control Protocol | User Datagram Protocol | | ||
| + | | Connection Type | Connection-oriented | Connectionless | | ||
| + | | Reliability | Reliable delivery with ACK and retransmission | Best effort, no delivery guarantee | | ||
| + | | Message Ordering | Preserves packet order | No ordering guarantee | | ||
| + | | Error Recovery | Automatic retransmission | No retransmission | | ||
| + | | Flow Control | Yes (sliding window) | No | | ||
| + | | Congestion Control | Yes | No | | ||
| + | | Overhead | Higher | Lower | | ||
| + | | Latency | Higher | Lower | | ||
| + | | Speed | Slower due to reliability mechanisms | Faster due to minimal overhead | | ||
| + | | Header Size | 20–60 bytes | 8 bytes | | ||
| + | | Communication Style | Continuous connection between client and server | Independent datagrams | | ||
| + | | Typical Use Cases | Web applications, | ||
| - | ==== TCP ==== | + | ^ Common Protocols and Applications ^ Transport Layer ^ |
| - | + | | HTTP/ | |
| - | * Connection-oriented | + | | HTTP/ |
| - | * Reliable delivery | + | | WebSocket |
| - | * Ordered messages | + | | Redis (RESP) | TCP | |
| - | * Retransmission support | + | | RabbitMQ |
| - | + | | Apache | |
| - | Used by: | + | | SMTP | TCP | |
| - | + | | FTP | TCP | | |
| - | * HTTP/1.1 | + | | SSH | TCP | |
| - | * HTTP/2 | + | | DNS | UDP (primarily), |
| - | * WebSocket | + | | VoIP | UDP | |
| - | * Redis | + | | Online Games | UDP | |
| - | * RabbitMQ | + | | WebRTC | UDP | |
| - | * Kafka | + | | QUIC | UDP | |
| - | + | | HTTP/3 | QUIC over UDP | | |
| - | ==== UDP ==== | + | |
| - | + | ||
| - | * Connectionless | + | |
| - | * Faster | + | |
| - | * No delivery guarantee | + | |
| - | + | ||
| - | Used by: | + | |
| - | * DNS | + | ^ Summary ^ TCP ^ UDP ^ |
| - | * VoIP | + | | Main Goal | Reliability and correctness | Speed and low latency | |
| - | * Online games | + | | Best For | Data that must not be lost | Data that must arrive quickly | |
| - | * WebRTC | + | | Example | File download, API requests, email | Video call, live stream, multiplayer game | |
| - | * QUIC (HTTP/3) | + | | Real-world Analogy | Registered mail with delivery confirmation | Radio broadcast | |
| ===== Layer 3: Network ===== | ===== Layer 3: Network ===== | ||
skills/network.1781702333.txt.gz · Last modified: by phong2018
