Ports and protocols

6 free practice questions for the CompTIA® A+® Core 1 (220-1201) exam, from the networks and protocols domain. Pick an answer, then open the explanation to check it.

Every question is original and written for Gapwise with AI. Two separate AI reviewers answered each one without seeing the answer key and checked it against the cited public sources. These are not real exam questions.

Question 1

A user's older mail client downloads messages with Post Office Protocol 3 (POP3) and does not use encryption. The mail server sits behind a firewall. Which server port must the firewall allow so the client can download mail?
  1. A. Port 143
  2. B. Port 25
  3. C. Port 110
  4. D. Port 389
Show the answer and explanation

Answer: C. Port 110

Unencrypted POP3 uses port 110. Its retrieval sibling IMAP uses port 143, and SMTP on port 25 handles sending. Keeping the three mail ports straight (25 send, 110 POP3, 143 IMAP) solves most mail-client firewall tickets.

Why each option is right or wrong

  • A. Incorrect. Port 143 is IMAP, the other mail retrieval protocol. A client set for POP3 does not connect there.
  • B. Incorrect. Port 25 is SMTP, used to send and relay mail, not to download it from a mailbox.
  • C. Correct. POP3 is registered on port 110, so unencrypted POP3 downloads need it.
  • D. Incorrect. Port 389 is LDAP, used to query directory services, not to retrieve mail.

References

Question 2

A technician can open a network printer's settings page at http://192.168.1.50, but https://192.168.1.50 fails immediately with "connection refused." What is the MOST likely explanation?
  1. A. The printer has no DNS record, so the https:// address cannot be resolved.
  2. B. The printer's web server listens on TCP port 80, but nothing listens on TCP port 443.
  3. C. HTTP and HTTPS share TCP port 80, so the printer refuses a second session.
  4. D. The browser sends https:// requests to TCP port 8443 by default, which the printer blocks.
Show the answer and explanation

Answer: B. The printer's web server listens on TCP port 80, but nothing listens on TCP port 443.

An http:// address with no port goes to TCP 80, and an https:// address goes to TCP 443. "Connection refused" means the device answered but nothing is listening on that port, so the printer's HTTPS service is off or not set up. Turning on HTTPS in the printer's settings, usually with a certificate, fixes it and encrypts the admin session.

Why each option is right or wrong

  • A. Incorrect. Both addresses use the IP address directly, so no DNS lookup takes place. Name resolution cannot explain the difference.
  • B. Correct. http:// defaults to TCP 80 and https:// to TCP 443. A refused connection on 443 means the printer has no HTTPS service running there.
  • C. Incorrect. HTTPS does not share port 80; its default is TCP 443. A web server also handles many sessions on one port.
  • D. Incorrect. Browsers use TCP 443 for https:// when no port is given. Port 8443 is used only when the address names it.

References

Question 3

A user at a branch office can log in to a partner's File Transfer Protocol (FTP) server. Every directory listing and download then hangs until it times out. The branch firewall allows outbound connections but drops all unsolicited inbound ones, and the FTP client is set to active mode. Which change is MOST likely to fix the transfers?
  1. A. Allow outbound TCP port 21 through the branch firewall
  2. B. Have the partner move the server's login service to TCP port 20
  3. C. Switch the client to passive mode so it opens the data connection
  4. D. Send the transfers over UDP so no data connection has to be set up
Show the answer and explanation

Answer: C. Switch the client to passive mode so it opens the data connection

FTP uses one connection for commands and a second one for each listing or file. In active mode the server opens that data connection back to the client, which the branch firewall drops as unsolicited inbound traffic. Passive mode reverses the direction: the server waits on a data port and the client connects outward. Memory hook: in passive mode the server sits passively and waits.

Why each option is right or wrong

  • A. Incorrect. Port 21 carries the control connection, and the login already succeeds, so that connection is getting through. The failure is on the separate data connection.
  • B. Incorrect. Port 20 is the server's default data port, not a login port. Moving the control service there would not change who opens the data connection.
  • C. Correct. In passive mode the server listens on a data port and the client connects out to it. The branch firewall allows outbound connections, so listings and downloads can flow.
  • D. Incorrect. FTP runs its control and data connections over TCP. There is no UDP mode to switch to, and the problem is the direction of the data connection, not the transport.

