Skip to main content

Command Palette

Search for a command to run...

TCP, UDP, and HTTP

Published
2 min readView as Markdown

When data moves on the internet, it doesn’t move randomly.
There are rules that decide how data is sent, how fast, and how safely.

These rules are called protocols.

Think of protocols as agreements:

“This is how we send data. Follow these rules.”

Why the Internet Needs Rules at All

Imagine sending a parcel without:

  • Address

  • Tracking

  • Delivery confirmation

Chaos, right?

Same with the internet.
To send data properly, computers need rules.

Two important protocol are to send a data

  • TCP

  • UDP

What is TCP ?

TCP stands for Transmission Control Protocol its ensure that whatever data is send make it all the packet which is transfer safe and complete TCP make sure nothing is lose..

What TCP does:

  • Sends data in order

  • Checks if data is received

  • Resends missing data

  • Makes sure nothing is lost

TCP is more Reliable and Its slow also because its doing 3 way handshake

What is UDP?

UDP Stand for User Datagram Protocol

UDP is used when speed matters more than accuracy.

What UDP does:

  • Sends data fast

  • Does NOT check if data arrived

  • Does NOT resend missing data

Simple example:
Live announcement on Viedo calling App.
If you miss it, it’s gone.

UDP is fast but not reliable.

Key Differences Between TCP and UDP

TCPUDP
ReliableNot reliable
SlowerFaster
Checks deliveryNo delivery check
Resends dataNo resend
Ordered dataNo order guarantee

What is HTTP?

Now comes the confusion part for beginners.

HTTP is NOT TCP.

HTTP is a higher-level rule.

HTTP decides:

  • How request looks

  • How response looks

  • Status codes (200, 404, 500)

  • Headers and body

HTTP does NOT send data itself.

Relationship Between HTTP and TCP

Think like this:

  • TCP → how data is transported

  • HTTP → what the data means

HTTP runs on top of TCP

HTTP says:

“Send a GET request for /login

TCP says:

“Okay, I’ll deliver it safely.”

Why HTTP Does Not Replace TCP

HTTP:

  • Does not guarantee delivery

  • Does not handle packet loss

  • Does not manage connections

So HTTP needs TCP to work.

Without TCP:

  • HTTP messages could break

  • Data could be lost

  • Websites would fail

More from this blog

Madin Bloch

18 posts