What is a port? What is it used for?
In network technology, ports have two meanings: one is physical ports, such as interfaces used by ADSL modems, hubs, switches and routers to connect other network devices, such as RJ-45 ports and SC ports. The second is logical port, which generally refers to the port in TCP/IP protocol. Port numbers range from 0 to 65535, such as port 80 for browsing web services, port 2 1 for FTP services and so on. What I want to introduce here is the logical port. To view the port in Windows 2000/XP/Server 2003, you can use the Netstat command: click Start → Run, type "cmd" and press enter to open the command prompt window. Type "netstat -a -n" at the command prompt, and then press Enter to view the port number and status of TCP and UDP connections displayed in digital form. Close/Open Ports Before introducing the functions of various ports, first introduce how to close/open ports in Windows, because by default, many unsafe or useless ports are open, such as port 23 for Telnet service, port 2 1 for FTP service, port 25 for SMTP service and port 135 for RPC service. In order to ensure the security of the system, we can close/open the port by the following methods. To close a port, such as port 25 of SMTP service in Windows 2000/XP, you can do this: first open Control Panel, double-click Administrative Tools, and then double-click the service. Then find and double-click the Simple Mail Transfer Protocol (SMTP) service in the opened service window, click the Stop button to stop the service, then select Disable in the Startup Type, and finally click the OK button. In this way, closing the SMTP service is equivalent to closing the corresponding port. Open a port If you want to open a port, just select Automatic in the startup type, click OK, then open the service, click Start Enable Port in the service status, and finally click OK. Tip: There is no "service" option in Windows 98. You can use the rule setting function of the firewall to close/open the port. In the logical sense of port classification, there are many classification standards for ports. Two common classifications will be introduced below: 1. Well-known ports are divided (1) according to the port number distribution, that is, well-known port numbers range from 0 to 1023, which are generally fixed in some services. For example, port 2 1 is assigned to FTP service, port 25 is assigned to SMTP (Simple Mail Transfer Protocol) service, port 80 is assigned to HTTP service, port 135 is assigned to RPC (Remote Procedure Call) service and so on. (2) Dynamic Ports Dynamic ports range from 1024 to 65535, and these port numbers are generally not assigned to a service, which means that many services can use these ports. As long as a running program requests the system to access the network, the system can assign one of these port numbers to the program. For example, port 1024 is assigned to the first program that sends an application to the system. After closing the program process, the occupied port number will be released.