The purpose of using remote port numbers is to ensure that packets can be delivered to the target host and target application correctly. Each port number corresponds to a different application. If the correct port number is not specified, it is impossible to establish a connection with the target application and transmit data. Therefore, the use of remote port numbers is very important in network communication.
There are many ways to check the remote port number, such as using the command line tools that come with Windows system (such as netstat command) or using some special network monitoring tools (such as Wireshark). Usually, we will use the port scanning tool to scan the port of the remote host to determine the remote port number. However, it should be noted that unauthorized port scanning is illegal and should be used in legal occasions.