Networking Basics ยท 12

๐Ÿšช Port Numbers & Services

How your computer handles dozens of apps talking at onceโฑ ~2 min

๐ŸขIP address is the building, port number is the office

Imagine a large office building. The street address gets you to the building (IP address). But once inside, you need a room number to find the right person. Port 80 is the web server's office. Port 443 is the HTTPS web server's office. Port 22 is where the SSH remote access person sits. Your computer can have hundreds of conversations at once because each gets its own port number.

How Ports Work

  • โ€ขPort numbers range from 0 to 65535
  • โ€ขWell-known ports (0โ€“1023): reserved for standard services, assigned by IANA
  • โ€ขRegistered ports (1024โ€“49151): used by specific applications (e.g., 3389 for Remote Desktop)
  • โ€ขDynamic/ephemeral ports (49152โ€“65535): assigned randomly to client connections
  • โ€ขA socket = IP address + port number. Example: 93.184.216.34:443 = example.com HTTPS
  • โ€ขEvery network conversation is identified by: source IP:port โ†” destination IP:port

Essential Port Numbers to Know

PortProtocolServiceUsed For
20 / 21TCPFTPFile transfer (21=control, 20=data)
22TCPSSHSecure remote terminal access
23TCPTelnetInsecure remote access (never use!)
25TCPSMTPSending email between servers
53UDP/TCPDNSDomain name resolution
67/68UDPDHCPIP address assignment
80TCPHTTPUnencrypted web traffic
110TCPPOP3Download email (deletes from server)
143TCPIMAPSync email (stays on server)
443TCPHTTPSEncrypted web traffic (TLS)
3389TCPRDPWindows Remote Desktop

Email Protocols Explained

POP3 (Port 110)
  • โ€ขDownloads email to your device
  • โ€ขDeletes from server after download
  • โ€ขWorks offline after download
  • โ€ขEmail only exists on one device
  • โ€ขOlder โ€” less common today
IMAP (Port 143)
  • โ€ขSyncs email โ€” stays on server
  • โ€ขSame inbox on phone, laptop, tablet
  • โ€ขDelete on one device = deleted everywhere
  • โ€ขNeeds internet to access email
  • โ€ขModern standard โ€” used by Gmail, Outlook
๐Ÿ”’ SecurityTelnet (port 23) sends everything โ€” including passwords โ€” as plain unencrypted text. Anyone with a packet sniffer on the same network can read every character you type. SSH (port 22) encrypts the entire session: it uses public-key cryptography to authenticate and establish a shared key, then switches to fast symmetric encryption (like AES) for the actual data. This is why Telnet is disabled on every modern network device and SSH is the universal replacement. In CyberPatriot, finding and disabling Telnet and enabling SSH is a scored hardening task on Cisco devices.
โ˜… FactWhen you visit a website, your browser picks a random high-numbered ephemeral port (like 54231) for the return trip. The conversation is: your IP:54231 โ†’ server IP:443. The server's reply comes back addressed to port 54231. This is how your computer knows which browser tab gets which response โ€” not all traffic goes to the same port.
๐Ÿง Quick Checkfirst try = +5 XP

A security scan of a server reveals these open ports: 22, 23, 80, 443, 3389. Which port is an IMMEDIATE security concern that should be closed?

โญ 0 XP๐Ÿ”ฅ 0 days