Computer networks: TCP versus UDP, latency and packet loss
Transport-layer fundamentals through reliability, retransmission, congestion and application latency.
What TCP actually provides
TCP offers applications an ordered, reliable byte stream. Retransmission and congestion control respond to packet loss and network conditions. TCP does not guarantee low latency for every request; retries, congestion and the destination application all contribute to response time. RFC 9293 consolidates the protocol specification.
Why applications choose UDP
UDP does not automatically offer TCP's ordered reliable stream, which can suit some real-time media and specialised protocols. But 'UDP is always faster' is misleading. When reliability, recovery or flow control is required, the application or a higher-level protocol must provide it.
Diagnose the right layer
A slow API is not necessarily a network problem. DNS resolution, TLS handshake, connection setup, server execution and database queries are distinct stages. Correlate browser timing, server logs and network measurements using the same request ID. This separates transient latency from persistent bottlenecks.
Measure security and capacity together
TLS protects transport connections but is not a substitute for the transport protocol itself. Measure packet loss, latency percentiles, connection failures and retransmissions. Protocol selection should be validated under realistic client conditions and failure scenarios, not from peak throughput claims alone.
Comments
0 real commentsNo real reader comments yet.
✎ Write a comment