
If a package shows up at your office building, whomever happens to be standing around at the time looks at the shipping label, notices the name, and does what needs to be done to get the package to that person. Similarly, there's a field in the TCP header called the TCP destination port that tells the receiving computer (Keith's PC in this case) which application program needs to be given the data. For each application program that is currently being used on one computer, the computer assigns that application a unique TCP port number. To send data to a specific application on the computer, you send a TCP segment to that computer and plug the correct TCP port number into the destination TCP port number field in the TCP header.
An example certainly helps in this case. Figure 9-11 shows how Keith uses the destination port field. Browser1 uses port number 1030, and browser2 uses port 1031. The e-mail client is using port 1040, and the FTP client is using port 1045. So, when the segment arrives, Keith's TCP software checks the TCP destination port field in the TCP header, which tells the PC to give the data to browser2. As long as each application running on Keith's computer uses a different TCP port number, Keith can receive TCP segments and figure out what to do with the data.