Certopolis

CompTIA A+ Core 1

Common TCP and UDP port numbers for A+ Core 1

Each network service listens on a port registered by IANA. The A+ set includes FTP 20 and 21, SSH 22, Telnet 23, SMTP 25, DNS 53, DHCP 67 and 68, HTTP 80, POP3 110, NetBIOS 137 to 139, IMAP 143, SNMP 161 and 162, LDAP 389, HTTPS 443, microsoft-ds 445 and ms-wbt-server 3389.

The registered ports

From the IANA service name and port number registry: 20 ftp-data (File Transfer, default data), 21 ftp (File Transfer Protocol, control), 22 ssh, 23 telnet, 25 smtp.

53 domain (Domain Name Server), 67 bootps and 68 bootpc (used by DHCP), 80 http, 110 pop3, 137 netbios-ns, 138 netbios-dgm, 139 netbios-ssn, 143 imap.

161 snmp, 162 snmptrap, 389 ldap, 427 svrloc (Server Location), 443 https (HTTP over TLS/SSL), 445 microsoft-ds, 548 afpovertcp (AFP over TCP), 3389 ms-wbt-server (MS WBT Server).

FTP uses two ports

RFC 959 keeps FTP commands and data on separate connections. Login and commands go over the control connection on port 21.

The server's default data port is the port next to the control port, L-1, which is port 20. The LIST command's output, a directory listing, travels over the data connection, not the control connection. So file names and file contents use port 20; the commands that asked for them use port 21.

DNS uses TCP as well as UDP

RFC 1035 says name servers accept TCP and UDP on port 53. UDP is the recommended method for standard queries.

RFC 1035 also says UDP is not acceptable for zone transfers. A secondary DNS server copying a whole zone from the primary therefore needs TCP port 53 open.

NetBIOS is three ports

IANA assigns 137 to the NETBIOS Name Service, 138 to the NETBIOS Datagram Service and 139 to the NETBIOS Session Service. Name lookups on 137, datagrams on 138 and sessions on 139 together mean NetBIOS over TCP/IP.

Where the exam catches people

  • Believing a directory listing comes back on port 21: port 21 carries commands only, and RFC 959 sends LIST output over the data connection, port 20 by default.
  • Believing DNS is UDP only: RFC 1035 rules out UDP for zone transfers, so they need TCP port 53.
  • Believing a block on port 53 only affects mail or file sharing: it stops name resolution, so sites open by IP address but not by name.
  • Believing 445 is one of the NetBIOS ports: IANA lists 137 to 139 as NetBIOS services and 445 separately as microsoft-ds.

Written from CompTIA's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A technician captures traffic between a workstation and an FTP server that uses its default ports. The user logs in, then requests a directory listing, and the server returns the list of file names. Which of the following server ports carries that list of file names?

    Right. In the game that’s Renown for your Networking building.

    Not that one: B is right. In the game your Networking building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    IANA registers that default data port, ftp-data, as port 20.

    Written from www.iana.org/assignments/service-names-port-numbers/

  2. A branch office's secondary DNS server must copy every record in the organization's zone from the primary DNS server at headquarters. The firewall between the two sites blocks all traffic by default. Which of the following must the technician allow for the copy to succeed?

    Right. In the game that’s Renown for your Networking building.

    Not that one: A is right. In the game your Networking building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    IANA registers the domain service on TCP port 53, so the firewall must allow TCP port 53.

    Written from www.iana.org/assignments/service-names-port-numbers/

  3. A technician capturing traffic from a legacy file-sharing setup sees name lookups on UDP port 137, datagrams on UDP port 138 and sessions on TCP port 139. Which of the following protocols uses these ports?

    Right. In the game that’s Renown for your Networking building.

    Not that one: D is right. In the game your Networking building would lose a little Renown, and this question would come back later.