Header
Home | Set as homepage | Add to favorites
  Search the Site     » Advanced Search
Sections
Syndication


Blogroll:

||||| ALL Cisco-Network ARTICLES |||||  
CCIE Journey,
The CCIE Journey,


Initializing TCP Port Numbers

Nov 24,2008 by alperen

image

Figure 9-12. Initializing TCP Port Numbers


When an application on Keith's PC (browser2 in this case) first asks TCP to send data, TCP software running on Keith finds a TCP port number that he's not currently using and uses it for this new application. As long as no other application that is running on Keith's PC uses this same TCP port number, any future TCP segments that Keith's PC receives can be handled correctly. In Figure 9-12, Keith's PC uses port 1031 for browser2.

Keith's PC hopes that the server will reply to its request for a web page. Keith expects that the segment he receives from the server will have a destination TCP port number field set to 1031. To make sure that happens, Keith's PC sets the TCP source port field in the first segment to a value of 1031. The TCP source port file contains the port number used by the application that sent the TCP segment. That way, when the server replies, it knows what to put in the TCP destination port field1031 in this example.

When a client application first comes up, TCP on that computer dynamically assigns the application a TCP port number. These port numbers are sometimes called dynamically assigned port numbers, or ephemeral port numbers.

Well, that's only part of the story. When Keith's PC creates the first segment in Figure 9-12, the one sent to the web server, Keith's PC must put something in the TCP destination port field. Why? Well, the computer where the web server software resides might have multiple applications running, so the server's TCP software would want to look at the destination port field in the received TCP segment to figure out to which application to give the data. In this case, Keith's PC put port 80 in the header because port 80 is the well-known port for web servers.

Well-known ports allow the first segment sent between applications on two computers to have a useful destination port in it. Before Keith attempts to connect to the web server, the web server software tells TCP on the web server something like "Hey, if you get something for destination port 80, give it to me." Later, when Keith sends a segment with destination port 80 to that server, the server's TCP software knows to give the data to the web server software. In general, servers use well-known ports, allowing clients to put the correct destination port number in their initial TCP segments.


142 times read

Related news

» TCP destination port
by alperen posted on Nov 24,2008
» The Chicken, the Egg, and the Destination Port of the First Segment
by alperen posted on Nov 24,2008
» Chapter 9
by alperen posted on Nov 26,2008
» Using the Destination Port Field Like a Recipient's Name on a Shipping Label
by alperen posted on Nov 24,2008
» Acknowledging Each Byte
by alperen posted on Nov 24,2008
Did you enjoy this article?
(total 0 votes)

comment Comments (0 posted) 

More Top News
CCSP-Cisco Certified Security Professional
Most Popular
Most Commented
Featured Author