FE Interview Hub
Browser InternalsBasic

What are the differences between TCP and UDP?

AI Practice

TCP (Transmission Control Protocol)

TCP is a connection-oriented protocol that requires establishing a connection (three-way handshake) before transmission, ensuring reliable and ordered data delivery.

Characteristics:

  • Connection establishment: Three-way handshake (SYN → SYN-ACK → ACK)
  • Connection termination: Four-way handshake
  • Reliable transmission: Ordered, no duplicates, no loss (ACK confirmation and retransmission)
  • Flow control and congestion control
  • Slower but stable

UDP (User Datagram Protocol)

UDP is a connectionless protocol that sends data directly without guaranteeing reliability.

Characteristics:

  • Connectionless, sends directly
  • No guarantee of order or delivery
  • No retransmission mechanism
  • Fast with low latency
  • Supports broadcast and multicast

Key Comparison

Feature TCP UDP
Connection Connection-oriented Connectionless
Reliability High (ACK/retransmit) Low (no guarantee)
Order Guaranteed Not guaranteed
Speed Slower Faster
Use Cases HTTP, FTP, Email Live streaming, Gaming, DNS, VoIP

When to Use

  • TCP: When reliable transmission is required — web browsing (HTTP/HTTPS), file transfer (FTP), email
  • UDP: When low latency is more important than reliability — video streaming, online gaming, DNS queries

✦ AI Mock Interview

Type your answer and get instant AI feedback

Sign in to use AI scoring