Free tech learning for everyone, from basics to pro

Start hereNetworking fundamentalsBasics

TCP, UDP and port numbers in simple terms

In short: IP gets data to the right device; port numbers get it to the right app. TCP delivers reliably with checks and resends; UDP is faster with no guarantees.

Two ways to deliver data

TCPUDP
ComparisonA tracked parcel with delivery confirmationA postcard: quick, but no confirmation
ReliabilityChecks everything arrived, in order; resends anything lostNo checking or resending
SpeedA little slowerFaster, less overhead
Used forWebsites, email, file transfers, SSHVoice and video calls, gaming, DNS lookups, live streams
Tracked parcel or postcard?TCP: tracked parcelHandshake before sendingEvery piece is confirmedLost pieces are resentWeb, email, file downloadsUDP: postcardJust sends straight awayNo confirmationLost pieces are skippedCalls, games, DNS lookups
Figure 1. TCP is like a tracked parcel that must arrive complete, while UDP is like a postcard that arrives quickly but without any guarantee.

The TCP handshake

Before sending data, TCP sets up a connection in three steps: SYN ("can we talk?"), SYN-ACK ("yes, can you hear me?"), ACK ("yes, let's start").

What port numbers do

A server can run many services at once. The IP address finds the device; the port number finds the app, like a flat number in an apartment building.

PortService
22SSH (secure remote login)
53DNS
80HTTP (unencrypted web)
443HTTPS (encrypted web)
3389Remote Desktop (RDP)

Look up more with the free port lookup tool.

Why this matters for security

Firewalls allow or block traffic by IP address and port. Closing ports you don't need is one of the simplest ways to reduce risk.

Real-world example: a video call and a download at the same time

At home, one person is on a video call while someone else downloads a large game update on the same Wi-Fi. The connection gets busy for a moment.

On the video call, the picture briefly turns blocky or a word drops out, then the call carries on. That is typical UDP behaviour: a missing piece of a live conversation is no use a second later, so the app simply moves on. The game update just slows down for a moment, but when it finishes, every byte is correct. That is TCP: anything lost is sent again, so the file is never corrupted, even if it takes a little longer.

Both streams arrive at the same devices through the same router. Port numbers keep them apart, so the call audio goes to the calling app and the download goes to the game launcher.

Try this: on Windows, open a few websites and run netstat -ano. Look at the "Foreign Address" column: entries ending in :443 are your secure web connections.

Key takeaways

  • IP finds the device; the port finds the app.
  • TCP = reliable and ordered; UDP = fast with no guarantees.
  • TCP starts with a three-step handshake: SYN, SYN-ACK, ACK.
  • Close ports you don't need.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.