Previous Page Next Page

B.5.3 Clients Initiate the Connection

On the other hand, most client applications will use a randomly-assigned port number for their end of the connection. Whenever an IP application is started, it will allocate a random port number above 1024 on the local IP stack, and use this port number for all incoming and outgoing data. When the web browser is used to establish a connection with a web server, it will generate a TCP packet using the local system's IP address and the local application's randomly-allocated port number, and then send the packet to the receiving system's IP address and well-known port number.

Since the web browser may open multiple connections to a host (one to retrieve the HTML file for example, and one to download an embedded JPEG image), the client will need to allocate multiple port numbers for these connections to work properly. If this is the case, then there will be multiple packets being generated by the client, each of which will have a different source port number, although they will all share the same source IP address, and destination IP address and port number.

The server does not care that the client is asking for multiple connections, since they are all coming from unique port numbers on the client. The server will simply return the requested data to the appropriate port number, and then terminate the connection when it is finished.

For more information on ports and sockets, refer to section B.5.1 Port Numbers and Sockets. For more information on application servers, refer to section B.5.2 Servers Listen for Connections. 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