RPC: Remote Procedure Call is a mechanism that allows distributed applications to call available services of different computers on the network. The RPC service registers a uuid in the Registry to become a universal unique identifier. This UUID is unique for each service and is applicable to all platforms.
When an RPC service is started, it obtains a high port and registers the port with its UUID. Some RPC services randomly use the high port, some services use the same port whenever possible (if available ). However, during the lifetime of the service, port allocation is static. When a client needs to communicate with a specific RPC service, it cannot know in advance which port the service is running on. Therefore, the client will first create a port er service to the server, windows at port 135, Unix/Linux/Solaris at port 111, use the uuid of the requested service to query the port number of the server port er service. The port er returns the port number to the client and closes the connection. Finally, the client creates a connection to the service by using the port number provided by the port er.
For example, when NFS is started, unused ports less than 1024 will be enabled as the listener for transmission, and the system will actively register with rpc. Therefore, RPC knows the port used by NFS. RPC uses a fixed port 111 to listen to the user's needs and returns the correct NFS port to the user. Connect the client to the correct NFS port. Therefore, the NFS service must start the RPC service.
The port in the software field generally refers to the communication protocol port in the network for connection services and non-connection services. It is an abstract software structure, includes some data structures and I/O (Basic Input and Output) buffers.
By port number can be divided into three categories:
(1) well known ports: from 0 to 1023, they are closely bound to some services. Usually the communication between these ports clearly indicates a service protocol. For example, port 80 is always HTTP Communication.
(2) Registration port (registered ports): from 1024 to 49151. They are loosely bound to some services. That is to say, many services are bound to these ports, which are also used for many other purposes. For example, many systems process dynamic ports starting from around 1024.
(3) dynamic and/or private ports: From 49152 to 65535. Theoretically, these ports should not be allocated to the service. In fact, machines usually allocate dynamic ports from 1024. But there are also exceptions: Sun's rpc port starts from 32768.
Original article: http://blog.csdn.net/genius_lg/article/details/15455217