計算機網絡中的端口的定義:以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的代號。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM