Please Whitelist This Site?
I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)
If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.
If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK.
Thanks for your understanding!
Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide
NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.
TCP/IP Client (Ephemeral) Ports and Client/Server Application Port Use
(Page 3 of 3)
Port Number Use During a Client/Server Exchange
So, let's return to the matter of
client/server application message exchange. Once assigned an ephemeral
port number, it is used as the source port in the client's request TCP/UDP
message. The server receives the request, and then generates a reply.
In forming this response message, it swaps the source and destination
port numbers, just as it does the source and destination IP addresses.
So, the server's reply is sent from the well-known or
registered port number on the server process, back to
the ephemeral port number on the client machine.
to our example! J
Our Web browser, with IP address 188.8.131.52 wants to send an HTTP request
to a particular Web site at IP address 184.108.40.206. The HTTP request
is sent using TCP, with a Destination Port number of 80 (the
one reserved for HTTP servers). The Source Port number is allocated
from a pool of ephemeral ports; let's say it's port 3,022. When the
HTTP request arrives at the Web server it is conveyed to port 80 where
the HTTP server receives it. That process generates a reply, and sends
it back to 220.127.116.11, using Destination Port 3,022 and Source
Port 80. The two processes can exchange information back and forth;
each time the source port number and destination port number are swapped
along with the source and destination IP addresses. This example is
illustrated in Figure 199.
Figure 199: TCP/IP Client/Server Application Port Mechanics
This highly simplified example shows how clients and servers use port numbers for a request.reply exchange. The client is making an HTTP request and sends it to the server at HTTPs well-known port number, 80. Its port number for this exchange is the pseudo-randomly-selected 3,022. The server sends its reply back to that port number, which it reads from the request.
Key Concept: In most TCP/IP client/server communications, the client uses a random ephemeral port number and sends a request to the appropriate reserved port number at the servers IP address. The server sends its reply back to whatever port number it finds in the Source Port field of the request.
|If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!|
Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.