Network Ports Explained

Network Ports Explained

What exactly is a network port?

In this context, ports refer to virtual connections that are utilized by services and applications to exchange data, rather than physical LAN connections. It specifically determines the application or service that will be used on a server, computer, or network device, for example, opening an email, utilizing an FTP service, or pulling up a webpage.

Each port is uniquely identified by a specific series of numbers. The value is between 0 and 65535. For instance, ports 80 and 443 are frequently utilized for web pages. Email is sent via port 25, while FTP is sent over port 21.

IP address and port number combination

An IP address, which is a numeric address is always linked to a port number. It serves as a network device or computer’s unique identifier. For communication to take place, each device needs to have an IP address.

Working in concert, an IP address and a port number allow data to be transmitted or exchanged over a network. For instance, the IP address is used to identify the geographical location of a server when you wish to connect to it on the internet, i.e. the continent, nation, city, and so forth. Additionally, a port number determines which program or service it wants to use be it email, FTP, web pages, or something else entirely.

Let’s pick a popular port that almost everyone uses on a daily basis i.e.?port 80. Web sites are connected to HTTP through port 80. Whether you realize it or not, port 80 is always used when you access a website from your PC.

Launching a web browser and typing google.com into the address box will take you to Google’s website. However, your computer must perform a few tasks before it can display the Google website.

It must translate Google’s IP address from the google.com domain name. Furthermore, because you are utilizing an HTTP web browser, your computer will add port 80 to the IP address, after which the IP address will then be used to locate Google’s web server.

The IP address has then completed its task once the server has been located. Now it’s the turn of the port number. Finally, you will be able to access Google’s website since its web server will detect the incoming request with port 80 and pass it to its built-in web service.

The port number and IP address that are in use work in the background. Nevertheless, the netstat program offers a method by which you can view them. Network statistics, or netstat for short, is a command-line utility that shows your computer’s active ports and network connections (for Windows operating system).


Launching the command prompt you would type in netstat –n and press enter. The output will display the port number that your computer has assigned itself for this session in addition to your computer’s local address, separated by a colon. The default port for HTTPS, 443, is provided along with the foreign address. Because port 443 is specifically intended for HTTPS (HyperText Transport Protocol Secure) services, it is the default port for HTTPS (encrypted) traffic.

Let’s say that Google has an FTP server up and operating, from which customers can send files. Using port number 21, FTP is the common protocol used to move files over a network between computers and servers.

You can see the same thing happen again on your computer if you open a web browser and, for instance, type in ftp.google.com. Since you’re using FTP, your computer will add port 21 to the IP address, converting the domain name google.com to Google’s IP address.

The Google Server will route the request to its integrated FTP service as soon as it detects an incoming request with port number 21. Additionally, if you run the same netstat query once more, port number 21 will be shown as the connection to Google’s FTP service.

Port number categories

The range of port numbers is 0 to 65535. The Internet Assigned Numbers Authority is the entity that assigns them. And there are three categories for these 65,000+ port numbers.

Port numbers 0 through 1023 are referred to as system or well-known ports. The majority of users frequently use these ports. Among these are ports 80, 443, 25, and 21.

The port range 1024 through 49151 is referred to as registered or user port range. These are ports that businesses and developers can register for a specific service.

The port numbers 49152 through 65535 are referred to as private or dynamic ports. You are free to use these client-side ports. During a session, your computer will temporarily assign these port numbers to itself, as in the case of browsing a webpage.

Of these three categories, the first two are utilized on a server; they are the well-known?and registered port numbers. Your computer connects to a server that uses the first two categories of ports.

However, the third type, known as dynamic or private port numbers, is utilized on a client, which is your computer. Your computer allocates itself one of these port numbers whenever it wants?to use a service or program on a different computer or server.

On your computer, you may occasionally see that popular ports like 21 and 80 are in use. For instance, if you?use the netstat -an command, you?can observe that ports 21 and 80 are either listening?or have established a?connection.

Clients do not use these port numbers; servers do. But, servers aren’t necessarily have to be large robust PCs. Your computer can act as a server that other computers connect to.

For instance, port 21 and port 80 that are either listening or have an established connection which?will be visible to you if your computer is hosting a website or an FTP service,?since you can?set up your computer to function as a server and accept incoming connections.

You could launch your computer and link to a few websites, such slimbztechsystems.com and linkedin.com. Next, you could establish an additional connection to an FTP server.

The local IP address of your machine and the dynamic or private client-side port numbers that are in use for that specific session?should be visible if you run the same netstat -n command again. The two IP addresses of the websites to which your computer is linked will then be displayed, along with port 80, which is designated for websites. Additionally, you will be able to see the single FTP site to which you are connected via port number 21.

When connecting to a website, port 443 is frequently displayed in place of port 80. And the reason for this is that web sites use both of these port numbers. However, port 80 differs in that it uses HTTP, which is meant for standard, insecure websites. But HTTPS is used on port 443, where the S stands for secure. It is used to visit websites with security features. Furthermore, many websites are now using port 443 rather than port 80.

Boney Maundu

Tech Contractor & Writer

Slim Bz TechSystems: Nairobi

要查看或添加评论,请登录

Boney Maundu的更多文章

社区洞察

其他会员也浏览了