端口号概念?

Port number concepts?

我正在尝试理解端口号的概念。据我所知,它标识特定进程或网络服务。 谁能给我一个现实生活中的例子。所以,它可能更容易理解。 我目前的一些疑惑-

  1. 听说有65536个端口。那是不是意味着一个系统可以同时识别65536个进程?
  2. 我看到有些端口是为某些特定服务预留的。那么,这是否意味着它不能用于任何其他服务?
  3. 知道哪些端口号可用或可用的命令是什么?
  4. 知道哪些端口号不可用以及它们的用途的命令是什么?
  5. 如果我尝试从我的计算机通过远程桌面访问系统,它会要求提供端口号。我应该提到什么?

如果可能请分享一个link。我目前对太多的技术理论感到困惑。谢谢!!!

I heard, there are 65536 ports.

你听错了。有 65535: 1 .. 65535。零不是有效的端口号。

Does, that mean, a system can identify 65536 processes simultaneously?

表示一个系统可以同时识别65535个端口。

I have seen that some ports are reserve for some specific service. So, does it mean, it can't be used for any other service?

这就是'reserve'这个词的意思。

What is the command to know which port numbers are free or to use?

这不是命令。它要么在 IETF 网站上搜索保留端口,要么使用数字零,这意味着下一个可用端口。

What is the command to know which port numbers are not free and what are they used for?

不一定是命令。它是在 IETF 网站上搜索保留端口,或 netstat 命令搜索本地主机上正在使用的端口。

If I try to access a system through remote desktop from my computer, it asks for a port number. What should I mention?

您在远程系统中尝试连接的端口号。

这里有更多说明:

I heard, there are 65536 ports.

端口是16位即2^16 =65536所以对

"Port Zero does not officially exist. It is defined as an invalid port number. But valid Internet packets can be formed and sent over the wire to and from port 0 just as with any other ports." https://www.grc.com/port_0.htm

Does, that mean, a system can identify 65536 processes simultaneously?

你关心的不是系统,你关心的是IP。对于每个 Ip,您可以同时使用 65536 个进程。

I have seen that some ports are reserve for some specific service. So, does it mean, it can't be used for any other service?

当然可以,否则会出现端口冲突

What is the command to know which port numbers are free or to use?

在这里引用我的 post

Netstat:在 Linux 和 Windows 中显示连接和端口

What is the command to know which port numbers are not free and what are they used for?

现在应该清楚了

If I try to access a system through remote desktop from my computer, it asks for a port number. What should I mention?

远程桌面要求提供远程计算机的 IP 地址。但是,它可能会要求提供远程计算机的用户凭据。

如果它要求 IP 和端口,则表示远程计算机中的远程桌面软件(服务器)的 IP 和端口。