计算机网络中的端口的定义:以port的本意去理解其真正含义。

原文地址:

What is Network Port? (tutorialspoint.com)

 

A port is a physical docking point using which an external device can be connected to the computer. It can also be programmatic docking point through which information flows from a program to the computer or over the Internet.

参考译文:

  最初,端口是计算机上的一个物理接口(USB应该也算),通过这个接口,外部设备可以连接到计算机,如果把计算机比作一个国度的话,那么端口(port)就是码头,通过这个码头,从外地来的船只的货物(外部设备的信息)可以到达本国,而且本国的出口货物(计算机产生的信息)也可以通过船只(可以理解为连接线)到达另一个国度。在计算机网络领域,端口也可以比作为码头,通过这个码头,计算机可以与互联网(除本机外的所有世界上所有联网设备)进行交互。

(programmatic这里不译,因为对理解没有好处。)

port (TOWN) 
noun [C or U]
a town by the sea or by a river which has a harbour, or the harbour itself:
 
dock (FOR SHIPS)
noun [C]
1 a specially enclosed area of water in a port that is used for loading and unloading or repairing ships
摘自《Cambridge Dictionary》
 
下面的这段指出了网络中究竟什么是端口,结合上文的形象的理解会很有启发。
To determine what protocol incoming traffic should be directed to, different port numbers are used. They allow a single host with a single IP address to run network services. Each port number have a distinct service, and for each host can have 65535 ports per IP address

参考译文:

  为了把不同作用的流量(ICMP的流量,UDP的流量作用不同)导入给不同的协议进行处理(用不同的算法处理这些输入(流量)),我们用一些数字来代表端口,每一个端口数字都对应不同的服务(协议),这样子就可以让一台客户机在只有一个IP的情况下同时运行多个协议,单IP客户机(一台客户机可以有多个IP)可以至多有65535个端口。

 

总结:

  也就是说,端口其实就是协议的代号。根据这个结论,22就是ssh的代号。

posted @ 2022-01-25 17:55  Hisi  阅读(1325)  评论(0编辑  收藏  举报