Previous Page Next Page

B.5.1 Port Numbers and Sockets

In the TCP/IP world, applications use what are commonly referred to as "well-known ports" to communicate with each other. Client applications assume that the corresponding server application is listening on the well-known port associated with that application.

For example, the well-known port number for HTTP, the protocol used to transfer HTML pages across the World Wide Web, is TCP port 80. By default, a web browser will attempt to open a connection on the destination host's TCP port 80, unless another port number is specified in the URL (such as 8000 or 8080). This process is illustrated in Figure B.8 below:

Figure B.8 By using well-known ports, client applications such as web browsers can connect directly to the web server running on a remote system.

Server applications typically load during system startup, and actively "listen" for incoming connections on their well-known port. Client applications will then attempt to connect to the server, and a TCP or UDP exchange will then take place. When the session is complete, the client will typically be the one to terminate the connection.

A "port" identifies a connection point in the local stack (i.e., port number 89 is typically used by a web server). A "socket" identifies an IP address and port number pair (i.e. , port 192.168.1.20:80 would be the web server port on host 192.168.1.20. The two together are considered a socket.). A "socket pair" identifies all four components (source address and port, and destination address and port).

When people refer to a "port" they are typically referring to a specific application on any host. When people refer to a "socket" they are typically referring to a specific application on a specific host. Finally, when people refer to a "socket pair" they are typically referring to the sockets on two specific systems which are exchanging data.

For more information on application servers, refer to section B.5.2 Servers Listen for Connections. For more information on the application clients, refer to section B.5.3 Clients Initiate the Connection. For more information on how clients and servers communicate with each other, refer to section B.5.4 Application Linguistics.

Previous Page Next Page

Copyright © 1997, Unoverica Corporation. All rights reserved. Unauthorized use prohibited.

Send comments to docs@unoverica.com