Cybersecurity – TCP vs UDP


Cybersecurity: TCP vs UDP

Sometimes, being safe means being slow.
That happens in networking too.

Today, we focus on a key idea: why TCP is reliable but slower, and when you should pick UDP instead.


What is a protocol?

A protocol is a set of rules that define how devices communicate over a network. Like speaking the same language!


TCP (Transmission Control Protocol)

Here’s how it works:

  • every data packet is sent only after the previous one is confirmed;

  • if something goes wrong, the packet is re-sent.

  • Reliable connection: ensures data is delivered in order and complete.

  • Error checking: missing data is re-sent.

  • Used for: websites (HTTP), email (SMTP), file transfers (FTP).

⚠️ Downside: it’s slower, because it checks everything.

Metaphor: Like sending a certified letter with return receipt. You know it arrived.


UDP (User Datagram Protocol)

It doesn’t wait for confirmations, and skips error checking.

  • Fast connection: no guarantees about delivery.
  • ⚠️ No error checking: packets can be lost.
  • Used for: streaming, VoIP, online gaming.

⚠️ Downside: no guarantee the data arrives, or that it’s in order.

Metaphor: Like mailing a postcard—you send it, but may not know if it arrives.

🎮 Real example: live video lessons

Let’s say you’re building a live e-learning platform.

With TCP, the stream may stutter every time a packet is lost.
With UDP, the video stays smooth, even if a frame or two gets lost.

📌 In this case, better to lose a bit than to lag a lot.


Why does it matter for cybersecurity?

Many attacks take advantage of UDP’s weaknesses:

  • spoofing (impersonation),
  • flooding (packet storms),
  • sniffing (eavesdropping on data).

Summary

ScenarioRecommended protocol
User login✅ TCP
Live video⚡ UDP
Email or messages✅ TCP
VoIP call⚡ UDP
Online transactions✅ TCP
Multiplayer game⚡ UDP
TCPUDP
ReliableFast
Error checkedNo error check
Ordered deliveryData loss possible
Web, email, FTPStreaming, gaming

❓ 5 multiple-choice questions

  1. Which protocol guarantees the order of packets?

    • A) UDP
    • B) TCP
    • C) HTTP
    • D) FTP
  2. For smooth video calls, which protocol is better?

    • A) TCP
    • B) UDP
    • C) SSH
    • D) SMTP
  3. UDP is best when:

    • A) You can’t tolerate delays
    • B) You want confirmations
    • C) You need encryption
    • D) You want something lightweight and fast
  4. The main problem with UDP is:

    • A) It’s slow
    • B) It repeats data
    • C) It lacks control
    • D) It’s expensive
  5. When sending critical data over TCP, you can expect:

    • A) Maximum speed
    • B) Ordered and complete delivery
    • C) Lost packets
    • D) No confirmation

✅ Answers

  1. B
  2. B
  3. D
  4. C
  5. B
© Nc6 by Giuseppe Fanuzzi - IT08952900721 - PIQA6QP