How the Internet Uses Sockets

You can think of an Internet server as a set of sockets, each of which provides capabilities called services. Examples of services are electronic mail, Telnet for remote login, and the File Transfer Protocol (FTP) for transferring files around the network. If the server to which you are attached is a Web server, then you can retrieve Web pages as well.

Ports and Services

Each service is associated with a port. A port is a numeric address through which service requests (such as asking for a Web page) are processed. On a UNIX system, the particular services provided are listed in the /etc/services file. Here are a few lines from a typical /etc/services file:

daytime 13/udp  
ftp 21/tcp  
telnet 23/tcp telnet
smtp 25/tcp ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.