What is the difference between TCP and UDP?
BeginnerConceptNetwork Models, TCP, UDP & Ports
Answer
TCP is connection-oriented, reliable and ordered: handshake, sequence numbers, acknowledgements, retransmission, flow and congestion control. UDP is connectionless and best-effort: no handshake, no retransmission, no ordering, just a datagram with source and destination port.
Use TCP when you need every byte in order (HTTP/1.1, HTTP/2, SSH, databases). Use UDP when latency matters more than perfection or the application handles loss itself (DNS, VoIP, QUIC, WireGuard, syslog, metrics via StatsD).
More on Network Models, TCP, UDP & Ports
What are the layers of the OSI model, and why does a DevOps engineer care?BeginnerHow does the TCP/IP model map to the OSI model?BeginnerDescribe the TCP three-way handshake.BeginnerHow does TCP close a connection, and what is TIME_WAIT?IntermediateWhat is a port, and what are well-known, registered and ephemeral ranges?BeginnerWhich ports should you know by heart for DevOps work?Beginner