References

Question 4

A field technician's tablet has little free storage and a slow cellular link. The user wants to browse and search the whole mailbox while it stays on the server. Each message body or attachment should download only when the user opens it. Which incoming mail setting fits BEST?
  1. A. Post Office Protocol 3 (POP3) on TCP port 110
  2. B. Simple Mail Transfer Protocol (SMTP) on TCP port 587
  3. C. Internet Message Access Protocol (IMAP) on TCP port 143
  4. D. Server Message Block (SMB) on TCP port 445
Show the answer and explanation

Answer: C. Internet Message Access Protocol (IMAP) on TCP port 143

IMAP is built for working with mail that stays on the server: it can search there and fetch just the attributes, text, or parts a client asks for. A tablet can list messages cheaply and pull a body or attachment only when opened. POP3 instead downloads whole messages, which costs storage and bandwidth.

Why each option is right or wrong

  • A. Incorrect. POP3 is designed to download whole messages, normally removing them from the server. It has no server-side search or partial fetching.
  • B. Incorrect. SMTP on port 587 is for submitting outgoing mail. It can't read or search a mailbox.
  • C. Correct. IMAP leaves mail on the server and supports server-side searching and fetching only selected parts of a message. That saves both storage and bandwidth.
  • D. Incorrect. SMB provides file and printer sharing. It is not a mail retrieval protocol.

References

Question 5

A clinic's old mail client signs in to its Post Office Protocol 3 (POP3) server on TCP port 110 without TLS, using the basic USER and PASS commands. A technician captures that traffic while troubleshooting. What can be read in the capture?
  1. A. The user name, but the password travels as a hash
  2. B. Nothing readable, because the server encrypts the session
  3. C. Message headers, but not the bodies of the messages
  4. D. The password and the full text of each downloaded message
Show the answer and explanation

Answer: D. The password and the full text of each downloaded message

Basic POP3 sign-in with USER and PASS sends the password as plain text, and retrieving messages sends their contents as plain text too. That is why clients should use POP3 over TLS or switch to an encrypted alternative. The tempting wrong answer assumes a hash, which only the separate APOP command uses.

Why each option is right or wrong

  • A. Incorrect. The PASS command sends the password itself in the clear. Hashing applies only to the separate APOP sign-in method.
  • B. Incorrect. Plain POP3 on port 110 has no built-in encryption. Without TLS, the whole session crosses the network as readable text.
  • C. Incorrect. When the client retrieves a message, the whole message is sent in the clear, body included.
  • D. Correct. POP3's PASS command sends the password in the clear, and its retrieval commands send mail in the clear. Anyone capturing the traffic can read both.

References

Question 6

A help desk app signs in to the company directory with a Lightweight Directory Access Protocol (LDAP) simple bind on TCP port 389, without TLS. A packet capture shows the app's service account password as readable text. Which change BEST protects the password while the app keeps using LDAP?
  1. A. Move the directory's listener from TCP 389 to UDP 389
  2. B. Connect with LDAP over TLS on TCP port 636
  3. C. Keep port 389 and change the service account's password each month
  4. D. Send the lookups through a web page on TCP port 80
Show the answer and explanation

Answer: B. Connect with LDAP over TLS on TCP port 636

An LDAP simple bind sends a cleartext password, which is only safe when the connection itself is protected. Adding TLS, as with LDAP over TLS on port 636, encrypts the bind and the queries. Changing ports or transports without TLS leaves the password readable.

Why each option is right or wrong

  • A. Incorrect. Changing the transport does not add encryption. The simple bind would still carry the password in the clear.
  • B. Correct. Port 636 is registered for LDAP over TLS. The TLS layer encrypts the bind, so the password no longer crosses the network as readable text.
  • C. Incorrect. Each new password would still be sent in the clear and could be captured the same way. Rotation doesn't fix the exposure.
  • D. Incorrect. Plain HTTP on port 80 is also unencrypted, and the app would no longer be using LDAP. The password would still be exposed.

References