🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

TCP or UDP? Choosing the Right Protocol

↗ Quelle (dev.to)
🗣️ Stimme:

1. Analogy



Imagine you're sending your friend a 500-page book.



You have two delivery companies.



The first guarantees every page arrives in order.

If page 187 gets lost, they'll resend only page 187.



The second company is incredibly fast.

They throw pages onto trucks immediately.

If page 187 disappears...



They simply keep driving.



Which company would you choose?



The answer depends on what you're sending.



That's exactly why the Internet has TCP and UDP.



Why One Protocol Isn't Enough



Different applications have different priorities.



Imagine these scenarios:



Downloading Ubuntu ISO





Watching Netflix





Video Calling





Playing Valorant





Sending Bank Transactions



Should they all behave the same?



Absolutely not.



A.Meet TCP



TCP says:



I refuse to lose data.



Its priorities:



✔ Reliability



✔ Correct order



✔ Error recovery



✔ Flow control



✔ Congestion control



Not speed.



How TCP Works



Before sending anything:



TCP says:



Let's introduce ourselves.



This is the famous Three-Way Handshake.



Client Server



SYN ------------------>




CODE
  <----------------  SYN-ACK




ACK ------------------>



Now both sides know:



"I'm ready."



Only then does data start flowing.



Explanation:



SYN

ACK

Sequence Numbers

Sequence Numbers



Imagine sending:



Hello World



TCP splits it.



Packet 1



Packet 2



Packet 3



Each receives a number.



1



2



3



If packet 2 disappears:



1





3



The receiver says:



"I got 1."



"I got 3."



"I'm still missing 2."



TCP resends only packet 2.



This is reliability.



Acknowledgments



Every successful delivery receives an ACK.



Packet





ACK



No ACK?



Resend.



Simple.



Flow Control



Imagine:



Sender:



1000 Mbps



Receiver:



20 Mbps



Without control:



The receiver drowns.



TCP asks:



"How much can you handle?"



Receiver answers:



512 KB



TCP obeys.



Congestion Control



What if the Internet itself is busy?



Highways become congested.



TCP slows down.



Not because the receiver is slow.



Because the network is crowded.



Explain:



Traffic jam analogy.



B.Meet UDP



UDP has one philosophy.



Send it.



That's it.



No handshake.



No acknowledgments.



No retries.



No ordering.



No waiting.



UDP in Action

Packet 1





Packet 2





Packet 3



Packet 2 disappears.



UDP simply continues.



1





3



4



5



6



No resend.



Why Would Anyone Want That?



Because sometimes waiting is worse than losing data.



Example:



a.Video Call



Imagine hearing:



Hello...



(wait 3 seconds)



How...



(wait)



are...



(wait)



you?



Terrible.



Instead,



if one audio packet disappears...



Your brain barely notices.



Speed matters more than perfection.



b.Gaming



Suppose you're playing FIFA.



Every 16 milliseconds your position changes.



If one packet disappears:



Do you want the old position?



No.



You want the newest one.



Old data is useless.



UDP wins.



c.Live Streaming



Watching football.



Frame 246 disappears.



Should Netflix stop?



No.



Show frame 247.



Keep going.



d.DNS Uses UDP Too



DNS requests are tiny.



Where is github.com?



The answer is tiny too.



If one packet gets lost:



Just ask again.



Using TCP would waste time establishing a connection for every lookup.



That's why most DNS queries use UDP.



When TCP Wins



Downloading files.



Example:



Linux ISO



PDF



ZIP



Database backup



One missing byte corrupts the entire file.



TCP ensures:



Nothing is lost.



Common Applications

TCP UDP

HTTP DNS

HTTPS VoIP

SSH Online Gaming

FTP Live Streaming

Email DHCP

Database Connections NTP



TCP vs UDP

Feature TCP UDP

Connection Yes No

Reliable Yes No

Ordered Delivery Yes No

Error Recovery Yes No

Speed Slower Faster

Header Size 20–60 bytes 8 bytes

Best For Files, APIs, Banking Games, Calls

How the OSI Model Fits



TCP and UDP both live in:



Layer 4



Transport Layer



Above them:



HTTP



HTTPS



DNS



SMTP



Below them:



IP



Ethernet



Wi-Fi



Interview Questions



a.Why doesn't TCP always replace UDP?



Because reliability has a cost. Handshakes, acknowledgments, retransmissions, and congestion control all add latency.



b.Why doesn't UDP replace TCP?



Because some data must arrive intact and in order. Losing a byte in a bank transaction or software download is unacceptable.



c.Can UDP be made reliable?



Yes. Applications can implement their own reliability mechanisms on top of UDP. A good example is QUIC, which runs over UDP and powers HTTP/3 by handling reliability and security in user space.



d.Why does HTTP/3 use UDP?



Because it builds its own transport features on top of UDP, avoiding some of TCP's limitations—particularly connection setup delays and head-of-line blocking.



Final Takeaways



TCP and UDP aren't competitors trying to replace one another. They solve different problems. TCP prioritizes reliability, ensuring data arrives completely, in order, and without corruption. UDP prioritizes speed and low latency, accepting occasional packet loss when timely delivery is more important than perfect delivery.



The next time you're downloading a file, making a video call, joining an online game, or performing a DNS lookup, you'll know why the Internet chooses one protocol over the other.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten TCP or UDP? Choosing the Right Protocol

Thematisch verwandte Begriffe: Choosing, Right, Protocol · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...