What are IP address and port?
IP address:
IP address distinguishes a computer from others on a network. A network contains lots of smaller networks and countless hosts. To send messages to Host B, Host A needs to find Host B first. This requires a distinguished identifier of Host B. The identifier of each host is the IP address.
Port:
IP address only locates the host on the network. To find the specific process on the host, port is needed. One port corresponds with only one process on a host. Therefore, when data is transmitted between processes on different computers, “IP address plus port” is used to locate a unique process.
What’s the difference between process ID and port number?
Note: Process ID (PID) and port number have nothing to do with each other.
Port number specifies the port used by a process in communication. Well-known port numbers are assigned to commonly used services. For example, 80 is for HTTP services and 443 is for HTTPS services. On the other hand, a PID is generated for a process when it is launched. The PID is a random number. At one time, a host can maintain several TCP connections using different ports.
PID, as indicated by the name, is the ID of a process running on the computer. Usually, plenty of processes run simultaneously. Windows users can open Task Manager and select the “Details” tab to check the information.
Let’s move to the relation between ports and network connection. While the IP address distinguishes a computer, the port number specifies the service provided or requested by a computer. For example, the port number in the client request packet specifies the service that the client means to access. If the port number in the client request is 80, the client tries to access an HTTP service; 443 corresponds to an HTTPS service; and 21 corresponds to an FTP service.
A firewall supports the port filtering function, which allows traffic destined for certain ports (services) to flow through and blocks the traffic for other ports (services).
Why the host IP address is 0.0.0.0 when the vision system functions as a TCP/UDP server?
To communicate with other computers, a host must provide its IP address and port number so that it can be reached by the peers.
When the host IP of the TCP/UDP server is set to 0.0.0.0, the server will listen for incoming connections on all IP addresses associated with all available network interfaces.
For example, the IPC has two network adapters, adapter A (192.168.1.100) and adapter B (192.168.2.100), which are respectively connected to device A (192.168.1.1) and device B (192.168.2.1).
When configuring a network service on the IPC, if you enter 0.0.0.0:50000 for the host IP address, both device A and device B can access the service on the IPC even though they belong to different subnets. However, if you enter the address of adapter B (192.168.2.100) for the listening IP address and turn on the service, the IPC will only accept data sent by device B. Device A will not be able to access the service. To ease the configuration, the software automatically sets the host IP address to 0.0.0.0 when you select “TCP server” or “UDP server” as the protocol of Standard Interface communication.
How to set the host IP address on a TCP/UDP client?
Enter the IP address and port of the IPC to which the client needs to connect.
- This is helpful.
- This does not solve my issue.