Dierent Services: Email, Web, FTP, Name Serving

Netscape sending a TCP request to a
web server running on another node.

But imagine that the node with the web server is also running an Email
server, an FTP server and a name server: how does it know which server
the TCP connection is for?
This is where TCP and UDP have a concept of `ports'. Every packet has
space for a `destination port', which says what service the packet is
for. For example, TCP port 25 is the mail server, and TCP port 80 is
the web server (although sometimes you nd web servers on dierent
ports). A list of ports can be found in `/etc/services'.

Also, if two Netscape windows are both accessing dierent parts of the
same web site, how does the Linux box running Netscape sort out the
TCP packets coming back from the web server?

This is where the `source port' comes in: every new TCP connection
gets a dierent source port, so everyone can tell them apart, even if
they are going to the same destination IP address and the same
destination port. Usually the rst source port given will be 1024, and
will increase over time.

No comments:

Post a Comment