Current location - Quotes Website - Team slogan - [:] in IP address: What is the port number?
[:] in IP address: What is the port number?
In network technology, ports have several meanings. The ports of hubs, switches and routers refer to the interfaces connecting other network devices, such as RJ-45 port and serial port. The port we are talking about here is not a physical port, but a port in TCP/IP protocol, which is a logical port.

If the IP address is compared to a house, the port is the door of the house. A real house has only a few doors, but an IP address can have 65536 ports! Ports are marked by port numbers, which are only integers from 0 to 65535.

As we know, a host with an IP address can provide many services, such as Web services, FTP services, SMTP services and so on. These services can be completely realized through 1 IP address. So, how does the host distinguish different network services? Obviously, you can't just rely on ip addresses, because IP addresses and network services have a one-to-many relationship. In fact, different services are distinguished by "IP address+port number".

It should be noted that the ports are not in one-to-one correspondence. For example, when your computer accesses a WWW server as a client, the WWW server uses "80" port to communicate with your computer, but your computer may use "3457" port, as shown in figure 1.

According to the corresponding protocol type, there are two kinds of ports: TCP port and UDP port. Because TCP and UDP are independent, their respective port numbers are also independent of each other. For example, TCP has 235 ports, and UDP can also have 235 ports. There is no conflict between them.

1. well-known port

Well-known ports are well-known port numbers ranging from 0 to 1023, of which 80 ports are allocated to W WW service and 2 1 ports are allocated to FTP service. We don't need to specify the port number when we enter a website (such as www.cce.com.cn) in the address bar of IE, because the port number of WWW service is "80" by default.

Network services can use other port numbers. If it is not the default port number, you should specify the port number in the address bar by adding a colon ":"(half angle) after the address and then adding the port number. For example, if you use "8080" as the port of WWW service, you need to enter "www.cce.com.cn:8080" in the address bar.

However, some system protocols use fixed port numbers and cannot be changed. For example, port 139 is specially used for communication between NetBIOS and TCP/IP and cannot be changed manually.

2. Dynamic port

Dynamic ports range from 1024 to 65535. It is called a dynamic port because it generally does not allocate a service fixedly, but dynamically. Dynamic allocation means that when a system process or an application process needs network communication, it applies for a port from the host, and the host allocates an available port number for it to use. When this process is shut down, it also releases the occupied port number.

How to view ports

A server has a large number of ports in use. How to check the ports? There are two ways: one is to use the commands built into the system, and the other is to use the third-party port scanning software.

1. Use "netstat -an" to check the port status.

In Windows 2000/XP, you can use "netstat -an" at the command prompt to check the port status of the system, and you can list the port numbers that the system is opening and their status.

2. Use third-party port scanning software.

There are many third-party port scanning software. Although the interfaces are quite different, their functions are similar. Use "Fport" here (go to /tools/index.php? Type_t=7 or /soft/cce download) as an example. Using "Fport" at the command prompt, the running result is similar to "netstat -an", but it can not only list the port number and type being used, but also list which application is using the port.