7.3 Ports and Sockets

TCP uses what is termed port addressing to deliver information to the appropriate application-layer program. A port is a 16-bit address. The term socket refers to the concatenation of the IP address of the node and the port number used by the application-layer program. The concept of opening a socket in an application layer program facilitates multiple sessions on a single network node.

For example, two V+ tasks, or sessions, on the same controller may communicate simultaneously with a network server. Because both tasks run on the same network node, they have the same IP address. However, through the use of sockets, the combination of the IP address and a port number uniquely identifies the task to which TCP needs to route the information, provided that the port numbers are different for each task.

NOTE: Some standard application-layer services use defined port numbers in the range of 0 to 255. For example, it is conventional for an FTP server application program to use port #21 as a control channel. Users developing their own protocols and applications should use port numbers out of the range 0 to 255.