The port number is the identifier for accessing the server. The client can find the corresponding server through the IP address, but the server has many ports. Each application corresponds to a port number. Only through a port number similar to the house number can the client truly access the server; in order to Ports are distinguished and each port is numbered. This is the port number. Ports are marked by port numbers, which are only integers ranging from 0 to 65535.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
What is the port number?
The port number is the identifier for accessing the server.
Port number is just like a house number. The client can find the corresponding server through the IP address, but the server has many ports. Each application corresponds to a port number. Through a similar house number The port number allows the client to actually access the server. In order to distinguish the ports, each port is numbered, which is the port number.
Ports include two types: logical ports and physical ports:
Physical ports are used to connect interfaces between physical devices, such as ADSL Modem, hubs, switches, The interface on the router used to connect other network devices, such as RJ-45 port, SC port, etc.
-
Logical port refers to the port used to distinguish services in a logical sense, such as port 80 for browsing web services, port 21 for FTP services, etc. For example, the service port in the TCP/IP protocol distinguishes different services through different logical ports. The ports of an IP address are numbered using 16 bits, and can have up to 65536 ports.
Ports are marked by port numbers. Port numbers are only integers, ranging from 0 to 65535.
The role of the port number
The main role of the port number is to indicate what is provided by a specific process in a computer services. Computers in the network represent their identities through IP addresses. It can only represent a specific computer, but one computer can provide many services at the same time, such as database services, FTP services, Web services, etc. We use The port number is used to distinguish these different services provided by the same computer. For example, the common port number 21 represents the FTP service, the port number 23 represents the Telnet service, and the port number 25 refers to the SMTP service. The port number is generally a 4-digit integer. The port number cannot be repeated on the same computer. Otherwise, exceptions such as port number conflicts will occur
Usage rules
The port addresses in the TCP and UDP segment structures are both 16 bits, and can have port numbers in the range of 0---65535. There are the following usage regulations for these 65536 port numbers:
(1) Port numbers less than 256 are defined as common ports, and servers are generally identified by common port numbers. The services provided by any TCP/IP implementation use port numbers between 1---1023, which are managed by ICANN; the port numbers from 1024---49151 are registered ports and also become "user ports". Designated as a special service by IANA;
(2) The client only needs to ensure that the port number is unique on the local machine. The client port number is also called a temporary port number because it exists for a short time;
(3) Most TCP/IP implementations allocate port numbers between 1024---5000 to temporary port numbers. Port numbers greater than 5000 are reserved for other servers.
COMMON UNIX port numbers
The UNIX operating system is widely used because of its stable operation, low system requirements, and high security. Its Berkeley socket developed earlier and has distinctive features. For example, UNIX systems have the concept of reserved port numbers. Only a process with superuser privileges is allowed to assign itself a reserved port number. These port numbers range from 1 to 1023. Some applications use it as part of the authentication between the client and the server. Most TCP/IP implementations assign port numbers between 1024 and 5000 to ephemeral ports. Ports greater than 5000 are reserved for other servers (services that are not commonly used on the Internet)
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What is the port number?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1
Powerful PHP integrated development environment