- Practice
- About 13 min
- 5 practice questions
Protocols and port numbers: matching drills
Match each common protocol to its job and port number, and avoid the usual mix-ups between sending and receiving mail and between secure and insecure versions.
If something looks wrong, please tell us.
A protocol is an agreed set of rules for communication. Exams give you a job and ask for the protocol, or give a protocol and ask for its job or port number. The list is short. Learn it as a table and then practise the pairs that are easy to confuse.
The table to learn
| Protocol | Job | Default port |
|---|---|---|
| HTTP | Transfers web pages | 80 |
| HTTPS | Transfers web pages with encryption | 443 |
| FTP | Transfers files between computers | 21 |
| SSH | Secure remote login | 22 |
| Telnet | Remote login without encryption | 23 |
| SMTP | Sends email | 25 |
| DNS | Converts domain names to IP addresses | 53 |
| POP3 | Downloads email from the server | 110 |
| IMAP | Reads email kept on the server | 143 |
| DHCP | Gives IP addresses automatically | 67 and 68 |
A port number identifies the service on a computer, in the way that a room number identifies a room in a building. The IP address finds the computer, and the port finds the program on it.
TCP and UDP
- TCP: sets up a connection, numbers the data, checks that it arrived and resends it if lost. Reliable but with more overhead. Used by web pages, email and file transfer.
- UDP: sends data with no connection and no check. Faster and lighter but not reliable. Used where speed matters more than perfect delivery, such as live video, voice calls and DNS queries.
The look-alike pairs
- SMTP versus POP3 and IMAP: SMTP sends; POP3 and IMAP receive.
- POP3 versus IMAP: POP3 usually downloads mail to one device; IMAP leaves mail on the server so several devices see the same mailbox.
- HTTP versus HTTPS: the S means secure; HTTPS encrypts the connection.
- Telnet versus SSH: both give remote login; SSH is encrypted, Telnet is not.
- FTP versus HTTP: FTP is for moving files, HTTP for web pages.
- DNS versus DHCP: DNS turns names into addresses; DHCP hands out addresses.
Worked examples
Example 1. Your email program sends a message to the mail server. Which protocol? Sending is SMTP. When it later fetches new mail and leaves a copy on the server for your phone to see as well, IMAP is used.
Example 2. A web address starts with https. Which port does the browser use by default? 443, because HTTPS has the default port 443. HTTP uses 80.
Example 3. A new laptop joins the office network and receives an address without anyone typing it. Which protocol did this? DHCP.
Example 4. A system administrator must log in to a remote server over the Internet and wants the session to be private. SSH, not Telnet, because Telnet sends text without encryption.
Example 5. A question gives the port number 53 and asks for the service. Port 53 belongs to DNS, which translates names such as a website name into the numeric address. If the question gives port 25, the answer is SMTP, because the mail is being sent. A quick way to remember the five most-asked numbers is: 21 file transfer, 22 secure login, 25 send mail, 53 names, 80 and 443 the web.
SMTP sends. POP3 and IMAP receive. HTTPS is HTTP plus encryption. DNS finds, DHCP gives.
Key takeaways. Learn the table of protocols and ports. Keep the sending protocol (SMTP) apart from the receiving ones (POP3, IMAP), and the secure versions (HTTPS, SSH) apart from the insecure ones (HTTP, Telnet). TCP is reliable and UDP is fast.
Check your understanding
-
1. Which protocol is used to send email from a client to a mail server?
- POP3
- IMAP
- SMTP
- FTP
Show answer
Answer: C. SMTP is the sending protocol. POP3 and IMAP are used to receive mail.
-
2. What is the default port number for HTTPS?
- 80
- 443
- 21
- 25
Show answer
Answer: B. HTTPS uses port 443 by default, while HTTP uses 80.
-
3. Which protocol automatically assigns IP addresses to devices?
- DHCP
- DNS
- SMTP
- SSH
Show answer
Answer: A. The Dynamic Host Configuration Protocol hands out IP addresses automatically.
-
4. Which pair correctly contrasts secure and insecure remote login?
- SSH is insecure, Telnet is secure
- FTP is secure, SSH is insecure
- Telnet is encrypted, FTP is not
- SSH is encrypted, Telnet is not
Show answer
Answer: D. SSH encrypts the session; Telnet sends everything as plain text.
-
5. Live video calls often prefer which transport protocol?
- TCP
- UDP
- SMTP
- HTTPS
Show answer
Answer: B. UDP is faster with less overhead, and a small loss is acceptable in live video.
Sign in to keep track of the lessons you finish.