What is a port number and how to find it?

3 min

A ‘port’ and ‘port number’ are somewhat obscure online networking concepts, though they are crucial for the modern Internet architecture. What is my port? What is my port number? In this article, you can learn the basics and find out what a port and its number are, how they are important, and what are the examples. Read on!

What is my IP and port?

The first part of this question is a bit tricky. IP stands for “Internet Protocol”, but what we really need to know is actually an IP address: a 32-bit or 128-bit number identifying a device (or a group of devices) in the network. A physical port is simply a kind of socket. In a computer, it is where you plug in a certain cable: Ethernet, USB, HDMI, and others. In software engineering, there can be virtual ports. They signify logical points of connection. Most commonly it is about connectivity within TCP/IP networks. IP ports are a parameter of a network socket, along with a transport protocol and an address. 

‘But what is my TCP port?’ one could ask. The answer is not as obvious as with an IP number. Various online services use a range of ports on your device, which still have the same IP address. The mentioned trio: protocol, IP address, and port are used to identify the source and destination processes during data transmission in the network. 

What is a port number?

It is a 16-bit port identifier, so it is in the range from 0 to 65535. Many numbers are associated with specific Internet services by worldwide conventions. The IANA (Internet Assigned Numbers Authority) organization is responsible for official assignments of port numbers. Due to practical and historical reasons, there are three sub-groups of port numbers:

  1. Well-known ports (0 to 1023) are designated for the widely used online services. Examples include: FTP (20 and 21), HTTP (80), SSH (22), SMTP (25), DNS (53), POP3 (110), HTTPS (443)
  2. Registered ports (1024 to 49151) are assigned by IANA for specific services upon a request. An organisation can apply for a port number to be used specifically for a given online service.
  3. Dynamic or private ports (49152 to 65535) are not managed officially. They are used for private (in-house) or temporary purposes.

What is my port ID or number, then? In simple words, it is an endpoint for a remote process to connect to.

How to find port numbers?

There are many misconceptions about Internet architecture. It is easy enough to explain the idea of IP address. But what is my port number? What is my server port? You need to remember this is not something you can find written on your notebook bottom, nor in any system settings. Ports are a way of managing the network traffic so that separate services can share a single online connection. But they are virtual entities, so the running tasks choose them based on the above conventions. How to find a port number in a specific case? Let’s take a look at VPN services for instance. There are several popular VPN protocols in use, some of which have their own port numbers assigned. VPN providers choose one and create a program that establishes a secure connection automatically, using the designated port number. Examples include:

  • OpenVPN – a popular and open-source VPN system with registered port number 1194.
  • PPTP – an obsolete standard, does not support security features and was vulnerable to attacks. Still has its own port 1723.
  • L2TP – also does not implicitly assure encryption, so most often is used in combination with safety protocol IPsec. As a result, two ports are employed: 500 and 1701.
  • SSTP – far safer than PPTP. Uses modern encryption standards. Does not have its own port, by default uses the one for TCP (number 443).

As you see, there is a range of solutions just for this one online service. The port number in use usually depends on the implementation details. Fortunately, most of the time you don’t need to worry about it. There is a lot of overhead in Internet connectivity for the software to care about, so you can just focus on your online experience. Network ports are vital for the Web, but not for everyday web browsing.

BackNext article