TCP vs UDP in a Nutshell
Scenario context
Transport layer protocols define how packets of data are transmitted across networks.
π― System Scenario & Requirements
System Goal
Transport layer protocols define how packets of data are transmitted across networks.
Actors & Components
- Application or API tier
- Core service under design
- Operator or SRE observer
Functional Requirements
- Transport layer protocols define how packets of data are transmitted across networks.
- The choice between TCP and UDP is a choice between reliability and speed.
- TCP (Transmission Control Protocol) Connection : Handshake required (SYN, SYN-ACK, ACK).
Constraints & Assumptions
- - UDP (User Datagram Protocol) Connection : Connectionless (fire-and-forget).
- - Guarantees : No delivery guarantees, packets can arrive out of order or drop.
- Production Considerations & Trade-offs - Detection: UDP (User Datagram Protocol) Connection : Connectionless (fire-and-forget).
- - User or operator impact: UDP (User Datagram Protocol) Connection : Connectionless (fire-and-forget).
β‘ Execution Stages & Decision Trace
Stage 1 β End-to-end outcome
TCP (Transmission Control Protocol) Connection : Handshake required (SYN, SYN-ACK, ACK).
TCP (Transmission Control Protocol) Connection : Handshake required (SYN, SYN-ACK, ACK).
Deep Dive
Scenario context
Transport layer protocols define how packets of data are transmitted across networks. The choice between TCP and UDP is a choice between reliability and speed.
TCP (Transmission Control Protocol)
- Connection: Handshake required (SYN, SYN-ACK, ACK).
- Guarantees: In-order delivery, error-checking, and packet recovery via retransmission.
- Best for: HTTP/HTTPS (Web browsing), Email, Database connectiβ¦
This walkthrough focuses on Scenario context.
Before making a design choice, clarify:
- Transport layer protocols define how packets of data are transmitted across networks.
- The choice between TCP and UDP is a choice between reliability and speed.
- TCP (Transmission Control Protocol) Connection : Handshake required (SYN, SYN-ACK, ACK).
Concepts in play: system-design-hld-architectures, api-gateway, api-security-oauth2
Stage 1 β End-to-end outcome
- TCP (Transmission Control Protocol) Connection : Handshake required (SYN, SYN-ACK, ACK).
Observable outcome: TCP (Transmission Control Protocol) Connection : Handshake required (SYN, SYN-ACK, ACK).
End-to-end outcome
Transport layer protocols define how packets of data are transmitted across networks.
Alternatives considered
Alternatives considered
The source focuses on one primary design.
Failure and degraded modes
Stage 1 β Production Considerations & Trade-offs
- Detection: - UDP (User Datagram Protocol) Connection : Connectionless (fire-and-forget).
- User or operator impact: - UDP (User Datagram Protocol) Connection : Connectionless (fire-and-forget).
Failure and degraded modes
- Detection: Production Considerations & Trade-offs - Detection: UDP (User Datagram Protocol) Connection : Connectionless (fire-and-forget).
- User or operator impact: Production Considerations & Trade-offs - Detection: UDP (User Datagram Protocol) Connection : Connectionless (fire-and-forget).
Key learnings
- TCP (Transmission Control Protocol) Connection : Handshake required (SYN, SYN-ACK, ACK).
