port number

What is a port number?

A port number is a way to identify a specific process to which an internet or other network message is to be forwarded when it arrives at a server. All network-connected devices come equipped with standardized ports that have an assigned number. These numbers are reserved for certain protocols and their associated function. Hypertext Transfer Protocol (HTTP) messages, for example, always go to port 80 -- one of the most commonly used ports.

Developers of the Advanced Research Projects Agency Network, an informal cooperation of system administrators and software authors, proposed the concept of port numbers. Once known as socket numbers, the early incarnation of port numbers is similar to the Internet Protocol (IP) address class used today.

What is the difference between an IP address and a port number?

An IP address identifies a machine in an IP network and is used to determine the destination of a data packet. Port numbers identify a particular application or service on a system.

structure of a data packet
An IP address identifies a machine in an IP network and determines the destination of a data packet, while port numbers identify particular applications or services on a system.

An IP address is a logical address used to identify a device on the network. Any device connected to the internet is assigned a unique IP address for identification. This identifying information enables devices to communicate over the internet.

Port numbers are part of the addressing information that helps identify senders and receivers of information and a particular application on the devices. Port numbers consist of 16-bit numbers.

For example, a user request for a file transfer from a client, or local host, to a remote server on the internet uses File Transfer Protocol (FTP) for the transaction. Both devices must be configured to transfer files via FTP. To transfer the file, the Transmission Control Protocol (TCP) software layer in local host identifies the port number of 21, which, by convention, associates with an FTP request -- in the 16-bit port number integer that is appended to the request.

At the server, the TCP layer will read port number 21 and forward the request to the FTP program at the server.

passive vs. active FTP
FTP uses ports 20 and 21 to transfer files between a client and a server.

What are the different types of port numbers and their uses?

There are 65,535 port numbers, but not all are used every day.

Restricted port numbers or well-known port numbers are reserved by prominent companies and range from 0 to 1023. Apple QuickTime, Structured Query Language services and Gopher services use some of these restricted ports.

Those who want to register a specific port number can choose from 1024 to 49151. Software companies typically register these port numbers. Dynamic or private ports ranging from 49152 to 65536 are available for anyone to use.

In another scenario, a port number is assigned temporarily -- for the duration of the request and its completion -- from a range of assigned port numbers. This is called a temporary port number.

Here are some commonly used ports and their associated networking protocols:

  • Ports 20 and 21. FTP is used to transfer files between a client and a server.
  • Port 22. Secure Shell is one of several tunneling protocols used to build secure network connections.
  • Port 25. Simple Mail Transfer Protocol (SMTP) is commonly used for email.
  • Port 53. Domain name system (DNS) is a critical process that matches human-readable domain names to machine-readable IP addresses on the modern internet. It helps users load websites and applications without typing in a long list of IP addresses.
  • Port 80. HTTP is the protocol that enables the World Wide Web.
  • Port 123. Network Time Protocol helps computer clocks sync with each other. It's a vital process in encryption
  • Port 179. Border Gateway Protocol (BGP) helps establish efficient routes between the large networks or autonomous systems that make up the internet. These large networks use BGP to broadcast which IP addresses they control.

The Internet Assigned Numbers Authority allocates and maintains all the port numbers listed above.

What are common questions raised about port numbers?

What is the port number for localhost?

Localhost is the default name used to establish a connection with a computer. The IP address is usually This is done by using a loopback address network. Port 80 is the common standard port for HTTP.

What is port number 8080 used for?

Port number 8080 is usually used for web servers. When a port number is added to the end of the domain name, it drives traffic to the web server. However, users can not reserve port 8080 for secondary web servers.

What is port number 3360 used for?

TCP/IP networks use port 3360. The connection-oriented protocol TCP demands handshaking to set up end-to-end communications. Upon establishing the connection, user data is transferred bidirectionally over the connection.

What is my IP address and port number?

The easiest way to find a router's public IP address is to search "what is my IP?" on a search engine like Google. Identifying a port number will depend on the operating system.

For Windows:

  • Go to the command prompt.
  • Type ipconfig.
  • Then, type netstat to populate a list of all the port numbers.

For macOS:

  • Go to System Preferences.
  • Next, go to Network > Advanced.
  • Click on the Port Scan tab, and enter the user's IP address.

What is a proxy server address and port number?

A proxy server is, essentially, a computer on the internet with its own IP address. It sits between the client device and the remote server and acts as an intermediary to handle communication requests over the internet.

When a local computer sends a web request, it automatically goes through the proxy server. The proxy server uses its own IP address for the web request and not the user's. Proxy servers offer privacy benefits -- for example, the ability to change the client IP address, masking the user's location.

The proxy server address includes an IP address with the port number attached to the end of the address. The port number 8080 is usually used for web servers, proxy and caching.

What is the port number for Gmail?

Gmail uses both Internet Message Access Protocol (IMAP) and SMTP. The IMAP port is 993, and the SMTP port is 25.

This was last updated in July 2021

Continue Reading About port number

Dig Deeper on Network infrastructure

Unified Communications
Mobile Computing
Data Center