'Why does my computer have active ports if it isn't a server? [closed]

As I know, only servers have active ports, but when doing "netstat -a" in command prompt there are actually many listening ports in my computer which is not a server. Why is that?



Solution 1:[1]

One reason at least is that you'll have TCP connections open to servers on the Internet and both sides of the connection (client as well as server) have a port associated with them.

You could show us the lines from netstat and point out which ones, in particular, you're concerned about.

Solution 2:[2]

As I know, only servers have active ports ...

That is incorrect knowledge.

  • Most non-server computers will have one or more local system services listening on the loopback IP address; e.g. 127.0.0.1 if you are using IPv4. Examples of such services include SMTP and SYSLOG.

  • Some operating systems enable ports to allow remote access or remote debugging.

  • Some applications work by providing a local HTTP service which the user can connect to using a conventional or embedded web browser.

  • Some applications work by connecting to a local database via the loopback IP address. The local database service will be listening.

  • Some application protocols (e.g. classic FTP) use a reverse connection from server to client. In FTP this is referred to as "active mode".

  • And so on.

In short, there are lots of situations where a non-server machine will need to listen for network connections on either local or external ports.

The notion of a "server" is far more nuanced than your "knowledge". And the netstat -a output is (probably1) demonstrating that.


1 - It is also possible that you have unwanted entries in the netstat -a; i.e. local services or applications that shouldn't be listening for incoming connection. But we can only distinguish the "good" and "bad" on a case-by-case basis.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ndc85430
Solution 2