Why Is UDP Preferred Over TCP in Some Applications?

314.8K views
•
April 25, 2018
by
Gate Smashers
YouTube video player
Why Is UDP Preferred Over TCP in Some Applications?

TL;DR

UDP is preferred when speed, low overhead, continuous delivery, or one-request-one-reply communication matters more than reliable and ordered packet delivery. Its connectionless, stateless design suits DNS, DHCP, online games, voice over IP, streaming, routing updates, broadcasting, and multicasting, although packets may arrive out of order or be lost.

Transcript

Hello friends Welcome to Gate Smashers The topic is UDP application We have seen that UDP is a connection less protocol means it does not establish any connection, it directly sends the data but TCP always tansfers after establishing a connection due to which the problems UDP is facing are due to not making a connection it is unreliable second is t... Read More

Key Insights

  • UDP is a connectionless protocol that sends data directly without establishing a connection first. This reduces setup work, but it also makes UDP unreliable because packets can be lost or arrive out of order without synchronization.
  • Query-response communication is well suited to UDP because one request can receive one reply without a prior connection. DNS follows this pattern when a user supplies a domain name and receives the corresponding IP address.
  • UDP has less header overhead than TCP because its header contains only four items, and the checksum is described as nonmandatory. The reduced amount of extra information makes UDP attractive for short requests and replies.
  • Speed is a primary reason to choose UDP for online games and voice over IP. TCP may retransmit a lost packet and reduce its transmission speed through congestion-control behavior, while UDP avoids those delays.
  • Broadcasting and multicasting work efficiently with UDP because one sender can transmit to many receivers without establishing an individual connection with each one. This avoids reserving separate buffers, bandwidth, and memory before communication begins.
  • Routing Information Protocol uses UDP to distribute routing tables to neighboring nodes every 30 seconds. The communication is broadcast or multicast, so requiring TCP connections with every neighboring receiver would add unnecessary setup and buffer requirements.
  • Continuous streaming benefits from UDP because uninterrupted packet flow can matter more than perfect clarity. In YouTube playback or Skype video chat, accepting some lost pixel information can help preserve continuity instead of pausing for retransmission.
  • UDP is stateless because it does not establish connections or save their values. This keeps overhead low when communicating with thousands of clients, unlike stateful applications that track user actions, selected items, colors, sizes, carts, and payment progress.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: Why is UDP preferred over TCP for some applications?

UDP is preferred when an application values speed, low overhead, continuous transmission, or communication with many receivers more than guaranteed delivery. It sends data without establishing a connection, maintaining connection state, reserving buffers, or retransmitting lost packets. These characteristics suit query-response protocols, online games, voice over IP, streaming, broadcasting, and multicasting.

Q: How does UDP reduce communication overhead?

UDP reduces overhead by avoiding connection establishment and using a smaller header than TCP. The transcript describes only four items in the UDP header and says the checksum is not mandatory, leaving an average of three added items. TCP adds many more header fields and may also require buffers, bandwidth, memory, flow control, and congestion control.

Q: Why does DNS use UDP for query-response communication?

DNS uses UDP because resolving a domain name is presented as a simple one-request-one-reply exchange. A user supplies a domain name, such as google.com, and asks for its corresponding IP address. The DNS server returns the answer without requiring a connection to be established first, which keeps the exchange direct and limits overhead.

Q: How does DHCP demonstrate a UDP query-response pattern?

DHCP demonstrates the query-response pattern when a machine has a MAC address but does not yet have an IP address. The machine effectively provides its MAC address and asks which IP address it should use. It receives an answer without first forming a connection, making the exchange suitable for UDP's direct request-and-reply operation.

Q: Why is UDP useful for online games and voice over IP?

UDP is useful for online games and voice over IP because speed and continuity are critical. TCP may retransmit a lost packet and change its speed through flow control and congestion control. Those actions can introduce pauses. In a game, even a pause of 1–2 seconds can disrupt play and allow another player to act first.

Q: Why is UDP suitable for broadcasting and multicasting?

UDP supports broadcasting and multicasting without requiring the sender to establish a separate connection with every receiver. TCP would require multiple connections and reserved buffers before sending one message to many clients. The transcript illustrates that if 1000 clients each required a 1MB buffer, 1000MB would need to be maintained before communication began.

Q: How does UDP support continuous video and voice streaming?

UDP supports continuous streaming by allowing packets to keep moving without stopping to retransmit every missing packet. During YouTube playback or Skype video chat, a dropped packet may reduce clarity because packets contain pixels, but the stream can continue. TCP may stop to retransmit the missing information, causing slower playback or a visible interruption.

Q: What does it mean that UDP is stateless?

UDP is stateless because it does not establish a connection and save the values associated with that connection. This helps keep overhead low when communicating with thousands of clients. By contrast, stateful applications such as Amazon or Flipkart track viewed pages, selected items, cart contents, colors, sizes, and progress toward payment.

Summary & Key Takeaways

  • UDP sends data without first establishing a connection, which reduces communication overhead but makes delivery unreliable. Packets may be lost or arrive out of order because UDP provides no synchronization. This tradeoff is useful when an application values immediate transmission, limited header information, and steady communication more than guaranteed delivery.

  • Query-response applications such as DNS and DHCP use UDP because they commonly involve one request followed by one reply. DNS returns the IP address corresponding to a domain name, while DHCP answers a client that has a MAC address but needs an IP address. Neither example requires prior connection establishment.

  • UDP is also suitable for online games, voice over IP, continuous streaming, broadcasting, and multicasting. It avoids TCP connection setup, buffer reservations, retransmission delays, flow control, and congestion control. Its stateless operation further reduces overhead when communication involves many clients or recipients.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Gate Smashers 📚