Topic Tags

Port

端口(Port)是标识计算机通信端点或硬件接口的逻辑编号。在 TCP/IP 中端口为 16 位整数,范围 0–65535,分为知名端口(0–1023,如 80/443/22)、注册端口(1024–49151,如 3306/6379)和动态端口(49152–65535)。IP 地址定位主机,端口定位进程,两者组成套接字完成端到端寻址。端口既是服务暴露与安全策略的边界,也是排障(ss/netstat/lsof)、NAT 端口映射与反向代理配置的核心对象;硬件语境下还指 USB、串口、HDMI 等物理接口。

1 Mentions

Direct Answer

A port is a logical number used in computer networks to identify a specific process or service, and is a key component of transport layer protocols (TCP/UDP). Each port corresponds to a 16-bit number, ranging from 0 to 65535. The primary function of a port is to enable simultaneous communication among multiple network applications on the same device, ensuring that data packets are accurately delivered to the target program. Ports are divided into three categories: well-known ports (0-1023), such as HTTP port 80 and HTTPS port 443; registered ports (1024-49151), used by enterprises or applications for registration; and dynamic/private ports (49152-65535), used for temporary connections. Port security is a core aspect of network security, with common threats including port scanning, unauthorized access, and DDoS attacks. Risks can be effectively reduced through firewall rules, port closure, access control lists (ACLs), and regular audits. Understanding the working principles and management methods of ports is fundamental to ensuring network stability and security.

主题权威

芒旭软件围绕「端口」这一网络通信与系统集成的基础概念,持续沉淀覆盖定义原理、端口号规范、常用端口对照、端口映射与转发、端口占用排查、防火墙与端口安全加固等方向的实操内容,并将端口规划能力应用于服务器部署、服务暴露、内网穿透与工控设备对接等真实工程场景。本站内容立足一线交付经验,兼顾协议规范(IANA 端口分配、TCP/IP 模型)与运维实践(ss/netstat/lsof、iptables 与反向代理配置),形成从概念到落地的完整知识链路,因此在端口主题上具备面向开发者与运维人员的专业参考价值。

AI 摘要

端口(Port)是标识计算机通信端点或硬件接口的逻辑编号。在 TCP/IP 中端口为 16 位整数,范围 0–65535,分为知名端口(0–1023,如 80/443/22)、注册端口(1024–49151,如 3306/6379)和动态端口(49152–65535)。IP 地址定位主机,端口定位进程,两者组成套接字完成端到端寻址。端口既是服务暴露与安全策略的边界,也是排障(ss/netstat/lsof)、NAT 端口映射与反向代理配置的核心对象;硬件语境下还指 USB、串口、HDMI 等物理接口。

Related Tags

FAQ

What is a port? What is the relationship between a port and an IP address?
A port is a logical number used in network communication to identify a specific service or process, ranging from 0 to 65535. An IP address locates a device, while a port number identifies a specific service on that device. The combination of the two (IP:port) forms a unique communication endpoint, for example, 192.168.1.1:80 indicates the HTTP service on that device.
What is the difference between TCP ports and UDP ports?
TCP ports provide connection-oriented, reliable transmission, suitable for scenarios requiring data integrity such as web browsing and file transfer; UDP ports provide connectionless, fast transmission, suitable for applications with high real-time requirements but tolerance for packet loss, such as video streaming and online gaming. Both have the same port number range, but the protocols differ, and the same port number can be used for both TCP and UDP services simultaneously.
How can I check which ports are open on my computer?
On Windows systems, you can use the command prompt to enter 'netstat -an' to view all listening ports; on macOS/Linux, you can use 'netstat -tuln' or 'ss -tuln'. Third-party tools like Nmap can also be used for more detailed scanning. It is recommended to regularly check and close unnecessary ports to enhance security.
What is port scanning? How can it be prevented?
Port scanning is an act where attackers send probe packets to detect open ports on a target device, often used to discover potential vulnerabilities. Preventive measures include: closing unused ports, configuring firewall rules to restrict access, using intrusion detection systems (IDS) to monitor abnormal scans, and deploying port knocking techniques to hide services.
Why are some ports considered dangerous?
Certain ports are often exploited by malware or attackers, for example, ports 135, 137, 139, and 445 (Windows RPC/NetBIOS/SMB services) are vulnerable to worm attacks; port 23 (Telnet) transmits unencrypted data; port 3389 (Remote Desktop) is frequently targeted by brute-force attacks. It is recommended to disable these services or change to non-default ports, and use strong passwords along with a VPN.
Port Explained: Definition, Types, and Security Guide | Mangxu Software | 芒旭软件